seagrid.gcm.smoc#
Copernicus SMOC hourly surface currents, as a module.
Every member of seagrid.sources.model.smoc.SMOC is available as a
module attribute, plus the grid metrics and C-grid helpers used by
tracmass:
from seagrid import smoc
ds = smoc.open_dataset("2023-01-01 06:00") # one hour
day = smoc.open_dataset("2023-01-01", timetype="daily")
cgrid = smoc.open_dataset("2023-01-01 06:00", c_grid=True)
metrics = smoc.grid_definition() # dxv, dyu, dxdy
Module Attributes
Functions
|
Return the SMOC cell metrics, computed once and cached as Zarr. |
|
Open one hour (or day) of SMOC, downloading the file if needed. |
|
Return a source object, optionally for a variant or with overrides. |
- seagrid.gcm.smoc.LAT1D = array([-80. , -79.91666667, -79.83333333, ..., 89.83333333, 89.91666667, 90. ], shape=(2041,))#
exact multiples of 1/12°, -80 … 90.
- Type:
Cell-centre latitudes
- seagrid.gcm.smoc.LON1D = array([-180. , -179.91666667, -179.83333333, ..., 179.75 , 179.83333333, 179.91666667], shape=(4320,))#
exact multiples of 1/12°, -180 … 180 - 1/12.
- Type:
Cell-centre longitudes
- seagrid.gcm.smoc.a_to_c_grid(ds)[source]#
Interpolate
uvel/vvelfrom an Arakawa A grid to a C grid.On the A grid all velocity components share the T-cell centres. On the C grid (the NEMO convention used by GLORYS)
U(i, j)sits on the east face of T-cell(i, j)andV(i, j)on its north face. Both are a two-point average with the eastern or northern neighbour. Longitude is periodic, souvelwraps exactly at the dateline; forvvelthe northernmost row wraps to the southernmost, which is unphysical, so mask or discard the last latitude row if needed.- Parameters:
ds (
xarray.Dataset) – Dataset withuvelandvvelonlat/lon.- Returns:
xarray.Dataset– Copy of ds withuvelandvvelon the C grid. The dimensions are unchanged; the half-cell stagger is implicit in the index convention.- Return type:
- seagrid.gcm.smoc.grid_definition(dask=True, force=False)[source]#
Return the SMOC cell metrics, computed once and cached as Zarr.
- Parameters:
- Returns:
xarray.Dataset–dxv(zonal cell width, m),dyu(meridional cell height, m) anddxdy(cell area, m²) ony/x, with 2-Dlonandlatcoordinates. The cache istrm_smoc_grid_def.zarrin the SMOC data directory.- Return type:
- seagrid.gcm.smoc.open_dataset(dtm=None, data_var=None, *, c_grid=False, **kwargs)[source]#
Open one hour (or day) of SMOC, downloading the file if needed.
As
seagrid.sources.DataSource.open_dataset(), plus c_grid.- Parameters:
dtm (
str,pandas.Timestamp,numpy.datetime64ordatetime, optional) – Date and hour. Default: the first available date.data_var (
str, optional) – Return only this variable.c_grid (
bool, optional) – Interpolateuvel/vvelto an Arakawa C grid (a_to_c_grid()). Default False.**kwargs –
timetype("hourly", the default, or"daily") and the other keywords ofopen_dataset().
- Returns:
- Return type: