Comments (5)
This is my request:
c.retrieve(
'seasonal-monthly-single-levels',
{
'originating_centre':'ecmwf',
'variable':'mean_sea_level_pressure',
'product_type':'monthly_mean',
'year':[
'1993','1994','1995',
'1996','1997','1998',
'1999','2000'
],
'month':'01',
'leadtime_month':[
'1','2','3'
],
'format':'grib'
},
'download.grib')
This one works perfectly with grib_to_netcdf
(grib_api version 1.26.1 installed from anaconda)
from cfgrib.
@matteodefelice unfortunately this is the expected behaviour at the moment. I feel your pain.
The problem is that these GRIB files express the step
in hours and since months have different length, the files don't typically produce a well formed hypercube in time
and step
. cfgrib builds a technically correct hypercube by filling the 'gaps' with np.nan
but it is not easy to work with the result.
Changing the dimension coordinate from step
to valid_time
(non-trivial to do) may help, but the data would still include a lot of np.nan
. On the other hand defining a real leadtime_month
coordinate looks really tricky.
Ideas and especially PRs are welcome!
from cfgrib.
Well, the most important thing for me is that you folks are aware of this. The good news is that if you convert with grib_to_netcdf
this problem disappears because the conversion "merges" the dimensions similarly to what you get if you sum time
and step
dimensions.
I have the impression what with a bit of pandas
and xarray
wizardry we may find a workaround, for example stacking the two temporal dimensions and aggregating in a smart way according to the month. Before going back (again!) to the NetCDF conversion I will try to find a workaround, I will keep you posted.
from cfgrib.
@matteodefelice what request are you using?
Last time I checked grib_to_netcdf
crashed on my test request:
>>> cds.retrieve('seasonal-monthly-single-levels', {
'originating_centre': 'ecmwf',
'variable': 'maximum_2m_temperature_in_the_last_24_hours',
'product_type': 'monthly_mean',
'year': '2018',
'month': ['04', '05'],
'leadtime_month': ['1', '2'],
'grid': ['3', '3'],
'format': 'grib',
},
'out.grib',
)
from cfgrib.
Even if this issue is older than #97 I'd like to close this one as duplicate of that as the discussion there has added useful insights. @matteodefelice hope you don't mind.
from cfgrib.
Related Issues (20)
- open_datasets fails to open GRIB messages of same parameter with different forecastTime values, silently skipping them HOT 4
- have cfgrib exit on skipping variable HOT 2
- xarray_to_grib.expand_dims too aggressively tries to expand dimensions that are already represented? HOT 4
- Inconsistency between "grib_errors" and "errors" as argument name HOT 1
- Restrictions on reusing an index file are too restrictive HOT 6
- Add to ECMWF downstream ci
- Split cf2cdm out of cfgrib and move it to its own repo HOT 4
- Unable to read the correct time series from NCEP .grib2 HOT 1
- nws noaa grib files open_file but fail to convert OnDiskArray to numpy array (cfgrib >= 0.9.10.2) HOT 4
- Reading National Blend of Models (NBM) Data with cfgrib HOT 6
- broken link in example grib file in github Readme "Usage" section HOT 1
- Offset Longitude Values in FNL GRIB1 files.
- Wrong latitude and longitude HOT 2
- Value error on CfMessage `step` key HOT 3
- Unable to read "step" with ecCodes 2.34.0 HOT 1
- Select dataset/group while opening grib file with xarray
- Request a new release HOT 3
- Cannot find eccodes when using cfgrib HOT 6
- cfgrib and pyinstaller HOT 2
- cfgrib loses all sub-hourly data with newer eccodes version HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cfgrib.