Personal tools
You are here: Home CDAT Tips and Tricks Time Tips Getting time axis range from a NetCDF file
Document Actions

Getting time axis range from a NetCDF file

by Renata McCoy last modified 2007-05-08 10:24

Goal: Learn about getting time axis range in CDAT.


 
import cdms,sys,cdtime
f=cdms.open(sys.prefix+'/sample_data/hadcrut2_sample.nc')
start_time = f.getAxis('time').asComponentTime()[0] 
end_time = f.getAxis('time').asComponentTime()[-1]
print 'start time = ',start_time, ',   end time= ',end_time             
  start time =  1991-1-1 0:0:0.0 ,   end time=  1993-12-1 0:0:0.0 


Powered by Plone