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

Bug Fix: Skip downloading invalid cURL range, such was in the RAP model wind messages. #260

Conversation

blaylockbk
Copy link
Owner

The RAP model uses GRIB submessages to store the wind vectors (UGRD and VGRD).

The byte ranges were incorrect for the first grib submessage, and would result in the entire file being downloaded instead of a single message.

image

To fix this, I simply check the byte range is valid (length of byte range is greater than 0). If the byte range is not valid, Herbie simply skips downloading that message.

from herbie import Herbie

model = "rap"
product = "awp130pgrb"
dtg = "2023-12-25 21:00"
fhr = 0
H = Herbie(dtg, model=model, product=product, fxx=fhr)
H.inventory(searchString="GUST|UGRD:10 m|VGRD:10 m|TMP:2 m|DPT:2 m")

ds = H.xarray(
    searchString="GUST|UGRD:10 m|VGRD:10 m|TMP:2 m|DPT:2 m",
    verbose=True,
    overwrite=True,
    remove_grib=False
)
image

@blaylockbk blaylockbk merged commit 2260d3e into main Dec 29, 2023
6 of 9 checks passed
@blaylockbk blaylockbk deleted the 259-2023123-unable-to-subset-by-multiple-items-in-searchstring-with-herbiexarray-but-works-for-herbieinventory branch December 29, 2023 16:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant