VolumeRelease

Contents

VolumeRelease#

class roms_tools.VolumeRelease(*, name: str, lat: Annotated[float, Ge(ge=-90), Le(le=90)], lon: float, depth: Annotated[float, Ge(ge=0)], hsc: Annotated[float, Ge(ge=0)] = 0.0, vsc: Annotated[float, Ge(ge=0)] = 0.0, times: list[datetime] = [], time_interpolation: bool = False, release_type: Literal[ReleaseType.volume] = ReleaseType.volume, fill_values: Literal['auto', 'zero'] = 'auto', volume_fluxes: Flux | Annotated[float, Ge(ge=0)] | list[Annotated[float, Ge(ge=0)]] = 0.0, tracer_concentrations: dict[str, Concentration | Annotated[float, Ge(ge=0)] | list[Annotated[float, Ge(ge=0)]]] = {})#

Represents a CDR release with volume flux and tracer concentrations.

Parameters:
  • name (str) – Unique identifier for the release.

  • lat (float) – Latitude of the release location in degrees North. Must be between -90 and 90.

  • lon (float) – Longitude of the release location in degrees East.

  • depth (float) – Depth of the release in meters. Must be non-negative.

  • hsc (float) – Horizontal scale (standard deviation) of the release in meters. Must be non-negative. Defaults to 0.0.

  • vsc (float) – Vertical scale (standard deviation) of the release in meters. Must be non-negative. Defaults to 0.0.

  • times (list of datetime.datetime, optional) –

    Explicit time points for volume fluxes and tracer concentrations. Defaults to [self.start_time, self.end_time] if None.

    Example: times=[datetime(2022, 1, 1), datetime(2022, 1, 2), datetime(2022, 1, 3)]

  • volume_fluxes (float or list of float, optional) –

    Volume flux(es) of the release in m³/s over time.

    • Constant: applies uniformly across the entire simulation period.

    • Time-varying: must match the length of times.

    Example:

    • Constant: volume_fluxes=1000.0 (uniform across the entire simulation period).

    • Time-varying: volume_fluxes=[1000.0, 1500.0, 2000.0] (corresponds to each times entry).

  • tracer_concentrations (dict, optional) –

    Dictionary of tracer names and their concentration values. The concentration values can be either a float (constant in time) or a list of float (time-varying).

    • Constant: applies uniformly across the entire simulation period.

    • Time-varying: must match the length of times.

    Default is an empty dictionary ({}) if not provided.

    Example:

    • Constant: {“ALK”: 2000.0, “DIC”: 1900.0}

    • Time-varying: {“ALK”: [2000.0, 2050.0, 2013.3], “DIC”: [1900.0, 1920.0, 1910.2]}

    • Mixed: {“ALK”: 2000.0, “DIC”: [1900.0, 1920.0, 1910.2]}

  • fill_values (str, optional) –

    Strategy for filling missing tracer concentration values. Options:

    • ”auto” (default): automatically set values to non-zero defaults

    • ”zero”: fill missing values with 0.0

  • time_interpolation (bool, optional) – Whether to interpolate between tracer flux quantities. True to interpolate, False for step-like release. Defaults to False.

Methods

VolumeRelease.get_tracer_metadata()

Returns long names and expected units for the tracer concentrations.

Attributes

VolumeRelease.times

Time points of the release events.

VolumeRelease.fill_values

Strategy for filling missing tracer concentration values.

VolumeRelease.volume_fluxes

Volume flux(es) of the release in m³/s over time.

VolumeRelease.tracer_concentrations

Dictionary of tracer names and their concentration values.

VolumeRelease.release_type

Type of the release.

VolumeRelease.name

Unique identifier for the release.

VolumeRelease.lat

Latitude of the release location in degrees North.

VolumeRelease.lon

Longitude of the release location in degrees East.

VolumeRelease.depth

Depth of the release in meters.

VolumeRelease.hsc

Horizontal scale (standard deviation) of the release in meters.

VolumeRelease.vsc

Vertical scale (standard deviation) of the release in meters.

VolumeRelease.time_interpolation

Whether to interpolate between prescribed tracer flux quantities.