Changeset 343 for nappy/trunk/naCore.py


Ignore:
Timestamp:
15/06/04 13:46:42 (15 years ago)
Author:
astephen
Message:

Latest version with new files in test directory.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • nappy/trunk/naCore.py

    r339 r343  
    33========= 
    44 
    5 Holds the NACore class that holds only the None type version 
     5Holds the NACore class that holds the None type version 
    66of all the possible NASA Ames variables described in the Gaines 
    77and Hipkind documents. It also holds a number of useful methods 
    8 for accessing information in the file. 
     8for accessing metadata within the file. 
     9 
    910""" 
    1011 
     12# Imports from standard python library 
    1113import re 
    12 pattnBrackets=re.compile("^\s*(.*)\((.+?)\)(.*)\s*$") 
    1314 
    1415class NACore: 
     16 
     17    pattnBrackets=re.compile("^\s*(.*)\((.+?)\)(.*)\s*$") 
    1518 
    1619    def __init__(self): 
     
    8184 
    8285    def getVariable(self, var_number):         
    83         match=pattnBrackets.match(self.VNAME[var_number]) 
     86        match=NACore.pattnBrackets.match(self.VNAME[var_number]) 
    8487        if match: 
    8588            (v1, units, v2)=match.groups() 
     
    9295 
    9396    def getIndependentVariable(self, ivar_number): 
    94         match=pattnBrackets.match(self.XNAME[ivar_number]) 
     97        match=NACore.pattnBrackets.match(self.XNAME[ivar_number]) 
    9598        if match: 
    9699            (v1, units, v2)=match.groups() 
     
    101104 
    102105    def getAuxVariable(self, avar_number):         
    103         match=pattnBrackets.match(self.ANAME[avar_number]) 
     106        match=NACore.pattnBrackets.match(self.ANAME[avar_number]) 
    104107        if match: 
    105108            (v1, units, v2)=match.groups() 
     
    125128    def getAuxVariables(self): 
    126129        avars=[] 
    127         for i in range(self.NAUXV): 
    128             avars.append(self.getAuxVariable(i)) 
     130        if not hasattr(self, "NAUXV"): 
     131            for i in range(self.NAUXV): 
     132                avars.append(self.getAuxVariable(i)) 
     133        else: 
     134            avars=[] 
    129135        return avars 
    130136 
Note: See TracChangeset for help on using the changeset viewer.