Changeset ee69839 in sasview for guiframe


Ignore:
Timestamp:
Feb 4, 2009 1:22:04 PM (15 years ago)
Author:
Gervaise Alina <gervyh@…>
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:
a2b6c05f
Parents:
7ce6c72
Message:

small bug fixed for box sum

File:
1 edited

Legend:

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

    r1f3655a ree69839  
    2727        self.markers = [] 
    2828        self.axes = axes 
    29         self.qmax = self.base.data2D.xmax 
     29        self.qmax = min(self.base.data2D.xmax, self.base.data2D.xmin) 
    3030        self.connect = self.base.connect 
    3131        self.xmin= -1* 0.5*min(math.fabs(self.base.data2D.xmax),math.fabs( self.base.data2D.xmin)) 
     
    150150        data = self.base.data2D 
    151151        from DataLoader.manipulations import  Boxavg 
    152         radius = math.sqrt(math.pow(self.qmax,2)+math.pow(self.qmax,2)) 
    153         x_min= self.vertical_lines.x2  
    154         x_max= self.vertical_lines.x1  
     152        #radius = math.sqrt(math.pow(self.qmax,2)+math.pow(self.qmax,2)) 
     153        x_min= self.horizontal_lines.x2  
     154        x_max= self.horizontal_lines.x1  
    155155        y_min= self.vertical_lines.y2 
    156156        y_max= self.vertical_lines.y1 
    157157        box =  Boxavg (x_min=x_min, x_max=x_max, y_min=y_min, y_max=y_max) 
    158158        self.count, self.error = box(self.base.data2D) 
    159         print "count, error",self.count, self.error 
     159        #print "count, error",self.count, self.error 
    160160                           
    161161    def moveend(self, ev): 
     
    163163        # Post paramters 
    164164        self._post_data() 
    165         """ 
    166         event = SlicerParameters.SlicerParameterEvent() 
    167         event.type = self.__class__.__name__ 
    168         print "event type boxsum: ", event.type 
    169         event.params = self.get_params() 
    170         wx.PostEvent(self.base, event) 
    171         """ 
     165        
    172166        self.type= self.__class__.__name__ 
    173167        params= self.get_params() 
     
    195189        params = {} 
    196190        
    197         params["x"] = math.fabs(self.horizontal_lines.half_width) 
    198         params["y"] = math.fabs(self.vertical_lines.half_height)  
     191        params["Width"] = math.fabs(self.vertical_lines.half_width)*2 
     192        params["Height"] = math.fabs(self.horizontal_lines.half_height)*2  
    199193         
    200194        params["center_x"] = self.center.x 
     
    218212    def set_params(self, params): 
    219213         
    220         x_max = math.fabs(params["x"] ) 
    221         y_max = math.fabs(params["y"] ) 
     214        x_max = math.fabs(params["Width"] )/2 
     215        y_max = math.fabs(params["Height"] )/2 
    222216         
    223217        self.center_x=params["center_x"]  
    224218        self.center_y=params["center_y"] 
    225          
     219        """ 
    226220        self.center.update(center_x=self.center_x,center_y=self.center_y) 
    227221        
     
    235229        self._post_data() 
    236230         
    237          
     231        """ 
    238232         
    239233    def freeze_axes(self): 
     
    410404        self.save_half_height= math.fabs(y) 
    411405         
    412         self.half_width= math.fabs(x) 
    413         self.save_half_width=math.fabs(x) 
     406        self.half_width= math.fabs(self.x1- self.x2)/2 
     407        self.save_half_width=math.fabs(self.x1- self.x2)/2 
    414408         
    415409        try: 
     
    470464        Draw the new roughness on the graph. 
    471465        """ 
     466        print "self.half_height",self.half_height,self.half_width 
    472467        if width!=None: 
    473468            self.half_width= width 
     
    477472            self.center_x= center.x 
    478473            self.center_y= center.y 
    479              
     474            print "vertical width",self.half_width ,self.center_x 
    480475            self.x1 = self.half_width + self.center_x 
    481476            self.x2= -self.half_width + self.center_x 
     
    516511         
    517512        self.save_half_height= self.half_height 
    518         self.save_half_width =  self.half_width 
     513        #self.save_half_width = math.fabs(self.x1-self.x2)/2 
     514        self.save_half_width = self.half_width 
    519515        self.base.freeze_axes() 
    520516 
     
    535531         
    536532        self.half_height= self.save_half_height 
     533        #self.half_width= math.fabs(self.x1-self.x2)/2 
    537534        self.half_width= self.save_half_width 
    538535        
     
    545542        self.x2= self.center_x - delta 
    546543         
    547         self.half_width= math.fabs(self.x1)-self.center_x 
     544        self.half_width= math.fabs(self.x1-self.x2)/2 
     545        print "Move vert: vertical width",self.half_width ,self.center_x 
    548546        self.has_move=True 
    549547        self.base.base.update() 
     
    660658        Draw the new roughness on the graph. 
    661659        """ 
     660        print "self.half_width",self.half_width 
    662661        if width!=None: 
    663662            self.half_width= width 
Note: See TracChangeset for help on using the changeset viewer.