Changes in / [d9410c5:66d4370] in sasview


Ignore:
Location:
src/sas
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • src/sas/qtgui/Perspectives/Inversion/InversionPerspective.py

    rb1f6063 rb0ba43e  
    309309                                            and not self.isCalculating) 
    310310        self.removeButton.setEnabled(self.logic.data_is_loaded) 
    311         self.explorerButton.setEnabled(self.logic.data_is_loaded) 
     311        self.explorerButton.setEnabled(self.logic.data_is_loaded 
     312                                       and np.all(self.logic.data.dy != 0)) 
    312313        self.stopButton.setVisible(self.isCalculating) 
    313314        self.regConstantSuggestionButton.setEnabled( 
     
    640641        self.calcThread.ready(2.5) 
    641642 
    642         #Perform estimate should be done on value enter this should solve delay problem 
    643         self.performEstimate() 
    644  
    645643    def stopCalcThread(self): 
    646644        """ Stops a thread if it exists and is running """ 
  • src/sas/sascalc/pr/invertor.py

    r6701a0b rb8080e1  
    7171        A[j][i] = (Fourier transformed base function for point j) 
    7272 
    73     We then choose a number of r-points, n_r, to evaluate the second 
     73    We them choose a number of r-points, n_r, to evaluate the second 
    7474    derivative of P(r) at. This is used as our regularization term. 
    7575    For a vector r of length n_r, the following n_r rows are set to :: 
     
    144144        x, y, err, d_max, q_min, q_max and alpha 
    145145        """ 
    146         if name == 'x': 
     146        if   name == 'x': 
    147147            if 0.0 in value: 
    148148                msg = "Invertor: one of your q-values is zero. " 
     
    227227        return None 
    228228 
    229     def add_errors(self, yvalues): 
    230         """ 
    231         Adds errors to data set is they are not avaialble 
    232         :return: 
    233         """ 
    234         stats_errors = np.zeros(len(yvalues)) 
    235         for i in range(len(yvalues)): 
    236             # Scale the error so that we can fit over several decades of Q 
    237             scale = 0.05 * np.sqrt(yvalues[i]) 
    238             min_err = 0.01 * yvalues[i] 
    239             stats_errors[i] = scale * np.sqrt(np.fabs(yvalues[i])) + min_err 
    240         logger.warning("Simulated errors have been added to the data set\n") 
    241         return stats_errors 
    242  
    243229    def clone(self): 
    244230        """ 
     
    258244        invertor.x = self.x 
    259245        invertor.y = self.y 
    260         if np.size(self.err) == 0 or np.all(self.err) == 0: 
    261             invertor.err = self.add_errors(self.y) 
    262         else: 
    263             invertor.err = self.err 
     246        invertor.err = self.err 
    264247        invertor.est_bck = self.est_bck 
    265248        invertor.background = self.background 
     
    285268            A[i][j] = (Fourier transformed base function for point j) 
    286269 
    287         We then choose a number of r-points, n_r, to evaluate the second 
     270        We them choose a number of r-points, n_r, to evaluate the second 
    288271        derivative of P(r) at. This is used as our regularization term. 
    289272        For a vector r of length n_r, the following n_r rows are set to :: 
Note: See TracChangeset for help on using the changeset viewer.