{ "cells": [ { "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ "# 🧩 HRRR in Zarr Format\n", "\n", "Selections of the HRRR archive are made available in [Zarr](https://zarr.readthedocs.io/en/stable/) format on [AWS](https://registry.opendata.aws/noaa-hrrr-pds/).\n", "\n", "There are two ways to access zarr data with xarray\n", "\n", "1. with `fsspec`\n", "1. with `s3fs`" ] }, { "cell_type": "code", "execution_count": 2, "metadata": {}, "outputs": [], "source": [ "import zarr\n", "import fsspec\n", "import xarray as xr" ] }, { "cell_type": "code", "execution_count": 3, "metadata": {}, "outputs": [ { "data": { "text/html": [ "
<xarray.DataArray 'TMP' (time: 36, projection_y_coordinate: 1059,\n",
" projection_x_coordinate: 1799)>\n",
"[68585076 values with dtype=float16]\n",
"Dimensions without coordinates: time, projection_y_coordinate,\n",
" projection_x_coordinate\n",
"Attributes:\n",
" GRIB_PARAM: [2, 0, 0, 0]\n",
" coordinates: forecast_reference_time forecast_period\n",
" long_name: 2m_above_ground/TMP\n",
" units: K<xarray.DataArray 'TMP' (projection_y_coordinate: 1059,\n",
" projection_x_coordinate: 1799)>\n",
"[1905141 values with dtype=float16]\n",
"Dimensions without coordinates: projection_y_coordinate, projection_x_coordinate\n",
"Attributes:\n",
" GRIB_PARAM: [2, 0, 0, 0]\n",
" coordinates: forecast_reference_time time pressure height forecast_period\n",
" long_name: 2m_above_ground/TMP\n",
" units: K<xarray.Dataset>\n",
"Dimensions: (time: 36, projection_x_coordinate: 1799,\n",
" projection_y_coordinate: 1059)\n",
"Coordinates:\n",
" * projection_x_coordinate (projection_x_coordinate) float64 -2.698e+06 ......\n",
" * projection_y_coordinate (projection_y_coordinate) float64 -1.587e+06 ......\n",
" * time (time) datetime64[ns] 2020-09-03T01:00:00 ... 20...\n",
"Data variables:\n",
" forecast_period (time) timedelta64[ns] ...\n",
" forecast_reference_time datetime64[ns] ...<xarray.DataArray 'projection_x_coordinate' (projection_x_coordinate: 1799)>\n",
"array([-2697520.142522, -2694520.142522, -2691520.142522, ..., 2690479.857478,\n",
" 2693479.857478, 2696479.857478])\n",
"Coordinates:\n",
" * projection_x_coordinate (projection_x_coordinate) float64 -2.698e+06 ......\n",
"Attributes:\n",
" standard_name: projection_x_coordinate\n",
" units: m<xarray.DataArray 'forecast_reference_time' ()>\n",
"[1 values with dtype=datetime64[ns]]\n",
"Attributes:\n",
" standard_name: forecast_reference_time<xarray.DataArray 'TMP' (projection_y_coordinate: 1059,\n",
" projection_x_coordinate: 1799)>\n",
"[1905141 values with dtype=float16]\n",
"Dimensions without coordinates: projection_y_coordinate, projection_x_coordinate\n",
"Attributes:\n",
" GRIB_PARAM: [2, 0, 0, 0]\n",
" coordinates: forecast_reference_time time pressure height forecast_period\n",
" long_name: 2m_above_ground/TMP\n",
" units: K<xarray.DataArray 'TMP' (projection_y_coordinate: 1059,\n",
" projection_x_coordinate: 500)>\n",
"[529500 values with dtype=float16]\n",
"Dimensions without coordinates: projection_y_coordinate, projection_x_coordinate\n",
"Attributes:\n",
" GRIB_PARAM: [2, 0, 0, 0]\n",
" coordinates: forecast_reference_time time pressure height forecast_period\n",
" long_name: 2m_above_ground/TMP\n",
" units: K