-
-
Save emontgomery-usgs/18741fdd410668beaece811f7340ee9d to your computer and use it in GitHub Desktop.
So this sequence of steps does successfully create time and time2 but ncBrowse does not make use of time2 and there is no metadata for either variable.
So I thought I could just get metadata and I hit a weird error in xarray - any ideas?
ValueError: invalid time units: True Julian Day
Gist is here:
https://gist.github.com/mmartini-usgs/ef997bb24792ead3a0469f436d3c677d
Hi Ellyn,
First, make sure you are using the latest stglib. You call a function that hasn't existed for 5 months (stglib.utils.create_epic_time
was renamed to stglib.utils.create_epic_times
with an "s" at the end).
In any case, the error still appears even with the newest stglib, xarray, etc. The error seems to be with some extra encoding values that crept in to many of the variables. What created the .nc file that you are working with? For example, here is the encoding
dictionary for u_1205
:
{'zlib': False,
'shuffle': False,
'complevel': 0,
'fletcher32': False,
'contiguous': True,
'chunksizes': None,
'source': '/Volumes/Backstaff/scratch/mvco/10811v/10811whVcurrents00repodropna-cal-trm-met.nc',
'original_shape': (12517, 52, 1, 1),
'dtype': dtype('float32'),
'_FillValue': nan}
If I delete all of these but _FillValue
and dtype
, then the file will save with the unlimited_dims
argument. Not sure why. Knowing where the file came from could help. Then we can implement some code to guard against the error.
So I thought I could just get metadata and I hit a weird error in xarray - any ideas?
ValueError: invalid time units: True Julian Day
Gist is here:
https://gist.github.com/mmartini-usgs/ef997bb24792ead3a0469f436d3c677d
Marinna can you create a new issue for this problem? Thanks.
@dnowacki-usgs (not sure if this syntax works in gists)
Hi Dan-
The file I am working with is one created by Marinna's new V processing code. I believe she instantiates variables largely with the xarray defaults, which is probably where the extraneous stuff comes from.
This gist was started because she had trouble writing EPIC times in her processing, so leaves time in these files as xarray/CF time. I am trying to generate the EPIC times to make something I can release on stellwagen using your create_epic_times module. (OK, I should have updated. thanks for pointing out the correct module!).
in cell 11, why doesn't the unlimited_dims argument work?