tsgettoolbox.tsgettoolbox.coops

tsgettoolbox.tsgettoolbox.coops(station, date=None, begin_date=None, end_date=None, range=None, product='hourly_height', datum='NAVD', time_zone='GMT', interval='h', bin=None)

global:station::1T,6T,H,D,M:Center for Operational Oceanographic Products and Services

CO-OPS web services is at https://tidesandcurrents.noaa.gov/api/. The time zone of the returned data depends on the setting of the “time_zone” option. The default is “GMT” also known as “UTC”.

Parameters:
  • station (str) –

    A 7 character station ID, or a currents station ID.

    Station listings for various products can be viewed at https://tidesandcurrents.noaa.gov or viewed on a map at Tides & Currents Station Map

  • date (str) –

    [optional, default is None]

    The API understands several parameters related to date ranges. Date formats are pretty flexible, however the closer to ISO 8601, the better.

    The date related options are ‘begin_date’, ‘end_date’, ‘date’, and ‘range’. They can be combined in the following 5 ways, but if conflicting then follows the table in order. For example, the ‘date’ option will be used if present regardless of any other option, then ‘range’, …etc.:

    Parameter Name(s)

    Description

    date

    ’latest’, ‘today’, or ‘recent’

    range

    Specify a number of hours to go back from now and retrieve data for that date range

    begin_date and range

    Specify a begin date and a number of hours to retrieve data starting from that date

    begin_date and end_date

    Specify the date/time range of retrieval

    end_date and range

    Specify an end date and a number of hours to retrieve data ending at that date

    Description of “–date” option

    Option

    Today’s data

    –date=’today’

    The last 3 days of data

    –date=’recent’

    The last data point available within the last 18 minutes.

    –date=’latest’

  • begin_date (Optional[Timestamp]) –

    [optional, default is None]

    The beginning date for the data. See explanation with the ‘date’ option on how to use all of the date related parameters.

  • end_date (Optional[Timestamp]) –

    [optional, default is None]

    The end date for the data. January 1st, 2012 through January 2nd, 2012:

    --begin_date='20120101' --end_date='20120102'
    

    See explanation with the ‘date’ option on how to use all of the date related parameters.

  • range (Optional[int]) –

    [optional, default is None]

    Specify the number of hours to go back from now, an ‘end_date’, or forward from a ‘begin_date’.

    48 hours beginning on April 15, 2012:

    --begin_date='20120415' --range=48
    

    48 hours ending on March 17, 2012:

    --end_date='20120307' --range=48
    

    The last 24 hours from now:

    --range=24
    

    The last 3 hours from now:

    --range=3
    

    See explanation with the ‘date’ option on how to use all of the date related parameters.

  • product (Union[List[Literal['air_gap', 'air_pressure', 'air_temperature', 'conductivity', 'currents', 'currents_header', 'currents_predictions', 'daily_mean', 'high_low', 'hourly_height', 'humidity', 'monthly_mean', 'ofs_water_level', 'one_minute_water_level', 'predictions', 'salinity', 'visibility', 'water_level', 'water_temperature', 'wind']], str]) –

    [optional, default is ‘hourly_height’]

    Specify the data product.

    Water Level Data Products

    Description

    water_level

    Six minute preliminary or verified water levels, depending on availability.

    hourly_height

    Verified hourly height water level data

    high_low

    Verified high/low water level data

    daily_mean

    Verified daily mean water level data

    monthly_mean

    Verified monthly mean water level data

    one_minute_water_level

    One minute water level data

    predictions

    Water level predictions at specified intervals by the interval argument

    air_gap

    (distance between a bridge and the water’s surface)

    Meteorological Products

    Description

    air_temperature

    Air temperature

    water_temperature

    Water temperature

    wind

    Wind speed, direction, and gusts

    air_pressure

    Barometric pressure

    conductivity

    The water’s conductivity

    visibility

    Visibility from the station’s visibility sensor. A measure of atmospheric clarity.

    humidity

    Relative humidity

    salinity

    Salinity and specific gravity

datum

[optional, default is ‘NAVD’]

Specify the datum that all water levels will be reported against. Note! Datum is mandatory for all water level products and defaults to “NAVD”.

Option

Description

Restrictions

CRD

Colombia River Datum

Only available for the Columbia River

IGLD

International Great Lakes Datum

Only available for the Great Lakes

LWD

Great Lakes Low Water Datum

Only available for the Great Lakes

MHHW

Mean Higher High Water

MHW

Mean High Water

MTL

Mean Tide Level

MSL

Mean Sea Level

MLW

Mean Low Water

MLLW

Mean Lower Low Water

Subordinate tide prediction stations must use this datum

NAVD

North American Vertical Datum

Not available for all stations

STND

Station Datum

time_zone

[optional, default is ‘GMT’]

The time zone is specified as ‘gmt’, ‘lst’ or ‘lst_ldt’.

Option

Description

gmt

Greenwich Mean Time

lst

Local Standard Time. The time local to the requested station.

lst_ldt

Local Standard/Local Daylight Time. The time local to the requested station.

interval

[optional, defaults to ‘h’]

Not used for observed water level data products:

product="water_level"             # 6 minute
product="hourly_height"           # hourly
product="high_low"                # variable interval
product="daily_mean"              # daily
product="monthly_mean"            # monthly
product="one_minute_water_level"  # one minute

Interval of the predicted water level.

product=”predictions”

Description

h

Hourly water level predictions

1, 5, 6, 10, 15, 30, 60

Interval in minutes. Only these intervals are available.

hilo

High/low predictions for subordinate stations

Interval of the currents data. Defaults to 6 minute intervals.

product=”currents”

Description

h

Hourly current data

Interval of the predicted currents.

product=”currents_predictions”

Description

h

Hourly current predictions

1, 6, 10, 30, 60

Interval in minutes. Only these intervals are available.

max_slack

Current predictions of max flood/ebb

Interval of the meteorological data. Defaults to 6 minute intervals.

product=”air_temperature” product=”water_temperature” product=”wind” product=”air_pressure” product=”conductivity” product=”visibility” product=”humidity” product=”salinity”

Description

h

Hourly meteorological data

The bin number for the specified currents station Example:’–bin=4’ Will retrieve data for bin number 4. Note! If a bin is not specified for a PORTS station, the data is returned using a predefined real-time bin.