anemoi-datasets 0.5.6__py3-none-any.whl → 0.5.10__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.
- anemoi/datasets/__init__.py +11 -3
- anemoi/datasets/__main__.py +2 -3
- anemoi/datasets/_version.py +2 -2
- anemoi/datasets/commands/__init__.py +2 -3
- anemoi/datasets/commands/cleanup.py +9 -0
- anemoi/datasets/commands/compare.py +3 -3
- anemoi/datasets/commands/copy.py +38 -68
- anemoi/datasets/commands/create.py +20 -5
- anemoi/datasets/commands/finalise-additions.py +9 -0
- anemoi/datasets/commands/finalise.py +9 -0
- anemoi/datasets/commands/init-additions.py +9 -0
- anemoi/datasets/commands/init.py +9 -0
- anemoi/datasets/commands/inspect.py +7 -1
- anemoi/datasets/commands/load-additions.py +9 -0
- anemoi/datasets/commands/load.py +9 -0
- anemoi/datasets/commands/patch.py +9 -0
- anemoi/datasets/commands/publish.py +9 -0
- anemoi/datasets/commands/scan.py +9 -0
- anemoi/datasets/compute/__init__.py +8 -0
- anemoi/datasets/compute/recentre.py +3 -2
- anemoi/datasets/create/__init__.py +64 -48
- anemoi/datasets/create/check.py +4 -3
- anemoi/datasets/create/chunks.py +3 -2
- anemoi/datasets/create/config.py +5 -5
- anemoi/datasets/create/functions/__init__.py +22 -7
- anemoi/datasets/create/functions/filters/__init__.py +2 -1
- anemoi/datasets/create/functions/filters/empty.py +3 -2
- anemoi/datasets/create/functions/filters/noop.py +2 -2
- anemoi/datasets/create/functions/filters/pressure_level_relative_humidity_to_specific_humidity.py +3 -2
- anemoi/datasets/create/functions/filters/pressure_level_specific_humidity_to_relative_humidity.py +3 -2
- anemoi/datasets/create/functions/filters/rename.py +16 -10
- anemoi/datasets/create/functions/filters/rotate_winds.py +3 -2
- anemoi/datasets/create/functions/filters/single_level_dewpoint_to_relative_humidity.py +3 -2
- anemoi/datasets/create/functions/filters/single_level_relative_humidity_to_dewpoint.py +3 -2
- anemoi/datasets/create/functions/filters/single_level_relative_humidity_to_specific_humidity.py +2 -2
- anemoi/datasets/create/functions/filters/single_level_specific_humidity_to_relative_humidity.py +2 -2
- anemoi/datasets/create/functions/filters/speeddir_to_uv.py +3 -2
- anemoi/datasets/create/functions/filters/unrotate_winds.py +3 -2
- anemoi/datasets/create/functions/filters/uv_to_speeddir.py +3 -2
- anemoi/datasets/create/functions/sources/__init__.py +2 -2
- anemoi/datasets/create/functions/sources/accumulations.py +10 -4
- anemoi/datasets/create/functions/sources/constants.py +3 -2
- anemoi/datasets/create/functions/sources/empty.py +3 -2
- anemoi/datasets/create/functions/sources/forcings.py +3 -2
- anemoi/datasets/create/functions/sources/grib.py +2 -2
- anemoi/datasets/create/functions/sources/hindcasts.py +3 -2
- anemoi/datasets/create/functions/sources/mars.py +97 -17
- anemoi/datasets/create/functions/sources/netcdf.py +3 -2
- anemoi/datasets/create/functions/sources/opendap.py +2 -2
- anemoi/datasets/create/functions/sources/recentre.py +3 -2
- anemoi/datasets/create/functions/sources/source.py +3 -2
- anemoi/datasets/create/functions/sources/tendencies.py +3 -2
- anemoi/datasets/create/functions/sources/xarray/__init__.py +8 -2
- anemoi/datasets/create/functions/sources/xarray/coordinates.py +5 -2
- anemoi/datasets/create/functions/sources/xarray/field.py +3 -2
- anemoi/datasets/create/functions/sources/xarray/fieldlist.py +12 -2
- anemoi/datasets/create/functions/sources/xarray/flavour.py +21 -16
- anemoi/datasets/create/functions/sources/xarray/grid.py +3 -2
- anemoi/datasets/create/functions/sources/xarray/metadata.py +3 -2
- anemoi/datasets/create/functions/sources/xarray/time.py +39 -4
- anemoi/datasets/create/functions/sources/xarray/variable.py +6 -6
- anemoi/datasets/create/functions/sources/xarray_kerchunk.py +2 -2
- anemoi/datasets/create/functions/sources/xarray_zarr.py +2 -2
- anemoi/datasets/create/functions/sources/zenodo.py +2 -2
- anemoi/datasets/create/input/__init__.py +3 -17
- anemoi/datasets/create/input/action.py +3 -2
- anemoi/datasets/create/input/concat.py +3 -2
- anemoi/datasets/create/input/context.py +3 -2
- anemoi/datasets/create/input/data_sources.py +3 -2
- anemoi/datasets/create/input/empty.py +3 -2
- anemoi/datasets/create/input/filter.py +3 -2
- anemoi/datasets/create/input/function.py +3 -2
- anemoi/datasets/create/input/join.py +3 -2
- anemoi/datasets/create/input/misc.py +3 -2
- anemoi/datasets/create/input/pipe.py +3 -2
- anemoi/datasets/create/input/repeated_dates.py +3 -2
- anemoi/datasets/create/input/result.py +187 -3
- anemoi/datasets/create/input/step.py +4 -2
- anemoi/datasets/create/input/template.py +3 -2
- anemoi/datasets/create/input/trace.py +3 -2
- anemoi/datasets/create/patch.py +9 -1
- anemoi/datasets/create/persistent.py +7 -3
- anemoi/datasets/create/size.py +3 -2
- anemoi/datasets/create/statistics/__init__.py +7 -3
- anemoi/datasets/create/statistics/summary.py +3 -2
- anemoi/datasets/create/utils.py +15 -2
- anemoi/datasets/create/writer.py +3 -2
- anemoi/datasets/create/zarr.py +8 -3
- anemoi/datasets/data/__init__.py +27 -1
- anemoi/datasets/data/concat.py +5 -1
- anemoi/datasets/data/dataset.py +216 -37
- anemoi/datasets/data/debug.py +4 -1
- anemoi/datasets/data/ensemble.py +4 -1
- anemoi/datasets/data/fill_missing.py +165 -0
- anemoi/datasets/data/forwards.py +27 -2
- anemoi/datasets/data/grids.py +236 -58
- anemoi/datasets/data/indexing.py +4 -1
- anemoi/datasets/data/interpolate.py +4 -1
- anemoi/datasets/data/join.py +17 -1
- anemoi/datasets/data/masked.py +36 -10
- anemoi/datasets/data/merge.py +180 -0
- anemoi/datasets/data/misc.py +18 -3
- anemoi/datasets/data/missing.py +4 -1
- anemoi/datasets/data/rescale.py +4 -1
- anemoi/datasets/data/select.py +15 -1
- anemoi/datasets/data/statistics.py +4 -1
- anemoi/datasets/data/stores.py +70 -3
- anemoi/datasets/data/subset.py +6 -1
- anemoi/datasets/data/unchecked.py +9 -1
- anemoi/datasets/data/xy.py +20 -5
- anemoi/datasets/dates/__init__.py +9 -7
- anemoi/datasets/dates/groups.py +3 -1
- anemoi/datasets/fields.py +3 -1
- anemoi/datasets/grids.py +86 -2
- anemoi/datasets/testing.py +60 -0
- anemoi/datasets/utils/__init__.py +8 -0
- anemoi/datasets/utils/fields.py +2 -2
- {anemoi_datasets-0.5.6.dist-info → anemoi_datasets-0.5.10.dist-info}/METADATA +11 -29
- anemoi_datasets-0.5.10.dist-info/RECORD +124 -0
- {anemoi_datasets-0.5.6.dist-info → anemoi_datasets-0.5.10.dist-info}/WHEEL +1 -1
- anemoi_datasets-0.5.6.dist-info/RECORD +0 -121
- {anemoi_datasets-0.5.6.dist-info → anemoi_datasets-0.5.10.dist-info}/LICENSE +0 -0
- {anemoi_datasets-0.5.6.dist-info → anemoi_datasets-0.5.10.dist-info}/entry_points.txt +0 -0
- {anemoi_datasets-0.5.6.dist-info → anemoi_datasets-0.5.10.dist-info}/top_level.txt +0 -0
anemoi/datasets/create/check.py
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
|
-
# (C) Copyright
|
|
1
|
+
# (C) Copyright 2024 Anemoi contributors.
|
|
2
2
|
#
|
|
3
3
|
# This software is licensed under the terms of the Apache Licence Version 2.0
|
|
4
4
|
# which can be obtained at http://www.apache.org/licenses/LICENSE-2.0.
|
|
5
|
+
#
|
|
5
6
|
# In applying this licence, ECMWF does not waive the privileges and immunities
|
|
6
7
|
# granted to it by virtue of its status as an intergovernmental organisation
|
|
7
8
|
# nor does it submit to any jurisdiction.
|
|
8
|
-
|
|
9
|
+
|
|
9
10
|
|
|
10
11
|
import logging
|
|
11
12
|
import re
|
|
@@ -88,7 +89,7 @@ class DatasetName:
|
|
|
88
89
|
self.messages.append(
|
|
89
90
|
f"the dataset name {self} does not follow naming convention. "
|
|
90
91
|
"See here for details: "
|
|
91
|
-
"https://
|
|
92
|
+
"https://anemoi-registry.readthedocs.io/en/latest/naming-conventions.html"
|
|
92
93
|
)
|
|
93
94
|
|
|
94
95
|
def check_resolution(self, resolution):
|
anemoi/datasets/create/chunks.py
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
|
-
# (C) Copyright 2024
|
|
1
|
+
# (C) Copyright 2024 Anemoi contributors.
|
|
2
2
|
#
|
|
3
3
|
# This software is licensed under the terms of the Apache Licence Version 2.0
|
|
4
4
|
# which can be obtained at http://www.apache.org/licenses/LICENSE-2.0.
|
|
5
|
+
#
|
|
5
6
|
# In applying this licence, ECMWF does not waive the privileges and immunities
|
|
6
7
|
# granted to it by virtue of its status as an intergovernmental organisation
|
|
7
8
|
# nor does it submit to any jurisdiction.
|
|
8
|
-
|
|
9
|
+
|
|
9
10
|
import logging
|
|
10
11
|
import warnings
|
|
11
12
|
|
anemoi/datasets/create/config.py
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
|
-
# (C) Copyright
|
|
1
|
+
# (C) Copyright 2024 Anemoi contributors.
|
|
2
2
|
#
|
|
3
3
|
# This software is licensed under the terms of the Apache Licence Version 2.0
|
|
4
4
|
# which can be obtained at http://www.apache.org/licenses/LICENSE-2.0.
|
|
5
|
+
#
|
|
5
6
|
# In applying this licence, ECMWF does not waive the privileges and immunities
|
|
6
7
|
# granted to it by virtue of its status as an intergovernmental organisation
|
|
7
8
|
# nor does it submit to any jurisdiction.
|
|
8
|
-
|
|
9
|
+
|
|
9
10
|
import datetime
|
|
10
11
|
import logging
|
|
11
12
|
import os
|
|
@@ -214,15 +215,14 @@ def _prepare_serialisation(o):
|
|
|
214
215
|
def set_to_test_mode(cfg):
|
|
215
216
|
NUMBER_OF_DATES = 4
|
|
216
217
|
|
|
217
|
-
dates = cfg["dates"]
|
|
218
218
|
LOG.warning(f"Running in test mode. Changing the list of dates to use only {NUMBER_OF_DATES}.")
|
|
219
219
|
groups = Groups(**LoadersConfig(cfg).dates)
|
|
220
220
|
|
|
221
|
-
dates = groups.
|
|
221
|
+
dates = groups.provider.values
|
|
222
222
|
cfg["dates"] = dict(
|
|
223
223
|
start=dates[0],
|
|
224
224
|
end=dates[NUMBER_OF_DATES - 1],
|
|
225
|
-
frequency=
|
|
225
|
+
frequency=groups.provider.frequency,
|
|
226
226
|
group_by=NUMBER_OF_DATES,
|
|
227
227
|
)
|
|
228
228
|
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
# (C) Copyright
|
|
1
|
+
# (C) Copyright 2024 Anemoi contributors.
|
|
2
2
|
#
|
|
3
3
|
# This software is licensed under the terms of the Apache Licence Version 2.0
|
|
4
4
|
# which can be obtained at http://www.apache.org/licenses/LICENSE-2.0.
|
|
5
|
+
#
|
|
5
6
|
# In applying this licence, ECMWF does not waive the privileges and immunities
|
|
6
7
|
# granted to it by virtue of its status as an intergovernmental organisation
|
|
7
8
|
# nor does it submit to any jurisdiction.
|
|
8
|
-
#
|
|
9
9
|
|
|
10
10
|
|
|
11
11
|
import importlib
|
|
@@ -21,6 +21,8 @@ def assert_is_fieldlist(obj):
|
|
|
21
21
|
|
|
22
22
|
def import_function(name, kind):
|
|
23
23
|
|
|
24
|
+
from anemoi.transform.filters import filter_registry
|
|
25
|
+
|
|
24
26
|
name = name.replace("-", "_")
|
|
25
27
|
|
|
26
28
|
plugins = {}
|
|
@@ -30,8 +32,21 @@ def import_function(name, kind):
|
|
|
30
32
|
if name in plugins:
|
|
31
33
|
return plugins[name].load()
|
|
32
34
|
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
35
|
+
try:
|
|
36
|
+
module = importlib.import_module(
|
|
37
|
+
f".{kind}.{name}",
|
|
38
|
+
package=__name__,
|
|
39
|
+
)
|
|
40
|
+
return module.execute
|
|
41
|
+
except ModuleNotFoundError:
|
|
42
|
+
pass
|
|
43
|
+
|
|
44
|
+
if kind == "filters":
|
|
45
|
+
if filter_registry.lookup(name, return_none=True):
|
|
46
|
+
|
|
47
|
+
def proc(context, data, *args, **kwargs):
|
|
48
|
+
return filter_registry.create(name, *args, **kwargs)(data)
|
|
49
|
+
|
|
50
|
+
return proc
|
|
51
|
+
|
|
52
|
+
raise ValueError(f"Unknown {kind} '{name}'")
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
# (C) Copyright 2024
|
|
1
|
+
# (C) Copyright 2024 Anemoi contributors.
|
|
2
2
|
#
|
|
3
3
|
# This software is licensed under the terms of the Apache Licence Version 2.0
|
|
4
4
|
# which can be obtained at http://www.apache.org/licenses/LICENSE-2.0.
|
|
5
|
+
#
|
|
5
6
|
# In applying this licence, ECMWF does not waive the privileges and immunities
|
|
6
7
|
# granted to it by virtue of its status as an intergovernmental organisation
|
|
7
8
|
# nor does it submit to any jurisdiction.
|
|
@@ -1,11 +1,12 @@
|
|
|
1
|
-
# (C) Copyright 2024
|
|
1
|
+
# (C) Copyright 2024 Anemoi contributors.
|
|
2
2
|
#
|
|
3
3
|
# This software is licensed under the terms of the Apache Licence Version 2.0
|
|
4
4
|
# which can be obtained at http://www.apache.org/licenses/LICENSE-2.0.
|
|
5
|
+
#
|
|
5
6
|
# In applying this licence, ECMWF does not waive the privileges and immunities
|
|
6
7
|
# granted to it by virtue of its status as an intergovernmental organisation
|
|
7
8
|
# nor does it submit to any jurisdiction.
|
|
8
|
-
|
|
9
|
+
|
|
9
10
|
|
|
10
11
|
import earthkit.data as ekd
|
|
11
12
|
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
# (C) Copyright 2024
|
|
1
|
+
# (C) Copyright 2024 Anemoi contributors.
|
|
2
2
|
#
|
|
3
3
|
# This software is licensed under the terms of the Apache Licence Version 2.0
|
|
4
4
|
# which can be obtained at http://www.apache.org/licenses/LICENSE-2.0.
|
|
5
|
+
#
|
|
5
6
|
# In applying this licence, ECMWF does not waive the privileges and immunities
|
|
6
7
|
# granted to it by virtue of its status as an intergovernmental organisation
|
|
7
8
|
# nor does it submit to any jurisdiction.
|
|
8
|
-
#
|
|
9
9
|
|
|
10
10
|
|
|
11
11
|
def execute(context, input, *args, **kwargs):
|
anemoi/datasets/create/functions/filters/pressure_level_relative_humidity_to_specific_humidity.py
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
|
-
# (C) Copyright 2024
|
|
1
|
+
# (C) Copyright 2024 Anemoi contributors.
|
|
2
2
|
#
|
|
3
3
|
# This software is licensed under the terms of the Apache Licence Version 2.0
|
|
4
4
|
# which can be obtained at http://www.apache.org/licenses/LICENSE-2.0.
|
|
5
|
+
#
|
|
5
6
|
# In applying this licence, ECMWF does not waive the privileges and immunities
|
|
6
7
|
# granted to it by virtue of its status as an intergovernmental organisation
|
|
7
8
|
# nor does it submit to any jurisdiction.
|
|
8
|
-
|
|
9
|
+
|
|
9
10
|
|
|
10
11
|
from collections import defaultdict
|
|
11
12
|
|
anemoi/datasets/create/functions/filters/pressure_level_specific_humidity_to_relative_humidity.py
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
|
-
# (C) Copyright 2024
|
|
1
|
+
# (C) Copyright 2024 Anemoi contributors.
|
|
2
2
|
#
|
|
3
3
|
# This software is licensed under the terms of the Apache Licence Version 2.0
|
|
4
4
|
# which can be obtained at http://www.apache.org/licenses/LICENSE-2.0.
|
|
5
|
+
#
|
|
5
6
|
# In applying this licence, ECMWF does not waive the privileges and immunities
|
|
6
7
|
# granted to it by virtue of its status as an intergovernmental organisation
|
|
7
8
|
# nor does it submit to any jurisdiction.
|
|
8
|
-
|
|
9
|
+
|
|
9
10
|
|
|
10
11
|
from collections import defaultdict
|
|
11
12
|
|
|
@@ -1,11 +1,12 @@
|
|
|
1
|
-
# (C) Copyright 2024
|
|
1
|
+
# (C) Copyright 2024 Anemoi contributors.
|
|
2
2
|
#
|
|
3
3
|
# This software is licensed under the terms of the Apache Licence Version 2.0
|
|
4
4
|
# which can be obtained at http://www.apache.org/licenses/LICENSE-2.0.
|
|
5
|
+
#
|
|
5
6
|
# In applying this licence, ECMWF does not waive the privileges and immunities
|
|
6
7
|
# granted to it by virtue of its status as an intergovernmental organisation
|
|
7
8
|
# nor does it submit to any jurisdiction.
|
|
8
|
-
|
|
9
|
+
|
|
9
10
|
|
|
10
11
|
import re
|
|
11
12
|
|
|
@@ -24,7 +25,9 @@ class RenamedFieldMapping:
|
|
|
24
25
|
def __init__(self, field, what, renaming):
|
|
25
26
|
self.field = field
|
|
26
27
|
self.what = what
|
|
27
|
-
self.renaming =
|
|
28
|
+
self.renaming = {}
|
|
29
|
+
for k, v in renaming.items():
|
|
30
|
+
self.renaming[k] = {str(a): str(b) for a, b in v.items()}
|
|
28
31
|
|
|
29
32
|
def metadata(self, key=None, **kwargs):
|
|
30
33
|
if key is None:
|
|
@@ -51,16 +54,19 @@ class RenamedFieldFormat:
|
|
|
51
54
|
format (str): A string that defines the new name of the field.
|
|
52
55
|
"""
|
|
53
56
|
|
|
54
|
-
def __init__(self, field, format):
|
|
57
|
+
def __init__(self, field, what, format):
|
|
55
58
|
self.field = field
|
|
59
|
+
self.what = what
|
|
56
60
|
self.format = format
|
|
57
61
|
self.bits = re.findall(r"{(\w+)}", format)
|
|
58
62
|
|
|
59
|
-
def metadata(self,
|
|
60
|
-
value = self.field.metadata(
|
|
61
|
-
if
|
|
62
|
-
|
|
63
|
-
|
|
63
|
+
def metadata(self, *args, **kwargs):
|
|
64
|
+
value = self.field.metadata(*args, **kwargs)
|
|
65
|
+
if args:
|
|
66
|
+
assert len(args) == 1
|
|
67
|
+
if args[0] == self.what:
|
|
68
|
+
bits = {b: self.field.metadata(b, **kwargs) for b in self.bits}
|
|
69
|
+
return self.format.format(**bits)
|
|
64
70
|
return value
|
|
65
71
|
|
|
66
72
|
def __getattr__(self, name):
|
|
@@ -69,6 +75,6 @@ class RenamedFieldFormat:
|
|
|
69
75
|
|
|
70
76
|
def execute(context, input, what="param", **kwargs):
|
|
71
77
|
if what in kwargs and isinstance(kwargs[what], str):
|
|
72
|
-
return FieldArray([RenamedFieldFormat(fs, kwargs[what]) for fs in input])
|
|
78
|
+
return FieldArray([RenamedFieldFormat(fs, what, kwargs[what]) for fs in input])
|
|
73
79
|
|
|
74
80
|
return FieldArray([RenamedFieldMapping(fs, what, kwargs) for fs in input])
|
|
@@ -1,11 +1,12 @@
|
|
|
1
|
-
# (C) Copyright 2024
|
|
1
|
+
# (C) Copyright 2024 Anemoi contributors.
|
|
2
2
|
#
|
|
3
3
|
# This software is licensed under the terms of the Apache Licence Version 2.0
|
|
4
4
|
# which can be obtained at http://www.apache.org/licenses/LICENSE-2.0.
|
|
5
|
+
#
|
|
5
6
|
# In applying this licence, ECMWF does not waive the privileges and immunities
|
|
6
7
|
# granted to it by virtue of its status as an intergovernmental organisation
|
|
7
8
|
# nor does it submit to any jurisdiction.
|
|
8
|
-
|
|
9
|
+
|
|
9
10
|
|
|
10
11
|
from collections import defaultdict
|
|
11
12
|
|
|
@@ -1,11 +1,12 @@
|
|
|
1
|
-
# (C) Copyright 2024
|
|
1
|
+
# (C) Copyright 2024 Anemoi contributors.
|
|
2
2
|
#
|
|
3
3
|
# This software is licensed under the terms of the Apache Licence Version 2.0
|
|
4
4
|
# which can be obtained at http://www.apache.org/licenses/LICENSE-2.0.
|
|
5
|
+
#
|
|
5
6
|
# In applying this licence, ECMWF does not waive the privileges and immunities
|
|
6
7
|
# granted to it by virtue of its status as an intergovernmental organisation
|
|
7
8
|
# nor does it submit to any jurisdiction.
|
|
8
|
-
|
|
9
|
+
|
|
9
10
|
|
|
10
11
|
from collections import defaultdict
|
|
11
12
|
|
|
@@ -1,11 +1,12 @@
|
|
|
1
|
-
# (C) Copyright 2024
|
|
1
|
+
# (C) Copyright 2024 Anemoi contributors.
|
|
2
2
|
#
|
|
3
3
|
# This software is licensed under the terms of the Apache Licence Version 2.0
|
|
4
4
|
# which can be obtained at http://www.apache.org/licenses/LICENSE-2.0.
|
|
5
|
+
#
|
|
5
6
|
# In applying this licence, ECMWF does not waive the privileges and immunities
|
|
6
7
|
# granted to it by virtue of its status as an intergovernmental organisation
|
|
7
8
|
# nor does it submit to any jurisdiction.
|
|
8
|
-
|
|
9
|
+
|
|
9
10
|
|
|
10
11
|
from collections import defaultdict
|
|
11
12
|
|
anemoi/datasets/create/functions/filters/single_level_relative_humidity_to_specific_humidity.py
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
# (C) Copyright 2024
|
|
1
|
+
# (C) Copyright 2024 Anemoi contributors.
|
|
2
2
|
#
|
|
3
3
|
# This software is licensed under the terms of the Apache Licence Version 2.0
|
|
4
4
|
# which can be obtained at http://www.apache.org/licenses/LICENSE-2.0.
|
|
5
|
+
#
|
|
5
6
|
# In applying this licence, ECMWF does not waive the privileges and immunities
|
|
6
7
|
# granted to it by virtue of its status as an intergovernmental organisation
|
|
7
8
|
# nor does it submit to any jurisdiction.
|
|
8
|
-
#
|
|
9
9
|
|
|
10
10
|
|
|
11
11
|
import numpy as np
|
anemoi/datasets/create/functions/filters/single_level_specific_humidity_to_relative_humidity.py
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
# (C) Copyright 2024
|
|
1
|
+
# (C) Copyright 2024 Anemoi contributors.
|
|
2
2
|
#
|
|
3
3
|
# This software is licensed under the terms of the Apache Licence Version 2.0
|
|
4
4
|
# which can be obtained at http://www.apache.org/licenses/LICENSE-2.0.
|
|
5
|
+
#
|
|
5
6
|
# In applying this licence, ECMWF does not waive the privileges and immunities
|
|
6
7
|
# granted to it by virtue of its status as an intergovernmental organisation
|
|
7
8
|
# nor does it submit to any jurisdiction.
|
|
8
|
-
#
|
|
9
9
|
|
|
10
10
|
|
|
11
11
|
import numpy as np
|
|
@@ -1,11 +1,12 @@
|
|
|
1
|
-
# (C) Copyright 2024
|
|
1
|
+
# (C) Copyright 2024 Anemoi contributors.
|
|
2
2
|
#
|
|
3
3
|
# This software is licensed under the terms of the Apache Licence Version 2.0
|
|
4
4
|
# which can be obtained at http://www.apache.org/licenses/LICENSE-2.0.
|
|
5
|
+
#
|
|
5
6
|
# In applying this licence, ECMWF does not waive the privileges and immunities
|
|
6
7
|
# granted to it by virtue of its status as an intergovernmental organisation
|
|
7
8
|
# nor does it submit to any jurisdiction.
|
|
8
|
-
|
|
9
|
+
|
|
9
10
|
|
|
10
11
|
from collections import defaultdict
|
|
11
12
|
|
|
@@ -1,11 +1,12 @@
|
|
|
1
|
-
# (C) Copyright 2024
|
|
1
|
+
# (C) Copyright 2024 Anemoi contributors.
|
|
2
2
|
#
|
|
3
3
|
# This software is licensed under the terms of the Apache Licence Version 2.0
|
|
4
4
|
# which can be obtained at http://www.apache.org/licenses/LICENSE-2.0.
|
|
5
|
+
#
|
|
5
6
|
# In applying this licence, ECMWF does not waive the privileges and immunities
|
|
6
7
|
# granted to it by virtue of its status as an intergovernmental organisation
|
|
7
8
|
# nor does it submit to any jurisdiction.
|
|
8
|
-
|
|
9
|
+
|
|
9
10
|
|
|
10
11
|
from collections import defaultdict
|
|
11
12
|
|
|
@@ -1,11 +1,12 @@
|
|
|
1
|
-
# (C) Copyright 2024
|
|
1
|
+
# (C) Copyright 2024 Anemoi contributors.
|
|
2
2
|
#
|
|
3
3
|
# This software is licensed under the terms of the Apache Licence Version 2.0
|
|
4
4
|
# which can be obtained at http://www.apache.org/licenses/LICENSE-2.0.
|
|
5
|
+
#
|
|
5
6
|
# In applying this licence, ECMWF does not waive the privileges and immunities
|
|
6
7
|
# granted to it by virtue of its status as an intergovernmental organisation
|
|
7
8
|
# nor does it submit to any jurisdiction.
|
|
8
|
-
|
|
9
|
+
|
|
9
10
|
|
|
10
11
|
from collections import defaultdict
|
|
11
12
|
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
# (C) Copyright 2024
|
|
1
|
+
# (C) Copyright 2024 Anemoi contributors.
|
|
2
2
|
#
|
|
3
3
|
# This software is licensed under the terms of the Apache Licence Version 2.0
|
|
4
4
|
# which can be obtained at http://www.apache.org/licenses/LICENSE-2.0.
|
|
5
|
+
#
|
|
5
6
|
# In applying this licence, ECMWF does not waive the privileges and immunities
|
|
6
7
|
# granted to it by virtue of its status as an intergovernmental organisation
|
|
7
8
|
# nor does it submit to any jurisdiction.
|
|
8
|
-
#
|
|
9
9
|
|
|
10
10
|
import glob
|
|
11
11
|
import logging
|
|
@@ -1,11 +1,12 @@
|
|
|
1
|
-
# (C) Copyright 2024
|
|
1
|
+
# (C) Copyright 2024 Anemoi contributors.
|
|
2
2
|
#
|
|
3
3
|
# This software is licensed under the terms of the Apache Licence Version 2.0
|
|
4
4
|
# which can be obtained at http://www.apache.org/licenses/LICENSE-2.0.
|
|
5
|
+
#
|
|
5
6
|
# In applying this licence, ECMWF does not waive the privileges and immunities
|
|
6
7
|
# granted to it by virtue of its status as an intergovernmental organisation
|
|
7
8
|
# nor does it submit to any jurisdiction.
|
|
8
|
-
|
|
9
|
+
|
|
9
10
|
import datetime
|
|
10
11
|
import logging
|
|
11
12
|
import warnings
|
|
@@ -327,7 +328,9 @@ def _compute_accumulations(
|
|
|
327
328
|
_member(field),
|
|
328
329
|
)
|
|
329
330
|
values = field.values # optimisation
|
|
330
|
-
|
|
331
|
+
if key not in accumulations:
|
|
332
|
+
raise ValueError(f"Key not found: {key}. Is it an accumulation field?")
|
|
333
|
+
|
|
331
334
|
for a in accumulations[key]:
|
|
332
335
|
a.add(field, values)
|
|
333
336
|
|
|
@@ -370,12 +373,15 @@ def accumulations(context, dates, **request):
|
|
|
370
373
|
|
|
371
374
|
user_accumulation_period = request.pop("accumulation_period", 6)
|
|
372
375
|
|
|
376
|
+
# If `data_accumulation_period` is not set, this means that the accumulations are from the start
|
|
377
|
+
# of the forecast.
|
|
378
|
+
|
|
373
379
|
KWARGS = {
|
|
374
380
|
("od", "oper"): dict(patch=_scda),
|
|
375
381
|
("od", "elda"): dict(base_times=(6, 18)),
|
|
376
382
|
("ea", "oper"): dict(data_accumulation_period=1, base_times=(6, 18)),
|
|
377
383
|
("ea", "enda"): dict(data_accumulation_period=3, base_times=(6, 18)),
|
|
378
|
-
("rr", "oper"): dict(
|
|
384
|
+
("rr", "oper"): dict(base_times=(0, 3, 6, 9, 12, 15, 18, 21)),
|
|
379
385
|
("l5", "oper"): dict(data_accumulation_period=1, base_times=(0,)),
|
|
380
386
|
}
|
|
381
387
|
|
|
@@ -1,11 +1,12 @@
|
|
|
1
|
-
# (C) Copyright 2024
|
|
1
|
+
# (C) Copyright 2024 Anemoi contributors.
|
|
2
2
|
#
|
|
3
3
|
# This software is licensed under the terms of the Apache Licence Version 2.0
|
|
4
4
|
# which can be obtained at http://www.apache.org/licenses/LICENSE-2.0.
|
|
5
|
+
#
|
|
5
6
|
# In applying this licence, ECMWF does not waive the privileges and immunities
|
|
6
7
|
# granted to it by virtue of its status as an intergovernmental organisation
|
|
7
8
|
# nor does it submit to any jurisdiction.
|
|
8
|
-
|
|
9
|
+
|
|
9
10
|
from earthkit.data import from_source
|
|
10
11
|
|
|
11
12
|
|
|
@@ -1,11 +1,12 @@
|
|
|
1
|
-
# (C) Copyright 2024
|
|
1
|
+
# (C) Copyright 2024 Anemoi contributors.
|
|
2
2
|
#
|
|
3
3
|
# This software is licensed under the terms of the Apache Licence Version 2.0
|
|
4
4
|
# which can be obtained at http://www.apache.org/licenses/LICENSE-2.0.
|
|
5
|
+
#
|
|
5
6
|
# In applying this licence, ECMWF does not waive the privileges and immunities
|
|
6
7
|
# granted to it by virtue of its status as an intergovernmental organisation
|
|
7
8
|
# nor does it submit to any jurisdiction.
|
|
8
|
-
|
|
9
|
+
|
|
9
10
|
|
|
10
11
|
import earthkit.data as ekd
|
|
11
12
|
|
|
@@ -1,11 +1,12 @@
|
|
|
1
|
-
# (C) Copyright 2024
|
|
1
|
+
# (C) Copyright 2024 Anemoi contributors.
|
|
2
2
|
#
|
|
3
3
|
# This software is licensed under the terms of the Apache Licence Version 2.0
|
|
4
4
|
# which can be obtained at http://www.apache.org/licenses/LICENSE-2.0.
|
|
5
|
+
#
|
|
5
6
|
# In applying this licence, ECMWF does not waive the privileges and immunities
|
|
6
7
|
# granted to it by virtue of its status as an intergovernmental organisation
|
|
7
8
|
# nor does it submit to any jurisdiction.
|
|
8
|
-
|
|
9
|
+
|
|
9
10
|
from earthkit.data import from_source
|
|
10
11
|
|
|
11
12
|
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
# (C) Copyright 2024
|
|
1
|
+
# (C) Copyright 2024 Anemoi contributors.
|
|
2
2
|
#
|
|
3
3
|
# This software is licensed under the terms of the Apache Licence Version 2.0
|
|
4
4
|
# which can be obtained at http://www.apache.org/licenses/LICENSE-2.0.
|
|
5
|
+
#
|
|
5
6
|
# In applying this licence, ECMWF does not waive the privileges and immunities
|
|
6
7
|
# granted to it by virtue of its status as an intergovernmental organisation
|
|
7
8
|
# nor does it submit to any jurisdiction.
|
|
8
|
-
#
|
|
9
9
|
|
|
10
10
|
|
|
11
11
|
import glob
|
|
@@ -1,11 +1,12 @@
|
|
|
1
|
-
# (C) Copyright 2024
|
|
1
|
+
# (C) Copyright 2024 Anemoi contributors.
|
|
2
2
|
#
|
|
3
3
|
# This software is licensed under the terms of the Apache Licence Version 2.0
|
|
4
4
|
# which can be obtained at http://www.apache.org/licenses/LICENSE-2.0.
|
|
5
|
+
#
|
|
5
6
|
# In applying this licence, ECMWF does not waive the privileges and immunities
|
|
6
7
|
# granted to it by virtue of its status as an intergovernmental organisation
|
|
7
8
|
# nor does it submit to any jurisdiction.
|
|
8
|
-
|
|
9
|
+
|
|
9
10
|
import logging
|
|
10
11
|
|
|
11
12
|
from earthkit.data.core.fieldlist import MultiFieldList
|