Changeset b99ac227 in sasview for DataLoader/readers/danse_reader.py


Ignore:
Timestamp:
Aug 6, 2008 10:54:02 AM (16 years ago)
Author:
Mathieu Doucet <doucetm@…>
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:
17a6843
Parents:
99d1af6
Message:

Updates and tests for readers

File:
1 edited

Legend:

Unmodified
Added
Removed
  • DataLoader/readers/danse_reader.py

    r99d1af6 rb99ac227  
    11""" 
    22    DANSE/SANS file reader 
     3""" 
     4 
     5""" 
     6This software was developed by the University of Tennessee as part of the 
     7Distributed Data Analysis of Neutron Scattering Experiments (DANSE) 
     8project funded by the US National Science Foundation.  
     9 
     10If you use DANSE applications to do scientific research that leads to  
     11publication, we ask that you acknowledge the use of the software with the  
     12following sentence: 
     13 
     14"This work benefited from DANSE software developed under NSF award DMR-0520547."  
     15 
     16copyright 2008, University of Tennessee 
    317""" 
    418 
     
    2438    type = ["DANSE files (*.sans)|*.sans"] 
    2539    ## Extension 
    26     ext  = ['.sans']     
     40    ext  = ['.sans', '.SANS']     
    2741         
    2842    def read(self, filename=None): 
     
    140154            xmax = None 
    141155             
    142             #x = numpy.zeros(size_x) 
    143             #y = numpy.zeros(size_y) 
    144             #X, Y = pylab.meshgrid(x, y) 
    145             #Z = copy.deepcopy(X) 
    146             #E = copy.deepcopy(X) 
    147             itot = 0 
    148             i_x = 0 
    149             i_y = 0 
    150              
    151156            # Qx and Qy vectors 
    152157            for i_x in range(size_x): 
     
    179184             
    180185            # Store the data in the 2D array 
     186            itot = 0 
     187            i_x  = 0 
     188            i_y  = -1 
     189             
    181190            for i_pt in range(len(data)): 
    182191                try: 
     
    188197                 
    189198                # Get bin number 
    190                 if math.fmod(itot, size_x)==0: 
     199                if math.fmod(i_pt, size_x)==0: 
    191200                    i_x = 0 
    192201                    i_y += 1 
     
    194203                    i_x += 1 
    195204                     
    196                 output.data[size_y-1-i_y][i_x] = value 
     205                output.data[i_y][i_x] = value        
     206                #output.data[size_y-1-i_y][i_x] = value 
    197207                if fversion>1.0: 
    198                     output.err_data[size_y-1-i_y][i_x] = error[i_pt] 
    199                  
    200                 itot += 1 
     208                    output.err_data[i_y][i_x] = error[i_pt] 
     209                    #output.err_data[size_y-1-i_y][i_x] = error[i_pt] 
     210                 
    201211                 
    202212            # Store all data ###################################### 
Note: See TracChangeset for help on using the changeset viewer.