Changeset d6513cd in sasview for DataLoader/data_info.py


Ignore:
Timestamp:
Aug 22, 2008 3:13:34 PM (16 years ago)
Author:
Mathieu Doucet <doucetm@…>
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:
48882d1
Parents:
533550c
Message:

Data loader update (still working)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • DataLoader/data_info.py

    rb99ac227 rd6513cd  
    104104    distance_unit = 'mm' 
    105105    ## Offset of this detector position in X, Y, (and Z if necessary) [Vector] [mm]  
    106     offset = Vector() 
     106    offset = None 
    107107    offset_unit = 'm' 
    108108    ## Orientation (rotation) of this detector in roll, pitch, and yaw [Vector] [degrees] 
    109     orientation = Vector() 
     109    orientation = None 
    110110    orientation_unit = 'degree' 
    111111    ## Center of the beam on the detector in X and Y (and Z if necessary) [Vector] [mm] 
    112     beam_center = Vector() 
     112    beam_center = None 
    113113    beam_center_unit = 'mm' 
    114114    ## Pixel size in X, Y, (and Z if necessary) [Vector] [mm] 
    115     pixel_size = Vector() 
     115    pixel_size = None 
    116116    pixel_size_unit = 'mm' 
    117117    ## Slit length of the instrument for this detector.[float] [mm] 
    118118    slit_length = None 
    119119    slit_length_unit = 'mm' 
     120     
     121    def __init__(self): 
     122        """ 
     123            Initialize class attribute that are objects... 
     124        """ 
     125        self.offset      = Vector() 
     126        self.orientation = Vector() 
     127        self.beam_center = Vector() 
     128        self.pixel_size  = Vector() 
     129         
    120130     
    121131    def __str__(self): 
     
    136146        return _str 
    137147 
     148class Aperture: 
     149    # Aperture size [Vector] 
     150    size = None 
     151    size_unit = 'mm' 
     152    # Aperture distance [float] 
     153    distance = None 
     154    distance_unit = 'mm' 
     155     
     156    def __init__(self): 
     157        self.size = Vector() 
     158     
    138159class Collimation: 
    139160    """ 
    140161        Class to hold collimation information 
    141162    """ 
    142     class Aperture: 
    143         # Aperture size [Vector] 
    144         size = Vector() 
    145         size_unit = 'mm' 
    146         # Aperture distance [float] 
    147         distance = None 
    148         distance_unit = 'mm' 
    149163     
    150164    ## Length [float] [mm] 
     
    152166    length_unit = 'mm' 
    153167    ## Aperture 
    154     aperture = [] 
     168    aperture = None 
     169     
     170    def __init__(self): 
     171        self.aperture = [] 
    155172     
    156173    def __str__(self): 
     
    172189    radiation = '' 
    173190    ## Beam size [Vector] [mm] 
    174     beam_size = Vector() 
     191    beam_size = None 
    175192    beam_size_unit = 'mm' 
    176193    ## Beam shape [string] 
     
    189206    wavelength_spread_unit = 'percent' 
    190207     
     208    def __init__(self): 
     209        self.beam_size = Vector() 
     210         
     211     
    191212    def __str__(self): 
    192213        _str  = "Source:\n" 
     
    229250    temperature_unit = 'C' 
    230251    ## Position [Vector] [mm] 
    231     position = Vector() 
     252    position = None 
    232253    position_unit = 'mm' 
    233254    ## Orientation [Vector] [degrees] 
    234     orientation = Vector() 
     255    orientation = None 
    235256    orientation_unit = 'degree' 
    236257    ## Details 
    237     details = [] 
     258    details = None 
     259     
     260    def __init__(self): 
     261        self.position    = Vector() 
     262        self.orientation = Vector() 
     263        self.details     = [] 
    238264     
    239265    def __str__(self): 
     
    264290    date = '' 
    265291    description= '' 
    266     term = [] 
    267     notes = [] 
     292    term = None 
     293    notes = None 
     294     
     295    def __init__(self): 
     296        self.term = [] 
     297        self.notes = [] 
    268298     
    269299    def __str__(self): 
     
    293323    filename   = '' 
    294324    ## Notes 
    295     notes      = [] 
     325    notes      = None 
    296326    ## Processes (Action on the data) 
    297     process    = [] 
     327    process    = None 
    298328    ## Instrument name 
    299329    instrument = '' 
    300330    ## Detector information 
    301     detector   = [] 
     331    detector   = None 
    302332    ## Sample information 
    303     sample     = Sample() 
     333    sample     = None 
    304334    ## Source information 
    305     source     = Source() 
     335    source     = None 
    306336    ## Collimation information 
    307     collimation = [] 
     337    collimation = None 
    308338    ## Additional meta-data 
    309     meta_data  = {} 
     339    meta_data  = None 
    310340    ## Loading errors 
    311     errors = [] 
     341    errors = None 
    312342             
    313343    def __init__(self): 
     
    583613     
    584614    ## Vector of Q-values at the center of each bin in x 
    585     x_bins = [] 
     615    x_bins = None 
    586616     
    587617    ## Vector of Q-values at the center of each bin in y 
    588     y_bins = [] 
     618    y_bins = None 
    589619     
    590620     
    591621    def __init__(self, data=None, err_data=None): 
     622        self.y_bins = [] 
     623        self.x_bins = [] 
    592624        DataInfo.__init__(self) 
    593625        plottable_2D.__init__(self, data, err_data) 
Note: See TracChangeset for help on using the changeset viewer.