Ignore:
Timestamp:
27/11/07 15:18:27 (12 years ago)
Author:
domlowe
Message:

added ability to filter out low dimension variables in scanner. Added some test crs definitions for testing rotated grids. Added axis identification by standard name

File:
1 edited

Legend:

Unmodified
Added
Removed
  • TI02-CSML/trunk/csml/csmllibs/csmlfeaturetypes.py

    r3055 r3065  
    1414 
    1515class featureBuilder(object): 
    16     def __init__(self, dataset_element, featureCollection_element, ffmap,fileExtractDictionary, timedim, timestorage,spatialstorage,valuestorage): 
     16    def __init__(self, dataset_element, featureCollection_element, ffmap,fileExtractDictionary, timedim, timestorage,spatialstorage,valuestorage,minaxes): 
    1717        self.ds_element=dataset_element 
    1818        self.featureCollection = featureCollection_element 
     
    2323        self.spatialstorage=spatialstorage 
    2424        self.valuestorage=valuestorage 
     25        self.minaxes=minaxes 
    2526                 
    2627        #empty list to hold featureMembers 
     
    104105        self.DI.openFile(self.repfilename) 
    105106        allVarNames=self.DI.getListofVariables() 
    106         numFeatures=len(allVarNames) 
    107         return allVarNames, numFeatures 
     107        checkedVars=[] 
     108        for var in allVarNames: 
     109            self.DI.setVariable(var) 
     110            numaxes=len(self.DI.getVariableAxes()) 
     111            #ignore any variables below the specified dimension threshold 
     112            if numaxes > self.minaxes: 
     113                checkedVars.append(var)               
     114        numFeatures=len(checkedVars) 
     115        return checkedVars, numFeatures 
    108116     
    109117    def __getGridCoordinatesTable(self,dimNames, crs,axisorder): 
     
    209217            return None, None, None 
    210218        unitlist=[] 
     219        stdNames=[] 
    211220        for dim in dimNames: 
    212221            self.DI.setAxis(dim) 
    213222            units=self.DI.getAxisAttribute('units')  #need to make special case of units in DI layer 
     223            stdname =None 
     224            try: 
     225                stdname=self.DI.getAxisAttribute('standard_name')                
     226            except: 
     227                pass 
     228            stdNames.append(stdname) 
    214229            unitlist.append(units)     
    215         crs, axisorder=catalogue.determineCRS(dimNames,unitlist) 
     230        crs, axisorder=catalogue.determineCRS(dimNames,unitlist, stdNames) 
    216231        return crs, axisorder, dimNames 
    217232     
Note: See TracChangeset for help on using the changeset viewer.