Changeset 80963c6c in sasview for src/sas/qtgui


Ignore:
Timestamp:
Feb 7, 2019 4:02:47 AM (5 years ago)
Author:
wojciech
Branches:
ESS_GUI, ESS_GUI_bumps_abstraction, ESS_GUI_iss1116, ESS_GUI_opencl, ESS_GUI_sync_sascalc
Children:
a1b49a7
Parents:
a74dd016 (diff), a0f3c29 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merge branch 'ESS_GUI' of https://github.com/SasView/sasview into ESS_GUI

Location:
src/sas/qtgui
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • src/sas/qtgui/Plotting/Plotter2D.py

    r8db20a9 rd09f462f  
    468468        # check scale 
    469469        if self.scale == 'log_{10}': 
    470             with numpy.errstate(all='ignore'): 
    471                 output = numpy.log10(output) 
    472             index = numpy.isfinite(output) 
    473             if not index.all(): 
    474                 cutoff = (numpy.quantile(output[index], 0.05) - numpy.log10(2) if index.any() else 0.) 
    475                 output[output < cutoff] = cutoff 
    476                 output[~index] = cutoff 
     470            #with numpy.errstate(all='ignore'): 
     471            #    output = numpy.log10(output) 
     472            #index = numpy.isfinite(output) 
     473            #if not index.all(): 
     474            #    cutoff = (numpy.quantile(output[index], 0.05) - numpy.log10(2) if index.any() else 0.) 
     475            #    output[output < cutoff] = cutoff 
     476            #    output[~index] = cutoff 
     477            try: 
     478                if  self.zmin <= 0  and len(output[output > 0]) > 0: 
     479                    zmin_temp = self.zmin 
     480                    output[output > 0] = numpy.log10(output[output > 0]) 
     481                elif self.zmin <= 0: 
     482                    zmin_temp = self.zmin 
     483                    output[output > 0] = numpy.zeros(len(output)) 
     484                    output[output <= 0] = MIN_Z 
     485                else: 
     486                    zmin_temp = self.zmin 
     487                    output[output > 0] = numpy.log10(output[output > 0]) 
     488            except: 
     489                #Too many problems in 2D plot with scale 
     490                output[output > 0] = numpy.log10(output[output > 0]) 
     491                pass 
     492 
    477493        vmin, vmax = None, None 
    478494 
  • src/sas/qtgui/Perspectives/Inversion/InversionLogic.py

    r3c4f02e ra74dd016  
    156156        return new_plot 
    157157 
     158    def add_errors(self, sigma=0.05): 
     159        """ 
     160        Adds errors to data set is they are not available. 
     161        Uses  $\Delta y = \sigma | y |$. 
     162        """ 
     163        self._data.dy = sigma * np.fabs(self._data.y) 
     164 
    158165    def computeDataRange(self): 
    159166        """ 
  • src/sas/qtgui/Perspectives/Inversion/InversionPerspective.py

    raed159f ra74dd016  
    473473            self._calculator.set_qmax(qmax) 
    474474            if np.size(self.logic.data.dy) == 0 or np.all(self.logic.data.dy) == 0: 
    475                 self._calculator.add_errors() 
     475                self.logic.add_errors() 
    476476            self.updateDataList(data) 
    477477            self.populateDataComboBox(self.logic.data.filename, data) 
Note: See TracChangeset for help on using the changeset viewer.