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

Can pygrib write a grib from scratch - even for a 3D variable? #240

Open
Marston opened this issue Mar 22, 2024 · 4 comments
Open

Can pygrib write a grib from scratch - even for a 3D variable? #240

Marston opened this issue Mar 22, 2024 · 4 comments

Comments

@Marston
Copy link

Marston commented Mar 22, 2024

Apologies for asking this as part of an issue but there is no discussion board on this repo.
I've been trying to find a good grib2 writer for 2D and 3D variables but keep hitting roadblocks. Grib2io was promising but they seem to focus mainly on internal issues. I use pygrib extensively for reading all kind of gribs and so I would like to develop a grib2 writer around pygrib. Is there some code to in development that I can use? I will be writing experimental data and not the standard meteorological parameter.

@jswhit
Copy link
Owner

jswhit commented Mar 24, 2024

You cannot write a grib file from scratch using pygrib - a template file is needed

@Marston
Copy link
Author

Marston commented Mar 25, 2024

Thank you for responding. OK. If I have a template for 1 record, i.e., a 2D grid, how would I create a 2d and 3D grib file?
By that I mean, which sections and subsections are mutable and ought to be updated? Section 0, 1, & 2 are only updated once, but 3-7 are dynamic.

@jswhit
Copy link
Owner

jswhit commented Mar 30, 2024

@Marston I don't know the answer - you'll just have to try it and see what works and what doesn't. It would be great if you could report back on your experience here for the benefit of others.

@Marston
Copy link
Author

Marston commented Apr 10, 2024

Apologies for the late reply.
Yes, I will give this a try. Clearing some things off my plate before sketching a design.
Will be an interesting project.

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