- Timestamp:
- 01/02/07 10:43:07 (14 years ago)
- Location:
- TI02-CSML/trunk/csml
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
TI02-CSML/trunk/csml/API/genSubset.py
r2083 r2091 6 6 7 7 8 def _subsetDomain(time ,times, domain,**kwargs):8 def _subsetDomain(timeaxis,times, domain,**kwargs): 9 9 '''takes the domain and returns a subset according to the keyword selection criteria 10 10 time = name of time dimension … … 17 17 straxisValues='' 18 18 if key in kwargs: 19 if key ==time :19 if key ==timeaxis: 20 20 straxisValues=strTimes 21 21 arraySize=len(strTimes.split()) … … 44 44 45 45 subsetDomain[key]=straxisValues 46 if key != time :46 if key != timeaxis: 47 47 arraySize=len(subsetDomain[key].split(',')) 48 48 else: -
TI02-CSML/trunk/csml/API/ops_GridSeriesFeature.py
r2084 r2091 136 136 time=csml.API.ops_AbstractFeature.__getCDtime(time).torel(calunits) 137 137 floatTimes.append(time.value) 138 nc.addAxis('t',floatTimes,isTime=1,units=calunits,calendar=caltype) 138 nc.addAxis('time',floatTimes,isTime=1,units=calunits,calendar=caltype) 139 139 140 for ord in ords: 140 print ord.coordAxisLabel.CONTENT141 141 vals=[] 142 142 lon,lat=None,None 143 if ord.coordAxisLabel.CONTENT==' Time':143 if ord.coordAxisLabel.CONTENT=='time': 144 144 continue 145 145 else: … … 147 147 if val != ' ': 148 148 vals.append(float(val)) 149 print vals 150 if ord.coordAxisLabel.CONTENT=='Lon': 149 if ord.coordAxisLabel.CONTENT=='longitude': 151 150 lon=1 152 151 name='longitude' 153 elif ord.coordAxisLabel.CONTENT==' Lat':152 elif ord.coordAxisLabel.CONTENT=='latitude': 154 153 lat=1 155 154 name='latitude' … … 159 158 nc.addAxis(name,vals,isLon=lon,isLat=lat,units='')#to do, units attribute for CF compliance 160 159 if len(ords)==3: 161 axes=['t ',axisorder[1],axisorder[2]]160 axes=['time',axisorder[1],axisorder[2]] 162 161 elif len(ords)==2: 163 axes=['t',axisorder[1]] 164 #print fulldata 165 print axes 162 axes=['time',axisorder[1]] 166 163 nc.addVariable(fulldata,self.id, axes,units='') #to do, units attribute for CF compliance 167 print 'added'168 164 nc.closeFinishedFile() 169 165 return subsettedFeature, pathToSubsetNetCDF -
TI02-CSML/trunk/csml/csmllibs/csmlcrs.py
r2061 r2091 21 21 22 22 # define lon lat pressure time CRS: 23 crs=CRSystem(srsName='ndg:crs:xypt', axes =[' Lon', 'Lat','Pressure','Time'])23 crs=CRSystem(srsName='ndg:crs:xypt', axes =['longitude', 'latitude','pressure','time']) 24 24 crs.lonAxis=0 25 25 crs.latAxis=1 … … 28 28 29 29 # define lon lat height time CRS: 30 crs=CRSystem(srsName='ndg:crs:xyht', axes =[' Lon', 'Lat','Height','Time'])30 crs=CRSystem(srsName='ndg:crs:xyht', axes =['longitude', 'latitude','height','time']) 31 31 crs.lonAxis=0 32 32 crs.latAxis=1 … … 35 35 36 36 # define lon lat time CRS: 37 crs=CRSystem(srsName='ndg:crs:xyt', axes =[' Lon', 'Lat','Time'])37 crs=CRSystem(srsName='ndg:crs:xyt', axes =['longitude', 'latitude','time']) 38 38 self.systems['ndg:crs:xyt']=crs 39 39 crs.lonAxis=0 … … 86 86 unittype='unknown' 87 87 if string.lower(unit) in ['second', 'seconds', 's', 'mins','minute','minutes','hour','hours','h','hr','hrs','day','days']: 88 unittype=' Time'88 unittype='time' 89 89 elif string.lower(unit)[:10] in ['days since', 'seconds si', 'minutes si', 'hours sinc','months sin', 'years sinc']: 90 unittype=' Time'90 unittype='time' 91 91 elif string.lower(unit) in ['mbar', 'pa','level']: 92 unittype=' Pressure'92 unittype='pressure' 93 93 elif string.lower(unit) in ['m', 'km']: 94 unittype=' Height'94 unittype='height' 95 95 elif string.lower(unit) in ['degrees_north', 'degrees_south']: 96 unittype=' Lat'96 unittype='latitude' 97 97 elif string.lower(unit) in ['degrees_east','degrees_west']: 98 unittype=' Lon'98 unittype='longitude' 99 99 crsMap.append(unittype) 100 100
Note: See TracChangeset
for help on using the changeset viewer.