Changeset 21969a4a in sasview


Ignore:
Timestamp:
Mar 29, 2011 4:52:25 PM (13 years ago)
Author:
Jae Cho <jhjcho@…>
Branches:
master, ESS_GUI, ESS_GUI_Docs, ESS_GUI_batch_fitting, ESS_GUI_bumps_abstraction, ESS_GUI_iss1116, ESS_GUI_iss879, ESS_GUI_iss959, ESS_GUI_opencl, ESS_GUI_ordering, ESS_GUI_sync_sascalc, costrafo411, magnetic_scatt, release-4.1.1, release-4.1.2, release-4.2.2, release_4.0.1, ticket-1009, ticket-1094-headless, ticket-1242-2d-resolution, ticket-1243, ticket-1249, ticket885, unittest-saveload
Children:
8f12385
Parents:
3b72b36
Message:

moving fixes from branch

Location:
guiframe
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • guiframe/local_perspectives/plotting/AnnulusSlicer.py

    r55a0dc1 r21969a4a  
    160160        # If the data file does not tell us what the axes are, just assume... 
    161161        new_plot.xaxis("\\rm{\phi}", 'degrees') 
    162         new_plot.yaxis("\\rm{Intensity} ", "cm^{-1}") 
     162        if hasattr(data, "scale"): 
     163            if data.scale == 'linear': 
     164                new_plot.ytransform = 'y' 
     165                new_plot.yaxis("\\rm{Residuals} ", "/") 
     166        else: 
     167            new_plot.yaxis("\\rm{Intensity} ", "cm^{-1}") 
     168 
    163169        new_plot.group_id = "AnnulusPhi" + self.base.data2D.name 
    164         new_plot.id = "AnnulusPhi" + self.base.data2D.name 
     170        new_plot.id = None 
    165171        #new_plot.is_data= True 
    166172        new_plot.xtransform = "x" 
  • guiframe/local_perspectives/plotting/SectorSlicer.py

    r55a0dc1 r21969a4a  
    167167        else: 
    168168            dxw = None 
    169         new_plot = Data1D(x=sector.x, y=sector.y, dy=sector.dy) 
     169        new_plot = Data1D(x=sector.x, y=sector.y, dy=sector.dy, dx=sector.dx) 
    170170        new_plot.dxl = dxl 
    171171        new_plot.dxw = dxw 
     
    175175        new_plot.interactive = True 
    176176        new_plot.detector = self.base.data2D.detector 
    177         # If the data file does not tell us what the axes are, just assume... 
    178         new_plot.xaxis("\\rm{Q}", 'A^{-1}') 
    179         new_plot.yaxis("\\rm{Intensity} ", "cm^{-1}") 
     177        ## If the data file does not tell us what the axes are, just assume... 
     178        new_plot.xaxis("\\rm{Q}", "A^{-1}") 
     179        if hasattr(data, "scale"): 
     180            if data.scale == 'linear': 
     181                new_plot.ytransform = 'y' 
     182                new_plot.yaxis("\\rm{Residuals} ", "/") 
     183        else: 
     184            new_plot.yaxis("\\rm{Intensity} ", "cm^{-1}") 
     185        
    180186        new_plot.group_id = "SectorQ" + self.base.data2D.name 
    181         new_plot.id = "SectorQ" + self.base.data2D.name 
     187        new_plot.id = None 
    182188        new_plot.is_data = True 
     189 
    183190        wx.PostEvent(self.base.parent, NewPlotEvent(plot=new_plot, 
    184191                                    title="SectorQ" + self.base.data2D.name)) 
  • guiframe/local_perspectives/plotting/boxSlicer.py

    r55a0dc1 r21969a4a  
    188188        new_plot.interactive = True 
    189189        new_plot.detector = self.base.data2D.detector 
    190         # If the data file does not tell us what the axes are, just assume... 
    191         new_plot.xaxis("\\rm{Q}", '\\AA^{-1}') 
    192         new_plot.yaxis("\\rm{Intensity} ","cm^{-1}") 
     190        ## If the data file does not tell us what the axes are, just assume... 
     191        new_plot.xaxis("\\rm{Q}", "A^{-1}") 
     192        if hasattr(self.base.data2D, "scale"): 
     193            if self.base.data2D.scale == 'linear': 
     194                new_plot.ytransform = 'y' 
     195                new_plot.yaxis("\\rm{Residuals} ", "/") 
     196        else: 
     197            new_plot.yaxis("\\rm{Intensity} ", "cm^{-1}") 
    193198        new_plot.group_id = str(self.averager.__name__) + self.base.data2D.name 
    194         new_plot.id = str(self.averager.__name__) 
     199        #new_plot.id = str(self.averager.__name__) 
    195200        #new_plot.is_data= True 
    196201        wx.PostEvent(self.base.parent, NewPlotEvent(plot=new_plot, 
  • guiframe/local_perspectives/plotting/masking.py

    r55a0dc1 r21969a4a  
    99#following sentence: 
    1010# 
    11 #"This work benefited from DANSE software developed under NSF award DMR-0520547."  
     11#This work benefited from DANSE software developed under NSF award DMR-0520547.  
    1212# 
    1313#copyright 2008, University of Tennessee 
     
    1919import sys 
    2020import pylab 
    21 from pylab import gca 
    22 from pylab import gcf 
    2321import math 
    24 import re 
    2522import copy 
    2623import numpy 
     
    119116        sizer = wx.GridBagSizer(10, 10) 
    120117        #---------inputs---------------- 
    121         #inputbox = wx.StaticBox(self, -1, "Draw Mask") 
    122118        shape_txt = wx.StaticText(self, -1, shape)   
    123119        sizer.Add(shape_txt, (1, 1), flag=wx.TOP|wx.LEFT|wx.BOTTOM, border=5) 
    124         #innersector_x_txt = wx.StaticText(self, -1, 'Inner Sector') 
    125120        self.innersector_rb = wx.RadioButton(self, -1, "Double Wings") 
    126121        self.Bind(wx.EVT_RADIOBUTTON, self.onInnerSectorMask, 
     
    128123        sizer.Add(self.innersector_rb, (2, 1),  
    129124                  flag=wx.RIGHT|wx.BOTTOM, border=5) 
    130         #innersector_x_txt = wx.StaticText(self, -1, 'Inner Sector') 
    131125        self.innercircle_rb = wx.RadioButton(self, -1, "Circular Disk") 
    132126        self.Bind(wx.EVT_RADIOBUTTON, self.onInnerRingMask, 
     
    139133                  id=self.innerbox_rb.GetId()) 
    140134        sizer.Add(self.innerbox_rb, (4, 1), flag=wx.RIGHT|wx.BOTTOM, border=5) 
    141         #outersector_y_txt = wx.StaticText(self, -1, 'Outer Sector') 
     135 
    142136        self.outersector_rb = wx.RadioButton(self, -1, "Double Wing Window") 
    143137        self.Bind(wx.EVT_RADIOBUTTON, self.onOuterSectorMask,  
     
    167161 
    168162        #-----Buttons------------1 
    169         id = wx.NewId() 
    170         button_add = wx.Button(self, id, "Add") 
     163        id_button = wx.NewId() 
     164        button_add = wx.Button(self, id_button, "Add") 
    171165        button_add.SetToolTipString("Add the mask drawn.") 
    172166        button_add.Bind(wx.EVT_BUTTON, self.onAddMask, id=button_add.GetId())  
    173167        sizer.Add(button_add, (13, 7)) 
    174         id = wx.NewId() 
    175         button_erase = wx.Button(self, id, "Erase") 
     168        id_button = wx.NewId() 
     169        button_erase = wx.Button(self, id_button, "Erase") 
    176170        button_erase.SetToolTipString("Erase the mask drawn.") 
    177171        button_erase.Bind(wx.EVT_BUTTON, self.onEraseMask, 
    178172                          id=button_erase.GetId())  
    179173        sizer.Add(button_erase, (13, 8)) 
    180         id = wx.NewId() 
    181         button_reset = wx.Button(self, id, "Reset") 
     174        id_button = wx.NewId() 
     175        button_reset = wx.Button(self, id_button, "Reset") 
    182176        button_reset.SetToolTipString("Reset the mask.") 
    183177        button_reset.Bind(wx.EVT_BUTTON, self.onResetMask, 
    184178                          id=button_reset.GetId())  
    185179        sizer.Add(button_reset, (13, 9), flag=wx.RIGHT|wx.BOTTOM, border=15) 
    186         id = wx.NewId() 
    187         button_reset = wx.Button(self, id, "Clear") 
     180        id_button = wx.NewId() 
     181        button_reset = wx.Button(self, id_button, "Clear") 
    188182        button_reset.SetToolTipString("Clear all mask.") 
    189183        button_reset.Bind(wx.EVT_BUTTON, self.onClearMask, 
     
    270264            self.onClearSlicer(event) 
    271265        self.slicer_z += 1 
    272         self.slicer = CircularMask(self,self.subplot, 
     266        self.slicer = CircularMask(self, self.subplot, 
    273267                                   zorder=self.slicer_z, side=True) 
    274268        self.subplot.set_ylim(self.data.ymin, self.data.ymax) 
     
    309303         
    310304        :param mask: mask data 
    311          
    312305        """ 
    313306        ## Redraw the current image 
     
    368361         
    369362        :param slicer: slicer class to create 
    370          
    371363        """ 
    372364        ## Clear current slicer 
     
    480472    def freeze_axes(self): 
    481473        """ 
     474        freeze axes 
    482475        """ 
    483476        self.plotpanel.axes_frozen = True 
     
    485478    def thaw_axes(self): 
    486479        """ 
     480        thaw axes 
    487481        """ 
    488482        self.plotpanel.axes_frozen = False        
     
    490484    def onMouseMotion(self, event): 
    491485        """ 
     486        onMotion event 
    492487        """ 
    493488        pass 
     
    495490    def onWheel(self, event): 
    496491        """ 
     492        on wheel event 
    497493        """ 
    498494        pass   
     
    529525    def add_image(self, plot): 
    530526        """ 
     527        Add Image 
    531528        """ 
    532529        self.plots[plot.name] = plot 
     
    554551        # Slicer plot popup menu 
    555552        slicerpop = wx.Menu() 
    556         #id = wx.NewId() 
    557         #slicerpop.Append(id,'&Save image', 'Save image as PNG') 
    558         #wx.EVT_MENU(self, id, self.onSaveImage) 
    559          
    560         id = wx.NewId() 
    561         slicerpop.Append(id, '&Toggle Linear/Log scale') 
    562         wx.EVT_MENU(self, id, self._onToggleScale) 
     553         
     554        id_cm = wx.NewId() 
     555        slicerpop.Append(id_cm, '&Toggle Linear/Log scale') 
     556        wx.EVT_MENU(self, id_cm, self._onToggleScale) 
    563557                
    564558        pos = event.GetPosition() 
  • guiframe/utils.py

    rf444b20 r21969a4a  
    2626        return output.lstrip().rstrip() 
    2727    if high: 
    28         output = "%-6.4g" % value 
     28        output = "%-7.5g" % value 
    2929    else: 
    3030        output = "%-5.3g" % value 
Note: See TracChangeset for help on using the changeset viewer.