Plot coastal only data#

This example shows how to plot the PO4 distribution in each basin.

This example is independent from GENIE’s mask

time = 9.5 [Year mid-point]
/home/docs/checkouts/readthedocs.org/user_builds/cgeniepy/envs/stable/lib/python3.12/site-packages/cgeniepy/model.py:58: UserWarning: No gemflag is provided, use default gemflags: [biogem]
  warnings.warn("No gemflag is provided, use default gemflags: [biogem]")

<matplotlib.collections.QuadMesh object at 0x7d6f32601610>

import xarray as xr
import cgeniepy
import numpy as np

model = cgeniepy.sample_model()

sst = model.get_var('ocn_sur_temp').isel(time=-1)

## grid category is a pre-defined 2D data
## 0: coastal
## 1: land
## 2: open ocean
gc = model.grid_category()

## coastal region
xr.where(gc == 0, sst.data, np.nan).plot()

Total running time of the script: (0 minutes 0.131 seconds)

Gallery generated by Sphinx-Gallery