Changeset dd11014 in sasview for src/sas/sascalc/dataloader/readers


Ignore:
Timestamp:
Apr 4, 2017 11:00:50 AM (8 years ago)
Author:
ajj
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
Message:

Fixing PR #55 broken merge

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/sas/sascalc/dataloader/readers/IgorReader.py

    red2276f rdd11014  
    1414import os 
    1515 
    16 import numpy as np 
    17 import math 
    18 #import logging 
    19  
    2016from sas.sascalc.dataloader.data_info import Data2D 
    2117from sas.sascalc.dataloader.data_info import Detector 
    2218from sas.sascalc.dataloader.manipulations import reader2D_converter 
     19import numpy as np 
    2320 
    2421# Look for unit converter 
     
    6562            data_conv_i(1.0, output.I_unit) 
    6663 
    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    
    9864        data_row = 0 
    9965        wavelength = distance = center_x = center_y = None 
Note: See TracChangeset for help on using the changeset viewer.