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

HERA5: fix missing lon/lat #25

Merged
merged 2 commits into from
May 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions orcestra_book/hera5.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ list(cat)
```

```{code-cell} ipython3
cat.HERA5.to_dask()
cat.HERA5.to_dask().pipe(egh.attach_coords)
```

### Some notes on the dataset
Expand Down Expand Up @@ -79,7 +79,7 @@ We would like to plot the 2m air temperature at one location, the BCO, in August
For this rather short time period, we would like to work with the hourly data. Therefore, we need to specify the time hierarchy when addressing the data in the catalog.

```{code-cell} ipython3
era5 = cat.HERA5(time="PT1H").to_dask()
era5 = cat.HERA5(time="PT1H").to_dask().pipe(egh.attach_coords)
```

Next, we select the cell index that is the nearest neighbor to the BCO location using [`healpy.ang2pix()`](https://healpy.readthedocs.io/en/latest/generated/healpy.pixelfunc.ang2pix.html#healpy.pixelfunc.ang2pix).
Expand Down Expand Up @@ -132,9 +132,9 @@ era5["r"].sel(
).mean(
"time"
).groupby(
era5.latitude.sel(cell=is_orcestra)
era5.lat.sel(cell=is_orcestra)
).mean().plot(
x="latitude",
x="lat",
yincrease=False,
cmap="cmo.dense",
ax=ax,
Expand Down Expand Up @@ -164,7 +164,7 @@ hp.mollview(
The `healpy` package only provides functions to plot the whole globe. However, in real-life analyses it is often necessary to constrain a plot to certain regions. The function `easygems.healpix_show()` allows to plot two-dimensional data onto a cartopy `GeoAxis` with arbitrary projection and extent.

```{code-cell} ipython3
era5 = cat.HERA5(time="P1M").to_dask()
era5 = cat.HERA5(time="P1M").to_dask().pipe(egh.attach_coords)
var = era5["tp"]

fig, ax = plt.subplots(figsize=(10, 6), subplot_kw={"projection": ccrs.PlateCarree()})
Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
jupyter-book
matplotlib
matplotlib<3.9 # required until there's a new release of healpy (see https://github.com/healpy/healpy/pull/944)
numpy
xarray
dask>=2023.2.0
Expand Down
Loading