mpimet / easygems

Utilities for earth system model analysis
MIT License
1 stars 1 forks source link

Reuse existing GeoAxes if possible #17

Closed lkluft closed 1 month ago

lkluft commented 1 month ago

Currently, healpix_show() and healpix_contour() will always create a new GeoAxes, if none is passed. This PR adds a check, if i) an axes exists and ii) is a GeoAxes. In those cases the axes is reused.

Example

import easygems.healpix as egh
import intake

cat = intake.open_catalog("https://tcodata.mpimet.mpg.de/internal.yaml")
ds = cat.HIFS(datetime="20240830T00").to_dask()

egh.healpix_contour(ds.tcwv.isel(time=1), colors="b")
egh.healpix_contour(ds.tcwv.isel(time=5), colors="r")
egh.healpix_contour(ds.tcwv.isel(time=10), colors="g")