Changeset b0d0723 in sasview for DataLoader/readers


Ignore:
Timestamp:
Aug 15, 2009 8:17:01 PM (15 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:
2cb89e7
Parents:
379e15b
Message:

dataloader: ported cansas reader to lxml

File:
1 edited

Legend:

Unmodified
Added
Removed
  • DataLoader/readers/cansas_reader.py

    r7d8094b rb0d0723  
    66See the license text in license.txt 
    77 
    8 copyright 2008, University of Tennessee 
     8copyright 2008, 2009, University of Tennessee 
    99""" 
    1010# Known issue: reader not compatible with multiple SASdata entries 
     
    2424import os, sys 
    2525from DataLoader.data_info import Data1D, Collimation, Detector, Process, Aperture 
    26 from xml import xpath 
    27 import xml.dom.minidom  
    28  
     26from lxml import etree 
     27import xml.dom.minidom 
    2928 
    3029has_converter = True 
     
    3332except: 
    3433    has_converter = False 
     34 
     35CANSAS_NS = "cansas1d/1.0" 
    3536 
    3637def write_node(doc, parent, name, value, attr={}): 
     
    5253    return False 
    5354 
    54 def get_node_text(node): 
    55     """ 
    56         Get the text context of a node 
    57          
    58         @param node: node to read from 
    59         @return: content, attribute list 
    60     """ 
    61     content = None 
    62     attr    = {} 
    63     for item in node.childNodes: 
    64         if item.nodeName.find('text')>=0 \ 
    65             and len(item.nodeValue.strip())>0: 
    66             content = item.nodeValue.strip() 
    67             break 
    68          
    69     if node.hasAttributes(): 
    70         for i in range(node.attributes.length): 
    71             attr[node.attributes.item(i).nodeName] \ 
    72                 = node.attributes.item(i).nodeValue 
    73  
    74     return content, attr 
    75  
    7655def get_content(location, node): 
    7756    """ 
     
    8059        @param location: xpath location 
    8160        @param node: node to start at 
    82     """ 
     61        @return: Element, or None 
     62    """ 
     63    nodes = node.xpath(location, namespaces={'ns': CANSAS_NS}) 
     64     
     65    if len(nodes)>0: 
     66        return nodes[0] 
     67    else: 
     68        return None 
     69 
     70def get_float(location, node): 
     71    """ 
     72        Get the content of a node as a float  
     73         
     74        @param location: xpath location 
     75        @param node: node to start at 
     76    """ 
     77    nodes = node.xpath(location, namespaces={'ns': CANSAS_NS}) 
     78     
    8379    value = None 
    84     attr  = {} 
    85     nodes = xpath.Evaluate(location, node) 
     80    attr = {} 
     81     
    8682    if len(nodes)>0: 
    8783        try: 
    88             # Skip comments and empty lines  
    89             for item in nodes[0].childNodes: 
    90                 if item.nodeName.find('text')>=0 \ 
    91                     and len(item.nodeValue.strip())>0: 
    92                     value = item.nodeValue.strip() 
    93                     break 
    94                  
    95             if nodes[0].hasAttributes(): 
    96                 for i in range(nodes[0].attributes.length): 
    97                     attr[nodes[0].attributes.item(i).nodeName] \ 
    98                         = nodes[0].attributes.item(i).nodeValue 
    99         except: 
    100             # problem reading the node. Skip it and return that 
    101             # nothing was found 
    102             logging.error("cansas_reader.get_content: %s\n  %s" % (location, sys.exc_value)) 
    103          
    104     return value, attr 
    105  
    106 def get_float(location, node): 
    107     """ 
    108         Get the content of a node as a float 
    109          
    110         @param location: xpath location 
    111         @param node: node to start at 
    112     """ 
    113     value = None 
    114     attr = {} 
    115     content, attr = get_content(location, node) 
    116     if content is not None: 
    117         try: 
    118             value = float(content)    
     84            value = float(nodes[0].text)    
    11985        except: 
    12086            # Could not pass, skip and return None 
    121             logging.error("cansas_reader.get_float: could not convert '%s' to float" % content) 
    122          
     87            logging.error("cansas_reader.get_float: could not convert '%s' to float" % nodes[0].text) 
     88         
     89        if nodes[0].get('unit') is not None: 
     90            attr['unit'] = nodes[0].get('unit') 
     91             
    12392    return value, attr 
    12493 
     
    140109        @raise ValueError: raised when the units are not recognized 
    141110    """ 
    142     value, attr = get_float(location, node) 
     111    entry = get_content(location, node) 
     112    try: 
     113        value = float(entry.text) 
     114    except: 
     115        value = None 
     116         
    143117    if value is not None: 
    144118        # If the entry has units, check to see that they are 
    145119        # compatible with what we currently have in the data object 
    146         if attr.has_key('unit'): 
     120        units = entry.get('unit') 
     121        if units is not None: 
    147122            toks = variable.split('.') 
    148123            exec "local_unit = storage.%s_unit" % toks[0] 
    149             if attr['unit'].lower()!=local_unit.lower(): 
     124            if units.lower()!=local_unit.lower(): 
    150125                if has_converter==True: 
    151126                    try: 
    152                         conv = Converter(attr['unit']) 
     127                        conv = Converter(units) 
    153128                        exec "storage.%s = %g" % (variable, conv(value, units=local_unit)) 
    154129                    except: 
    155                         #Below three lines were added for the unit = 1/A. local unit is defined in 'mm'. Need to check!!! 
    156                         if variable == 'slit_length' and attr['unit'] !=local_unit: 
    157                             pass 
    158                         else: 
    159                             raise ValueError, "CanSAS reader: could not convert %s unit [%s]; expecting [%s]\n  %s" \ 
    160                             % (variable, attr['unit'], local_unit, sys.exc_value) 
     130                        raise ValueError, "CanSAS reader: could not convert %s unit [%s]; expecting [%s]\n  %s" \ 
     131                        % (variable, units, local_unit, sys.exc_value) 
    161132                else: 
    162133                    raise ValueError, "CanSAS reader: unrecognized %s unit [%s]; expecting [%s]" \ 
    163                         % (variable, attr['unit'], local_unit) 
     134                        % (variable, units, local_unit) 
    164135            else: 
    165136                exec "storage.%s = value" % variable 
     
    181152        @param storage: data object that has the 'variable' data member 
    182153    """ 
    183     value, attr = get_content(location, node) 
    184     if value is not None: 
    185         exec "storage.%s = value" % variable 
     154    entry = get_content(location, node) 
     155    if entry is not None and entry.text is not None: 
     156        exec "storage.%s = entry.text.strip()" % variable 
    186157 
    187158 
     
    213184            @raise ValueError: when the length of the data vectors are inconsistent 
    214185        """ 
    215         from xml.dom.minidom import parse 
    216          
    217186        output = [] 
    218187         
     
    222191            if extension.lower() in self.ext: 
    223192                 
    224                 dom = parse(path) 
    225                  
     193                tree = etree.parse(path, parser=etree.ETCompatXMLParser()) 
    226194                # Check the format version number 
    227                 nodes = xpath.Evaluate('SASroot', dom) 
    228                 if nodes[0].hasAttributes(): 
    229                     for i in range(nodes[0].attributes.length): 
    230                         if nodes[0].attributes.item(i).nodeName=='version': 
    231                             if nodes[0].attributes.item(i).nodeValue != self.version: 
    232                                 raise ValueError, "cansas_reader: unrecognized version number %s" % \ 
    233                                     nodes[0].attributes.item(i).nodeValue 
    234                  
    235                 entry_list = xpath.Evaluate('SASroot/SASentry', dom) 
     195                # Specifying the namespace will take care of the file format version  
     196                root = tree.getroot() 
     197                 
     198                entry_list = root.xpath('/ns:SASroot/ns:SASentry', namespaces={'ns': CANSAS_NS}) 
     199                 
    236200                for entry in entry_list: 
    237201                    sas_entry = self._parse_entry(entry) 
     
    262226        data_info = Data1D(x, y) 
    263227         
    264         # Look up title 
    265         _store_content('Title', dom, 'title', data_info) 
     228        # Look up title       
     229        _store_content('ns:Title', dom, 'title', data_info) 
     230         
    266231        # Look up run number    
    267         nodes = xpath.Evaluate('Run', dom) 
     232        nodes = dom.xpath('ns:Run', namespaces={'ns': CANSAS_NS}) 
    268233        for item in nodes:     
    269             value, attr = get_node_text(item) 
    270             if value is not None: 
    271                 data_info.run.append(value) 
    272                 if attr.has_key('name'): 
    273                     data_info.run_name[value] = attr['name']          
     234            if item.text is not None: 
     235                value = item.text.strip() 
     236                if len(value) > 0: 
     237                    data_info.run.append(value) 
     238                    if item.get('name') is not None: 
     239                        data_info.run_name[value] = item.get('name') 
    274240                            
    275241        # Look up instrument name               
    276         _store_content('SASinstrument/name', dom, 'instrument', data_info) 
    277         #value, attr = get_content('SASinstrument', dom) 
    278         #if attr.has_key('name'): 
    279         #    data_info.instrument = attr['name'] 
    280  
    281         note_list = xpath.Evaluate('SASnote', dom) 
     242        _store_content('ns:SASinstrument/ns:name', dom, 'instrument', data_info) 
     243 
     244        # Notes 
     245        note_list = dom.xpath('ns:SASnote', namespaces={'ns': CANSAS_NS}) 
    282246        for note in note_list: 
    283247            try: 
    284                 note_value, note_attr = get_node_text(note) 
    285                 if note_value is not None: 
    286                     data_info.notes.append(note_value) 
     248                if note.text is not None: 
     249                    note_value = note.text.strip() 
     250                    if len(note_value) > 0: 
     251                        data_info.notes.append(note_value) 
    287252            except: 
    288253                logging.error("cansas_reader.read: error processing entry notes\n  %s" % sys.exc_value) 
    289  
    290254         
    291255        # Sample info ################### 
    292         value, attr = get_content('SASsample', dom) 
    293         if attr.has_key('name'): 
    294             data_info.sample.name = attr['name'] 
    295              
    296         _store_content('SASsample/ID',  
     256        entry = get_content('ns:SASsample', dom) 
     257        if entry is not None: 
     258            data_info.sample.name = entry.get('name') 
     259             
     260        _store_content('ns:SASsample/ns:ID',  
    297261                     dom, 'ID', data_info.sample)                     
    298         _store_float('SASsample/thickness',  
     262        _store_float('ns:SASsample/ns:thickness',  
    299263                     dom, 'thickness', data_info.sample) 
    300         _store_float('SASsample/transmission',  
     264        _store_float('ns:SASsample/ns:transmission',  
    301265                     dom, 'transmission', data_info.sample) 
    302         _store_float('SASsample/temperature',  
     266        _store_float('ns:SASsample/ns:temperature',  
    303267                     dom, 'temperature', data_info.sample) 
    304         nodes = xpath.Evaluate('SASsample/details', dom) 
     268         
     269        nodes = dom.xpath('ns:SASsample/ns:details', namespaces={'ns': CANSAS_NS}) 
    305270        for item in nodes: 
    306271            try: 
    307                 detail_value, detail_attr = get_node_text(item) 
    308                 if detail_value is not None: 
    309                     data_info.sample.details.append(detail_value) 
     272                if item.text is not None: 
     273                    detail_value = item.text.strip() 
     274                    if len(detail_value) > 0: 
     275                        data_info.sample.details.append(detail_value) 
    310276            except: 
    311277                logging.error("cansas_reader.read: error processing sample details\n  %s" % sys.exc_value) 
    312278         
    313279        # Position (as a vector) 
    314         _store_float('SASsample/position/x',  
     280        _store_float('ns:SASsample/ns:position/ns:x',  
    315281                     dom, 'position.x', data_info.sample)           
    316         _store_float('SASsample/position/y',  
     282        _store_float('ns:SASsample/ns:position/ns:y',  
    317283                     dom, 'position.y', data_info.sample)           
    318         _store_float('SASsample/position/z',  
     284        _store_float('ns:SASsample/ns:position/ns:z',  
    319285                     dom, 'position.z', data_info.sample)           
    320286         
    321287        # Orientation (as a vector) 
    322         _store_float('SASsample/orientation/roll',  
     288        _store_float('ns:SASsample/ns:orientation/ns:roll',  
    323289                     dom, 'orientation.x', data_info.sample)           
    324         _store_float('SASsample/orientation/pitch',  
     290        _store_float('ns:SASsample/ns:orientation/ns:pitch',  
    325291                     dom, 'orientation.y', data_info.sample)           
    326         _store_float('SASsample/orientation/yaw',  
     292        _store_float('ns:SASsample/ns:orientation/ns:yaw',  
    327293                     dom, 'orientation.z', data_info.sample)           
    328294        
    329295        # Source info ################### 
    330         value, attr = get_content('SASinstrument/SASsource', dom) 
    331         if attr.has_key('name'): 
    332             data_info.source.name = attr['name'] 
    333          
    334         _store_content('SASinstrument/SASsource/radiation',  
     296        entry = get_content('ns:SASinstrument/ns:SASsource', dom) 
     297        if entry is not None: 
     298            data_info.source.name = entry.get('name') 
     299         
     300        _store_content('ns:SASinstrument/ns:SASsource/ns:radiation',  
    335301                     dom, 'radiation', data_info.source)                     
    336         _store_content('SASinstrument/SASsource/beam_shape',  
     302        _store_content('ns:SASinstrument/ns:SASsource/ns:beam_shape',  
    337303                     dom, 'beam_shape', data_info.source)                     
    338         _store_float('SASinstrument/SASsource/wavelength',  
     304        _store_float('ns:SASinstrument/ns:SASsource/ns:wavelength',  
    339305                     dom, 'wavelength', data_info.source)           
    340         _store_float('SASinstrument/SASsource/wavelength_min',  
     306        _store_float('ns:SASinstrument/ns:SASsource/ns:wavelength_min',  
    341307                     dom, 'wavelength_min', data_info.source)           
    342         _store_float('SASinstrument/SASsource/wavelength_max',  
     308        _store_float('ns:SASinstrument/ns:SASsource/ns:wavelength_max',  
    343309                     dom, 'wavelength_max', data_info.source)           
    344         _store_float('SASinstrument/SASsource/wavelength_spread',  
     310        _store_float('ns:SASinstrument/ns:SASsource/ns:wavelength_spread',  
    345311                     dom, 'wavelength_spread', data_info.source)     
    346312         
    347313        # Beam size (as a vector)    
    348         value, attr = get_content('SASinstrument/SASsource/beam_size', dom) 
    349         if attr.has_key('name'): 
    350             data_info.source.beam_size_name = attr['name'] 
    351              
    352         _store_float('SASinstrument/SASsource/beam_size/x',  
     314        entry = get_content('ns:SASinstrument/ns:SASsource/ns:beam_size', dom) 
     315        if entry is not None: 
     316            data_info.source.beam_size_name = entry.get('name') 
     317             
     318        _store_float('ns:SASinstrument/ns:SASsource/ns:beam_size/ns:x',  
    353319                     dom, 'beam_size.x', data_info.source)     
    354         _store_float('SASinstrument/SASsource/beam_size/y',  
     320        _store_float('ns:SASinstrument/ns:SASsource/ns:beam_size/ns:y',  
    355321                     dom, 'beam_size.y', data_info.source)     
    356         _store_float('SASinstrument/SASsource/beam_size/z',  
     322        _store_float('ns:SASinstrument/ns:SASsource/ns:beam_size/ns:z',  
    357323                     dom, 'beam_size.z', data_info.source)     
    358324         
    359325        # Collimation info ################### 
    360         nodes = xpath.Evaluate('SASinstrument/SAScollimation', dom) 
     326        nodes = dom.xpath('ns:SASinstrument/ns:SAScollimation', namespaces={'ns': CANSAS_NS}) 
    361327        for item in nodes: 
    362328            collim = Collimation() 
    363             value, attr = get_node_text(item) 
    364             if attr.has_key('name'): 
    365                 collim.name = attr['name'] 
    366             _store_float('length', item, 'length', collim)   
     329            if item.get('name') is not None: 
     330                collim.name = item.get('name') 
     331            _store_float('ns:length', item, 'length', collim)   
    367332             
    368333            # Look for apertures 
    369             apert_list = xpath.Evaluate('aperture', item) 
     334            apert_list = item.xpath('ns:aperture', namespaces={'ns': CANSAS_NS}) 
    370335            for apert in apert_list: 
    371336                aperture =  Aperture() 
    372337                 
    373338                # Get the name and type of the aperture 
    374                 ap_value, ap_attr = get_node_text(apert) 
    375                 if ap_attr.has_key('name'): 
    376                     aperture.name = ap_attr['name'] 
    377                 if ap_attr.has_key('type'): 
    378                     aperture.type = ap_attr['type'] 
     339                aperture.name = apert.get('name') 
     340                aperture.type = apert.get('type') 
    379341                     
    380                 _store_float('distance', apert, 'distance', aperture)     
    381                  
    382                 value, attr = get_content('size', apert) 
    383                 if attr.has_key('name'): 
    384                     aperture.size_name = attr['name'] 
    385                  
    386                 _store_float('size/x', apert, 'size.x', aperture)     
    387                 _store_float('size/y', apert, 'size.y', aperture)     
    388                 _store_float('size/z', apert, 'size.z', aperture) 
     342                _store_float('ns:distance', apert, 'distance', aperture)     
     343                 
     344                entry = get_content('ns:size', apert) 
     345                if entry is not None: 
     346                    aperture.size_name = entry.get('name') 
     347                 
     348                _store_float('ns:size/ns:x', apert, 'size.x', aperture)     
     349                _store_float('ns:size/ns:y', apert, 'size.y', aperture)     
     350                _store_float('ns:size/ns:z', apert, 'size.z', aperture) 
    389351                 
    390352                collim.aperture.append(aperture) 
     
    393355         
    394356        # Detector info ###################### 
    395         nodes = xpath.Evaluate('SASinstrument/SASdetector', dom) 
     357        nodes = dom.xpath('ns:SASinstrument/ns:SASdetector', namespaces={'ns': CANSAS_NS}) 
    396358        for item in nodes: 
    397359             
    398360            detector = Detector() 
    399361             
    400             _store_content('name', item, 'name', detector) 
    401             _store_float('SDD', item, 'distance', detector)     
     362            _store_content('ns:name', item, 'name', detector) 
     363            _store_float('ns:SDD', item, 'distance', detector)     
    402364             
    403365            # Detector offset (as a vector) 
    404             _store_float('offset/x', item, 'offset.x', detector)     
    405             _store_float('offset/y', item, 'offset.y', detector)     
    406             _store_float('offset/z', item, 'offset.z', detector)     
     366            _store_float('ns:offset/ns:x', item, 'offset.x', detector)     
     367            _store_float('ns:offset/ns:y', item, 'offset.y', detector)     
     368            _store_float('ns:offset/ns:z', item, 'offset.z', detector)     
    407369             
    408370            # Detector orientation (as a vector) 
    409             _store_float('orientation/roll',  item, 'orientation.x', detector)     
    410             _store_float('orientation/pitch', item, 'orientation.y', detector)     
    411             _store_float('orientation/yaw',   item, 'orientation.z', detector)     
     371            _store_float('ns:orientation/ns:roll',  item, 'orientation.x', detector)     
     372            _store_float('ns:orientation/ns:pitch', item, 'orientation.y', detector)     
     373            _store_float('ns:orientation/ns:yaw',   item, 'orientation.z', detector)     
    412374             
    413375            # Beam center (as a vector) 
    414             _store_float('beam_center/x', item, 'beam_center.x', detector)     
    415             _store_float('beam_center/y', item, 'beam_center.y', detector)     
    416             _store_float('beam_center/z', item, 'beam_center.z', detector)     
     376            _store_float('ns:beam_center/ns:x', item, 'beam_center.x', detector)     
     377            _store_float('ns:beam_center/ns:y', item, 'beam_center.y', detector)     
     378            _store_float('ns:beam_center/ns:z', item, 'beam_center.z', detector)     
    417379             
    418380            # Pixel size (as a vector) 
    419             _store_float('pixel_size/x', item, 'pixel_size.x', detector)     
    420             _store_float('pixel_size/y', item, 'pixel_size.y', detector)     
    421             _store_float('pixel_size/z', item, 'pixel_size.z', detector)     
    422              
    423             _store_float('slit_length', item, 'slit_length', detector) 
     381            _store_float('ns:pixel_size/ns:x', item, 'pixel_size.x', detector)     
     382            _store_float('ns:pixel_size/ns:y', item, 'pixel_size.y', detector)     
     383            _store_float('ns:pixel_size/ns:z', item, 'pixel_size.z', detector)     
     384             
     385            _store_float('ns:slit_length', item, 'slit_length', detector) 
    424386             
    425387            data_info.detector.append(detector)     
    426388 
    427389        # Processes info ###################### 
    428         nodes = xpath.Evaluate('SASprocess', dom) 
     390        nodes = dom.xpath('ns:SASprocess', namespaces={'ns': CANSAS_NS}) 
    429391        for item in nodes: 
    430392            process = Process() 
    431             _store_content('name', item, 'name', process) 
    432             _store_content('date', item, 'date', process) 
    433             _store_content('description', item, 'description', process) 
    434              
    435             term_list = xpath.Evaluate('term', item) 
     393            _store_content('ns:name', item, 'name', process) 
     394            _store_content('ns:date', item, 'date', process) 
     395            _store_content('ns:description', item, 'description', process) 
     396             
     397            term_list = item.xpath('ns:term', namespaces={'ns': CANSAS_NS}) 
    436398            for term in term_list: 
    437399                try: 
    438                     term_value, term_attr = get_node_text(term) 
    439                     term_attr['value'] = term_value 
    440                     if term_value is not None: 
     400                    term_attr = {} 
     401                    for attr in term.keys(): 
     402                        term_attr[attr] = term.get(attr).strip() 
     403                    if term.text is not None: 
     404                        term_attr['value'] = term.text.strip() 
    441405                        process.term.append(term_attr) 
    442406                except: 
    443407                    logging.error("cansas_reader.read: error processing process term\n  %s" % sys.exc_value) 
    444408             
    445             note_list = xpath.Evaluate('SASprocessnote', item) 
     409            note_list = item.xpath('ns:SASprocessnote', namespaces={'ns': CANSAS_NS}) 
    446410            for note in note_list: 
    447                 try: 
    448                     note_value, note_attr = get_node_text(note) 
    449                     if note_value is not None: 
    450                         process.notes.append(note_value) 
    451                 except: 
    452                     logging.error("cansas_reader.read: error processing process notes\n  %s" % sys.exc_value) 
    453              
     411                if note.text is not None: 
     412                    process.notes.append(note.text.strip()) 
    454413             
    455414            data_info.process.append(process) 
     
    457416             
    458417        # Data info ###################### 
    459         nodes = xpath.Evaluate('SASdata', dom) 
     418        nodes = dom.xpath('ns:SASdata', namespaces={'ns': CANSAS_NS}) 
    460419        if len(nodes)>1: 
    461420            raise RuntimeError, "CanSAS reader is not compatible with multiple SASdata entries" 
    462421         
    463         nodes = xpath.Evaluate('SASdata/Idata', dom) 
     422        nodes = dom.xpath('ns:SASdata/ns:Idata', namespaces={'ns': CANSAS_NS}) 
     423 
    464424        x  = numpy.zeros(0) 
    465425        y  = numpy.zeros(0) 
     
    470430         
    471431        for item in nodes: 
    472             _x, attr = get_float('Q', item) 
    473             _dx, attr_d = get_float('Qdev', item) 
    474             _dxl, attr_l = get_float('dQl', item) 
    475             _dxw, attr_w = get_float('dQw', item) 
     432            _x, attr = get_float('ns:Q', item) 
     433            _dx, attr_d = get_float('ns:Qdev', item) 
     434            _dxl, attr_l = get_float('ns:dQl', item) 
     435            _dxw, attr_w = get_float('ns:dQw', item) 
    476436            if _dx == None: 
    477437                _dx = 0.0 
     
    529489                        % (attr['unit'], data_info.x_unit) 
    530490                     
    531             _y, attr = get_float('I', item) 
    532             _dy, attr_d = get_float('Idev', item) 
     491            _y, attr = get_float('ns:I', item) 
     492            _dy, attr_d = get_float('ns:Idev', item) 
    533493            if _dy == None: 
    534494                _dy = 0.0 
     
    804764    reader = Reader() 
    805765    print reader.read("../test/cansas1d.xml") 
     766    #print reader.read("../test/latex_smeared.xml") 
    806767     
    807768     
Note: See TracChangeset for help on using the changeset viewer.