Changeset dd11014 in sasview for src/sas/sascalc/dataloader/readers
- Timestamp:
- Apr 4, 2017 11:00:50 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.2.2, ticket-1009, ticket-1094-headless, ticket-1242-2d-resolution, ticket-1243, ticket-1249, ticket885, unittest-saveload
- Children:
- 7b15990, a2e980b, 4b81e01, 3a33740
- Parents:
- 1779e72
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/sas/sascalc/dataloader/readers/IgorReader.py
red2276f rdd11014 14 14 import os 15 15 16 import numpy as np17 import math18 #import logging19 20 16 from sas.sascalc.dataloader.data_info import Data2D 21 17 from sas.sascalc.dataloader.data_info import Detector 22 18 from sas.sascalc.dataloader.manipulations import reader2D_converter 19 import numpy as np 23 20 24 21 # Look for unit converter … … 65 62 data_conv_i(1.0, output.I_unit) 66 63 67 for line in lines:68 69 # Find setup info line70 if isInfo:71 isInfo = False72 line_toks = line.split()73 # Wavelength in Angstrom74 try:75 wavelength = float(line_toks[1])76 except:77 msg = "IgorReader: can't read this file, missing wavelength"78 raise ValueError, msg79 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 it86 continue87 88 # Get total bin number89 90 i_tot_row += 191 i_tot_row = math.ceil(math.sqrt(i_tot_row)) - 192 #print "i_tot", i_tot_row93 size_x = i_tot_row # 192#12894 size_y = i_tot_row # 192#12895 output.data = np.zeros([size_x, size_y])96 output.err_data = np.zeros([size_x, size_y])97 98 64 data_row = 0 99 65 wavelength = distance = center_x = center_y = None
Note: See TracChangeset
for help on using the changeset viewer.