Changeset a4d4b35 in sasview for guiframe/local_perspectives


Ignore:
Timestamp:
Mar 12, 2010 12:48:57 PM (15 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:
08ece0b
Parents:
095ab1b
Message:

fixed slabY bug: binning x-direction

File:
1 edited

Legend:

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

    r4ac8556 ra4d4b35  
    4242        ## Number of points on the plot 
    4343        self.nbins = 30 
     44        ## If True, I(|Q|) will be return, otherwise, negative q-values are allowed 
     45        self.fold = True         
    4446        ## reference of the current  Slab averaging 
    4547        self.averager=None 
     
    135137         
    136138     
    137     def post_data(self,new_slab=None , nbins=None): 
     139    def post_data(self,new_slab=None , nbins=None, direction =None): 
    138140        """ 
    139141             post data averaging in Qx or Qy given new_slab type 
    140142             @param new_slab: slicer that determine with direction to average 
    141143             @param nbins: the number of points plotted when averaging 
     144             @param direction: the direction of averaging 
    142145        """ 
    143146        x_min= -1*math.fabs(self.vertical_lines.x) 
     
    153156                raise ValueError,"post data:cannot average , averager is empty" 
    154157            self.averager= new_slab 
    155         bin_width= (x_max + math.fabs(x_min))/self.nbins 
     158        if direction == "X": 
     159            if self.fold: x_low = 0 
     160            else: x_low = math.fabs(x_min) 
     161            bin_width= (x_max + x_low)/self.nbins 
     162        else: 
     163            if self.fold: y_low = 0 
     164            else: y_low = math.fabs(y_min) 
     165            bin_width= (y_max + y_low)/self.nbins 
    156166        ## Average data2D given Qx or Qy 
    157167        box = self.averager( x_min=x_min, x_max=x_max, y_min=y_min, y_max=y_max, 
    158168                         bin_width=bin_width) 
    159          
     169        box.fold = self.fold 
    160170        boxavg = box(self.base.data2D) 
    161171        #3 Create Data1D to plot 
     
    541551        """ 
    542552        from DataLoader.manipulations import SlabX 
    543         self.post_data(SlabX )    
     553        self.post_data(SlabX, direction ="X")    
    544554         
    545555 
     
    559569        """ 
    560570        from DataLoader.manipulations import SlabY 
    561         self.post_data(SlabY )    
    562          
    563          
     571        self.post_data(SlabY, direction ="Y")    
     572         
     573         
Note: See TracChangeset for help on using the changeset viewer.