climdata 0.0.2__py2.py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of climdata might be problematic. Click here for more details.
- climdata/__init__.py +8 -0
- climdata/__main__.py +5 -0
- climdata/conf/config.yaml +23 -0
- climdata/conf/mappings/parameters.yaml +172 -0
- climdata/datasets/DWD.py +73 -0
- climdata/datasets/MSWX.py +195 -0
- climdata/main.py +56 -0
- climdata/requirements.txt +20 -0
- climdata/utils/__init__.py +0 -0
- climdata/utils/config.py +30 -0
- climdata/utils/utils_download.py +976 -0
- climdata-0.0.2.dist-info/METADATA +253 -0
- climdata-0.0.2.dist-info/RECORD +17 -0
- climdata-0.0.2.dist-info/WHEEL +6 -0
- climdata-0.0.2.dist-info/entry_points.txt +2 -0
- climdata-0.0.2.dist-info/licenses/LICENSE +22 -0
- climdata-0.0.2.dist-info/top_level.txt +1 -0
|
@@ -0,0 +1,253 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: climdata
|
|
3
|
+
Version: 0.0.2
|
|
4
|
+
Summary: This project automates the fetching and extraction of weather data from multiple sources — such as MSWX, DWD HYRAS, ERA5-Land, NASA-NEX-GDDP, and more — for a given location and time range.
|
|
5
|
+
Author-email: Kaushik Muduchuru <kaushik.reddy.m@gmail.com>
|
|
6
|
+
License: MIT License
|
|
7
|
+
Project-URL: Homepage, https://github.com/Kaushikreddym/climdata
|
|
8
|
+
Keywords: climdata
|
|
9
|
+
Classifier: Intended Audience :: Developers
|
|
10
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
11
|
+
Classifier: Natural Language :: English
|
|
12
|
+
Classifier: Programming Language :: Python :: 3.8
|
|
13
|
+
Classifier: Programming Language :: Python :: 3.9
|
|
14
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
15
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
16
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
17
|
+
Requires-Python: >=3.8
|
|
18
|
+
Description-Content-Type: text/markdown
|
|
19
|
+
License-File: LICENSE
|
|
20
|
+
Requires-Dist: xarray
|
|
21
|
+
Requires-Dist: xesmf
|
|
22
|
+
Requires-Dist: ipython
|
|
23
|
+
Requires-Dist: jupyter
|
|
24
|
+
Requires-Dist: openpyxl
|
|
25
|
+
Requires-Dist: pandas
|
|
26
|
+
Requires-Dist: geopandas
|
|
27
|
+
Requires-Dist: rioxarray
|
|
28
|
+
Requires-Dist: dask[complete]
|
|
29
|
+
Requires-Dist: xclim
|
|
30
|
+
Requires-Dist: cartopy
|
|
31
|
+
Requires-Dist: colormaps
|
|
32
|
+
Requires-Dist: h5netcdf
|
|
33
|
+
Requires-Dist: netCDF4
|
|
34
|
+
Requires-Dist: pymannkendall
|
|
35
|
+
Requires-Dist: tqdm
|
|
36
|
+
Requires-Dist: zarr
|
|
37
|
+
Requires-Dist: ipyleaflet
|
|
38
|
+
Requires-Dist: hydra-core
|
|
39
|
+
Requires-Dist: intake
|
|
40
|
+
Requires-Dist: intake-esm
|
|
41
|
+
Requires-Dist: aiohttp
|
|
42
|
+
Requires-Dist: requests
|
|
43
|
+
Requires-Dist: gcsfs
|
|
44
|
+
Requires-Dist: dask-jobqueue
|
|
45
|
+
Requires-Dist: seaborn
|
|
46
|
+
Requires-Dist: earthengine-api
|
|
47
|
+
Requires-Dist: geemap
|
|
48
|
+
Requires-Dist: xsdba
|
|
49
|
+
Requires-Dist: xclim
|
|
50
|
+
Requires-Dist: pyarrow
|
|
51
|
+
Requires-Dist: fastparquet
|
|
52
|
+
Requires-Dist: mlflow
|
|
53
|
+
Requires-Dist: scikit-learn
|
|
54
|
+
Requires-Dist: xgboost
|
|
55
|
+
Requires-Dist: optuna
|
|
56
|
+
Requires-Dist: gitpython
|
|
57
|
+
Provides-Extra: all
|
|
58
|
+
Requires-Dist: pandas; extra == "all"
|
|
59
|
+
Provides-Extra: extra
|
|
60
|
+
Requires-Dist: pandas; extra == "extra"
|
|
61
|
+
Dynamic: license-file
|
|
62
|
+
|
|
63
|
+
# climdata
|
|
64
|
+
|
|
65
|
+
|
|
66
|
+
[](https://pypi.python.org/pypi/climdata)
|
|
67
|
+
[](https://anaconda.org/conda-forge/climdata)
|
|
68
|
+
|
|
69
|
+
|
|
70
|
+
**This project automates the fetching and extraction of weather data from multiple sources — such as MSWX, DWD HYRAS, ERA5-Land, NASA-NEX-GDDP, and more — for a given location and time range.**
|
|
71
|
+
|
|
72
|
+
|
|
73
|
+
- Free software: MIT License
|
|
74
|
+
- Documentation: https://Kaushikreddym.github.io/climdata
|
|
75
|
+
|
|
76
|
+
|
|
77
|
+
## 📦 Data Sources
|
|
78
|
+
|
|
79
|
+
This project utilizes climate and weather datasets from a variety of data sources:
|
|
80
|
+
|
|
81
|
+
- **DWD Station Data**
|
|
82
|
+
Retrieved using the [DWD API](https://wetterdienst.readthedocs.io/en/latest/index.html). Provides high-resolution observational data from Germany's national meteorological service.
|
|
83
|
+
|
|
84
|
+
- **MSWX (Multi-Source Weather)**
|
|
85
|
+
Accessed via [GloH2O's Google Drive](https://www.gloh2o.org/mswx/). Combines multiple satellite and reanalysis datasets for global gridded weather variables.
|
|
86
|
+
|
|
87
|
+
- **DWD HYRAS**
|
|
88
|
+
Downloaded from the [DWD Open Data FTP Server](https://opendata.dwd.de/). Offers gridded observational data for Central Europe, useful for hydrological applications.
|
|
89
|
+
|
|
90
|
+
- **ERA5, ERA5-Land**
|
|
91
|
+
Accessed through the [Google Earth Engine](https://developers.google.com/earth-engine/datasets/catalog). Provides reanalysis datasets from ECMWF with high temporal and spatial resolution.
|
|
92
|
+
|
|
93
|
+
- **NASA NEX-GDDP**
|
|
94
|
+
Also retrieved via Earth Engine. Downscaled CMIP5/CMIP6 climate projections developed by NASA for local-scale impact assessment.
|
|
95
|
+
|
|
96
|
+
- **CMIP6**
|
|
97
|
+
Obtained using [ESGPull](https://esgf.github.io/esgf-download/) from the ESGF data nodes. Includes multi-model climate simulations following various future scenarios.
|
|
98
|
+
|
|
99
|
+
It supports:
|
|
100
|
+
✅ Automatic file download (e.g., from Google Drive or online servers)
|
|
101
|
+
✅ Flexible configuration via `config.yaml`
|
|
102
|
+
✅ Time series extraction for a user-specified latitude/longitude
|
|
103
|
+
✅ Batch processing for many locations from a CSV file
|
|
104
|
+
|
|
105
|
+
|
|
106
|
+
## 🚀 How to Run and Explore Configurations
|
|
107
|
+
|
|
108
|
+
### ✅ Run a download job with custom overrides
|
|
109
|
+
|
|
110
|
+
You can run the data download script and override any configuration value directly in the command line using [Hydra](https://hydra.cc/).
|
|
111
|
+
|
|
112
|
+
For example, to download **ERA5-Land** data for **January 1–4, 2020**, run:
|
|
113
|
+
|
|
114
|
+
```bash
|
|
115
|
+
python download_location.py dataset='era5-land' \
|
|
116
|
+
time_range.start_date='2020-01-01' \
|
|
117
|
+
time_range.end_date='2020-01-04' \
|
|
118
|
+
location.lat=52.5200 \
|
|
119
|
+
location.lon=13.4050
|
|
120
|
+
```
|
|
121
|
+
|
|
122
|
+
For downloading multiple locations from a csv file `locations.csv`, run:
|
|
123
|
+
|
|
124
|
+
```bash
|
|
125
|
+
python download_csv.py dataset='era5-land' \
|
|
126
|
+
time_range.start_date='2020-01-01' \
|
|
127
|
+
time_range.end_date='2020-01-04' \
|
|
128
|
+
```
|
|
129
|
+
|
|
130
|
+
an example `locations.csv` can be
|
|
131
|
+
|
|
132
|
+
```csv
|
|
133
|
+
lat,lon,city
|
|
134
|
+
52.5200,13.4050,berlin
|
|
135
|
+
48.1351,11.5820,munich
|
|
136
|
+
53.5511,9.9937,hamburg
|
|
137
|
+
```
|
|
138
|
+
|
|
139
|
+
**What this does:**
|
|
140
|
+
|
|
141
|
+
- `dataset='era5-land'` tells the script which dataset to use.
|
|
142
|
+
- `time_range.start_date` and `time_range.end_date` override the default dates in your YAML config.
|
|
143
|
+
- All other settings use your existing `config.yaml` in the `conf` folder.
|
|
144
|
+
|
|
145
|
+
---
|
|
146
|
+
|
|
147
|
+
### ✅ List all available datasets defined in your configuration
|
|
148
|
+
|
|
149
|
+
To see what datasets are available (without running the downloader), you can dump the **resolved configuration** and filter it using [`yq`](https://github.com/mikefarah/yq).
|
|
150
|
+
|
|
151
|
+
Run:
|
|
152
|
+
|
|
153
|
+
```bash
|
|
154
|
+
python download_location.py --cfg job | yq '.mappings | keys'
|
|
155
|
+
```
|
|
156
|
+
|
|
157
|
+
**What this does:**
|
|
158
|
+
|
|
159
|
+
- `--cfg job` tells Hydra to output the final resolved configuration and exit.
|
|
160
|
+
- `| yq '.mappings | keys'` filters the output to show only the dataset names defined under the `mappings` section.
|
|
161
|
+
|
|
162
|
+
---
|
|
163
|
+
|
|
164
|
+
### ⚡️ Tip
|
|
165
|
+
|
|
166
|
+
- Make sure `yq` is installed:
|
|
167
|
+
```bash
|
|
168
|
+
brew install yq # macOS
|
|
169
|
+
# OR
|
|
170
|
+
pip install yq
|
|
171
|
+
```
|
|
172
|
+
|
|
173
|
+
- To see available variables for a specific dataset (for example `mswx`), run:
|
|
174
|
+
```bash
|
|
175
|
+
python download_location.py --cfg job | yq '.mappings.mswx.variables | keys'
|
|
176
|
+
```
|
|
177
|
+
|
|
178
|
+
---
|
|
179
|
+
|
|
180
|
+
---
|
|
181
|
+
|
|
182
|
+
## ⚙️ **Key Features**
|
|
183
|
+
|
|
184
|
+
- **Supports multiple weather data providers**
|
|
185
|
+
- **Uses `xarray` for robust gridded data extraction**
|
|
186
|
+
- **Handles curvilinear and rectilinear grids**
|
|
187
|
+
- **Uses a Google Drive Service Account for secure downloads**
|
|
188
|
+
- **Easily reproducible runs using Hydra**
|
|
189
|
+
|
|
190
|
+
---
|
|
191
|
+
## 📡 Google Drive API Setup
|
|
192
|
+
|
|
193
|
+
This project uses the **Google Drive API** with a **Service Account** to securely download weather data files from a shared Google Drive folder.
|
|
194
|
+
|
|
195
|
+
Follow these steps to set it up correctly:
|
|
196
|
+
|
|
197
|
+
---
|
|
198
|
+
|
|
199
|
+
### ✅ 1. Create a Google Cloud Project
|
|
200
|
+
|
|
201
|
+
- Go to [Google Cloud Console](https://console.cloud.google.com/).
|
|
202
|
+
- Click **“Select Project”** → **“New Project”**.
|
|
203
|
+
- Enter a project name (e.g. `WeatherDataDownloader`).
|
|
204
|
+
- Click **“Create”**.
|
|
205
|
+
|
|
206
|
+
---
|
|
207
|
+
|
|
208
|
+
### ✅ 2. Enable the Google Drive API
|
|
209
|
+
|
|
210
|
+
- In the left sidebar, go to **APIs & Services → Library**.
|
|
211
|
+
- Search for **“Google Drive API”**.
|
|
212
|
+
- Click it, then click **“Enable”**.
|
|
213
|
+
|
|
214
|
+
---
|
|
215
|
+
|
|
216
|
+
### ✅ 3. Create a Service Account
|
|
217
|
+
|
|
218
|
+
- Go to **IAM & Admin → Service Accounts**.
|
|
219
|
+
- Click **“Create Service Account”**.
|
|
220
|
+
- Enter a name (e.g. `weather-downloader-sa`).
|
|
221
|
+
- Click **“Create and Continue”**. You can skip assigning roles for read-only Drive access.
|
|
222
|
+
- Click **“Done”** to finish.
|
|
223
|
+
|
|
224
|
+
---
|
|
225
|
+
|
|
226
|
+
### ✅ 4. Create and Download a JSON Key
|
|
227
|
+
|
|
228
|
+
- After creating the Service Account, click on its email address to open its details.
|
|
229
|
+
- Go to the **“Keys”** tab.
|
|
230
|
+
- Click **“Add Key” → “Create new key”** → choose **`JSON`** → click **“Create”**.
|
|
231
|
+
- A `.json` key file will download automatically. **Store it securely!**
|
|
232
|
+
|
|
233
|
+
### ✅ 5. Store the JSON Key Securely
|
|
234
|
+
|
|
235
|
+
- Place the downloaded `.json` key in the conf folder with the name service.json.
|
|
236
|
+
|
|
237
|
+
|
|
238
|
+
## Setup Instructions fro ERA5 api
|
|
239
|
+
|
|
240
|
+
### 1. CDS API Key Setup
|
|
241
|
+
|
|
242
|
+
1. Create a free account on the
|
|
243
|
+
[Copernicus Climate Data Store](https://cds.climate.copernicus.eu/user/register)
|
|
244
|
+
2. Once logged in, go to your [user profile](https://cds.climate.copernicus.eu/user)
|
|
245
|
+
3. Click on the "Show API key" button
|
|
246
|
+
4. Create the file `~/.cdsapirc` with the following content:
|
|
247
|
+
|
|
248
|
+
```bash
|
|
249
|
+
url: https://cds.climate.copernicus.eu/api/v2
|
|
250
|
+
key: <your-api-key-here>
|
|
251
|
+
```
|
|
252
|
+
|
|
253
|
+
5. Make sure the file has the correct permissions: `chmod 600 ~/.cdsapirc`
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
climdata/__init__.py,sha256=B1_5R81XGP5TfKeZI3HkC30QQyKPFVVNBU6baa8g2A0,225
|
|
2
|
+
climdata/__main__.py,sha256=Gn-CeD1_A0xSU8lvpuDJeniNtVgkwDpcRhxBOlrfV_w,82
|
|
3
|
+
climdata/main.py,sha256=4_tm82v6tEa1fH1IeL2IslyjiB9NWOk46A-_QcsHg64,1586
|
|
4
|
+
climdata/requirements.txt,sha256=olJJbNA402X16qOlUKY43ntycujwCE2D0jvSrHnznZw,349
|
|
5
|
+
climdata/conf/config.yaml,sha256=LL5f9CVqkltNjK3DpRcpmtCdKb9v0JdSslIvZ57KbLM,468
|
|
6
|
+
climdata/conf/mappings/parameters.yaml,sha256=3E_rB7YuGyW_7wDJNOsHx4RSbOizTzotvJes5AwAzBE,4153
|
|
7
|
+
climdata/datasets/DWD.py,sha256=DwqBBkRLE_FXyjZX38iVv3cduiO6uQc8MQaTvHQqxjA,2850
|
|
8
|
+
climdata/datasets/MSWX.py,sha256=FA9t1AjcH7D88d-wfsU0g_ZHb-bui_wli8rhSezuTnU,6882
|
|
9
|
+
climdata/utils/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
10
|
+
climdata/utils/config.py,sha256=eARrf5fTCeEJbpCxxph4yL2m_ZzKXqcShu8T-1s3twA,927
|
|
11
|
+
climdata/utils/utils_download.py,sha256=1yfxP-X6CL4oI0CwgdVcTBqOVd8UmGmgoHSENGpjZgI,33400
|
|
12
|
+
climdata-0.0.2.dist-info/licenses/LICENSE,sha256=f_3cGg8TC4V7GSbVaJo9b_hy-iY3q_ZpWq1MN2VQcnw,1076
|
|
13
|
+
climdata-0.0.2.dist-info/METADATA,sha256=en2YwpmDhoMyxyb_lTcQsp3VOvpnW0vs-QcrusEdYz4,8163
|
|
14
|
+
climdata-0.0.2.dist-info/WHEEL,sha256=JNWh1Fm1UdwIQV075glCn4MVuCRs0sotJIq-J6rbxCU,109
|
|
15
|
+
climdata-0.0.2.dist-info/entry_points.txt,sha256=tiYPawJoZiBj7lU67vNTCb3esSvx_d-lBvOffA26ouU,47
|
|
16
|
+
climdata-0.0.2.dist-info/top_level.txt,sha256=BPnAhRqg8vk580nSJDXTdLmfq6OZ_LR8eNTgrRabArw,9
|
|
17
|
+
climdata-0.0.2.dist-info/RECORD,,
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025, Kaushik Muduchuru
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
22
|
+
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
climdata
|