Skip to content

loading cubes with differing units for time and time_bounds #1801

@andreas-h

Description

@andreas-h

I have a .nc file where the time variable has different units from time_bnds:

ncdump -h 2008001.nc
netcdf \2008001 {
dimensions:
    bnds = 2 ;
    time = 1 ;
    longitude = 7200 ;
    latitude = 3600 ;
    wavelength = 1 ;
variables:
    int bnds(bnds) ;
    double time_bnds(bnds) ;
        time_bnds:units = "days since 2008-01-01 00:00:00" ;
        time_bnds:calendar = "proleptic_gregorian" ;
    double time(time) ;
        time:bounds = "time_bnds" ;
        time:standard_name = "time" ;
        time:units = "days since 2008-01-09 00:00:00" ;
        time:calendar = "proleptic_gregorian" ;

When I load this cube in Iris 1.8.1, the time coord is wrong:

In [3]: c = iris.load('2008001.nc')[0]

In [4]: c.coord('time')
Out[4]: DimCoord(array([ 0.]), bounds=array([[  0.,  16.]]), standard_name=u'time', units=Unit('days since 2008-01-09 00:00:00', calendar='proleptic_gregorian'), var_name='time')

In [5]: print c.coord('time')
DimCoord([2008-01-09 00:00:00], bounds=[[2008-01-09 00:00:00, 2008-01-25 00:00:00]], standard_name=u'time', calendar=u'proleptic_gregorian', var_name='time')

It seems like the units of the time_bnds variable are applied to both time and time_bnds points.

Metadata

Metadata

Type

No type

Projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions