Changeset 5917637 in sasview for sanscalculator/src


Ignore:
Timestamp:
Jan 13, 2013 11:22:55 AM (12 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:
32aba6a
Parents:
3657667
Message:

minor corrections

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sanscalculator/src/sans/calculator/sans_gen.py

    r3657667 r5917637  
    295295            raise ValueError, msg 
    296296         
    297     def remove_null_points(self, remove=False): 
     297    def remove_null_points(self, remove=False, recenter=False): 
    298298        """ 
    299299        Removes any mx, my, and mz = 0 points 
     
    310310                self.my = self.my[is_nonzero] 
    311311                self.mz = self.mz[is_nonzero] 
    312         self.pos_x -= (min(self.pos_x) + max(self.pos_x)) / 2.0 
    313         self.pos_y -= (min(self.pos_y) + max(self.pos_y)) / 2.0 
    314         self.pos_z -= (min(self.pos_z) + max(self.pos_z)) / 2.0 
     312        if recenter: 
     313            self.pos_x -= (min(self.pos_x) + max(self.pos_x)) / 2.0 
     314            self.pos_y -= (min(self.pos_y) + max(self.pos_y)) / 2.0 
     315            self.pos_z -= (min(self.pos_z) + max(self.pos_z)) / 2.0 
    315316  
    316317    def get_magsld(self): 
     
    542543                except: 
    543544                    pass 
    544             #print pix_symbol, pos_x 
    545             pos_x -= (min(pos_x) + max(pos_x)) / 2.0 
    546             pos_y -= (min(pos_y) + max(pos_y)) / 2.0 
    547             pos_z -= (min(pos_z) + max(pos_z)) / 2.0 
     545            #re-centering 
     546            #pos_x -= (min(pos_x) + max(pos_x)) / 2.0 
     547            #pos_y -= (min(pos_y) + max(pos_y)) / 2.0 
     548            #pos_z -= (min(pos_z) + max(pos_z)) / 2.0 
    548549 
    549550            output = MagSLD(pos_x, pos_y, pos_z, sld_n, sld_mx, sld_my, sld_mz) 
     
    645646                        # Skip non-data lines 
    646647                        pass 
    647                   
    648             pos_x -= (min(pos_x) + max(pos_x)) / 2.0 
    649             pos_y -= (min(pos_y) + max(pos_y)) / 2.0 
    650             pos_z -= (min(pos_z) + max(pos_z)) / 2.0 
     648             
     649            # re-center      
     650            #pos_x -= (min(pos_x) + max(pos_x)) / 2.0 
     651            #pos_y -= (min(pos_y) + max(pos_y)) / 2.0 
     652            #pos_z -= (min(pos_z) + max(pos_z)) / 2.0 
    651653 
    652654            output = MagSLD(pos_x, pos_y, pos_z, sld_n,  
Note: See TracChangeset for help on using the changeset viewer.