TracerPerturbation

TracerPerturbation#

class roms_tools.TracerPerturbation(*, 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.tracer_perturbation] = ReleaseType.tracer_perturbation, tracer_fluxes: dict[str, Flux | float | list[float]] = {})#

Represents a CDR release with tracer fluxes and without any volume.

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)]

  • tracer_fluxes (dict, optional) –

    Dictionary of tracer names and their flux values. The flux 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]}

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

Methods

TracerPerturbation.get_tracer_metadata()

Returns long names and expected units for the tracer fluxes.

Attributes

TracerPerturbation.times

Time points of the release events.

TracerPerturbation.tracer_fluxes

Dictionary of tracer names and their non-negative flux values.

TracerPerturbation.release_type

Type of the release.

TracerPerturbation.name

Unique identifier for the release.

TracerPerturbation.lat

Latitude of the release location in degrees North.

TracerPerturbation.lon

Longitude of the release location in degrees East.

TracerPerturbation.depth

Depth of the release in meters.

TracerPerturbation.hsc

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

TracerPerturbation.vsc

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

TracerPerturbation.time_interpolation

Whether to interpolate between prescribed tracer flux quantities.