WOABGCDataset#
- class roms_tools.datasets.lat_lon_datasets.WOABGCDataset(*, filename: str | ~pathlib.Path | list[str | ~pathlib.Path], start_time: ~datetime.datetime | None = None, end_time: ~datetime.datetime | None = None, dim_names: dict[str, str] = <factory>, var_names: dict[str, str] = <factory>, opt_var_names: dict[str, str] = <factory>, climatology: bool = True, has_encoded_times: bool = False, needs_lateral_fill: bool = True, use_dask: bool = False, chunks: dict[str, int] | None = None, initial_slice_bounds: dict[str, tuple[int | float, int | float]] | None = None, read_zarr: bool = False, allow_flex_time: bool = False, start_time_pad: bool = True, end_time_pad: bool = True, apply_post_processing: bool = True, ds_loader_fn: ~collections.abc.Callable[[], ~xarray.core.dataset.Dataset] | None = None, ts_decade: str = 'decav', deep_fill: str = 'annual_blend', deep_blend_halfwidth: float = 100.0)#
World Ocean Atlas 2023 nutrients and oxygen as a gridded BGC source.
Reads a directory of per-variable, per-month WOA23 netCDF files and merges them into one twelve-month climatology carrying the four BGC tracers WOA measures (
NO3,PO4,SiO3,O2) plus the temperature and salinity used to convert units and to build the density coordinate for"density"/"density_mld"vertical interpolation.WOA has no DIC, alkalinity or iron, so this source cannot satisfy MARBL on its own; combine it with GLODAP, ESPER or a constants source via
bgc_sources.Notes
Resolution. WOA23 publishes nutrients and oxygen on the 1 degree grid only (0.25 degree exists for T/S alone), so everything here is 1 degree.
Month pairing. In the NCEI layout the
decav/alltoken is the averaging period over years, not the period within a year; the month is the two-digit filename suffix. Each variable is read from its files in01-12order, so indexkis monthk+1for every variable, and monthly tracers are paired with the matching monthly T/S. The rawtimevalues are dropped before merging because they differ between variable families (January temperature is 396.5 “months since 1965-01-01” while January nitrate is 336.5, reflecting the different start years); merging on them would yield a 24-step union axis. The inheritedWOADataset.clean_up()then installs the shared mid-month axis.Depth. Monthly WOA fields are shallow: 800 m (43 levels) for the nutrients and 1500 m (57 levels) for oxygen and T/S. Only the annual field is full-depth (5500 m, 102 levels). Since the shallow axes are exact leading slices of the annual axis, each variable is extended to the full 102-level grid according to
deep_fill.Methods
Fill vertical NaN gaps downward and upward, then rebuild the mask.
Open and merge the per-variable, per-month WOA23 files.
Convert the tracers to mmol/m3 and build the land/ocean mask.
Attributes
WOABGCDataset.bgc_source_tsThe opt_var_names keys that supply the density-coordinate source.
WOABGCDataset.climatologyWOABGCDataset.deep_blend_halfwidthHalf-width, in metres, of the
"annual_blend"taper band, centred on each variable's own deepest monthly level.WOABGCDataset.deep_fill"annual_blend"splices the full-depth annual climatology underneath with a linear taper across the seam;"ffill"persists the deepest monthly value downward.WOABGCDataset.has_encoded_timesWOABGCDataset.needs_lateral_fillWOABGCDataset.ts_decadeOver-years averaging token for T/S.
WOABGCDataset.dim_namesWOABGCDataset.var_namesWOABGCDataset.opt_var_namesWOABGCDataset.filenameWOABGCDataset.is_globalWOABGCDataset.ds