GClunies / noaa_coops

A Python wrapper for the NOAA CO-OPS Tides & Currents Data and Metadata APIs.
Apache License 2.0
80 stars 28 forks source link

ValueError: No Predictions data was found. Please make sure the Datum input is valid. #26

Closed mauroc closed 3 years ago

mauroc commented 3 years ago

why am I getting this message on some stations (and not others)?

Example:

st = nc.Station(8533941)
st.get_data(
    begin_date="20200101",
    end_date="20200131",
    product="predictions",
    datum="MLLW",
    units="metric",
    time_zone="gmt")
---------------------------------------------------------------------------
ValueError                                Traceback (most recent call last)
......
ValueError: No Predictions data was found. Please make sure the Datum input is valid.

This station id was obtained through a request to the metadata API with

https://api.tidesandcurrents.noaa.gov/mdapi/prod/webapi/stations.json?type=tidepredictions&greatlakes=False

I tried with different datum types.

I appreciate this may be an issue with CO-OPS API and not noa_coops , but I can't find any explanations on their site and have not gotten a response from them yet.

Is there a way to predict what stations have (or don't have) predictions by looking at the st objects without having to call the get_data method?

Thank you

GClunies commented 3 years ago

This is saying that NOAA does not have the data you requested ("predictions") for the station you specified.

You should be able to investigate what data is available for your station using something like

st = nc.Station(8533941)
print(st.metadata)

This will return a dict that should show what data is available at the station.