virtualship.instruments package#

Measurement instrument that can be used with Parcels.

Submodules#

virtualship.instruments.adcp module#

ADCP instrument.

virtualship.instruments.adcp.simulate_adcp(fieldset: FieldSet, out_path: str | Path, max_depth: float, min_depth: float, num_bins: int, sample_points: list[Spacetime]) None#

Use Parcels to simulate an ADCP in a fieldset.

Parameters:
  • fieldset – The fieldset to simulate the ADCP in.

  • out_path – The path to write the results to.

  • max_depth – Maximum depth the ADCP can measure.

  • min_depth – Minimum depth the ADCP can measure.

  • num_bins – How many samples to take in the complete range between max_depth and min_depth.

  • sample_points – The places and times to sample at.

virtualship.instruments.argo_float module#

Argo float instrument.

class virtualship.instruments.argo_float.ArgoFloat(spacetime: Spacetime, min_depth: float, max_depth: float, drift_depth: float, vertical_speed: float, cycle_days: float, drift_days: float)#

Bases: object

Configuration for a single Argo float.

cycle_days: float#
drift_days: float#
drift_depth: float#
max_depth: float#
min_depth: float#
spacetime: Spacetime#
vertical_speed: float#
virtualship.instruments.argo_float.simulate_argo_floats(fieldset: FieldSet, out_path: str | Path, argo_floats: list[ArgoFloat], outputdt: timedelta, endtime: datetime | None) None#

Use Parcels to simulate a set of Argo floats in a fieldset.

Parameters:
  • fieldset – The fieldset to simulate the Argo floats in.

  • out_path – The path to write the results to.

  • argo_floats – A list of Argo floats to simulate.

  • outputdt – Interval which dictates the update frequency of file output during simulation

  • endtime – Stop at this time, or if None, continue until the end of the fieldset.

virtualship.instruments.ctd module#

CTD instrument.

class virtualship.instruments.ctd.CTD(spacetime: Spacetime, min_depth: float, max_depth: float)#

Bases: object

Configuration for a single CTD.

max_depth: float#
min_depth: float#
spacetime: Spacetime#
virtualship.instruments.ctd.simulate_ctd(fieldset: FieldSet, out_path: str | Path, ctds: list[CTD], outputdt: timedelta) None#

Use Parcels to simulate a set of CTDs in a fieldset.

Parameters:
  • fieldset – The fieldset to simulate the CTDs in.

  • out_path – The path to write the results to.

  • ctds – A list of CTDs to simulate.

  • outputdt – Interval which dictates the update frequency of file output during simulation

Raises:

ValueError – Whenever provided CTDs, fieldset, are not compatible with this function.

virtualship.instruments.drifter module#

Drifter instrument.

class virtualship.instruments.drifter.Drifter(spacetime: Spacetime, depth: float, lifetime: timedelta | None)#

Bases: object

Configuration for a single Drifter.

depth: float#
lifetime: timedelta | None#
spacetime: Spacetime#
virtualship.instruments.drifter.simulate_drifters(fieldset: FieldSet, out_path: str | Path, drifters: list[Drifter], outputdt: timedelta, dt: timedelta, endtime: datetime | None = None) None#

Use Parcels to simulate a set of drifters in a fieldset.

Parameters:
  • fieldset – The fieldset to simulate the Drifters in.

  • out_path – The path to write the results to.

  • drifters – A list of drifters to simulate.

  • outputdt – Interval which dictates the update frequency of file output during simulation.

  • dt – Dt for integration.

  • endtime – Stop at this time, or if None, continue until the end of the fieldset or until all drifters ended. If this is earlier than the last drifter ended or later than the end of the fieldset, a warning will be printed.

virtualship.instruments.ship_underwater_st module#

Ship salinity and temperature.

virtualship.instruments.ship_underwater_st.simulate_ship_underwater_st(fieldset: FieldSet, out_path: str | Path, depth: float, sample_points: list[Spacetime]) None#

Use Parcels to simulate underway data, measuring salinity and temperature at the given depth along the ship track in a fieldset.

Parameters:
  • fieldset – The fieldset to simulate the sampling in.

  • out_path – The path to write the results to.

  • depth – The depth at which to measure. 0 is water surface, negative is into the water.

  • sample_points – The places and times to sample at.

virtualship.instruments.xbt module#

XBT instrument.

class virtualship.instruments.xbt.XBT(spacetime: Spacetime, min_depth: float, max_depth: float, fall_speed: float, deceleration_coefficient: float)#

Bases: object

Configuration for a single XBT.

deceleration_coefficient: float#
fall_speed: float#
max_depth: float#
min_depth: float#
spacetime: Spacetime#
virtualship.instruments.xbt.simulate_xbt(fieldset: FieldSet, out_path: str | Path, xbts: list[XBT], outputdt: timedelta) None#

Use Parcels to simulate a set of XBTs in a fieldset.

Parameters:
  • fieldset – The fieldset to simulate the XBTs in.

  • out_path – The path to write the results to.

  • xbts – A list of XBTs to simulate.

  • outputdt – Interval which dictates the update frequency of file output during simulation

Raises:

ValueError – Whenever provided XBTs, fieldset, are not compatible with this function.