Changeset 20522e1 in sasview for src/sas/sascalc/dataloader
- Timestamp:
- Jan 20, 2017 3:45:03 AM (8 years ago)
- 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:
- 18501795
- Parents:
- b5db35d
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/sas/sascalc/dataloader/data_info.py
rb5db35d r20522e1 489 489 ## Loading errors 490 490 errors = None 491 ## SESANS data check 492 isSesans = None 493 491 494 492 495 def __init__(self): … … 521 524 ## Loading errors 522 525 self.errors = [] 526 ## SESANS data check 527 self.isSesans = False 523 528 524 529 def append_empty_process(self): … … 694 699 1D data class 695 700 """ 696 def __init__(self, x=None, y=None, dx=None, dy=None, lam=None, dlam=None, isSesans=False): 697 self.isSesans = isSesans 701 def __init__(self, x=None, y=None, dx=None, dy=None, lam=None, dlam=None, isSesans=None): 698 702 DataInfo.__init__(self) 699 703 plottable_1D.__init__(self, x, y, dx, dy,None, None, lam, dlam) 700 if self.isSesans: 701 x_unit = 'A' 702 y_unit = 'pol' 703 elif not self.isSesans: # it's SANS data! (Could also be simple else statement, but i prefer exhaustive conditionals...-JHB) 704 x_unit = '1/A' 705 y_unit = '1/cm' 706 else: # and if it's neither, you get punished! 707 raise(TypeError,'This is neither SANS nor SESANS data, what the hell are you doing??') 704 self.isSesans = isSesans 705 try: 706 if self.isSesans: # the data is SESANS 707 x_unit = 'A' 708 y_unit = 'pol' 709 elif not self.isSesans: # the data is SANS 710 x_unit = '1/A' 711 y_unit = '1/cm' 712 except: # the data is not recognized/supported, and the user is notified 713 raise(TypeError, 'data not recognized, check documentation for supported 1D data formats') 708 714 709 715 def __str__(self): … … 927 933 def __init__(self, data=None, err_data=None, qx_data=None, 928 934 qy_data=None, q_data=None, mask=None, 929 dqx_data=None, dqy_data=None): 930 self.y_bins = [] 931 self.x_bins = [] 935 dqx_data=None, dqy_data=None, isSesans=None): 932 936 DataInfo.__init__(self) 933 937 plottable_2D.__init__(self, data, err_data, qx_data, 934 938 qy_data, q_data, mask, dqx_data, dqy_data) 939 self.y_bins = [] 940 self.x_bins = [] 941 self.isSesans=isSesans 942 935 943 if len(self.detector) > 0: 936 944 raise RuntimeError, "Data2D: Detector bank already filled at init"
Note: See TracChangeset
for help on using the changeset viewer.