Changeset d09f462f in sasview for src/sas/qtgui


Ignore:
Timestamp:
Feb 6, 2019 7:04:17 AM (5 years ago)
Author:
Piotr Rozyczko <piotr.rozyczko@…>
Branches:
ESS_GUI, ESS_GUI_bumps_abstraction, ESS_GUI_iss1116, ESS_GUI_opencl, ESS_GUI_sync_sascalc
Children:
a0f3c29
Parents:
bda3ce4
git-author:
Piotr Rozyczko <piotr.rozyczko@…> (02/06/19 07:02:58)
git-committer:
Piotr Rozyczko <piotr.rozyczko@…> (02/06/19 07:04:17)
Message:

Some platforms still use older numpy without quantile(). Temporarily
revert the code.

File:
1 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 
Note: See TracChangeset for help on using the changeset viewer.