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
480 stars 72 forks source link

Opening filter_by_keys={"typeOfLevel": "tropopause"} for GFS #293

Closed segrovets closed 6 months ago

segrovets commented 6 months ago

Hello, I'm hoping you guys can help.

Usually I'm opening GFS data using this kind of expression: ds = xr.open_dataset( file_path, filter_by_keys={"typeOfLevel": "isobaricInhPa"}, engine="cfgrib", backend_kwargs={"errors": "ignore"}, ).metpy.quantify()

For GFS data I am able to change "typeOfLevel" to "tropopause" and extract the tropopause altitude in pressure height as a 2D dataset (lat,lon dimensions)

With herbie I was able to open the contents of isobaricInhPa using the regular selection of GFS = Herbie( "2022-11-11 00:00", model="gfs", product="pgrb2b.0p25", fxx=6, ) and searching search_this for the relevant keys that I get from the table (found here: https://www.nco.ncep.noaa.gov/pmb/docs/on388/table2.html )

My issue:: I cant find any key in the table that correspond to tropopause height / level. I know the GFS file contains tropopause but I dont know how to access it using herbie. (other than downloading the whole file and extracting it using my previous expression)

Any suggestions welcome!

segrovets commented 6 months ago

I managed to open the NOAA tropopause data as follows:

GFS = Herbie( "2022-11-11 00:00", model="gfs", fxx=6,  ) #note there is no product specified, it will default to 0p25 which works great for me
ds_tropopause = GFS.xarray(
        backend_kwargs={
            "filter_by_keys": {"typeOfLevel": "tropopause"}
        },
    )