yx21e commited on
Commit
142536c
·
verified ·
1 Parent(s): aa1d04b

Add spatial serving and HRRR downloader updates

Browse files
Files changed (1) hide show
  1. data_downloader/README.md +117 -0
data_downloader/README.md ADDED
@@ -0,0 +1,117 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Data Downloader
2
+
3
+ This directory contains a lightweight, client-facing downloader for data sources
4
+ used by FireWx-FM and planned general hazard-model work. It is intentionally a
5
+ raw-data downloader, not a model-ready dataloader. Dataset adapters and aligned
6
+ caches should be built after raw files are obtained under each provider's terms.
7
+
8
+ ## Design
9
+
10
+ The downloader follows the older `Pyhazard_data_downloader` API pattern:
11
+
12
+ ```python
13
+ from data_downloader import DownloadRequest, download_data, list_datasets
14
+ ```
15
+
16
+ Each dataset declares:
17
+
18
+ - `access`: whether it is public direct download, ArcGIS REST, auth-required, or instructions-only.
19
+ - `time_mode`: how time selection works.
20
+ - `aoi_mode`: whether bounding-box selection is native, post-processing only, or unsupported.
21
+
22
+ This avoids pretending that every source supports the same query semantics.
23
+
24
+ ## Quick Start
25
+
26
+ List datasets:
27
+
28
+ ```bash
29
+ python3 -m data_downloader.cli --list
30
+ ```
31
+
32
+ Dry-run a small client request:
33
+
34
+ ```bash
35
+ python3 -m data_downloader.cli \
36
+ --datasets aqs_pm25 hms_smoke ibtracs \
37
+ --output-root ./downloads_demo \
38
+ --start-year 2024 \
39
+ --end-year 2024 \
40
+ --dry-run \
41
+ --max-files 3 \
42
+ --report ./downloads_demo/report.json
43
+ ```
44
+
45
+ For datasets that use a bounding box, pass negative longitudes with the equals
46
+ form so the shell/argparse does not parse them as flags:
47
+
48
+ ```bash
49
+ python3 -m data_downloader.cli \
50
+ --datasets firms_area \
51
+ --output-root ./downloads_firms \
52
+ --start-date 2024-06-01 \
53
+ --end-date 2024-06-02 \
54
+ --bbox=-125,32,-114,42 \
55
+ --dry-run
56
+ ```
57
+
58
+ Python API:
59
+
60
+ ```python
61
+ from data_downloader import DownloadRequest, download_data
62
+
63
+ request = DownloadRequest(
64
+ datasets=["aqs_pm25", "hms_smoke"],
65
+ output_root="./downloads",
66
+ years=(2024, 2025),
67
+ dry_run=False,
68
+ )
69
+ results = download_data(request)
70
+ ```
71
+
72
+ Download HRRR files from the public NOAA AWS archive:
73
+
74
+ ```bash
75
+ python3 data_downloader/hrrr_downloader.py \
76
+ --start-date 2024-06-01 \
77
+ --end-date 2024-06-02 \
78
+ --hours 00,06,12,18 \
79
+ --forecast-hours 00 \
80
+ --output-root ./downloads_hrrr \
81
+ --include-idx \
82
+ --dry-run
83
+ ```
84
+
85
+ Remove `--dry-run` to download the files. The script writes
86
+ `hrrr_download_manifest.json` with every URL, output path, and download status.
87
+
88
+ ## Implemented Direct Downloads
89
+
90
+ These sources are implemented as direct public downloads:
91
+
92
+ - `aqs_pm25`: EPA AirData hourly PM2.5 files and site/monitor metadata.
93
+ - `hms_smoke`: NOAA HMS annual smoke-polygon and fire-point bundles.
94
+ - `ibtracs`: NOAA/NCEI IBTrACS v04r01 CSV tracks and documentation.
95
+ - `hurdat2`: NOAA/NHC HURDAT2 latest best-track text files and format docs.
96
+ - `usdm`: U.S. Drought Monitor weekly GIS shapefile archive.
97
+ - `hrrr_fireseason`: NOAA HRRR public S3 files for selected years, fire-season dates, hours, and product.
98
+ - `wfigs_current`: current WFIGS perimeter snapshot through ArcGIS REST.
99
+ - `landfire_static`: known LF2024 CONUS `FBFM40` and `CC` static products.
100
+
101
+ ## Credential or Terms-Limited Sources
102
+
103
+ These are intentionally not silently downloaded:
104
+
105
+ - `firms_area`: requires a NASA FIRMS `MAP_KEY`; set `FIRMS_MAP_KEY` or pass it in `extra_options`.
106
+ - `merra2`: requires NASA Earthdata/GES DISC authenticated access.
107
+ - `landscan`: governed by ORNL/LandScan provider-specific access terms.
108
+ - `wrc_housing`: provider links can redirect/change; pass an explicit URL or use the provider portal.
109
+ - `mtbs_perimeters`: heavy ArcGIS chunk pulls are available in internal Slurm scripts, but this public client records instructions first.
110
+
111
+ ## Notes for Clients
112
+
113
+ - Raw source files are not redistributed by this repository.
114
+ - The downloader writes `download_manifest.json` under each dataset output folder.
115
+ - Use `--dry-run` and `--max-files` before large requests.
116
+ - For large HRRR, GOES, MERRA-2, NWM, or full MTBS/RAVG pulls, run downloads on compute/storage infrastructure rather than a login node.
117
+ - `hrrr_downloader.py` is the direct HRRR client for custom date/hour/forecast-hour requests.