ocf-data-sampler 0.2.4__py3-none-any.whl → 0.2.6__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 ocf-data-sampler might be problematic. Click here for more details.
- ocf_data_sampler/load/nwp/providers/gfs.py +1 -1
- ocf_data_sampler/load/nwp/providers/icon.py +1 -1
- ocf_data_sampler/load/utils.py +5 -0
- {ocf_data_sampler-0.2.4.dist-info → ocf_data_sampler-0.2.6.dist-info}/METADATA +1 -1
- {ocf_data_sampler-0.2.4.dist-info → ocf_data_sampler-0.2.6.dist-info}/RECORD +7 -7
- {ocf_data_sampler-0.2.4.dist-info → ocf_data_sampler-0.2.6.dist-info}/WHEEL +0 -0
- {ocf_data_sampler-0.2.4.dist-info → ocf_data_sampler-0.2.6.dist-info}/top_level.txt +0 -0
|
@@ -31,6 +31,6 @@ def open_gfs(zarr_path: str | list[str]) -> xr.DataArray:
|
|
|
31
31
|
check_time_unique_increasing(nwp.init_time_utc)
|
|
32
32
|
nwp = make_spatial_coords_increasing(nwp, x_coord="longitude", y_coord="latitude")
|
|
33
33
|
|
|
34
|
-
nwp = nwp.transpose("init_time_utc", "step", "channel", "
|
|
34
|
+
nwp = nwp.transpose("init_time_utc", "step", "channel", "longitude", "latitude")
|
|
35
35
|
|
|
36
36
|
return nwp
|
|
@@ -41,6 +41,6 @@ def open_icon_eu(zarr_path: str) -> xr.Dataset:
|
|
|
41
41
|
nwp = nwp.isel(step=slice(0, 78))
|
|
42
42
|
nwp = remove_isobaric_lelvels_from_coords(nwp)
|
|
43
43
|
nwp = nwp.to_array().rename({"variable": "channel"})
|
|
44
|
-
nwp = nwp.transpose("init_time_utc", "step", "channel", "
|
|
44
|
+
nwp = nwp.transpose("init_time_utc", "step", "channel", "longitude", "latitude")
|
|
45
45
|
nwp = make_spatial_coords_increasing(nwp, x_coord="longitude", y_coord="latitude")
|
|
46
46
|
return nwp
|
ocf_data_sampler/load/utils.py
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
"""Utility functions for working with xarray objects."""
|
|
2
2
|
|
|
3
|
+
import numpy as np
|
|
3
4
|
import pandas as pd
|
|
4
5
|
import xarray as xr
|
|
5
6
|
|
|
@@ -22,8 +23,12 @@ def make_spatial_coords_increasing(ds: xr.Dataset, x_coord: str, y_coord: str) -
|
|
|
22
23
|
# Make sure the coords are in increasing order
|
|
23
24
|
if ds[x_coord][0] > ds[x_coord][-1]:
|
|
24
25
|
ds = ds.isel({x_coord: slice(None, None, -1)})
|
|
26
|
+
# Below we the coord values so we don't have numpy array with negative strides
|
|
27
|
+
# Numpy arrays with negative strides cannot be converted to torch Tensor
|
|
28
|
+
ds[x_coord] = np.ascontiguousarray(ds[x_coord].values)
|
|
25
29
|
if ds[y_coord][0] > ds[y_coord][-1]:
|
|
26
30
|
ds = ds.isel({y_coord: slice(None, None, -1)})
|
|
31
|
+
ds[y_coord] = np.ascontiguousarray(ds[y_coord].values)
|
|
27
32
|
|
|
28
33
|
# Check the coords are all increasing now
|
|
29
34
|
if not (ds[x_coord].diff(dim=x_coord) > 0).all():
|
|
@@ -10,14 +10,14 @@ ocf_data_sampler/load/gsp.py,sha256=keB3Nv_CNK1P6pS9Kdfc8PoZXTI1_YFN-spsvEv_Ewc,
|
|
|
10
10
|
ocf_data_sampler/load/load_dataset.py,sha256=0NyDxCDfgE_esKVW3s-rZEe16WB30FQ74ClWlrIo72M,1602
|
|
11
11
|
ocf_data_sampler/load/satellite.py,sha256=E7Ln7Y60Qr1RTV-_R71YoxXQM-Ca7Y1faIo3oKB2eFk,2292
|
|
12
12
|
ocf_data_sampler/load/site.py,sha256=zOzlWk6pYZBB5daqG8URGksmDXWKrkutUvN8uALAIh8,1468
|
|
13
|
-
ocf_data_sampler/load/utils.py,sha256=
|
|
13
|
+
ocf_data_sampler/load/utils.py,sha256=sZ0-zzconcLkVQwAkCYrqKDo98Hrh5ChdiQJv5Bh91g,2040
|
|
14
14
|
ocf_data_sampler/load/nwp/__init__.py,sha256=SmcrnbygO5xtCKmGR4wtHrj-HI7nOAvnAtfuvRufBGQ,25
|
|
15
15
|
ocf_data_sampler/load/nwp/nwp.py,sha256=OUK6thsKfEcqGUj4WoxDiyqGcVwwoujePdmQRis8H8I,1076
|
|
16
16
|
ocf_data_sampler/load/nwp/providers/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
17
17
|
ocf_data_sampler/load/nwp/providers/cloudcasting.py,sha256=mGsEqo5nVGQhfIK1KC-ywLsaFKU18-UFKqQVtB8gpnw,1564
|
|
18
18
|
ocf_data_sampler/load/nwp/providers/ecmwf.py,sha256=5AzktPJgertCx6oij6aePRosPuZHGFznMxTgtkk_mgc,994
|
|
19
|
-
ocf_data_sampler/load/nwp/providers/gfs.py,sha256=
|
|
20
|
-
ocf_data_sampler/load/nwp/providers/icon.py,sha256=
|
|
19
|
+
ocf_data_sampler/load/nwp/providers/gfs.py,sha256=pPqVqZqC9eK1gKfRsvR_hB-eiQ1V9LeYB15DVJElUX0,979
|
|
20
|
+
ocf_data_sampler/load/nwp/providers/icon.py,sha256=q2ZJIKYptXFvoHzb9y3iNKSJZ0PNtnH54h2gwYbgIJ8,1569
|
|
21
21
|
ocf_data_sampler/load/nwp/providers/ukv.py,sha256=-0v8JCLH8ypz8GMXZ6Rrx-I0LoHuHO8sXFupbC1RpM0,1013
|
|
22
22
|
ocf_data_sampler/load/nwp/providers/utils.py,sha256=cJZ9JA4W_ZeTcLQ5z71w46_DJaPcW_2JMmBdjP9r3qs,835
|
|
23
23
|
ocf_data_sampler/numpy_sample/__init__.py,sha256=nY5C6CcuxiWZ_jrXRzWtN7WyKXhJImSiVTIG6Rz4B_4,401
|
|
@@ -52,7 +52,7 @@ ocf_data_sampler/torch_datasets/utils/merge_and_fill_utils.py,sha256=we7BTxRH7B7
|
|
|
52
52
|
ocf_data_sampler/torch_datasets/utils/valid_time_periods.py,sha256=xcy75cVxl0WrglnX5YUAFjXXlO2GwEBHWyqo8TDuiOA,4714
|
|
53
53
|
scripts/refactor_site.py,sha256=skzvsPP0Cn9yTKndzkilyNcGz4DZ88ctvCJ0XrBdc2A,3135
|
|
54
54
|
utils/compute_icon_mean_stddev.py,sha256=a1oWMRMnny39rV-dvu8rcx85sb4bXzPFrR1gkUr4Jpg,2296
|
|
55
|
-
ocf_data_sampler-0.2.
|
|
56
|
-
ocf_data_sampler-0.2.
|
|
57
|
-
ocf_data_sampler-0.2.
|
|
58
|
-
ocf_data_sampler-0.2.
|
|
55
|
+
ocf_data_sampler-0.2.6.dist-info/METADATA,sha256=ukSZN_SjzikTkSkCNpRHFUcE-BO6EPxSUXnUxLZUBz4,11594
|
|
56
|
+
ocf_data_sampler-0.2.6.dist-info/WHEEL,sha256=52BFRY2Up02UkjOa29eZOS2VxUrpPORXg1pkohGGUS8,91
|
|
57
|
+
ocf_data_sampler-0.2.6.dist-info/top_level.txt,sha256=LEFU4Uk-PEo72QGLAfnVZIUEm37Q8mKuMeg_Xk-p33g,31
|
|
58
|
+
ocf_data_sampler-0.2.6.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|