Skip to content

Commit

Permalink
renamed ship_st to ship_underwater_st
Browse files Browse the repository at this point in the history
  • Loading branch information
surgura committed Jun 5, 2024
1 parent dfe461d commit 4b065a5
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@
from parcels import FieldSet

from virtual_ship import Location, Spacetime
from virtual_ship.instruments.ship_st import simulate_ship_st
from virtual_ship.instruments.ship_underwater_st import simulate_ship_underwater_st


def test_simulate_ship_st() -> None:
def test_simulate_ship_underwater_st() -> None:
DEPTH = -2

fieldset = FieldSet.from_data(
Expand All @@ -21,7 +21,7 @@ def test_simulate_ship_st() -> None:

sample_points = [Spacetime(Location(0, 0), 0)]

simulate_ship_st(
simulate_ship_underwater_st(
fieldset=fieldset,
out_file_name="test",
depth=DEPTH,
Expand Down
4 changes: 2 additions & 2 deletions tests/test_sailship.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ def test_sailship() -> None:
{"lon": 0, "lat": 0},
)

ship_st_fieldset = FieldSet.from_data(
ship_underwater_st_fieldset = FieldSet.from_data(
{"U": 0, "V": 0, "S": 0, "T": 0},
{"lon": 0, "lat": 0},
)
Expand Down Expand Up @@ -44,7 +44,7 @@ def test_sailship() -> None:
config = VirtualShipConfiguration(
"sailship_config.json",
adcp_fieldset=adcp_fieldset,
ship_st_fieldset=ship_st_fieldset,
ship_underwater_st_fieldset=ship_underwater_st_fieldset,
ctd_fieldset=ctd_fieldset,
drifter_fieldset=drifter_fieldset,
argo_float_fieldset=argo_float_fieldset,
Expand Down
4 changes: 2 additions & 2 deletions virtual_ship/instruments/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
"""Measurement instrument that can be used with Parcels."""

from . import adcp, argo_float, ctd, drifter, ship_st
from . import adcp, argo_float, ctd, drifter, ship_underwater_st

__all__ = ["adcp", "argo_float", "ctd", "drifter", "ship_st"]
__all__ = ["adcp", "argo_float", "ctd", "drifter", "ship_underwater_st"]
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ def _sample_temperature(particle, fieldset, time):
particle.temperature = fieldset.T[time, particle.depth, particle.lat, particle.lon]


def simulate_ship_st(
def simulate_ship_underwater_st(
fieldset: FieldSet,
out_file_name: str,
depth: float,
Expand Down
12 changes: 6 additions & 6 deletions virtual_ship/sailship.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
from .instruments.argo_float import ArgoFloat, simulate_argo_floats
from .instruments.ctd import CTD, simulate_ctd
from .instruments.drifter import Drifter, simulate_drifters
from .instruments.ship_st import simulate_ship_st
from .instruments.ship_underwater_st import simulate_ship_underwater_st
from .location import Location
from .postprocess import postprocess
from .spacetime import Spacetime
Expand Down Expand Up @@ -63,7 +63,7 @@ def sailship(config: VirtualShipConfiguration):
adcps: list[Spacetime] = []

# ship st objects to be used in simulation
ship_sts: list[Spacetime] = []
ship_underwater_sts: list[Spacetime] = []

# argo float deployment locations that have been visited
argo_locations_visited: set[Location] = set()
Expand Down Expand Up @@ -193,11 +193,11 @@ def sailship(config: VirtualShipConfiguration):
)

print("Simulating onboard salinity and temperature measurements.")
simulate_ship_st(
fieldset=config.ship_st_fieldset,
out_file_name=os.path.join("results", "ship_st.zarr"),
simulate_ship_underwater_st(
fieldset=config.ship_underwater_st_fieldset,
out_file_name=os.path.join("results", "ship_underwater_st.zarr"),
depth=-2,
sample_points=ship_sts,
sample_points=ship_underwater_sts,
)

print("Simulating onboard ADCP.")
Expand Down
8 changes: 4 additions & 4 deletions virtual_ship/virtual_ship_configuration.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ class VirtualShipConfiguration:
"""Configuration of the virtual ship, initialized from a json file."""

adcp_fieldset: FieldSet
ship_st_fieldset: FieldSet
ship_underwater_st_fieldset: FieldSet
argo_float_fieldset: FieldSet
drifter_fieldset: FieldSet
ctd_fieldset: FieldSet
Expand All @@ -23,7 +23,7 @@ def __init__(
self,
json_file,
adcp_fieldset: FieldSet,
ship_st_fieldset: FieldSet,
ship_underwater_st_fieldset: FieldSet,
ctd_fieldset: FieldSet,
drifter_fieldset: FieldSet,
argo_float_fieldset: FieldSet,
Expand All @@ -33,14 +33,14 @@ def __init__(
:param json_file: Path to the JSON file to init from.
:param adcp_fieldset: Fieldset for ADCP measurements.
:param ship_st_fieldset: Fieldset for ship salinity temperature measurements.
:param ship_underwater_st_fieldset: Fieldset for ship salinity temperature measurements.
:param ctd_fieldset: Fieldset for CTD measurements.
:param drifter_fieldset: Fieldset for CTD measurements.
:param argo_float_fieldset: Fieldset for argo float measurements.
:raises ValueError: If JSON file not valid.
"""
self.adcp_fieldset = adcp_fieldset
self.ship_st_fieldset = ship_st_fieldset
self.ship_underwater_st_fieldset = ship_underwater_st_fieldset
self.ctd_fieldset = ctd_fieldset
self.drifter_fieldset = drifter_fieldset
self.argo_float_fieldset = argo_float_fieldset
Expand Down

0 comments on commit 4b065a5

Please sign in to comment.