Configuration

Forcing configuration dataclass.

Simple, standalone config with no dependency on nos_ofs. The caller provides values directly or uses factory methods.

class nos_utils.config.ForcingConfig(lon_min: float, lon_max: float, lat_min: float, lat_max: float, pdy: str, cyc: int, nowcast_hours: int = 6, forecast_hours: int = 48, igrd_met: int = 0, met_num: int = 1, gfs_resolution: str = '0p50', scale_hflux: float = 1.0, grid_file: Path | None = None, nws: int = 2, variables: List[str] = <factory>, hrrr_lon_min: float | None = None, hrrr_lon_max: float | None = None, hrrr_lat_min: float | None = None, hrrr_lat_max: float | None = None, obc_roi_2d: dict | None = None, obc_roi_3d: dict | None = None, nudge_roi_3d: dict | None = None, obc_ssh_offset: float = 0.0, adt_enabled: bool = False, nudging_enabled: bool = False, nudging_timescale_seconds: float = 86400.0, n_levels: int = 51, river_config_file: Path | None = None, river_clim_file: Path | None = None, river_default_temp: float = 10.0, river_default_salt: float = 0.0, nwm_product: str = 'analysis_assim', nwm_n_list_target: int = 55, nwm_n_list_min: int = 31, tidal_constituents: List[str] = <factory>, bctides_template: Path | None = None)[source]

Bases: object

Configuration for forcing generation.

All values are caller-provided. No YAML coupling or environment variable magic.

Variables:
  • lat_max (lon_min, lon_max, lat_min,) – Domain bounding box (degrees)

  • pdy (str) – Production date YYYYMMDD

  • cyc (int) – Cycle hour (0, 6, 12, 18)

  • nowcast_hours (int) – Length of nowcast/hindcast period

  • forecast_hours (int) – Length of forecast period

  • igrd_met (int) – Grid interpolation method (0=native, 1+=interpolate to model grid)

  • met_num (int) – Number of met sources (1=GFS only, 2=GFS+HRRR)

  • scale_hflux (float) – Heat flux scaling factor

  • grid_file (pathlib.Path | None) – Path to model grid (hgrid.ll) for interpolation when igrd_met > 0

  • nws (int) – SCHISM forcing mode (2=sflux standalone, 4=DATM UFS-Coastal)

  • variables (List[str]) – List of variables to extract (empty = use processor defaults)

lon_min: float
lon_max: float
lat_min: float
lat_max: float
pdy: str
cyc: int
nowcast_hours: int = 6
forecast_hours: int = 48
igrd_met: int = 0
met_num: int = 1
gfs_resolution: str = '0p50'
scale_hflux: float = 1.0
grid_file: Path | None = None
nws: int = 2
variables: List[str]
hrrr_lon_min: float | None = None
hrrr_lon_max: float | None = None
hrrr_lat_min: float | None = None
hrrr_lat_max: float | None = None
obc_roi_2d: dict | None = None
obc_roi_3d: dict | None = None
nudge_roi_3d: dict | None = None
obc_ssh_offset: float = 0.0
adt_enabled: bool = False
nudging_enabled: bool = False
nudging_timescale_seconds: float = 86400.0
n_levels: int = 51
river_config_file: Path | None = None
river_clim_file: Path | None = None
river_default_temp: float = 10.0
river_default_salt: float = 0.0
nwm_product: str = 'analysis_assim'
nwm_n_list_target: int = 55
nwm_n_list_min: int = 31
tidal_constituents: List[str]
bctides_template: Path | None = None
property domain

Return domain bounds as tuple (lon_min, lon_max, lat_min, lat_max).

property hrrr_domain

HRRR domain bounds (falls back to main domain if not set).

classmethod for_secofs(pdy: str, cyc: int, **overrides) → ForcingConfig[source]

Factory with SECOFS defaults (SE Coastal Ocean Forecast System).

classmethod for_secofs_ufs(pdy: str, cyc: int, **overrides) → ForcingConfig[source]

Factory with SECOFS UFS-Coastal defaults (nws=4, DATM coupling).

classmethod for_stofs_3d_atl(pdy: str, cyc: int, **overrides) → ForcingConfig[source]

Factory with STOFS-3D-ATL defaults (Atlantic Storm Surge).

classmethod for_stofs_3d_atl_ufs(pdy: str, cyc: int, **overrides) → ForcingConfig[source]

Factory with STOFS-3D-ATL UFS-Coastal defaults (nws=4, DATM coupling).

classmethod for_ensemble(pdy: str, cyc: int, member: int = 0, n_members: int = 6, base_ofs: str = 'stofs_3d_atl', **overrides) → ForcingConfig[source]

Factory for ensemble member forcing.

Parameters:
  • member – Member index (0=control, 1-N=perturbation)

  • n_members – Total ensemble size

  • base_ofs – Base OFS to inherit domain/timing from

classmethod from_yaml(yaml_path, **overrides) → ForcingConfig[source]

Load from a NOS-OFS YAML config file.

Extracts grid.domain, model.run, and forcing.atmospheric sections. Falls back gracefully if PyYAML is not installed.