Ignore:
Timestamp:
02/06/06 16:52:45 (14 years ago)
Author:
domlowe
Message:

time and calendar working in netcdf output. Time subsetting by min/max or explicit values. Ready for attempt at data extractor integration.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • TI02-CSML/trunk/parser/API/ops_AbstractFeature.py

    r1028 r1086  
    11''' ops_AbstractFeature  contains operations for AbstractFeatures''' 
    22from API import * 
     3import cdtime 
    34 
    45def testmethod(self): 
     
    89def getAllowedSubsettings(self): 
    910    return ['none'] 
     11 
     12def __compareTimes(timemin, timecheck, timemax): 
     13 
     14    year=int(timecheck.split('-')[0]) 
     15    month=int(timecheck.split('-')[1]) 
     16    day=int(timecheck.split('-')[2].split('T')[0]) 
     17    tcheck=cdtime.comptime(year,month,day) 
     18    timeok=0 
     19    if tcheck.cmp(timemin) >= 0: 
     20        if tcheck.cmp(timemax) < 1: 
     21            print tcheck 
     22            timeok = 1 
     23    return timeok 
     24 
     25def __getCDtime(time): 
     26    year=int(time.split('-')[0]) 
     27    month=int(time.split('-')[1]) 
     28    day=int(time.split('-')[2].split('T')[0]) 
     29    cdTimeVal=cdtime.comptime(year,month,day) 
     30    return cdTimeVal 
Note: See TracChangeset for help on using the changeset viewer.