Ignore:
Timestamp:
Apr 4, 2017 12:26:11 PM (8 years ago)
Author:
smk78
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.
Message:

Merge branch 'master' of https://github.com/SasView/sasview.git

File:
1 edited

Legend:

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

    r36d69e1 red2276f  
    1414import os 
    1515 
     16import numpy as np 
     17import math 
     18#import logging 
     19 
    1620from sas.sascalc.dataloader.data_info import Data2D 
    1721from sas.sascalc.dataloader.data_info import Detector 
    1822from sas.sascalc.dataloader.manipulations import reader2D_converter 
    19 import numpy as np 
    2023 
    2124# Look for unit converter 
     
    6265            data_conv_i(1.0, output.I_unit) 
    6366 
     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   
    6498        data_row = 0 
    6599        wavelength = distance = center_x = center_y = None 
Note: See TracChangeset for help on using the changeset viewer.