Open matteodefelice opened 3 years ago
@matteodefelice monthly datasets are tricky to translate due to fact that "a month" is no a proper time interval (see the discussion here for example: https://cfconventions.org/Data/cf-conventions/cf-conventions-1.8/cf-conventions.html#time-coordinate)
You may try to use the poorly documented time_dims
option that was added exactly to handle CDS monthly seasonal products: https://github.com/ecmwf/cfgrib/issues/97#issuecomment-557190695
I didn't test it on NCEP though.
If you want to know more, the whole conversation in the issue is a good read.
Thanks a lot. It seems that if I use verifying_time
in time_dims
I get the same coordinate used by grib_to_netcdf
. This should solve my problem BUT...why can't I use only verifying_time
in time_dims
?
If I use backend_kwargs=dict(time_dims = ('time', 'verifying_time'))
everything works fine but if I leave only the second:
ValueError: time_dims 'verifying_time' not a subset of ['time', 'step', 'valid_time', 'verifying_time', 'forecastMonth', 'indexing_time']
The error message doesn't help a lot. What is happening here?
SOLVED: it's the annoying Python-comma...If I use:
`backend_kwargs=dict(time_dims = ('verifying_time',))
then the check in dataset.py
works :)
Do you see any potential issue in doing this?
I think this issue is not really an issue caused by
cfgrib
but I think it's relevant because in this case it forces me to switch to the NetCDF version of the files on the CDS.I downloaded an NCEP forecast monthly, start date january and lead times 2, 3 and 4. The dimension are very big, due probably to the initialization method of the NCEP, if I open the GRIB with xarray I get:
I cannot do anything with this file, because I would need 170 GB of memory to deal with it. Instead, if I convert it to NetCDF it becomes:
I was using the GRIB because in my workflow I am computing the mean on the 'step' dimension to have a seasonal average, but in this case I get an error due to lack of memory to perform the computation. Why the NetCDF is so compact? What's the magic behind it?