Changeset be577e7 in sasview for src/sans/dataloader/data_info.py


Ignore:
Timestamp:
Dec 30, 2013 2:20:27 PM (11 years ago)
Author:
Jeff Krzywon <jeffery.krzywon@…>
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:
1ce36f37
Parents:
17a25d4
Message:

Fix for the broken build.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/sans/dataloader/data_info.py

    rffbe487 rbe577e7  
    401401        return _str 
    402402     
     403class TransmissionSpectrum: 
     404    """ 
     405    Class that holds information about transmission spectrum 
     406    for white beams and spallation sources. 
     407    """ 
     408    name = '' 
     409    timestamp = '' 
     410    ## Wavelength (float) [A] 
     411    wavelength = None 
     412    wavelength_unit = 'A' 
     413    ## Transmission (float) [unit less] 
     414    transmission = None 
     415    transmission_unit = '' 
     416    ## Transmission Deviation (float) [unit less] 
     417    transmission_deviation = None 
     418    transmission_deviation_unit = '' 
     419     
     420    def __init__(self): 
     421        self.wavelength = [] 
     422        self.transmission = [] 
     423        self.transmission_deviation = [] 
     424     
     425    def __str__(self): 
     426        _str  = "Transmission Spectrum:\n" 
     427        _str += "   Name:       {0}".format(self.name) 
     428        _str += "   Timestamp:  {1}".format(self.timestamp) 
     429        _str += "   Wavelength [{0}] | Transmission [{1}] | Trans Dev [{2}]\n".format(self.wavelength_unit, self.transmission_unit, self.transmission_deviation_unit) 
     430        for i in range(len(self.wavelength)): 
     431            _str += "   {0}, {1}".format(self.wavelength[i], self.transmission[i]) 
     432            if len(self.transmission_deviation > i): 
     433                _str += ", {0}".format(self.transmission_deviation[i]) 
     434            _str += "\n" 
     435        return _str 
     436     
    403437   
    404438class DataInfo: 
     
    431465    ## Collimation information 
    432466    collimation = None 
     467    ## Transmission Spectrum INfo 
     468    trans_spectrum = None 
    433469    ## Additional meta-data 
    434470    meta_data  = None 
     
    461497        ## Collimation information 
    462498        self.collimation = [] 
     499        ## Transmission Spectrum 
     500        self.trans_spectrum = TransmissionSpectrum() 
    463501        ## Additional meta-data 
    464502        self.meta_data  = {} 
Note: See TracChangeset for help on using the changeset viewer.