Skip to content

Commit 15c5bb2

Browse files
authored
Merge pull request #93 from GeoOcean/53-descarga-noaa
[JTH] first working version for NOAA downloader for NDBC
2 parents 59d4f82 + 03fb473 commit 15c5bb2

File tree

5 files changed

+1226
-0
lines changed

5 files changed

+1226
-0
lines changed

bluemath_tk/downloaders/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,11 @@
1010
# Import essential functions/classes to be available at the package level.
1111
from ._base_downloaders import BaseDownloader
1212
from .copernicus.copernicus_downloader import CopernicusDownloader
13+
from .noaa.noaa_downloader import NOAADownloader
1314

1415
# Optionally, define the module's `__all__` variable to control what gets imported when using `from module import *`.
1516
__all__ = [
1617
"BaseDownloader",
1718
"CopernicusDownloader",
19+
"NOAADownloader",
1820
]
Lines changed: 115 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,115 @@
1+
{
2+
"datasets": {
3+
"buoy_data": {
4+
"name": "NOAA Buoy Data",
5+
"description": "Historical buoy measurements from NDBC",
6+
"base_url": "https://www.ndbc.noaa.gov/data",
7+
"template": {
8+
"buoy_id": null,
9+
"year": null,
10+
"data_type": "bulk_parameters"
11+
},
12+
"mandatory_fields": [
13+
"buoy_id",
14+
"year"
15+
]
16+
},
17+
"forecast_data": {
18+
"name": "NOAA GFS Forecast Data",
19+
"description": "GFS 0.25 degree forecast data",
20+
"base_url": "https://nomads.ncep.noaa.gov/dods/gfs_0p25_1hr",
21+
"template": {
22+
"date": null
23+
},
24+
"mandatory_fields": [
25+
"date"
26+
]
27+
}
28+
},
29+
"data_types": {
30+
"bulk_parameters": {
31+
"name": "bulk_parameters",
32+
"long_name": "Standard Meteorological Data",
33+
"description": "Wind, wave, temperature, and pressure measurements",
34+
"url_pattern": "historical/stdmet/{buoy_id}h{year}.txt.gz",
35+
"fallback_urls": [
36+
"view_text_file.php?filename={buoy_id}h{year}.txt.gz&dir=data/historical/stdmet/",
37+
"stdmet/{year}/{buoy_id}h{year}.txt.gz"
38+
],
39+
"dataset": "buoy_data",
40+
"file_format": "txt.gz",
41+
"columns": [
42+
"YYYY",
43+
"MM",
44+
"DD",
45+
"hh",
46+
"mm",
47+
"WD",
48+
"WSPD",
49+
"GST",
50+
"WVHT",
51+
"DPD",
52+
"APD",
53+
"MWD",
54+
"BAR",
55+
"ATMP",
56+
"WTMP",
57+
"DEWP",
58+
"VIS",
59+
"TIDE"
60+
]
61+
},
62+
"wave_spectra": {
63+
"name": "wave_spectra",
64+
"long_name": "Wave Spectral Density",
65+
"description": "Wave energy density spectra",
66+
"url_pattern": "historical/swden/{buoy_id}w{year}.txt.gz",
67+
"dataset": "buoy_data",
68+
"file_format": "txt.gz"
69+
},
70+
"directional_spectra": {
71+
"name": "directional_spectra",
72+
"long_name": "Directional Wave Spectra Coefficients",
73+
"description": "Fourier coefficients for directional wave spectra",
74+
"dataset": "buoy_data",
75+
"file_format": "txt.gz",
76+
"coefficients": {
77+
"d": {
78+
"name": "alpha1",
79+
"url_pattern": "historical/swdir/{buoy_id}d{year}.txt.gz"
80+
},
81+
"i": {
82+
"name": "alpha2",
83+
"url_pattern": "historical/swdir2/{buoy_id}i{year}.txt.gz"
84+
},
85+
"j": {
86+
"name": "r1",
87+
"url_pattern": "historical/swr1/{buoy_id}j{year}.txt.gz"
88+
},
89+
"k": {
90+
"name": "r2",
91+
"url_pattern": "historical/swr2/{buoy_id}k{year}.txt.gz"
92+
},
93+
"w": {
94+
"name": "c11",
95+
"url_pattern": "historical/swden/{buoy_id}w{year}.txt.gz"
96+
}
97+
}
98+
},
99+
"wind_forecast": {
100+
"name": "wind_forecast",
101+
"long_name": "GFS Wind Forecast",
102+
"description": "Wind speed and direction forecast from GFS model",
103+
"dataset": "forecast_data",
104+
"file_format": "netcdf",
105+
"variables": [
106+
"ugrd10m",
107+
"vgrd10m"
108+
],
109+
"output_variables": {
110+
"u10": "ugrd10m",
111+
"v10": "vgrd10m"
112+
}
113+
}
114+
}
115+
}

bluemath_tk/downloaders/noaa/__init__.py

Whitespace-only changes.

0 commit comments

Comments
 (0)