Changeset 7b7ec05 in sasview for src/sas/sascalc/dataloader/readers/IgorReader.py
- Timestamp:
- Apr 4, 2017 12:26:11 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.2.2, ticket-1009, ticket-1094-headless, ticket-1242-2d-resolution, ticket-1243, ticket-1249, ticket885, unittest-saveload
- Children:
- 1779e72
- Parents:
- ce9e0b5 (diff), f68d503 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent. - File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/sas/sascalc/dataloader/readers/IgorReader.py
r36d69e1 red2276f 14 14 import os 15 15 16 import numpy as np 17 import math 18 #import logging 19 16 20 from sas.sascalc.dataloader.data_info import Data2D 17 21 from sas.sascalc.dataloader.data_info import Detector 18 22 from sas.sascalc.dataloader.manipulations import reader2D_converter 19 import numpy as np20 23 21 24 # Look for unit converter … … 62 65 data_conv_i(1.0, output.I_unit) 63 66 67 for line in lines: 68 69 # Find setup info line 70 if isInfo: 71 isInfo = False 72 line_toks = line.split() 73 # Wavelength in Angstrom 74 try: 75 wavelength = float(line_toks[1]) 76 except: 77 msg = "IgorReader: can't read this file, missing wavelength" 78 raise ValueError, msg 79 80 #Find # of bins in a row assuming the detector is square. 81 if dataStarted == True: 82 try: 83 value = float(line) 84 except: 85 # Found a non-float entry, skip it 86 continue 87 88 # Get total bin number 89 90 i_tot_row += 1 91 i_tot_row = math.ceil(math.sqrt(i_tot_row)) - 1 92 #print "i_tot", i_tot_row 93 size_x = i_tot_row # 192#128 94 size_y = i_tot_row # 192#128 95 output.data = np.zeros([size_x, size_y]) 96 output.err_data = np.zeros([size_x, size_y]) 97 64 98 data_row = 0 65 99 wavelength = distance = center_x = center_y = None
Note: See TracChangeset
for help on using the changeset viewer.