Changeset d6513cd in sasview for DataLoader/readers


Ignore:
Timestamp:
Aug 22, 2008 5:13:34 PM (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:
48882d1
Parents:
533550c
Message:

Data loader update (still working)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • DataLoader/readers/cansas_reader.py

    r99d1af6 rd6513cd  
    2020import numpy 
    2121import os, sys 
    22 from DataLoader.data_info import Data1D, Collimation, Detector, Process 
     22from DataLoader.data_info import Data1D, Collimation, Detector, Process, Aperture 
    2323from xml import xpath 
    2424 
     
    7070                    break 
    7171                 
    72                 if nodes[0].hasAttributes(): 
    73                     for i in range(nodes[0].attributes.length): 
    74                         attr[nodes[0].attributes.item(i).nodeName] \ 
    75                             = nodes[0].attributes.item(i).nodeValue 
     72            if nodes[0].hasAttributes(): 
     73                for i in range(nodes[0].attributes.length): 
     74                    attr[nodes[0].attributes.item(i).nodeName] \ 
     75                        = nodes[0].attributes.item(i).nodeValue 
    7676        except: 
    7777            # problem reading the node. Skip it and return that 
     
    317317            apert_list = xpath.Evaluate('aperture', item) 
    318318            for apert in apert_list: 
    319                 aperture =  collim.Aperture() 
    320                  
     319                aperture =  Aperture() 
    321320                _store_float('distance', apert, 'distance', aperture)     
    322321                _store_float('size/x', apert, 'size.x', aperture)     
     
    426425        data_info.dx = dx 
    427426        data_info.dy = dy 
     427         
     428        data_conv_q = None 
     429        data_conv_i = None 
     430         
     431        if has_converter == True and data_info.x_unit != '1/A': 
     432            data_conv_q = Converter('1/A') 
     433            # Test it 
     434            data_conv_q(1.0, output.Q_unit) 
     435             
     436        if has_converter == True and data_info.y_unit != '1/cm': 
     437            data_conv_i = Converter('1/cm') 
     438            # Test it 
     439            data_conv_i(1.0, output.I_unit)             
     440     
     441         
    428442        if data_conv_q is not None: 
    429             data_info.xaxis("\\rm{Q}", output.x_unit) 
     443            data_info.xaxis("\\rm{Q}", data_info.x_unit) 
    430444        else: 
    431445            data_info.xaxis("\\rm{Q}", 'A^{-1}') 
    432446        if data_conv_i is not None: 
    433             data_info.yaxis("\\{I(Q)}", output.y_unit) 
     447            data_info.yaxis("\\{I(Q)}", data_info.y_unit) 
    434448        else: 
    435449            data_info.yaxis("\\rm{I(Q)}","cm^{-1}") 
Note: See TracChangeset for help on using the changeset viewer.