blaylockbk / Herbie

Download numerical weather prediction datasets (HRRR, RAP, GFS, IFS, etc.) from NOMADS, NODD partners (Amazon, Google, Microsoft), ECMWF open data, and the University of Utah Pando Archive System.
https://herbie.readthedocs.io/
MIT License
424 stars 70 forks source link

EOFError: No valid message found #275

Closed roesgaard closed 5 months ago

roesgaard commented 5 months ago

I am new to the package but it seems super!

I have setup the project with docker and continuumio/miniconda3

The project start up fine and I can somewhat follow the guide:

from herbie import Herbie

Herbie object for the HRRR model 6-hr surface forecast product

H = Herbie(
  '2021-01-01 12:00',
  model='hrrr',
  product='sfc',
  fxx=6,
  save_dir='./data'
)
H.inventory(searchString="GRD:10 m")

resulting in image 1: file1

However, using xarray (dsList = H.xarray(searchString = "GRD:10 m", remove_grib=False)) I get the subsequent failure. file2 Any idea as to where I should look for help?

blaylockbk commented 5 months ago

Hi @roesgaard

Thanks for giving Herbie a try.

Unfortunatly, I'm not able to reproduce your error.

from herbie import Herbie

H = Herbie(
    "2021-01-01 12:00",
    model="hrrr",
    product="sfc",
    fxx=6,
    save_dir="./data",
)
H.inventory(searchString="GRD:10 m")
ds = H.xarray(searchString="GRD:10 m", remove_grib=False)
ds

image

I don't have experience using Herbie inside a docker container (I know some people have made it work). Can you check that you have permissions set to write to the ./data directory and can you check that the file downloaded completely (it kind of looks like it didn't download the file correctly; when I downloaded the subset the size of the file data/hrrr/20210101/subset_8fb2391b__hrrr.t12z.wrfsfcf06.grib2 is about 4.8M).

Also, what versions of xarray and cfgrib do you have installed? (I can tell from the warning in the inventory you are using Pandas 2.2.0, I'll resolve that.)

roesgaard commented 5 months ago

Diving further into the docker image I found that for some reason curl was not installed. Installing that solved eveything!

Thanks for the fast reply!

One additional question (let me know if I should open it as a seperate): is there an easy way to get all forecasted hours for a given weather model run. For example all forecasted hours from GFS00 forecasted 2024-01-01. or would that mean looping over the lead hour variable (FXX)?

blaylockbk commented 5 months ago

Ah, yes, curl is required. (I should put a check in Herbie that warns if curl is not in the Path. That would help identify this problem faster).

As for the question regarding data from all forecasted hours in a run...

  1. A Herbie object represents a single file, so you can use a loop to get many files and then concat them together.
  2. I have a rough implementation of this using FastHerbie. https://herbie.readthedocs.io/en/stable/user_guide/_tutorial_notebooks/fast.html. It's not the best implementation, but might get the job done.