ocf-data-sampler 0.5.8__tar.gz → 0.5.9__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 ocf-data-sampler might be problematic. Click here for more details.
- {ocf_data_sampler-0.5.8 → ocf_data_sampler-0.5.9}/PKG-INFO +1 -1
- {ocf_data_sampler-0.5.8 → ocf_data_sampler-0.5.9}/ocf_data_sampler.egg-info/PKG-INFO +1 -1
- {ocf_data_sampler-0.5.8 → ocf_data_sampler-0.5.9}/ocf_data_sampler.egg-info/SOURCES.txt +1 -2
- {ocf_data_sampler-0.5.8 → ocf_data_sampler-0.5.9}/ocf_data_sampler.egg-info/top_level.txt +0 -1
- ocf_data_sampler-0.5.8/utils/compute_icon_mean_stddev.py +0 -72
- {ocf_data_sampler-0.5.8 → ocf_data_sampler-0.5.9}/LICENSE +0 -0
- {ocf_data_sampler-0.5.8 → ocf_data_sampler-0.5.9}/README.md +0 -0
- {ocf_data_sampler-0.5.8 → ocf_data_sampler-0.5.9}/ocf_data_sampler/__init__.py +0 -0
- {ocf_data_sampler-0.5.8 → ocf_data_sampler-0.5.9}/ocf_data_sampler/config/__init__.py +0 -0
- {ocf_data_sampler-0.5.8 → ocf_data_sampler-0.5.9}/ocf_data_sampler/config/load.py +0 -0
- {ocf_data_sampler-0.5.8 → ocf_data_sampler-0.5.9}/ocf_data_sampler/config/model.py +0 -0
- {ocf_data_sampler-0.5.8 → ocf_data_sampler-0.5.9}/ocf_data_sampler/config/save.py +0 -0
- {ocf_data_sampler-0.5.8 → ocf_data_sampler-0.5.9}/ocf_data_sampler/data/uk_gsp_locations_20220314.csv +0 -0
- {ocf_data_sampler-0.5.8 → ocf_data_sampler-0.5.9}/ocf_data_sampler/data/uk_gsp_locations_20250109.csv +0 -0
- {ocf_data_sampler-0.5.8 → ocf_data_sampler-0.5.9}/ocf_data_sampler/load/__init__.py +0 -0
- {ocf_data_sampler-0.5.8 → ocf_data_sampler-0.5.9}/ocf_data_sampler/load/gsp.py +0 -0
- {ocf_data_sampler-0.5.8 → ocf_data_sampler-0.5.9}/ocf_data_sampler/load/load_dataset.py +0 -0
- {ocf_data_sampler-0.5.8 → ocf_data_sampler-0.5.9}/ocf_data_sampler/load/nwp/__init__.py +0 -0
- {ocf_data_sampler-0.5.8 → ocf_data_sampler-0.5.9}/ocf_data_sampler/load/nwp/nwp.py +0 -0
- {ocf_data_sampler-0.5.8 → ocf_data_sampler-0.5.9}/ocf_data_sampler/load/nwp/providers/__init__.py +0 -0
- {ocf_data_sampler-0.5.8 → ocf_data_sampler-0.5.9}/ocf_data_sampler/load/nwp/providers/cloudcasting.py +0 -0
- {ocf_data_sampler-0.5.8 → ocf_data_sampler-0.5.9}/ocf_data_sampler/load/nwp/providers/ecmwf.py +0 -0
- {ocf_data_sampler-0.5.8 → ocf_data_sampler-0.5.9}/ocf_data_sampler/load/nwp/providers/gfs.py +0 -0
- {ocf_data_sampler-0.5.8 → ocf_data_sampler-0.5.9}/ocf_data_sampler/load/nwp/providers/icon.py +0 -0
- {ocf_data_sampler-0.5.8 → ocf_data_sampler-0.5.9}/ocf_data_sampler/load/nwp/providers/ukv.py +0 -0
- {ocf_data_sampler-0.5.8 → ocf_data_sampler-0.5.9}/ocf_data_sampler/load/nwp/providers/utils.py +0 -0
- {ocf_data_sampler-0.5.8 → ocf_data_sampler-0.5.9}/ocf_data_sampler/load/open_xarray_tensorstore.py +0 -0
- {ocf_data_sampler-0.5.8 → ocf_data_sampler-0.5.9}/ocf_data_sampler/load/satellite.py +0 -0
- {ocf_data_sampler-0.5.8 → ocf_data_sampler-0.5.9}/ocf_data_sampler/load/site.py +0 -0
- {ocf_data_sampler-0.5.8 → ocf_data_sampler-0.5.9}/ocf_data_sampler/load/utils.py +0 -0
- {ocf_data_sampler-0.5.8 → ocf_data_sampler-0.5.9}/ocf_data_sampler/numpy_sample/__init__.py +0 -0
- {ocf_data_sampler-0.5.8 → ocf_data_sampler-0.5.9}/ocf_data_sampler/numpy_sample/collate.py +0 -0
- {ocf_data_sampler-0.5.8 → ocf_data_sampler-0.5.9}/ocf_data_sampler/numpy_sample/common_types.py +0 -0
- {ocf_data_sampler-0.5.8 → ocf_data_sampler-0.5.9}/ocf_data_sampler/numpy_sample/datetime_features.py +0 -0
- {ocf_data_sampler-0.5.8 → ocf_data_sampler-0.5.9}/ocf_data_sampler/numpy_sample/gsp.py +0 -0
- {ocf_data_sampler-0.5.8 → ocf_data_sampler-0.5.9}/ocf_data_sampler/numpy_sample/nwp.py +0 -0
- {ocf_data_sampler-0.5.8 → ocf_data_sampler-0.5.9}/ocf_data_sampler/numpy_sample/satellite.py +0 -0
- {ocf_data_sampler-0.5.8 → ocf_data_sampler-0.5.9}/ocf_data_sampler/numpy_sample/site.py +0 -0
- {ocf_data_sampler-0.5.8 → ocf_data_sampler-0.5.9}/ocf_data_sampler/numpy_sample/sun_position.py +0 -0
- {ocf_data_sampler-0.5.8 → ocf_data_sampler-0.5.9}/ocf_data_sampler/select/__init__.py +0 -0
- {ocf_data_sampler-0.5.8 → ocf_data_sampler-0.5.9}/ocf_data_sampler/select/dropout.py +0 -0
- {ocf_data_sampler-0.5.8 → ocf_data_sampler-0.5.9}/ocf_data_sampler/select/fill_time_periods.py +0 -0
- {ocf_data_sampler-0.5.8 → ocf_data_sampler-0.5.9}/ocf_data_sampler/select/find_contiguous_time_periods.py +0 -0
- {ocf_data_sampler-0.5.8 → ocf_data_sampler-0.5.9}/ocf_data_sampler/select/geospatial.py +0 -0
- {ocf_data_sampler-0.5.8 → ocf_data_sampler-0.5.9}/ocf_data_sampler/select/location.py +0 -0
- {ocf_data_sampler-0.5.8 → ocf_data_sampler-0.5.9}/ocf_data_sampler/select/select_spatial_slice.py +0 -0
- {ocf_data_sampler-0.5.8 → ocf_data_sampler-0.5.9}/ocf_data_sampler/select/select_time_slice.py +0 -0
- {ocf_data_sampler-0.5.8 → ocf_data_sampler-0.5.9}/ocf_data_sampler/torch_datasets/datasets/__init__.py +0 -0
- {ocf_data_sampler-0.5.8 → ocf_data_sampler-0.5.9}/ocf_data_sampler/torch_datasets/datasets/pvnet_uk.py +0 -0
- {ocf_data_sampler-0.5.8 → ocf_data_sampler-0.5.9}/ocf_data_sampler/torch_datasets/datasets/site.py +0 -0
- {ocf_data_sampler-0.5.8 → ocf_data_sampler-0.5.9}/ocf_data_sampler/torch_datasets/sample/__init__.py +0 -0
- {ocf_data_sampler-0.5.8 → ocf_data_sampler-0.5.9}/ocf_data_sampler/torch_datasets/sample/base.py +0 -0
- {ocf_data_sampler-0.5.8 → ocf_data_sampler-0.5.9}/ocf_data_sampler/torch_datasets/sample/site.py +0 -0
- {ocf_data_sampler-0.5.8 → ocf_data_sampler-0.5.9}/ocf_data_sampler/torch_datasets/sample/uk_regional.py +0 -0
- {ocf_data_sampler-0.5.8 → ocf_data_sampler-0.5.9}/ocf_data_sampler/torch_datasets/utils/__init__.py +0 -0
- {ocf_data_sampler-0.5.8 → ocf_data_sampler-0.5.9}/ocf_data_sampler/torch_datasets/utils/config_normalization_values_to_dicts.py +0 -0
- {ocf_data_sampler-0.5.8 → ocf_data_sampler-0.5.9}/ocf_data_sampler/torch_datasets/utils/merge_and_fill_utils.py +0 -0
- {ocf_data_sampler-0.5.8 → ocf_data_sampler-0.5.9}/ocf_data_sampler/torch_datasets/utils/spatial_slice_for_dataset.py +0 -0
- {ocf_data_sampler-0.5.8 → ocf_data_sampler-0.5.9}/ocf_data_sampler/torch_datasets/utils/time_slice_for_dataset.py +0 -0
- {ocf_data_sampler-0.5.8 → ocf_data_sampler-0.5.9}/ocf_data_sampler/torch_datasets/utils/valid_time_periods.py +0 -0
- {ocf_data_sampler-0.5.8 → ocf_data_sampler-0.5.9}/ocf_data_sampler/torch_datasets/utils/validation_utils.py +0 -0
- {ocf_data_sampler-0.5.8 → ocf_data_sampler-0.5.9}/ocf_data_sampler/utils.py +0 -0
- {ocf_data_sampler-0.5.8 → ocf_data_sampler-0.5.9}/ocf_data_sampler.egg-info/dependency_links.txt +0 -0
- {ocf_data_sampler-0.5.8 → ocf_data_sampler-0.5.9}/ocf_data_sampler.egg-info/requires.txt +0 -0
- {ocf_data_sampler-0.5.8 → ocf_data_sampler-0.5.9}/pyproject.toml +0 -0
- {ocf_data_sampler-0.5.8 → ocf_data_sampler-0.5.9}/scripts/download_gsp_location_data.py +0 -0
- {ocf_data_sampler-0.5.8 → ocf_data_sampler-0.5.9}/scripts/refactor_site.py +0 -0
- {ocf_data_sampler-0.5.8 → ocf_data_sampler-0.5.9}/setup.cfg +0 -0
|
@@ -62,5 +62,4 @@ ocf_data_sampler/torch_datasets/utils/time_slice_for_dataset.py
|
|
|
62
62
|
ocf_data_sampler/torch_datasets/utils/valid_time_periods.py
|
|
63
63
|
ocf_data_sampler/torch_datasets/utils/validation_utils.py
|
|
64
64
|
scripts/download_gsp_location_data.py
|
|
65
|
-
scripts/refactor_site.py
|
|
66
|
-
utils/compute_icon_mean_stddev.py
|
|
65
|
+
scripts/refactor_site.py
|
|
@@ -1,72 +0,0 @@
|
|
|
1
|
-
"""Script to compute normalisation constants from NWP data."""
|
|
2
|
-
|
|
3
|
-
import argparse
|
|
4
|
-
import glob
|
|
5
|
-
import logging
|
|
6
|
-
|
|
7
|
-
import numpy as np
|
|
8
|
-
import xarray as xr
|
|
9
|
-
|
|
10
|
-
from ocf_data_sampler.load.nwp.providers.icon import open_icon_eu
|
|
11
|
-
|
|
12
|
-
# Configure logging
|
|
13
|
-
logging.basicConfig(level=logging.INFO)
|
|
14
|
-
logger = logging.getLogger(__name__)
|
|
15
|
-
|
|
16
|
-
# Add argument parser
|
|
17
|
-
parser = argparse.ArgumentParser(description="Compute normalization constants from NWP data")
|
|
18
|
-
parser.add_argument("--data-path", type=str, required=True,
|
|
19
|
-
help='Path pattern to zarr files (e.g., "/path/to/data/*.zarr.zip")')
|
|
20
|
-
parser.add_argument("--n-samples", type=int, default=2000,
|
|
21
|
-
help="Number of random samples to use (default: 2000)")
|
|
22
|
-
|
|
23
|
-
args = parser.parse_args()
|
|
24
|
-
|
|
25
|
-
zarr_files = glob.glob(args.data_path)
|
|
26
|
-
n_samples = args.n_samples
|
|
27
|
-
|
|
28
|
-
ds = open_icon_eu(zarr_files)
|
|
29
|
-
|
|
30
|
-
n_init_times = ds.sizes["init_time_utc"]
|
|
31
|
-
n_lats = ds.sizes["latitude"]
|
|
32
|
-
n_longs = ds.sizes["longitude"]
|
|
33
|
-
n_steps = ds.sizes["step"]
|
|
34
|
-
|
|
35
|
-
random_init_times = np.random.choice(n_init_times, size=n_samples, replace=True)
|
|
36
|
-
random_lats = np.random.choice(n_lats, size=n_samples, replace=True)
|
|
37
|
-
random_longs = np.random.choice(n_longs, size=n_samples, replace=True)
|
|
38
|
-
random_steps = np.random.choice(n_steps, size=n_samples, replace=True)
|
|
39
|
-
|
|
40
|
-
samples = []
|
|
41
|
-
for i in range(n_samples):
|
|
42
|
-
sample = ds.isel(init_time_utc=random_init_times[i],
|
|
43
|
-
latitude=random_lats[i],
|
|
44
|
-
longitude=random_longs[i],
|
|
45
|
-
step=random_steps[i])
|
|
46
|
-
samples.append(sample)
|
|
47
|
-
|
|
48
|
-
samples_stack = xr.concat(samples, dim="samples")
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
available_channels = samples_stack.channel.values.tolist()
|
|
52
|
-
logger.info("Available channels: %s", available_channels)
|
|
53
|
-
|
|
54
|
-
ICON_EU_MEAN = {}
|
|
55
|
-
ICON_EU_STD = {}
|
|
56
|
-
|
|
57
|
-
for var in available_channels:
|
|
58
|
-
if var not in available_channels:
|
|
59
|
-
logger.warning("Variable '%s' not found in the channel coordinate; skipping.", var)
|
|
60
|
-
continue
|
|
61
|
-
var_data = samples_stack.sel(channel=var)
|
|
62
|
-
var_mean = float(var_data.mean().compute())
|
|
63
|
-
var_std = float(var_data.std().compute())
|
|
64
|
-
|
|
65
|
-
ICON_EU_MEAN[var] = var_mean
|
|
66
|
-
ICON_EU_STD[var] = var_std
|
|
67
|
-
|
|
68
|
-
logger.info("Processed %s: mean=%.4f, std=%.4f", var, var_mean, var_std)
|
|
69
|
-
|
|
70
|
-
logger.info("\nMean values:\n%s", ICON_EU_MEAN)
|
|
71
|
-
logger.info("\nStandard deviations:\n%s", ICON_EU_STD)
|
|
72
|
-
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{ocf_data_sampler-0.5.8 → ocf_data_sampler-0.5.9}/ocf_data_sampler/load/nwp/providers/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
{ocf_data_sampler-0.5.8 → ocf_data_sampler-0.5.9}/ocf_data_sampler/load/nwp/providers/ecmwf.py
RENAMED
|
File without changes
|
{ocf_data_sampler-0.5.8 → ocf_data_sampler-0.5.9}/ocf_data_sampler/load/nwp/providers/gfs.py
RENAMED
|
File without changes
|
{ocf_data_sampler-0.5.8 → ocf_data_sampler-0.5.9}/ocf_data_sampler/load/nwp/providers/icon.py
RENAMED
|
File without changes
|
{ocf_data_sampler-0.5.8 → ocf_data_sampler-0.5.9}/ocf_data_sampler/load/nwp/providers/ukv.py
RENAMED
|
File without changes
|
{ocf_data_sampler-0.5.8 → ocf_data_sampler-0.5.9}/ocf_data_sampler/load/nwp/providers/utils.py
RENAMED
|
File without changes
|
{ocf_data_sampler-0.5.8 → ocf_data_sampler-0.5.9}/ocf_data_sampler/load/open_xarray_tensorstore.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{ocf_data_sampler-0.5.8 → ocf_data_sampler-0.5.9}/ocf_data_sampler/numpy_sample/common_types.py
RENAMED
|
File without changes
|
{ocf_data_sampler-0.5.8 → ocf_data_sampler-0.5.9}/ocf_data_sampler/numpy_sample/datetime_features.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{ocf_data_sampler-0.5.8 → ocf_data_sampler-0.5.9}/ocf_data_sampler/numpy_sample/satellite.py
RENAMED
|
File without changes
|
|
File without changes
|
{ocf_data_sampler-0.5.8 → ocf_data_sampler-0.5.9}/ocf_data_sampler/numpy_sample/sun_position.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{ocf_data_sampler-0.5.8 → ocf_data_sampler-0.5.9}/ocf_data_sampler/select/fill_time_periods.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{ocf_data_sampler-0.5.8 → ocf_data_sampler-0.5.9}/ocf_data_sampler/select/select_spatial_slice.py
RENAMED
|
File without changes
|
{ocf_data_sampler-0.5.8 → ocf_data_sampler-0.5.9}/ocf_data_sampler/select/select_time_slice.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{ocf_data_sampler-0.5.8 → ocf_data_sampler-0.5.9}/ocf_data_sampler/torch_datasets/datasets/site.py
RENAMED
|
File without changes
|
{ocf_data_sampler-0.5.8 → ocf_data_sampler-0.5.9}/ocf_data_sampler/torch_datasets/sample/__init__.py
RENAMED
|
File without changes
|
{ocf_data_sampler-0.5.8 → ocf_data_sampler-0.5.9}/ocf_data_sampler/torch_datasets/sample/base.py
RENAMED
|
File without changes
|
{ocf_data_sampler-0.5.8 → ocf_data_sampler-0.5.9}/ocf_data_sampler/torch_datasets/sample/site.py
RENAMED
|
File without changes
|
|
File without changes
|
{ocf_data_sampler-0.5.8 → ocf_data_sampler-0.5.9}/ocf_data_sampler/torch_datasets/utils/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{ocf_data_sampler-0.5.8 → ocf_data_sampler-0.5.9}/ocf_data_sampler.egg-info/dependency_links.txt
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|