Changeset 1380


Ignore:
Timestamp:
10/08/06 15:23:02 (13 years ago)
Author:
domlowe
Message:

propagating additional args/configs through Scanner code

Location:
TI02-CSML/trunk/Scanner
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • TI02-CSML/trunk/Scanner/csmllibs/csmlbuilder.py

    r1342 r1380  
    1616    #this class contains all the method calls to create and populate a csmldoc 
    1717    #it needs to be provided with several bits of information to be able to do this. 
    18     def __init__(self,directory,csmlft, mapping, timedimension ,outputfile,printscreen): 
     18    def __init__(self,directory,csmlft, mapping, timedimension ,outputfile,printscreen,timestorage,spatialstorage,valuestorage): 
    1919        self.directory = directory # top level directory containing data files  
    2020        self.csmlfeaturetype  = csmlft  
     
    2323        self.outputfile=outputfile 
    2424        self.printscreen=printscreen 
     25        self.timestorage=timestorage 
     26        self.spatialstorage=spatialstorage 
     27        self.valuestorage=valuestorage 
    2528        self.csml = None  # csml object holds the csml document in memory. 
    2629        self.ds_element = None #<Dataset> tag, root node. 
     
    8891    def makeFileExtracts(self): 
    8992        print "make FEs" 
    90         feBuilder =csmllibs.csmlfileextracts.fileExtractBuilder( self.ds, self.ffmap) 
    91         #self.csml = feBuilder.csmldoc 
    92         self.ds = feBuilder.dataset_element 
    93         #todo, remember ds == dataset_element in this file 
    94         self.extractType = feBuilder.extractType 
    95         self.extractPrefix  = feBuilder.extractPrefix 
    96         self.extractDictionary=feBuilder.fileExtractDictionary 
     93        if self.spatialstorage=='fileextract': 
     94            feBuilder =csmllibs.csmlfileextracts.fileExtractBuilder( self.ds, self.ffmap, self.timedimension) 
     95            self.ds = feBuilder.dataset_element 
     96            self.extractType = feBuilder.extractType 
     97            self.extractPrefix  = feBuilder.extractPrefix 
     98            self.extractDictionary=feBuilder.fileExtractDictionary 
    9799 
    98100    def createFeatureCollection(self): 
  • TI02-CSML/trunk/Scanner/csmllibs/csmlfeaturetypes.py

    r1352 r1380  
    370370                                #create a file extract link for long lists 
    371371                                arraySize=len(measuredvalues)*len(listOfFiles)  
     372                                #TODO this needs to be able to handle inline, use VALUESTORAGE to determine which to use: 
    372373                                fextract=csmllibs.csmlfileextracts.createSingleExtract(self.extractType,filenames,allVarNames[i],arraySize) 
    373374                                qlist = csmllibs.Parser.MeasureOrNullList(val=fextract) 
  • TI02-CSML/trunk/Scanner/csmllibs/csmlfileextracts.py

    r1154 r1380  
    66import sys 
    77class fileExtractBuilder: 
    8     def __init__(self, dataset_element, ffmap): 
     8    def __init__(self, dataset_element, ffmap, timedim): 
    99        self.dataset_element=dataset_element 
    1010        self.ffmap=ffmap 
    11         self.createFileExtracts() 
    12      
    13     def createFileExtracts(self): 
    14         #print "REPRESENTATIVE FILES:" 
    15         #print self.ffmap.getRepresentativeFiles() 
    16          
    17         #given a featurefilemap object, create file extracts from the "representativeFiles"      
    18         #used to store extract/filename/variable relationship 
    19         #referenced when creating features 
    20         self.fileExtractDictionary={} 
    21      
     11        self.fileExtractDictionary={} #used to store extract/filename/variable relationship 
     12        self.createFileExtractsForAxes() 
     13 
     14    def createFileExtractsForAxes(self): 
     15        #given a featurefilemap object, create file extracts for the axes from the "representativeFiles"         
     16             
    2217        fileid=0  #used to distinguish extract names for similar variables from different files 
    2318        #adlist is an empty list object to hold CSML ArrayDescriptors eg. NetCDFExtract, GRIBExtract etc 
     
    2621            fileid=fileid+1 
    2722            filename=repfile.getRepresentativeFileName() 
    28             #print 'representative file:' 
    29             #print repfile.getRepresentativeFileName() 
    30             #print 'feature type:' 
    31             #print repfile.getFeatureType()      
    3223            DI = csmllibs.csmldataiface.DataInterface() 
    3324            DI = DI.getUnknownInterfaceType(filename) 
     
    3930            allDimNames=DI.getListOfAxes() 
    4031            numDomains=len(allDimNames) 
     32            print allDimNames 
    4133            for j in range (0, len(allDimNames)): 
    42 #                 print self.extractType 
    43 #                 print self.extractPrefix 
    4434                if self.extractType=='NASAAmesExtract': 
    4535                    arrayDescriptor=csmllibs.Parser.NASAAmesExtract() 
  • TI02-CSML/trunk/Scanner/csmlscan.py

    r1379 r1380  
    108108    MAPPING=None 
    109109    TIMEDIMENSION=None 
     110    TIMESTORAGE='inline' 
     111    VALUESTORAGE='fileextract' 
     112    SPATIALSTORAGE='fileextract' 
     113     
    110114    #... 
    111115    if hasConfig == True: 
     
    119123        SRSNAME = config.getConfigNoError('SpatialReference', 'srs') 
    120124        TIMEDIMENSION=config.getConfigNoError('time','timedimension') 
     125        TIMESTORAGE=config.getConfigNoError('time','timestorage') 
     126        VALUESTORAGE=config.getConfigNoError('values','valuestorage') 
     127        SPATIALSTORAGE=config.getConfigNoError('spatialaxes','spatialstorage') 
    121128         
    122129        if configTest==True: 
     
    133140            print '\n SpatialReference:srs =%s'%SRSNAME 
    134141            print '\n time:timedimension =%s'%TIMEDIMENSION 
     142            print '\n time:timestorage =%s'%TIMESTORAGE 
     143            print '\n spatialaxes:spatialstorage =%s'%SPATIALSTORAGE 
     144            print '\n values:valuestorage =%s'%VALUESTORAGE 
    135145            sys.exit() 
    136146     
     
    172182    #build CSML document 
    173183    print ROOTDIRECTORY 
    174     csmldataset=csmllibs.csmlbuilder.csmlBuilder(ROOTDIRECTORY,FEATURETYPE,MAPPING,TIMEDIMENSION, OUTPUTFILE, PRINTSCREEN) 
     184    csmldataset=csmllibs.csmlbuilder.csmlBuilder(ROOTDIRECTORY,FEATURETYPE,MAPPING,TIMEDIMENSION, OUTPUTFILE, PRINTSCREEN,TIMESTORAGE,SPATIALSTORAGE,VALUESTORAGE) 
    175185    csmldataset.build() 
    176186 
  • TI02-CSML/trunk/Scanner/sampleconfig.cfg

    r1379 r1380  
    99printscreen:1 
    1010 
     11[spatialaxes] 
     12spatialstorage:inline 
     13 
     14[values] 
     15valuestorage:fileextract 
     16 
    1117[SpatialReference] 
    1218srs: EPSG 4326 
     
    1420[time] 
    1521timedimension: t 
     22timestorage:inline 
    1623 
    1724[outputfile] 
Note: See TracChangeset for help on using the changeset viewer.