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

Can't pull data from 2019-present #66

Open salme146 opened 3 weeks ago

salme146 commented 3 weeks ago

I'm trying to pull data from the Chesapeake City gage from 2019 - present and am having issues.

site = Station(id='8537121') df_19 = site.get_data(begin_date="20190101",end_date="20200101",product="conductivity",time_zone="gmt")


COOPSAPIError Traceback (most recent call last) Cell In[19], line 2 1 site = Station(id='8537121') ----> 2 df_19 = site.get_data(begin_date="20190101",end_date="20200101",product="conductivity",time_zone="gmt")

File ~/mambaforge/envs/pangeo/lib/python3.10/site-packages/noaa_coops/station.py:732, in Station.get_data(self, begin_date, end_date, product, datum, bin_num, interval, units, time_zone) 729 df = pd.concat([df, df_block]) 731 if df.empty: --> 732 raise COOPSAPIError( 733 f"No data returned for {product} product between " 734 f"{begin_str} and {end_str}" 735 ) 737 df.index = pd.to_datetime(df["t"]) 738 df = df.drop(columns=["t"])

COOPSAPIError: No data returned for conductivity product between 20190101 00:00 and 20200101 00:00

When I do a data inventory this is what the dates of data are:

'Water Conductivity': {'end_date': '2024-08-22 19:42', 'start_date': '2017-03-22 13:24'},

Do I have my syntax wrong? It works for 2017-2018 and 2018-2019, just nothing newer than 2019

GClunies commented 3 weeks ago

@salme146 when I check the available data products for station 8537121, I don't see 'Water Conductivity' listed

>>> from noaa_coops import Station
>>> from pprint import pprint
>>> station = Station("8537121")
>>> pprint(station.metadata["products"]["products"])
[{'name': 'Water Levels',
  'value': 'https://tidesandcurrents.noaa.gov/waterlevels.html?id=8537121'},
 {'name': 'Reports',
  'value': 'https://tidesandcurrents.noaa.gov/reports.html?id=8537121'},
 {'name': 'Tide Predictions',
  'value': 'https://tidesandcurrents.noaa.gov/noaatidepredictions.html?id=8537121'},
 {'name': 'Meteorological',
  'value': 'https://tidesandcurrents.noaa.gov/met.html?id=8537121'},
 {'name': 'PORTS',
  'value': 'https://tidesandcurrents.noaa.gov/ports/ports.html?id=8537121'},
 {'name': 'OFS',
  'value': 'https://tidesandcurrents.noaa.gov/ofs/ofs_station.html?stname=Ship '
           'John Shoal&ofs=db&stnid=8537121&subdomain=0'},
 {'name': 'Datums',
  'value': 'https://tidesandcurrents.noaa.gov/datums.html?id=8537121'},
 {'name': 'Supersceded Datums',
  'value': 'https://tidesandcurrents.noaa.gov/benchmarks.html?id=8537121&type=superseded'},
 {'name': 'Harmonic',
  'value': 'https://tidesandcurrents.noaa.gov/harcon.html?id=8537121'},
 {'name': 'Physical Oceanagraphy',
  'value': 'https://tidesandcurrents.noaa.gov/physocean.html?id=8537121'},
 {'name': 'PORT Code', 'value': 'db'},
 {'name': 'PORT Name', 'value': 'Delaware River and Bay PORTS'},
 {'name': 'OFS Code', 'value': 'db'},
 {'name': 'OFS Name', 'value': 'Delaware Bay'}]

Can you share your code that produces that error.