source: TI02-CSML/trunk/parser/API/ops_AbstractFeature.py @ 1086

Subversion URL: http://proj.badc.rl.ac.uk/svn/ndg/TI02-CSML/trunk/parser/API/ops_AbstractFeature.py@1086
Revision 1086, 836 bytes checked in by domlowe, 14 years ago (diff)

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

Line 
1''' ops_AbstractFeature  contains operations for AbstractFeatures'''
2from API import *
3import cdtime
4
5def testmethod(self):
6    print 'testmethod for abstract feature'
7    return 'testmethod abstract feature'
8
9def getAllowedSubsettings(self):
10    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 TracBrowser for help on using the repository browser.