Skip to Content
cwa
API reference

Marine

marine.sea

def sea(station: None = None, *, days: SeaPeriod = 2) -> tuple[SeaStation, ...]
def sea(station: str, *, days: SeaPeriod = 2) -> SeaStation
def sea(station: Sequence[str], *, days: SeaPeriod = 2) -> Mapping[str, SeaStation]

Return buoy and tide station observations from the past days.

from cwa import marine

result = marine.sea("46694A")
client.marine.sea(station: None = None, *, days: SeaPeriod = 2) -> tuple[SeaStation, ...]
client.marine.sea(station: str, *, days: SeaPeriod = 2) -> SeaStation
client.marine.sea(station: Sequence[str], *, days: SeaPeriod = 2) -> Mapping[str, SeaStation]
await async_client.marine.sea(station: None = None, *, days: SeaPeriod = 2) -> tuple[SeaStation, ...]
await async_client.marine.sea(station: str, *, days: SeaPeriod = 2) -> SeaStation
await async_client.marine.sea(station: Sequence[str], *, days: SeaPeriod = 2) -> Mapping[str, SeaStation]

marine.tides

def tides(location: None = None) -> tuple[TideForecast, ...]
def tides(location: TownshipInput) -> TideForecast
def tides(location: Sequence[TownshipInput]) -> Mapping[str | Township, TideForecast]

Return one-month tide forecasts for townships or coastal points.

from cwa import marine

result = marine.tides("花蓮縣吉安鄉")
client.marine.tides(location: None = None) -> tuple[TideForecast, ...]
client.marine.tides(location: TownshipInput) -> TideForecast
client.marine.tides(location: Sequence[TownshipInput]) -> Mapping[str | Township, TideForecast]
await async_client.marine.tides(location: None = None) -> tuple[TideForecast, ...]
await async_client.marine.tides(location: TownshipInput) -> TideForecast
await async_client.marine.tides(location: Sequence[TownshipInput]) -> Mapping[str | Township, TideForecast]

marine.SeaCurrent

layer: int
direction: Number
direction_text: Text
speed: Number

Current at one depth layer. Speed is in m/s, direction in degrees.

marine.SeaObservation

time: Time
tide_height: Number
tide_level: Text
wave_height: Number
wave_direction: Number
wave_direction_text: Text
wave_period: Number
sea_temperature: Number
air_temperature: Number
pressure: Number
wind_speed: Number
wind_scale: Number
wind_direction: Number
gust_speed: Number
currents: tuple[SeaCurrent, ...]

Sea conditions at one time.

Tide height is in metres, wave height in metres, wave period in seconds, temperatures in °C, pressure in hPa and wind speed in m/s.

marine.SeaPeriod

type SeaPeriod = Literal[2, 30]

marine.SeaStation

id: str
observations: Annotated[tuple[SeaObservation, ...], ordered(time)]

A buoy or tide station and its observations in time order.

marine.Tide

time: Time
type: str
height_twvd: Number
height_local_msl: Number
height_chart_datum: Number

A high or low tide. Heights are in centimetres.

marine.TideDay

date: Day
lunar_date: Text
tide_range: Text
tides: Annotated[tuple[Tide, ...], ordered(time)]

One day of tides. tide_range is 大, 中 or 小.

marine.TideForecast

location_id: str
name: str
township: TownshipCode
latitude: Number
longitude: Number
days: Annotated[tuple[TideDay, ...], ordered(date)]

The one-month tide forecast for a township or coastal point.

township is set when location_id is a township code.