Project

General

Profile

Revision 750:ccb55f4d7a99

IDccb55f4d7a99
Parent 749:43030c4a11ec
Child 751:9393848b6214

Added by Maarten Sneep over 2 years ago

use python time objects

View differences:

src/pycama/CAMA_call.py
271 271
                time_range = [ref['time_bounds'][0, 0], ref['time_bounds'][-1, 1]]
272 272
                time_units = ref['time'].attrs['units']
273 273
                # logger.debug("time range: {0}, type {1}".format(time_range, str(type(time_range[0]))))
274
                times = netCDF4.num2date(time_range, time_units)
274
                times = netCDF4.num2date(time_range, time_units, only_use_cftime_datetimes=False, only_use_python_datetimes=True)
275 275
            duration_secs = (times[1] - times[0]).total_seconds()
276 276

  
277 277
            if math.fabs(duration_secs - 86400.0) < 6060.0:

Also available in: Unified diff