Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

to_grib not able to write ensemble forecasts in GRIB v1 ? #316

Open
jodemaey opened this issue Oct 10, 2022 · 3 comments
Open

to_grib not able to write ensemble forecasts in GRIB v1 ? #316

jodemaey opened this issue Oct 10, 2022 · 3 comments

Comments

@jodemaey
Copy link

jodemaey commented Oct 10, 2022

Hi there,

I'm presently trying to load, modify and rewrite ECMWF perturbed members using to_grib in GRIB v1, and despite all the other needed keys being there, the keys perturbationNumber and numberOfForecastsInEnsemble are not present in the final output file.

All the members are present in the output grib file but it is impossible to know which member is which one. Therefore, later I cannot reload correctly once gain using cf_grib.

Is there a way to do it properly or this is not yet implemented?

Thank you in advance,

Jonathan

@shahramn
Copy link
Collaborator

The GRIB edition 1 standard does not include ensemble forecasts. We have to use a "local definition" to store the perturbation number etc
See https://apps.ecmwf.int/codes/grib/format/grib1/local/

@jodemaey
Copy link
Author

jodemaey commented Oct 10, 2022

Oh I see, then I guess using a local definition is not possible with to_grib , right? Or is it possible?

@jodemaey
Copy link
Author

jodemaey commented Oct 12, 2022

Ok I switched to v2 and it worked. Up to you to see if you want this to remain open or not.

Edit: FYI, even in v2, I had to impose the perturbationNumber by hand via grib_keys because to_grib was not picking it from my xarray dataset coordinate number.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants