Changeset ad4632c in sasview for src/sas/sascalc
- Timestamp:
- Feb 6, 2017 4:00:46 PM (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:
- 157b716
- Parents:
- 2a2b43a
- Location:
- src/sas/sascalc/dataloader
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
src/sas/sascalc/dataloader/data_info.py
r18501795 rad4632c 352 352 ## Details 353 353 details = None 354 ## SESANS zacceptance 355 zacceptance = None 354 356 355 357 def __init__(self): … … 545 547 _str += "Title: %s\n" % self.title 546 548 _str += "Run: %s\n" % str(self.run) 549 _str += "SESANS: %s\n" % str(self.isSesans) 547 550 _str += "Instrument: %s\n" % str(self.instrument) 548 551 _str += "%s\n" % str(self.sample) … … 1179 1182 final_dataset.xmin = data.xmin 1180 1183 final_dataset.ymin = data.ymin 1184 final_dataset.isSesans = datainfo.isSesans 1181 1185 final_dataset.title = datainfo.title 1182 1186 final_dataset.run = datainfo.run -
src/sas/sascalc/dataloader/readers/cansas_constants.py
r250fec92 rad4632c 133 133 "variable" : None, 134 134 "children" : {"Idata" : SASDATA_IDATA, 135 "Sesans": {"storeas": "content"}, 136 "zacceptance": {"storeas": "float"}, 135 137 "<any>" : ANY 136 138 } -
src/sas/sascalc/dataloader/readers/cansas_reader.py
r0639476 rad4632c 247 247 ## I and Q Data 248 248 elif tagname == 'I': 249 self.current_dataset.yaxis("Intensity", unit) 249 unit_list = unit.split(" | ") 250 if len(unit_list) > 1: 251 self.current_dataset.yaxis(unit_list[0], unit_list[1]) 252 else: 253 self.current_dataset.yaxis("Intensity", unit) 250 254 self.current_dataset.y = np.append(self.current_dataset.y, data_point) 251 255 elif tagname == 'Idev': 252 256 self.current_dataset.dy = np.append(self.current_dataset.dy, data_point) 253 257 elif tagname == 'Q': 254 self.current_dataset.xaxis("Q", unit) 258 unit_list = unit.split(" | ") 259 if len(unit_list) > 1: 260 self.current_dataset.xaxis(unit_list[0], unit_list[1]) 261 else: 262 self.current_dataset.xaxis("Q", unit) 255 263 self.current_dataset.x = np.append(self.current_dataset.x, data_point) 256 264 elif tagname == 'Qdev': … … 264 272 elif tagname == 'Shadowfactor': 265 273 pass 274 elif tagname == 'Sesans': 275 self.current_datainfo.isSesans = bool(data_point) 276 elif tagname == 'zacceptance': 277 self.current_datainfo.sample.zacceptance = (data_point, unit) 266 278 267 279 ## Sample Information … … 919 931 node.append(point) 920 932 self.write_node(point, "Q", datainfo.x[i], 921 {'unit': datainfo. x_unit})933 {'unit': datainfo._xaxis + " | " + datainfo._xunit}) 922 934 if len(datainfo.y) >= i: 923 935 self.write_node(point, "I", datainfo.y[i], 924 {'unit': datainfo. y_unit})936 {'unit': datainfo._yaxis + " | " + datainfo._yunit}) 925 937 if datainfo.dy is not None and len(datainfo.dy) > i: 926 938 self.write_node(point, "Idev", datainfo.dy[i], 927 {'unit': datainfo. y_unit})939 {'unit': datainfo._yaxis + " | " + datainfo._yunit}) 928 940 if datainfo.dx is not None and len(datainfo.dx) > i: 929 941 self.write_node(point, "Qdev", datainfo.dx[i], 930 {'unit': datainfo. x_unit})942 {'unit': datainfo._xaxis + " | " + datainfo._xunit}) 931 943 if datainfo.dxw is not None and len(datainfo.dxw) > i: 932 944 self.write_node(point, "dQw", datainfo.dxw[i], 933 {'unit': datainfo. x_unit})945 {'unit': datainfo._xaxis + " | " + datainfo._xunit}) 934 946 if datainfo.dxl is not None and len(datainfo.dxl) > i: 935 947 self.write_node(point, "dQl", datainfo.dxl[i], 936 {'unit': datainfo.x_unit}) 948 {'unit': datainfo._xaxis + " | " + datainfo._xunit}) 949 if datainfo.isSesans: 950 sesans = self.create_element("Sesans") 951 sesans.text = str(datainfo.isSesans) 952 node.append(sesans) 953 self.write_node(node, "zacceptance", datainfo.sample.zacceptance[0], 954 {'unit': datainfo.sample.zacceptance[1]}) 955 937 956 938 957 def _write_trans_spectrum(self, datainfo, entry_node):
Note: See TracChangeset
for help on using the changeset viewer.