Ignore:
Timestamp:
Oct 10, 2016 4:32:09 PM (8 years ago)
Author:
jhbakker
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, ticket-1009, ticket-1094-headless, ticket-1242-2d-resolution, ticket-1243, ticket-1249, ticket885, unittest-saveload
Children:
392056d
Parents:
51a4d78
Message:

SESANS is almost working, but this is NOT a stable version!

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/sas/sascalc/dataloader/data_info.py

    r51a4d78 r1fac6c0  
    2525import numpy 
    2626import math 
    27  
    2827class plottable_1D(object): 
    2928    """ 
     
    696695    1D data class 
    697696    """ 
    698     if plottable_1D.lam is None: # This means it's SANS data! 
    699         x_unit = '1/A' 
    700         y_unit = '1/cm' 
    701     elif plottable_1D.lam is not None: # This means it's SESANS data! 
    702         x_unit = 'A' 
    703         y_unit = 'pol' 
    704     else: # and if it's neither, you get punished! 
    705         raise(TypeError,'This is neither SANS nor SESANS data, what the hell are you doing??') 
    706  
    707     def __init__(self, x=None, y=None, dx=None, dy=None, lam=None, dlam=None): 
     697    #if plottable_1D.lam is None: # This means it's SANS data! 
     698     #   x_unit = '1/A' 
     699      #  y_unit = '1/cm' 
     700    #elif plottable_1D.lam is not None: # This means it's SESANS data! 
     701     #   x_unit = 'A' 
     702      #  y_unit = 'pol' 
     703    #else: # and if it's neither, you get punished! 
     704     #   raise(TypeError,'This is neither SANS nor SESANS data, what the hell are you doing??') 
     705 
     706    def __init__(self, x=None, y=None, dx=None, dy=None, lam=None, dlam=None, isSesans=False): 
     707        self.isSesans = isSesans 
    708708        DataInfo.__init__(self) 
    709709        plottable_1D.__init__(self, x, y, dx, dy,None, None, lam, dlam) 
    710         if self.lam is None: # This means the lam param was not detected in the data: it's SANS data! 
     710        if self.isSesans: 
     711            x_unit = 'A' 
     712            y_unit = 'pol' 
     713        elif not self.isSesans: # it's SANS data! (Could also be simple else statement, but i prefer exhaustive conditionals...-JHB) 
    711714            x_unit = '1/A' 
    712715            y_unit = '1/cm' 
    713         elif self.lam is not None: # This means lam was detected (should be an empty ndarray): it's SESANS data! 
    714             x_unit = 'A' 
    715             y_unit = 'pol' 
    716716        else: # and if it's neither, you get punished! 
    717717            raise(TypeError,'This is neither SANS nor SESANS data, what the hell are you doing??') 
Note: See TracChangeset for help on using the changeset viewer.