Changeset d2539aa in sasview


Ignore:
Timestamp:
Oct 20, 2010 6:50:20 PM (14 years ago)
Author:
Jae Cho <jhjcho@…>
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, release_4.0.1, ticket-1009, ticket-1094-headless, ticket-1242-2d-resolution, ticket-1243, ticket-1249, ticket885, unittest-saveload
Children:
b2f25dc5
Parents:
fb59ed9
Message:

reset the value to zero if nan or inf

File:
1 edited

Legend:

Unmodified
Added
Removed
  • DataLoader/readers/red2d_reader.py

    r0997158f rd2539aa  
    2424except: 
    2525    has_converter = False 
    26  
     26     
     27def check_point(x_point): 
     28    """ 
     29    check point validity 
     30    """ 
     31    # set zero for non_floats 
     32    try: 
     33        return float(x_point) 
     34    except: 
     35        return 0 
     36         
    2737class Reader: 
    2838    """ Simple data reader for Igor data files """ 
     
    185195            data_list = "\t".join(data_lines.tolist()) 
    186196            data_list = data_list.split() 
    187              
     197 
    188198        # Change it(string) into float 
    189         data_list = map(float,data_list) 
     199        #data_list = map(float,data_list) 
     200        data_list1 = map(check_point,data_list) 
     201       
    190202        # numpy array form 
    191         data_array = numpy.array(data_list) 
    192  
     203        data_array = numpy.array(data_list1) 
    193204        # Redimesion based on the row_num and col_num, otherwise raise an error. 
    194205        try: 
     
    216227        # If all mask elements are False, put all True 
    217228        if not mask.any(): mask[mask==False] = True    
    218    
     229             
    219230        # Store limits of the image in q space 
    220231        xmin    = numpy.min(qx_data) 
Note: See TracChangeset for help on using the changeset viewer.