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

Request that uvRelativeToGrid GRIB key be read by default #378

Closed
blaylockbk opened this issue May 17, 2024 · 0 comments · Fixed by #379
Closed

Request that uvRelativeToGrid GRIB key be read by default #378

blaylockbk opened this issue May 17, 2024 · 0 comments · Fixed by #379
Labels
enhancement New feature or request

Comments

@blaylockbk
Copy link
Contributor

Is your feature request related to a problem? Please describe.

When working with wind vector data, it is important to know if the vectors represented are grid- or earth-relative vectors. To get this information, a user currently needs to explicitly read this GRIB key.

import xarray as xr

xr.open_dataset(
    "/path/to/file.grib2",
    engine="cfgrib",
    backend_kwargs={"read_keys": ["uvRelativeToGrid"]},
)

Since this detail is necessary when interpreting wind vectors (i.e., comparing modeled wind to an observation), I suggest this GRIB key be included in the DataArray attrs by default.

Describe the solution you'd like

If I'm right, I think this key can be simply added in the list here

cfgrib/cfgrib/dataset.py

Lines 40 to 48 in eacde4c

DATA_ATTRIBUTES_KEYS = [
"paramId",
"dataType",
"numberOfPoints",
"typeOfLevel",
"stepUnits",
"stepType",
"gridType",
]

Describe alternatives you've considered

No response

Additional context

No response

Organisation

No response

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

Successfully merging a pull request may close this issue.

1 participant