supermanzer / NDBC

Repository for housing Python code for fetching, parsing, and loading NDBC data into a local Python object for analysis.
MIT License
13 stars 4 forks source link

Ability to load other data besides stdmet? #19

Closed lgramer closed 3 years ago

lgramer commented 3 years ago

I began coding a little python package to download NDBC data files and parse them, when luckily I stumbled on this project. But I need ADCP (and some day, wave spectrum) data files in addition to the Standard Meteorology data. Any plans to add these?

And just to keep issues separate, another one to come in a sec (sorry about the issue clutter)...

supermanzer commented 3 years ago

Honestly the only reason the data collection is restricted to standard meteorology is that was the data I used for my research.

If you could provide a station ID that includes ADCP data I could review the corresponding data structure. Then I will evaluate how best to integrate that data into the DataBuoy class as well as a more holistic get_data method that could bundle standard meteorology, adcp, and wave spectrum data (I was looking into this but the correlation wasn't there for my work).

supermanzer commented 3 years ago

Known data packages with matching URL patterns have been added as a constant. This can be reviewed like so:

from NDBC.NDBC import DataBuoy
db = DataBuoy()
print(db.DATA_PACKAGES)

Using these identified data packages and their correct abbreviations, one can query any of the listed data sets for any data station.

n42 = DataBuoy(46042)
n42.get_data(months=(1,2), data_type='swden', datetime_index=True)

Where this data package is not available users will currently receive the "x time not available" message.