climdata 0.1.1__tar.gz → 0.1.2__tar.gz
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-0.1.1 → climdata-0.1.2}/PKG-INFO +1 -1
- {climdata-0.1.1 → climdata-0.1.2}/climdata/__init__.py +1 -1
- {climdata-0.1.1 → climdata-0.1.2}/climdata/datasets/CMIPCloud.py +1 -0
- {climdata-0.1.1 → climdata-0.1.2}/climdata/datasets/MSWX.py +15 -6
- {climdata-0.1.1 → climdata-0.1.2}/climdata.egg-info/PKG-INFO +1 -1
- climdata-0.1.2/examples/extract_dwd_loc.ipynb +1771 -0
- {climdata-0.1.1 → climdata-0.1.2}/pyproject.toml +2 -2
- climdata-0.1.1/examples/extract_dwd_loc.ipynb +0 -2429
- {climdata-0.1.1 → climdata-0.1.2}/.editorconfig +0 -0
- {climdata-0.1.1 → climdata-0.1.2}/.github/ISSUE_TEMPLATE/bug_report.md +0 -0
- {climdata-0.1.1 → climdata-0.1.2}/.github/ISSUE_TEMPLATE/config.yml +0 -0
- {climdata-0.1.1 → climdata-0.1.2}/.github/ISSUE_TEMPLATE/feature_request.md +0 -0
- {climdata-0.1.1 → climdata-0.1.2}/.github/workflows/docs-build.yml +0 -0
- {climdata-0.1.1 → climdata-0.1.2}/.github/workflows/docs.yml +0 -0
- {climdata-0.1.1 → climdata-0.1.2}/.github/workflows/installation.yml +0 -0
- {climdata-0.1.1 → climdata-0.1.2}/.github/workflows/macos.yml +0 -0
- {climdata-0.1.1 → climdata-0.1.2}/.github/workflows/pypi.yml +0 -0
- {climdata-0.1.1 → climdata-0.1.2}/.github/workflows/ubuntu.yml +0 -0
- {climdata-0.1.1 → climdata-0.1.2}/.github/workflows/windows.yml +0 -0
- {climdata-0.1.1 → climdata-0.1.2}/.gitignore +0 -0
- {climdata-0.1.1 → climdata-0.1.2}/LICENSE +0 -0
- {climdata-0.1.1 → climdata-0.1.2}/MANIFEST.in +0 -0
- {climdata-0.1.1 → climdata-0.1.2}/README.md +0 -0
- {climdata-0.1.1 → climdata-0.1.2}/climdata/__main__.py +0 -0
- {climdata-0.1.1 → climdata-0.1.2}/climdata/conf/config.yaml +0 -0
- {climdata-0.1.1 → climdata-0.1.2}/climdata/conf/mappings/parameters.yaml +0 -0
- {climdata-0.1.1 → climdata-0.1.2}/climdata/conf/mappings/variables.yaml +0 -0
- {climdata-0.1.1 → climdata-0.1.2}/climdata/datasets/CMIPlocal.py +0 -0
- {climdata-0.1.1 → climdata-0.1.2}/climdata/datasets/DWD.py +0 -0
- {climdata-0.1.1 → climdata-0.1.2}/climdata/datasets/ERA5.py +0 -0
- {climdata-0.1.1 → climdata-0.1.2}/climdata/main.py +0 -0
- {climdata-0.1.1 → climdata-0.1.2}/climdata/utils/__init__.py +0 -0
- {climdata-0.1.1 → climdata-0.1.2}/climdata/utils/config.py +0 -0
- {climdata-0.1.1 → climdata-0.1.2}/climdata/utils/utils_download.py +0 -0
- {climdata-0.1.1 → climdata-0.1.2}/climdata.egg-info/SOURCES.txt +0 -0
- {climdata-0.1.1 → climdata-0.1.2}/climdata.egg-info/dependency_links.txt +0 -0
- {climdata-0.1.1 → climdata-0.1.2}/climdata.egg-info/entry_points.txt +0 -0
- {climdata-0.1.1 → climdata-0.1.2}/climdata.egg-info/requires.txt +0 -0
- {climdata-0.1.1 → climdata-0.1.2}/climdata.egg-info/top_level.txt +0 -0
- {climdata-0.1.1 → climdata-0.1.2}/docs/changelog.md +0 -0
- {climdata-0.1.1 → climdata-0.1.2}/docs/climdata.md +0 -0
- {climdata-0.1.1 → climdata-0.1.2}/docs/common.md +0 -0
- {climdata-0.1.1 → climdata-0.1.2}/docs/contributing.md +0 -0
- {climdata-0.1.1 → climdata-0.1.2}/docs/faq.md +0 -0
- {climdata-0.1.1 → climdata-0.1.2}/docs/index.md +0 -0
- {climdata-0.1.1 → climdata-0.1.2}/docs/installation.md +0 -0
- {climdata-0.1.1 → climdata-0.1.2}/docs/overrides/main.html +0 -0
- {climdata-0.1.1 → climdata-0.1.2}/docs/usage.md +0 -0
- {climdata-0.1.1 → climdata-0.1.2}/dwd_tas_LAT52.507_LON14.1372_1989-01-01_2020-12-31.csv +0 -0
- {climdata-0.1.1 → climdata-0.1.2}/examples/zarr_tas_data/metadata.json +0 -0
- {climdata-0.1.1 → climdata-0.1.2}/mkdocs.yml +0 -0
- {climdata-0.1.1 → climdata-0.1.2}/requirements.txt +0 -0
- {climdata-0.1.1 → climdata-0.1.2}/requirements_dev.txt +0 -0
- {climdata-0.1.1 → climdata-0.1.2}/setup.cfg +0 -0
- {climdata-0.1.1 → climdata-0.1.2}/tests/__init__.py +0 -0
- {climdata-0.1.1 → climdata-0.1.2}/tests/test_climdata.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: climdata
|
|
3
|
-
Version: 0.1.
|
|
3
|
+
Version: 0.1.2
|
|
4
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
5
|
Author-email: Kaushik Muduchuru <kaushik.reddy.m@gmail.com>
|
|
6
6
|
License: MIT License
|
|
@@ -160,6 +160,8 @@ class MSWXmirror:
|
|
|
160
160
|
local_path = os.path.join(output_dir, provider, parameter_key, f)
|
|
161
161
|
try:
|
|
162
162
|
ds = xr.open_dataset(local_path, chunks='auto', engine='netcdf4')[param_info.name]
|
|
163
|
+
# Rename DataArray to parameter_key
|
|
164
|
+
ds = ds.rename(parameter_key)
|
|
163
165
|
valid_dsets.append(ds)
|
|
164
166
|
except Exception as e:
|
|
165
167
|
print(f"Skipping file due to error: {f}\n{e}")
|
|
@@ -167,7 +169,7 @@ class MSWXmirror:
|
|
|
167
169
|
dset = xr.concat(valid_dsets, dim='time')
|
|
168
170
|
dset = dset.transpose('time', 'lat', 'lon')
|
|
169
171
|
self.dataset = self._fix_coords(dset)
|
|
170
|
-
return
|
|
172
|
+
return self.dataset
|
|
171
173
|
|
|
172
174
|
def to_zarr(self, zarr_filename):
|
|
173
175
|
if self.dataset is None:
|
|
@@ -227,10 +229,10 @@ class MSWXmirror:
|
|
|
227
229
|
ds_subset = ds.sel(lon=lon, lat=lat, method="nearest")
|
|
228
230
|
|
|
229
231
|
elif box is not None:
|
|
230
|
-
|
|
232
|
+
# Accept dict: {'lat_min': ..., 'lat_max': ..., 'lon_min': ..., 'lon_max': ...}
|
|
231
233
|
ds_subset = ds.sel(
|
|
232
|
-
lon=slice(
|
|
233
|
-
lat=slice(
|
|
234
|
+
lon=slice(box['lon_min'], box['lon_max']),
|
|
235
|
+
lat=slice(box['lat_min'], box['lat_max'])
|
|
234
236
|
)
|
|
235
237
|
|
|
236
238
|
elif shapefile is not None:
|
|
@@ -248,7 +250,8 @@ class MSWXmirror:
|
|
|
248
250
|
|
|
249
251
|
else:
|
|
250
252
|
raise ValueError("Must provide either point, box, or shapefile.")
|
|
251
|
-
|
|
253
|
+
self.dataset = ds_subset
|
|
254
|
+
self.dataset = self.dataset.to_dataset()
|
|
252
255
|
return ds_subset
|
|
253
256
|
|
|
254
257
|
def to_dataframe(self, ds=None):
|
|
@@ -287,6 +290,12 @@ class MSWXmirror:
|
|
|
287
290
|
ds.name: "value"
|
|
288
291
|
})
|
|
289
292
|
return df
|
|
293
|
+
def save_netcdf(self, filename):
|
|
294
|
+
if self.dataset is not None:
|
|
295
|
+
if "time" in self.dataset.variables:
|
|
296
|
+
self.dataset["time"].encoding.clear()
|
|
297
|
+
self.dataset.to_netcdf(filename)
|
|
298
|
+
# print(f"Saved NetCDF to {filename}")
|
|
290
299
|
|
|
291
300
|
def format(self, df):
|
|
292
301
|
"""
|
|
@@ -299,4 +308,4 @@ class MSWXmirror:
|
|
|
299
308
|
|
|
300
309
|
df = df[["latitude", "longitude", "time", "source", "variable", "value", "units"]]
|
|
301
310
|
return df
|
|
302
|
-
|
|
311
|
+
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: climdata
|
|
3
|
-
Version: 0.1.
|
|
3
|
+
Version: 0.1.2
|
|
4
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
5
|
Author-email: Kaushik Muduchuru <kaushik.reddy.m@gmail.com>
|
|
6
6
|
License: MIT License
|