open netCDF gives 'time' dim with 1969 change in timezone
See original GitHub issueI’m on xarray version 0.7.2 netCDF4-python version 1.2.2 Python version via Conda: 3.5.1 |Continuum Analytics, Inc.| (default, Dec 7 2015, 11:16:01) [GCC 4.4.7 20120313 (Red Hat 4.4.7-1)]
The time
dim on Datasets read in from netCDF files seems to change timezones in 1969. This is especially a pain for annual data because the bug causes annual indexes to shift by one year. I’ve seen this problem in reanalysis for NCEP/NCAR, Twentieth Century Reanalysis, and some reconstructed SST fields.
For example, if a read in a netCDF file. Take NCEP/NCAR Reanalysis 1 monthly mean geopotential height as an example (ftp://ftp.cdc.noaa.gov/Datasets/ncep.reanalysis.derived/pressure/hgt.mon.mean.nc ; a 278 MB file).
import xarray as xr
ds = xr.open_dataset('~/Downloads/hgt.mon.mean.nc')
print(ds.time)
The interesting part of this printed time dim is always around 1969:
...
'1969-09-01T00:00:00.000000000Z', '1969-10-01T00:00:00.000000000Z',
'1969-11-01T00:00:00.000000000Z', '1969-12-01T00:00:00.000000000Z',
'1969-12-31T17:00:00.000000000-0700',
'1970-01-31T17:00:00.000000000-0700',
'1970-02-28T17:00:00.000000000-0700',
...
You can see we go from Z
to-0700
. It also gives me an extra measure for Dec 1969 :-\
I don’t think this is a hidden calendar or datetime-like feature that I’m unaware of…? Seems like a bug with you guys or upstream.
Thanks for your help!
Issue Analytics
- State:
- Created 7 years ago
- Reactions:1
- Comments:5 (5 by maintainers)
Top GitHub Comments
The best channel out there is definitely conda-forge: https://conda-forge.github.io/
Check it out!
+1 for conda-forge. We should add a note about it to the install page.