stactools.noaa_hrrr
noaa-hrrr:forecast_cycle_type
: either standard (18-hour) or extended (48-hour)noaa-hrrr:region
: either conus
or alaska
This package can be used to generate STAC metadata for the NOAA High Resolution Rapid Refresh (HRRR) atmospheric forecast dataset.
The data are uploaded to cloud storage in AWS, Azure, and Google so you can pick
which cloud provider you want to use for the grib
and index
hrefs using the
cloud_provider
argument to the functions in stactools.noaa_hrrr.stac
.
The NOAA HRRR dataset is a continuously updated atmospheric forecast data product.
00-23
) get an 18-hour forecast in the conus
region00
, 03
, 06
, etc) in the
alaska
region00
, 06
, 12
, 18
a 48-hour forecast is generatedsubh
) gets 15 minute forecasts (four per hour per
attribute), but the sub-hourly forecasts are stored as layers within a
single GRIB2 file for the forecast hour rather than in separate files.sfc
, prs
, nat
, subh
), After extensive discussions, we decided to organize the STAC metadata with the following structure:
Collections: Separate collections for each region-product combination
conus
and alaska
sfc
, prs
, nat
, and subh
Items: Each GRIB file in the archive is represented as an item with two assets:
"grib"
: Contains the actual data."index"
: The .grib2.idx sidecar file.Each GRIB file contains the forecasts for all of a product's variables for a particular forecast hour from a reference time, so you need to combine data from multiple items to construct a time series for a forecast.
grib:layers
: Within each "grib"
asset, a grib:layers
property details
each layer's information, including description, units, and byte ranges.
This enables applications to access specific parts of the GRIB2 files without
downloading the entire file.
GRIB
STAC extension with the grib:layers
property
for storing byte-ranges after testing this specification out on other GRIB2
datasets./vsisubfile
or
vrt://
:
/vsisubfile/{start_byte}_{byte_size},/vsicurl/{grib_href}
vrt:///vsicurl/{grib_href}?bands={grib_message}
, where grib_message
is
the index of the layer within the GRIB2 file.vrt
driver is reading the sidecar .grib2.idx file
and translating it into a /vsisubfile
URI.grib:layers
to create layer-specific data sets, facilitating
efficient data handling.For more details, please refer to the related issue discussion and pull requests #3 and #6.
grib:layers
metadata to
load the data into xarray.Install stactools-noaa-hrrr
with pip:
pip install stactools-noaa-hrrr
To create a collection object:
stac noaahrrr create-collection {region} {product} {cloud_provider} {destination_file}
e.g.
stac noaahrrr create-collection conus sfc azure example-collection.json
To create an item:
stac noaahrrr create-item \
{region} \
{product} \
{cloud_provider} \
{reference_datetime} \
{forecast_hour} \
{destination_file}
e.g.
stac noaahrrr create-item conus sfc azure 2024-05-01T12 10 example-item.json
To create all items for a date range:
stac noaahrrr create-item-collection \
{region} \
{product} \
{cloud_provider} \
{start_date} \
{end_date} \
{destination_folder}
e.g.
stac noaahrrr create-item-collection conus sfc azure 2024-05-01 2024-05-31 /tmp/items
You can launch a jupyterhub server in a docker container with all of the dependencies installed using these commands:
docker/build
docker/jupyter
Use stac noaahrrr --help
to see all subcommands and options.
We use pre-commit to check any changes. To set up your development environment:
pip install -e '.[dev]'
pre-commit install
To check all files:
pre-commit run --all-files
To run the tests:
pytest -vv
If you've updated the STAC metadata output, update the examples:
scripts/update-examples