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/utilities.py
372 372
        tvar = ref['time']
373 373
        tbvar = ref['time_bounds']
374 374
        try:
375
            t, tstart, tend = netCDF4.num2date([tvar[index], tbvar[index, 0], tbvar[index, 1]], tvar.attrs['units'])
375
            t, tstart, tend = netCDF4.num2date([tvar[index], tbvar[index, 0], tbvar[index, 1]], tvar.attrs['units'], 
376
                only_use_cftime_datetimes=False, only_use_python_datetimes=True)
376 377
        except IndexError:
377 378
            raise CAMAException("Index {0} is out of range".format(index))
378 379

  

Also available in: Unified diff