Changeset 1485 for TI02-CSML


Ignore:
Timestamp:
06/09/06 10:23:22 (13 years ago)
Author:
domlowe
Message:

more module moves

Location:
TI02-CSML/trunk/csml
Files:
4 edited
1 moved

Legend:

Unmodified
Added
Removed
  • TI02-CSML/trunk/csml/API/ops_AbstractFileExtract.py

    r1483 r1485  
    11''' ops_AbstractFileExtract  contains operations for AbstractFileExtracts''' 
    2 import sys 
     2import csml.csmllibs.csmldataiface 
    33 
    44def testmethod(self): 
     
    2121        file=self.fileName 
    2222    #open the file 
    23     DI = csmldataiface.DataInterface() 
     23    DI = csml.csmllibs.csmldataiface.DataInterface() 
    2424    DI=DI.getUnknownInterfaceType(file) 
    2525    DI.openFile(file) 
  • TI02-CSML/trunk/csml/API/ops_Dataset.py

    r1484 r1485  
    33import codecs 
    44import csml.csmllibs.xmlEncoding 
     5import csml.parser_extra 
    56 
    67def testmethod(self): 
     
    1617    f.close() 
    1718    #parse with correct encoding 
    18     tree = parser_extra.encodingParser(csmlfile,encoding) 
     19    tree = csml.parser_extra.encodingParser(csmlfile,encoding) 
    1920    self.fromXML(tree.getroot()) 
    20     self =parser_extra.ParserPostProcessor(self).resolveReferences() 
     21    self =csml.parser_extra.ParserPostProcessor(self).resolveReferences() 
    2122     
    2223def getSecurity(self): 
  • TI02-CSML/trunk/csml/API/ops_GridSeriesFeature.py

    r1483 r1485  
    11''' ops_GridSeriesFeature  contains operations for GridSeriesFeatures''' 
    2 #from API import NetCDFWriter 
    3 from CSMLDocument import * 
    4 from Scientific.IO.NetCDF import *  #use this instead of cdms for now for it's simple write interface.. 
     2 
    53from Numeric import * 
     4import csml.parser 
     5import csml.csmllibs.csmltime 
     6import csml.csmllibs.csmlDocument 
     7import csml.API.ops_AbstractFeature 
    68 
    79 
     
    1618    #Inspects a time position list for the domain reference. 
    1719    #TODO, does not handle a file extract in place of a list. 
    18     if isinstance(self.domain.domainReference,Parser.TimePositionList): 
     20    if isinstance(self.domain.domainReference,csml.parser.TimePositionList): 
    1921        time = {} 
    2022        time['t'] = self.domain.domainReference.timePositions 
     
    3032    dc = self.domain.domainComplement 
    3133    #dc should be a grid! 
    32     if isinstance(dc, Parser.Grid): 
     34    if isinstance(dc, csml.parser.Grid): 
    3335        for ordinate in dc.ordinates: 
    3436            domaincomp[ordinate.definesAxis]=ordinate.axisValues.getData() 
     
    9294        self.times=[] 
    9395        for time in dr['t'].split(): 
    94             timeok=ops_AbstractFeature.__compareTimes(tone,time,ttwo) 
     96            timeok=csml.API.ops_AbstractFeature.__compareTimes(tone,time,ttwo) 
    9597            if timeok ==1: 
    9698                self.times.append(time) 
     
    122124        caltype=self.domain.domainReference.frame.split(':',1)[0] 
    123125        calunits=self.domain.domainReference.frame.split(':',1)[1] 
    124         csmltime.setcdtimeCalendar(caltype) 
     126        csml.csmllibs.csmltime.setcdtimeCalendar(caltype) 
    125127    except: 
    126         csmltime.setcdtimeCalendar(csmltime.cdtime.DefaultCalendar) 
     128        csml.csmllibs.csmltime.setcdtimeCalendar(csmltime.cdtime.DefaultCalendar) 
    127129    ### define domain and rangeSet to use for feature in csml document#### 
    128     domain=Parser.GridSeriesDomain() 
    129     domain.domainReference=Parser.TimePositionList(timePositions=strTimes) 
    130     grid=Parser.Grid() 
     130    domain=csml.parser.GridSeriesDomain() 
     131    domain.domainReference=csml.parser.TimePositionList(timePositions=strTimes) 
     132    grid=csml.parser.Grid() 
    131133    #dc = self.getDomainComplement() 
    132134    ordinates= [] 
     
    138140        arraySize=0 
    139141        i=i+1 
    140         god=Parser.GridOrdinateDescription() 
     142        god=csml.parser.GridOrdinateDescription() 
    141143        god.gridAxesSpanned='dim%s'%i 
    142144        god.sequenceRule='+x+y+z' 
     
    171173    grid.ordinates=ordinates 
    172174    domain.domainComplement=grid 
    173     rangeSet=Parser.RangeSet() 
    174     rangeSet.arrayDescriptor=Parser.NetCDFExtract(id=self.id,fileName=pathToSubsetNetCDF,variableName=self.id,arraySize=[arraySize]) 
     175    rangeSet=csml.parser.RangeSet() 
     176    rangeSet.arrayDescriptor=csml.parser.NetCDFExtract(id=self.id,fileName=pathToSubsetNetCDF,variableName=self.id,arraySize=[arraySize]) 
    175177 
    176178    #### write csml document #####  
    177     csmldoc=CSMLDocument("mydoc", "mymetadata") 
     179    csmldoc=csml.csmllibs.csmlDocument.CSMLDocument("mydoc", "mymetadata") 
    178180    csmldoc.addGridSeriesFeature(domain,rangeSet,datasetID="A",featureID="B",description="C") 
    179181    csmldoc=csmldoc.consolidate() 
  • TI02-CSML/trunk/csml/parser_extra.py

    r1483 r1485  
    9191class ParserPostProcessor: 
    9292    def __init__(self,dataset): 
    93         if isinstance(dataset,Parser.Dataset): 
     93        if isinstance(dataset,csml.parser.Dataset): 
    9494            self.dataset=dataset 
    9595        else:  
     
    136136                if hasattr (feature, 'domain'): 
    137137                    if hasattr(feature.domain, 'domainComplement'): 
    138                         if isinstance(feature.domain.domainComplement, Parser.Grid): 
     138                        if isinstance(feature.domain.domainComplement, csml.parser.Grid): 
    139139                                for ordinate in feature.domain.domainComplement.ordinates: 
    140140                                    #search arrayDescriptors for a match. 
Note: See TracChangeset for help on using the changeset viewer.