anemoi-datasets 0.5.25__py3-none-any.whl → 0.5.27__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 +1 -2
- anemoi/datasets/_version.py +16 -3
- anemoi/datasets/commands/check.py +1 -1
- anemoi/datasets/commands/copy.py +1 -2
- anemoi/datasets/commands/create.py +1 -1
- anemoi/datasets/commands/grib-index.py +1 -1
- anemoi/datasets/commands/inspect.py +27 -35
- anemoi/datasets/commands/validate.py +59 -0
- anemoi/datasets/compute/recentre.py +3 -6
- anemoi/datasets/create/__init__.py +22 -25
- anemoi/datasets/create/check.py +10 -12
- anemoi/datasets/create/chunks.py +1 -2
- anemoi/datasets/create/config.py +3 -6
- anemoi/datasets/create/filter.py +21 -24
- anemoi/datasets/create/input/__init__.py +1 -2
- anemoi/datasets/create/input/action.py +3 -5
- anemoi/datasets/create/input/concat.py +5 -8
- anemoi/datasets/create/input/context.py +3 -6
- anemoi/datasets/create/input/data_sources.py +5 -8
- anemoi/datasets/create/input/empty.py +1 -2
- anemoi/datasets/create/input/filter.py +2 -3
- anemoi/datasets/create/input/function.py +1 -2
- anemoi/datasets/create/input/join.py +4 -5
- anemoi/datasets/create/input/misc.py +4 -6
- anemoi/datasets/create/input/repeated_dates.py +13 -18
- anemoi/datasets/create/input/result.py +29 -33
- anemoi/datasets/create/input/step.py +6 -24
- anemoi/datasets/create/input/template.py +3 -4
- anemoi/datasets/create/input/trace.py +1 -1
- anemoi/datasets/create/patch.py +1 -2
- anemoi/datasets/create/persistent.py +3 -5
- anemoi/datasets/create/size.py +1 -3
- anemoi/datasets/create/sources/accumulations.py +47 -52
- anemoi/datasets/create/sources/accumulations2.py +4 -8
- anemoi/datasets/create/sources/constants.py +1 -3
- anemoi/datasets/create/sources/empty.py +1 -2
- anemoi/datasets/create/sources/fdb.py +133 -0
- anemoi/datasets/create/sources/forcings.py +1 -2
- anemoi/datasets/create/sources/grib.py +6 -10
- anemoi/datasets/create/sources/grib_index.py +13 -15
- anemoi/datasets/create/sources/hindcasts.py +2 -5
- anemoi/datasets/create/sources/legacy.py +1 -1
- anemoi/datasets/create/sources/mars.py +17 -21
- anemoi/datasets/create/sources/netcdf.py +1 -2
- anemoi/datasets/create/sources/opendap.py +1 -3
- anemoi/datasets/create/sources/patterns.py +4 -6
- anemoi/datasets/create/sources/planetary_computer.py +44 -0
- anemoi/datasets/create/sources/recentre.py +8 -11
- anemoi/datasets/create/sources/source.py +3 -6
- anemoi/datasets/create/sources/tendencies.py +2 -5
- anemoi/datasets/create/sources/xarray.py +4 -6
- anemoi/datasets/create/sources/xarray_support/__init__.py +15 -32
- anemoi/datasets/create/sources/xarray_support/coordinates.py +16 -12
- anemoi/datasets/create/sources/xarray_support/field.py +17 -16
- anemoi/datasets/create/sources/xarray_support/fieldlist.py +11 -15
- anemoi/datasets/create/sources/xarray_support/flavour.py +83 -45
- anemoi/datasets/create/sources/xarray_support/grid.py +15 -9
- anemoi/datasets/create/sources/xarray_support/metadata.py +19 -128
- anemoi/datasets/create/sources/xarray_support/patch.py +47 -6
- anemoi/datasets/create/sources/xarray_support/time.py +10 -13
- anemoi/datasets/create/sources/xarray_support/variable.py +27 -23
- anemoi/datasets/create/sources/xarray_zarr.py +1 -2
- anemoi/datasets/create/sources/zenodo.py +3 -5
- anemoi/datasets/create/statistics/__init__.py +3 -6
- anemoi/datasets/create/testing.py +2 -74
- anemoi/datasets/create/typing.py +1 -2
- anemoi/datasets/create/utils.py +1 -2
- anemoi/datasets/create/zarr.py +7 -2
- anemoi/datasets/data/__init__.py +15 -6
- anemoi/datasets/data/complement.py +52 -23
- anemoi/datasets/data/concat.py +5 -8
- anemoi/datasets/data/dataset.py +42 -47
- anemoi/datasets/data/debug.py +7 -9
- anemoi/datasets/data/ensemble.py +4 -6
- anemoi/datasets/data/fill_missing.py +7 -10
- anemoi/datasets/data/forwards.py +30 -28
- anemoi/datasets/data/grids.py +12 -16
- anemoi/datasets/data/indexing.py +9 -12
- anemoi/datasets/data/interpolate.py +7 -15
- anemoi/datasets/data/join.py +8 -12
- anemoi/datasets/data/masked.py +6 -11
- anemoi/datasets/data/merge.py +5 -9
- anemoi/datasets/data/misc.py +41 -45
- anemoi/datasets/data/missing.py +11 -16
- anemoi/datasets/data/observations/__init__.py +8 -14
- anemoi/datasets/data/padded.py +3 -5
- anemoi/datasets/data/records/backends/__init__.py +2 -2
- anemoi/datasets/data/rescale.py +5 -12
- anemoi/datasets/data/select.py +13 -16
- anemoi/datasets/data/statistics.py +4 -7
- anemoi/datasets/data/stores.py +23 -77
- anemoi/datasets/data/subset.py +8 -11
- anemoi/datasets/data/unchecked.py +7 -11
- anemoi/datasets/data/xy.py +25 -21
- anemoi/datasets/dates/__init__.py +13 -18
- anemoi/datasets/dates/groups.py +7 -10
- anemoi/datasets/grids.py +11 -12
- anemoi/datasets/testing.py +93 -7
- anemoi/datasets/validate.py +598 -0
- {anemoi_datasets-0.5.25.dist-info → anemoi_datasets-0.5.27.dist-info}/METADATA +5 -4
- anemoi_datasets-0.5.27.dist-info/RECORD +134 -0
- anemoi/datasets/create/filters/__init__.py +0 -33
- anemoi/datasets/create/filters/empty.py +0 -37
- anemoi/datasets/create/filters/legacy.py +0 -93
- anemoi/datasets/create/filters/noop.py +0 -37
- anemoi/datasets/create/filters/orog_to_z.py +0 -58
- anemoi/datasets/create/filters/pressure_level_relative_humidity_to_specific_humidity.py +0 -83
- anemoi/datasets/create/filters/pressure_level_specific_humidity_to_relative_humidity.py +0 -84
- anemoi/datasets/create/filters/rename.py +0 -205
- anemoi/datasets/create/filters/rotate_winds.py +0 -105
- anemoi/datasets/create/filters/single_level_dewpoint_to_relative_humidity.py +0 -78
- anemoi/datasets/create/filters/single_level_relative_humidity_to_dewpoint.py +0 -84
- anemoi/datasets/create/filters/single_level_relative_humidity_to_specific_humidity.py +0 -163
- anemoi/datasets/create/filters/single_level_specific_humidity_to_relative_humidity.py +0 -451
- anemoi/datasets/create/filters/speeddir_to_uv.py +0 -95
- anemoi/datasets/create/filters/sum.py +0 -68
- anemoi/datasets/create/filters/transform.py +0 -51
- anemoi/datasets/create/filters/unrotate_winds.py +0 -105
- anemoi/datasets/create/filters/uv_to_speeddir.py +0 -94
- anemoi/datasets/create/filters/wz_to_w.py +0 -98
- anemoi/datasets/utils/__init__.py +0 -8
- anemoi_datasets-0.5.25.dist-info/RECORD +0 -150
- {anemoi_datasets-0.5.25.dist-info → anemoi_datasets-0.5.27.dist-info}/WHEEL +0 -0
- {anemoi_datasets-0.5.25.dist-info → anemoi_datasets-0.5.27.dist-info}/entry_points.txt +0 -0
- {anemoi_datasets-0.5.25.dist-info → anemoi_datasets-0.5.27.dist-info}/licenses/LICENSE +0 -0
- {anemoi_datasets-0.5.25.dist-info → anemoi_datasets-0.5.27.dist-info}/top_level.txt +0 -0
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
anemoi/datasets/__init__.py,sha256=SPozLbLUFiQ9rtFVRlgeOobFUiFzj-jGo85Tt4YMJp4,1041
|
|
2
|
+
anemoi/datasets/__main__.py,sha256=ErwAqE3rBc7OaNO2JRsEOhWpB8ldjAt7BFSuRhbnlqQ,936
|
|
3
|
+
anemoi/datasets/_version.py,sha256=NpQwstz_sufQbfjY26eRaeRp1kf0fn1y-L32HfoDMIY,706
|
|
4
|
+
anemoi/datasets/check.py,sha256=hbEMUurl2IjZbp56dBgOfAEsAmmgymgRM5ySaMJSTdk,2755
|
|
5
|
+
anemoi/datasets/grids.py,sha256=04NFEcBz71n7caiimUjHhyh-1IHYoj5D-edZFHHI8dA,18157
|
|
6
|
+
anemoi/datasets/testing.py,sha256=_vUNMjuWjAm5a7qqtEASHWi-OzpIa52_lHDbqvxnhMQ,4462
|
|
7
|
+
anemoi/datasets/validate.py,sha256=Fnshpn27YwaXoSdj8-fviAtxuvUc0maGSna8U5Z08bA,18300
|
|
8
|
+
anemoi/datasets/commands/__init__.py,sha256=O5W3yHZywRoAqmRUioAr3zMCh0hGVV18wZYGvc00ioM,698
|
|
9
|
+
anemoi/datasets/commands/check.py,sha256=7iOlY3wtgkXqkNZu1_2uG_aAQMSQf2N0aJDPZOyc65c,2650
|
|
10
|
+
anemoi/datasets/commands/cleanup.py,sha256=FX082xkHKCSd8d-FUN5zDBSiKA-QYQEeUZ6dCUD-Ob8,1816
|
|
11
|
+
anemoi/datasets/commands/compare-lam.py,sha256=F5GYRsKOtdhDePhifgf1TCj5L2T8EVIA2N8AdO-AKKY,14857
|
|
12
|
+
anemoi/datasets/commands/compare.py,sha256=jzhjbbt1U-YANTVRBhrwSh2CcYgk4qX2IiTMJtcn82s,3678
|
|
13
|
+
anemoi/datasets/commands/copy.py,sha256=WuKrCSUdZeQwA1HcTQmeJzLA6gGs6BYrcvvmg00QYFM,17271
|
|
14
|
+
anemoi/datasets/commands/create.py,sha256=FIXzQ2Aw0luXRD7Wahvtc2Rbz7WRnQy4Bhom45sjltk,6544
|
|
15
|
+
anemoi/datasets/commands/finalise-additions.py,sha256=GXjGAJILFORXXkE_wfgnk5w4jYug18Q2TpwVah5Ctto,1982
|
|
16
|
+
anemoi/datasets/commands/finalise.py,sha256=cZIiqpJsaN1rqBKOStOA6pJh5n1tisrMFcGGT2UGpKY,1706
|
|
17
|
+
anemoi/datasets/commands/grib-index.py,sha256=0_cISIRw0Iwf6NX5VasxlGbPWX1p7xDMciLglS9G1Yg,3075
|
|
18
|
+
anemoi/datasets/commands/init-additions.py,sha256=wIsintXpf3aG2VhuBJJYI8ZZGXLrum7sM05IX8ImRXk,1928
|
|
19
|
+
anemoi/datasets/commands/init.py,sha256=5IKyJ_hJA4lLIbpT88XtcGzXccHLSGwSoqVSvVJGxPg,2852
|
|
20
|
+
anemoi/datasets/commands/inspect.py,sha256=mpran6kHgpGO8nK7U_MomrrsPEi_k5eaYgLSEAImFJY,26334
|
|
21
|
+
anemoi/datasets/commands/load-additions.py,sha256=bg0JYaPPXhGXKL-p0nngAeI2rPhSTFpZ7bY04mKuSKk,2001
|
|
22
|
+
anemoi/datasets/commands/load.py,sha256=FuKdRYuNlnv_p5ScwPKCiVDEVc9cA1Khvbd-T7N4SvU,2031
|
|
23
|
+
anemoi/datasets/commands/patch.py,sha256=Q9FDabWxlvK1QaeH4D9zhNpoSGB4h7EliWgcV76iFBs,1599
|
|
24
|
+
anemoi/datasets/commands/publish.py,sha256=7YusLCWYdVLuexZzvyh8ztYoBOBzVmve3uJs-XKeMAE,1469
|
|
25
|
+
anemoi/datasets/commands/scan.py,sha256=6Uoyd7WkM4ypoqmZargXIG50uRKzHE3AlvkAr7sCBy4,4262
|
|
26
|
+
anemoi/datasets/commands/validate.py,sha256=mNs29zmPV4glaOC1uPHZsSsv_SWyg1JciR76fmE1xr0,1871
|
|
27
|
+
anemoi/datasets/compute/__init__.py,sha256=hCW0QcLHJmE-C1r38P27_ZOvCLNewex5iQEtZqx2ckI,393
|
|
28
|
+
anemoi/datasets/compute/recentre.py,sha256=XEyXZIIbSpmmSfuQWikLd562Ml48VdhWHAFK6xGtbeI,5835
|
|
29
|
+
anemoi/datasets/create/__init__.py,sha256=j5WRUeQZd_3wK80WrnNiNdDGCzTvg33yMGW2FZD2xT0,50715
|
|
30
|
+
anemoi/datasets/create/check.py,sha256=w8_AhuWxqRjI1c0SdGgfFHcW5rYmBVQuyoS3ncsF9TI,10724
|
|
31
|
+
anemoi/datasets/create/chunks.py,sha256=MBEXTClQyOuYtl96ho8IqQr75hpnWbKe5Li5l6nx_48,3994
|
|
32
|
+
anemoi/datasets/create/config.py,sha256=PjdX-B6OMWrPgyrOAsv1N06PFzG0QaUXs48QJc62bJs,13312
|
|
33
|
+
anemoi/datasets/create/filter.py,sha256=EaBp3AbGERY8aFs08fZ1eioAclkc0Gy2ucQawWTolBc,1356
|
|
34
|
+
anemoi/datasets/create/patch.py,sha256=4852mUbEfM1GCUxIUq56gr6RI_lk8kuWCkG8N80OOqc,5367
|
|
35
|
+
anemoi/datasets/create/persistent.py,sha256=L8Ttk8J4rMWRYgzkFGb5QN4h0tDSizYBXNflCWoEZow,7779
|
|
36
|
+
anemoi/datasets/create/size.py,sha256=2AaD8toBkGO_l8m8UaYX5LSTS4UkU5ULdZAREXZ1JbE,1399
|
|
37
|
+
anemoi/datasets/create/source.py,sha256=xoV8uH_y6aBSE4_PWuy5w7Q7cX-tGm8e-2xC9flSAT4,1336
|
|
38
|
+
anemoi/datasets/create/testing.py,sha256=gANTsosxkUoA44azuXQ2I4lYNopDfFz_ja2oUGUzfNk,73
|
|
39
|
+
anemoi/datasets/create/typing.py,sha256=sy10Tzq6F8zd9jBe4154X60VFAhuZEweOeSo3AgGuDw,460
|
|
40
|
+
anemoi/datasets/create/utils.py,sha256=q3bjn1CTN5wytfXMkwKe1qdNpUvqzL7A7gBB22-pdtk,5543
|
|
41
|
+
anemoi/datasets/create/writer.py,sha256=nZBJvYZ63g_c9FfL65bAeG10Y6bX2R7CgtZvY0kW3fI,2203
|
|
42
|
+
anemoi/datasets/create/zarr.py,sha256=a_hqvvdiDvl3poEEic-F1LlcwCeo7SvcLLS0sGkiats,9549
|
|
43
|
+
anemoi/datasets/create/input/__init__.py,sha256=6j4kcbWNBol8Jh5o6jqtzCBxNnYFd_9eXr5-s8H8pN4,2855
|
|
44
|
+
anemoi/datasets/create/input/action.py,sha256=66I-fw4-YQrubvmUNSw3cVzTyqdc0MjjhPyjpVdEUGM,7730
|
|
45
|
+
anemoi/datasets/create/input/concat.py,sha256=n_5lyffbSa3KCnM_7YmDes88bP0ieBxfq4PjvcYfcX4,5276
|
|
46
|
+
anemoi/datasets/create/input/context.py,sha256=oczpLx7YJ5J_gY-VwCZpSGR0CV0otYfuxomxwlduWFA,2622
|
|
47
|
+
anemoi/datasets/create/input/data_sources.py,sha256=EpHnGDHj9AAicqm4VJsaULPSWzIP-hsB3KASJgvSPLY,4306
|
|
48
|
+
anemoi/datasets/create/input/empty.py,sha256=E_ZbB1q_wVUY0yKPXEHUiVtL8U2cikqbaZgJv81pZnE,1510
|
|
49
|
+
anemoi/datasets/create/input/filter.py,sha256=v_pS8-xmXz1B5O4NbdUmxfAQWNNmqtNETw-L_nVIweE,3289
|
|
50
|
+
anemoi/datasets/create/input/function.py,sha256=T5r94FfE_JYxRExtDv1pkoWzuXqZIbKVzm2aIvqo45g,6892
|
|
51
|
+
anemoi/datasets/create/input/join.py,sha256=EGLljUKtMs6cGt17ICv8s-esmt7vnZyvs-sATYA6acQ,3992
|
|
52
|
+
anemoi/datasets/create/input/misc.py,sha256=_2Y2r3o0VgNSss01AsZUh-rfQCv1hCa1KDagC9gYHZI,3292
|
|
53
|
+
anemoi/datasets/create/input/pipe.py,sha256=-tCz161IwXoI8pl1hilA9T_j5eHSr-sgbijFLp9HHNc,2083
|
|
54
|
+
anemoi/datasets/create/input/repeated_dates.py,sha256=UZeRpI93tgJr13-I4BvhS2ECbkZSM0zic5s_MfYGACs,11885
|
|
55
|
+
anemoi/datasets/create/input/result.py,sha256=0OMf9O9190JgZ3IBIpY1qbfH5Fhzzi4Uq5c0SUTG2SU,24187
|
|
56
|
+
anemoi/datasets/create/input/step.py,sha256=ikfs4TQeuNV9qAotM85C57Lu6R1WVS4n40Lps3m9b_A,5273
|
|
57
|
+
anemoi/datasets/create/input/template.py,sha256=O3IjT_GIdGaqjwG8_R35tMKZ9d4Tn6brPLH-t9MG-HU,4077
|
|
58
|
+
anemoi/datasets/create/input/trace.py,sha256=kVZI1eilg857sKRweGyyDZYb2IjT15a_KWpGCw-dtOU,3329
|
|
59
|
+
anemoi/datasets/create/sources/__init__.py,sha256=XNiiGaC6NbxnGfl6glPw-gTJASi3vsGKwVlfkMqYGk4,950
|
|
60
|
+
anemoi/datasets/create/sources/accumulations.py,sha256=6qruHy66Z3xQxy86RV9V32mKsmEsT2IT2azECUTA0Ek,32360
|
|
61
|
+
anemoi/datasets/create/sources/accumulations2.py,sha256=fOi0taVQdAvn5WFW-bNbRADhSOAfIHsPDM_cl-7n-wk,20558
|
|
62
|
+
anemoi/datasets/create/sources/anemoi_dataset.py,sha256=2xJJTmKlv87F_2ECMKeehaeW7_oWLlDcLt8C_Prp1RI,2017
|
|
63
|
+
anemoi/datasets/create/sources/constants.py,sha256=O2E1a5KKpH7ossA0B8B5mLyqeIrnEtzMuPf2yEJAP0Y,1480
|
|
64
|
+
anemoi/datasets/create/sources/eccc_fstd.py,sha256=8HK38f444HcWMvBhooP0XqTfMXYoCbN_8G9RI_Ne5rc,659
|
|
65
|
+
anemoi/datasets/create/sources/empty.py,sha256=80ld_gILTgDYAehv6yUxTYqzlWlRhCd_BJ4i3VJ7EMY,996
|
|
66
|
+
anemoi/datasets/create/sources/fdb.py,sha256=AkxvW7vZqJs2AbwYEzfkU5j3Udk4gTaGx2Pbwsa5qNk,4396
|
|
67
|
+
anemoi/datasets/create/sources/forcings.py,sha256=Ff9Cowg-ofNqk2LLfVFoKTtfzvIPjIrIO5noIb-rHhQ,1198
|
|
68
|
+
anemoi/datasets/create/sources/grib.py,sha256=-WH9_r0bKh2-ky3oXO-G0S8gkCZyGzfFNwikB4TlJZs,4151
|
|
69
|
+
anemoi/datasets/create/sources/grib_index.py,sha256=1hrFaQzfhMv8e3nloBJKtArIBVX0g_uOh-3mgrQr9UI,18965
|
|
70
|
+
anemoi/datasets/create/sources/hindcasts.py,sha256=Wp6urPyYSbq6U370kSSfOyzrTB-4cO8ZJzlRV9YBLWY,2533
|
|
71
|
+
anemoi/datasets/create/sources/legacy.py,sha256=CpUoJNE3nEOinDEIK-xiE0xmJ8XE0v04H6CpkZoEDf0,2661
|
|
72
|
+
anemoi/datasets/create/sources/mars.py,sha256=7m0gF0W3IvOx91IX6wUDTtlaCHGKySG09L7taSIFw4Q,13015
|
|
73
|
+
anemoi/datasets/create/sources/netcdf.py,sha256=apPD3wWXdJW9HIQMdyKmb4UDzd6STq5ln65v0Z0dxT0,1198
|
|
74
|
+
anemoi/datasets/create/sources/opendap.py,sha256=40uWROLwuDgb4omDpidEd8QDNMfCij3bHfjkIHu4PFo,1206
|
|
75
|
+
anemoi/datasets/create/sources/patterns.py,sha256=dLCWz7nJtqMI4v9Qytiun-iUs4Lkv-4i7pbA19hoQe8,2243
|
|
76
|
+
anemoi/datasets/create/sources/planetary_computer.py,sha256=Erk6fKJt63gj_pgbklBWhAKjzjtAfq_DRizMfWdqPPU,1578
|
|
77
|
+
anemoi/datasets/create/sources/recentre.py,sha256=shmwBbDju5oYl_eiYD2QfuVkizKcfIIimDfoUfVo8Dw,3943
|
|
78
|
+
anemoi/datasets/create/sources/source.py,sha256=i0ruqZl6F3apAdC2N2xNHj3ScGPeQLZABqtkDfIU0n8,2038
|
|
79
|
+
anemoi/datasets/create/sources/tendencies.py,sha256=ui1NCuiN4TIoMPKSCoDe07orTvqO0iGVv34KelOJIc0,5517
|
|
80
|
+
anemoi/datasets/create/sources/xarray.py,sha256=6c2Ss2I795Y3Xj9Qbr4Voiwcq7SaZFLaq1G_5lh_kAs,2491
|
|
81
|
+
anemoi/datasets/create/sources/xarray_kerchunk.py,sha256=vdFaFzze8VLjYUgIX8Lc39ELvwmgfT3ioyxBHAt4nrs,1136
|
|
82
|
+
anemoi/datasets/create/sources/xarray_zarr.py,sha256=s4XzrY0RJyHg_Ej2PR7SB-77OiD7Px15fHsffdDmJqs,1177
|
|
83
|
+
anemoi/datasets/create/sources/zenodo.py,sha256=zD7P3p_sHmXKbvBBjRqk6yoG68TDolePmS_66UIL1EQ,2017
|
|
84
|
+
anemoi/datasets/create/sources/xarray_support/README.md,sha256=56olM9Jh0vI0_bU9GI-IqbBcz4DZXWONqvdzN_VeAFE,78
|
|
85
|
+
anemoi/datasets/create/sources/xarray_support/__init__.py,sha256=o18nd8aVIwhRatYPnYNuBlLLpX6xYclbZZwD2B8sDYM,4675
|
|
86
|
+
anemoi/datasets/create/sources/xarray_support/coordinates.py,sha256=bwjRl7yWT56YlR8thypIR85Ro8iSNMkRGLgjgmbJS6Q,11055
|
|
87
|
+
anemoi/datasets/create/sources/xarray_support/field.py,sha256=EKN595kO8M6C09wMAo9QmM0-0LZ5y9NBB0bxxRirXh4,6567
|
|
88
|
+
anemoi/datasets/create/sources/xarray_support/fieldlist.py,sha256=BqLeP8ObTd3Ze7O6jsFJqX9aXD7E352vIT8ZtySv9_0,8158
|
|
89
|
+
anemoi/datasets/create/sources/xarray_support/flavour.py,sha256=5ZGnzErbfuUogcnLBfUrNcg_JCMb6vbwLnwlzaWiaV0,33302
|
|
90
|
+
anemoi/datasets/create/sources/xarray_support/grid.py,sha256=4VLpWBCkFaRErFsjW8AzY4L-xeSoMYoQhxRor3hQqs8,6496
|
|
91
|
+
anemoi/datasets/create/sources/xarray_support/metadata.py,sha256=CR9MYneZH49kJw-G1Ie2Vhevs-fliPUzKohiMfO-sWs,7838
|
|
92
|
+
anemoi/datasets/create/sources/xarray_support/patch.py,sha256=vAImOFec9_ryOX_ZGIYzeb7fSlaso1cU0hlnqipbAW4,2979
|
|
93
|
+
anemoi/datasets/create/sources/xarray_support/time.py,sha256=S-tvA5QZIMh0wQnQa51FotK9oxE8JTpUqfSYimF_Hwo,12401
|
|
94
|
+
anemoi/datasets/create/sources/xarray_support/variable.py,sha256=8Cekc5YOpZx_MNFEHMM2cE91ydjY-YBUhB7wX17wkVs,9288
|
|
95
|
+
anemoi/datasets/create/statistics/__init__.py,sha256=xe8WE7xezM6EDhRywOGRmK1c8mim1k6FhXnEw8yHnBQ,18199
|
|
96
|
+
anemoi/datasets/create/statistics/summary.py,sha256=JdtChTmsr1Y958_nka36HltTbeZkawuGbprbfZD7Ux8,4790
|
|
97
|
+
anemoi/datasets/data/__init__.py,sha256=WKWn_k4bKRUbzRO-5Mp89gV6DeuBuMb00WisD_M-ypI,3200
|
|
98
|
+
anemoi/datasets/data/complement.py,sha256=WgdKNEBp_jsOFPTAYqSudmbk2QItbKO4GWuUT-chJuU,11864
|
|
99
|
+
anemoi/datasets/data/concat.py,sha256=ArOLD7mrZUw6yzaObSzNWlMKZWH74gaYBx0AvjSCFps,8921
|
|
100
|
+
anemoi/datasets/data/dataset.py,sha256=iM4bkDZb91hqy2frJU15IfIHWvFKPerEJULAI4-mrA4,32151
|
|
101
|
+
anemoi/datasets/data/debug.css,sha256=z2X_ZDSnZ9C3pyZPWnQiEyAxuMxUaxJxET4oaCImTAQ,211
|
|
102
|
+
anemoi/datasets/data/debug.py,sha256=DUG_Rr5sYbXENSFMbtDZuG4IEwvDF-EoqF45z16tHso,10747
|
|
103
|
+
anemoi/datasets/data/ensemble.py,sha256=N_43HcgcvFmYnU3afyobjx9nZIGtb5WDTVSDXFQPwWE,5303
|
|
104
|
+
anemoi/datasets/data/fill_missing.py,sha256=Ic2icBvVnj34DpRperiyd8U_VjeI9ygIJdFzdmttK_I,8710
|
|
105
|
+
anemoi/datasets/data/forwards.py,sha256=dixet1sv_E5yUL6To2M-Z0BpzpF4-TwEw8acnb9XO4Y,20012
|
|
106
|
+
anemoi/datasets/data/grids.py,sha256=rQO17HxATY2SCUPA0NqFXdYxUcEwpJxgtBwKicn1TKo,21949
|
|
107
|
+
anemoi/datasets/data/indexing.py,sha256=5JhiRTBUrj2tOmhSmrFyugw_kOOIKOdtZnoq2Cfgj_k,7444
|
|
108
|
+
anemoi/datasets/data/interpolate.py,sha256=n1klwVIwIyBSnMtjOqPh09MkhVqO5CTCH6xYkaLVhlM,9099
|
|
109
|
+
anemoi/datasets/data/join.py,sha256=EjgnjXKNbEUVaQEMzoJ7sv63vApwhDtkcJutxhZ1H5g,9110
|
|
110
|
+
anemoi/datasets/data/masked.py,sha256=6D6ygKNddp3xc-vjxNFuT-Pfh4jwfYnCds96Y0dCTH0,10078
|
|
111
|
+
anemoi/datasets/data/merge.py,sha256=zdF7-OKouN-iE3-Km-g5MZfyARg85IepQWQrSeUsG7w,8637
|
|
112
|
+
anemoi/datasets/data/misc.py,sha256=iGbZg6EEheJlIH-AECTLnf-30lXaQXG-ngfbwFIt5CM,22862
|
|
113
|
+
anemoi/datasets/data/missing.py,sha256=TUZCr5Vtx23_0R9fl0RZF9fgKnJq2d_wuVMmrMm8L9w,12457
|
|
114
|
+
anemoi/datasets/data/padded.py,sha256=sunn3QRThlfUHJOGE04s008F-v7kT7gY_i2E6wulCdk,7834
|
|
115
|
+
anemoi/datasets/data/rescale.py,sha256=xTj2Vn8YuyB1KWW5y37B2HHilTVdCcuNCnYHoiQFRBg,6859
|
|
116
|
+
anemoi/datasets/data/select.py,sha256=hScUbJya1Nsew4PCmwYdTix2CtngDXTNezH_cHUdaJs,8198
|
|
117
|
+
anemoi/datasets/data/statistics.py,sha256=Z4Kffb1uIDwueWHD8XpbiV5la_XXRCAHCHFI4HfHyZI,3095
|
|
118
|
+
anemoi/datasets/data/stores.py,sha256=ip1T8LF4MpqYYT2QUs5mWEuygjbLL5o7mjUOqnTS-zY,18128
|
|
119
|
+
anemoi/datasets/data/subset.py,sha256=XTOf4xzbRLanefaewvSZH3okStsThusFsiyyQo0CMpc,8888
|
|
120
|
+
anemoi/datasets/data/unchecked.py,sha256=KxUrd_yilo4aZk99ALJSrmICEUbXhJP3iOhfac11Fb4,7218
|
|
121
|
+
anemoi/datasets/data/xy.py,sha256=raecf5OrsgUDE30rri80r7yIYkvhHd15Hb9vo_7bzCw,7675
|
|
122
|
+
anemoi/datasets/data/observations/__init__.py,sha256=V9vd7M3FqcwwGTIQk2frhvEQs3w_J4_QwIknmRAyEvg,11119
|
|
123
|
+
anemoi/datasets/data/observations/legacy_obs_dataset.py,sha256=6Aj32XWmNmCsd0azhuB6aDcpDaJ7lRdgJ9KWlU9fXxs,7342
|
|
124
|
+
anemoi/datasets/data/observations/multi.py,sha256=nDeN99LRNVyjUCNTFCL3R7iAQNsf1tSen-fSw9-VsiY,2184
|
|
125
|
+
anemoi/datasets/data/records/__init__.py,sha256=lWJBukNArbBBdcfG8bh5MzJoSOjk5Fi8zcwHWo5a0I8,12405
|
|
126
|
+
anemoi/datasets/data/records/backends/__init__.py,sha256=u894d7duXMiGTOQh5WfuxTsA4Fgj0KraBu2QqWRV3xA,5237
|
|
127
|
+
anemoi/datasets/dates/__init__.py,sha256=CZX0oJEEpKr3IjnN5LNWAuXi7PzuurY3dUs01t8OvMk,13450
|
|
128
|
+
anemoi/datasets/dates/groups.py,sha256=bdA6YjFtNlgFAXiov5-zFHZ3C_QtUrdQiSFgb2zWxVM,10034
|
|
129
|
+
anemoi_datasets-0.5.27.dist-info/licenses/LICENSE,sha256=8HznKF1Vi2IvfLsKNE5A2iVyiri3pRjRPvPC9kxs6qk,11354
|
|
130
|
+
anemoi_datasets-0.5.27.dist-info/METADATA,sha256=H_piQI0ivIT9oK8TrVEcSdH_Eg85TLbp6zhT-J65D90,16154
|
|
131
|
+
anemoi_datasets-0.5.27.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
132
|
+
anemoi_datasets-0.5.27.dist-info/entry_points.txt,sha256=yR-o-4uiPEA_GLBL81SkMYnUoxq3CAV3hHulQiRtGG0,66
|
|
133
|
+
anemoi_datasets-0.5.27.dist-info/top_level.txt,sha256=DYn8VPs-fNwr7fNH9XIBqeXIwiYYd2E2k5-dUFFqUz0,7
|
|
134
|
+
anemoi_datasets-0.5.27.dist-info/RECORD,,
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
# (C) Copyright 2024 Anemoi contributors.
|
|
2
|
-
#
|
|
3
|
-
# This software is licensed under the terms of the Apache Licence Version 2.0
|
|
4
|
-
# which can be obtained at http://www.apache.org/licenses/LICENSE-2.0.
|
|
5
|
-
#
|
|
6
|
-
# In applying this licence, ECMWF does not waive the privileges and immunities
|
|
7
|
-
# granted to it by virtue of its status as an intergovernmental organisation
|
|
8
|
-
# nor does it submit to any jurisdiction.
|
|
9
|
-
#
|
|
10
|
-
|
|
11
|
-
from typing import Any
|
|
12
|
-
|
|
13
|
-
from anemoi.utils.registry import Registry
|
|
14
|
-
|
|
15
|
-
filter_registry = Registry(__name__)
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
def create_filter(context: Any, config: Any) -> Any:
|
|
19
|
-
"""Create a filter based on the provided configuration.
|
|
20
|
-
|
|
21
|
-
Parameters
|
|
22
|
-
----------
|
|
23
|
-
context : Any
|
|
24
|
-
The context in which the filter is created.
|
|
25
|
-
config : Any
|
|
26
|
-
The configuration for the filter.
|
|
27
|
-
|
|
28
|
-
Returns
|
|
29
|
-
-------
|
|
30
|
-
Any
|
|
31
|
-
The created filter.
|
|
32
|
-
"""
|
|
33
|
-
return filter_registry.from_config(config, context)
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
# (C) Copyright 2024 Anemoi contributors.
|
|
2
|
-
#
|
|
3
|
-
# This software is licensed under the terms of the Apache Licence Version 2.0
|
|
4
|
-
# which can be obtained at http://www.apache.org/licenses/LICENSE-2.0.
|
|
5
|
-
#
|
|
6
|
-
# In applying this licence, ECMWF does not waive the privileges and immunities
|
|
7
|
-
# granted to it by virtue of its status as an intergovernmental organisation
|
|
8
|
-
# nor does it submit to any jurisdiction.
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
from typing import Any
|
|
12
|
-
|
|
13
|
-
import earthkit.data as ekd
|
|
14
|
-
from anemoi.transform.fields import new_empty_fieldlist
|
|
15
|
-
|
|
16
|
-
from .legacy import legacy_filter
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
@legacy_filter(__file__)
|
|
20
|
-
def execute(context: Any, input: ekd.FieldList, **kwargs: Any) -> ekd.FieldList:
|
|
21
|
-
"""Create a pipeline that returns an empty result.
|
|
22
|
-
|
|
23
|
-
Parameters
|
|
24
|
-
----------
|
|
25
|
-
context : Any
|
|
26
|
-
The context in which the function is executed.
|
|
27
|
-
input : List[Any]
|
|
28
|
-
List of input fields.
|
|
29
|
-
**kwargs : Any
|
|
30
|
-
Additional keyword arguments.
|
|
31
|
-
|
|
32
|
-
Returns
|
|
33
|
-
-------
|
|
34
|
-
Any
|
|
35
|
-
An empty result.
|
|
36
|
-
"""
|
|
37
|
-
return new_empty_fieldlist()
|
|
@@ -1,93 +0,0 @@
|
|
|
1
|
-
# (C) Copyright 2025- Anemoi contributors.
|
|
2
|
-
#
|
|
3
|
-
# This software is licensed under the terms of the Apache Licence Version 2.0
|
|
4
|
-
# which can be obtained at http://www.apache.org/licenses/LICENSE-2.0.
|
|
5
|
-
#
|
|
6
|
-
# In applying this licence, ECMWF does not waive the privileges and immunities
|
|
7
|
-
# granted to it by virtue of its status as an intergovernmental organisation
|
|
8
|
-
# nor does it submit to any jurisdiction.
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
import inspect
|
|
12
|
-
import logging
|
|
13
|
-
import os
|
|
14
|
-
from typing import Any
|
|
15
|
-
from typing import Callable
|
|
16
|
-
|
|
17
|
-
from ..filter import Filter
|
|
18
|
-
from . import filter_registry
|
|
19
|
-
|
|
20
|
-
LOG = logging.getLogger(__name__)
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
class LegacyFilter(Filter):
|
|
24
|
-
"""A legacy filter class.
|
|
25
|
-
|
|
26
|
-
Parameters
|
|
27
|
-
----------
|
|
28
|
-
context : Any
|
|
29
|
-
The context in which the filter is created.
|
|
30
|
-
*args : tuple
|
|
31
|
-
Positional arguments.
|
|
32
|
-
**kwargs : dict
|
|
33
|
-
Keyword arguments.
|
|
34
|
-
"""
|
|
35
|
-
|
|
36
|
-
def __init__(self, context: Any, *args: Any, **kwargs: Any) -> None:
|
|
37
|
-
super().__init__(context, *args, **kwargs)
|
|
38
|
-
self.args = args
|
|
39
|
-
self.kwargs = kwargs
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
class legacy_filter:
|
|
43
|
-
"""A decorator class for legacy filters.
|
|
44
|
-
|
|
45
|
-
Parameters
|
|
46
|
-
----------
|
|
47
|
-
name : str
|
|
48
|
-
The name of the legacy filter.
|
|
49
|
-
"""
|
|
50
|
-
|
|
51
|
-
def __init__(self, name: str) -> None:
|
|
52
|
-
name, _ = os.path.splitext(os.path.basename(name))
|
|
53
|
-
self.name = name
|
|
54
|
-
|
|
55
|
-
def __call__(self, execute: Callable) -> Callable:
|
|
56
|
-
"""Call method to wrap the execute function.
|
|
57
|
-
|
|
58
|
-
Parameters
|
|
59
|
-
----------
|
|
60
|
-
execute : Callable
|
|
61
|
-
The execute function to be wrapped.
|
|
62
|
-
|
|
63
|
-
Returns
|
|
64
|
-
-------
|
|
65
|
-
Callable
|
|
66
|
-
The wrapped execute function.
|
|
67
|
-
"""
|
|
68
|
-
this = self
|
|
69
|
-
name = f"Legacy{self.name.title()}Filter"
|
|
70
|
-
source = ".".join([execute.__module__, execute.__name__])
|
|
71
|
-
|
|
72
|
-
def execute_wrapper(self, input) -> Any:
|
|
73
|
-
"""Wrapper method to call the execute function."""
|
|
74
|
-
try:
|
|
75
|
-
return execute(self.context, input, *self.args, **self.kwargs)
|
|
76
|
-
except TypeError:
|
|
77
|
-
LOG.error(f"Error executing filter {this.name} from {source}")
|
|
78
|
-
LOG.error(f"Function signature is: {inspect.signature(execute)}")
|
|
79
|
-
LOG.error(f"Arguments are: {self.args=}, {self.kwargs=}")
|
|
80
|
-
raise
|
|
81
|
-
|
|
82
|
-
klass = type(
|
|
83
|
-
name,
|
|
84
|
-
(LegacyFilter,),
|
|
85
|
-
{
|
|
86
|
-
"execute": execute_wrapper,
|
|
87
|
-
"_source": source,
|
|
88
|
-
},
|
|
89
|
-
)
|
|
90
|
-
|
|
91
|
-
filter_registry.register(self.name)(klass)
|
|
92
|
-
|
|
93
|
-
return execute
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
# (C) Copyright 2024 Anemoi contributors.
|
|
2
|
-
#
|
|
3
|
-
# This software is licensed under the terms of the Apache Licence Version 2.0
|
|
4
|
-
# which can be obtained at http://www.apache.org/licenses/LICENSE-2.0.
|
|
5
|
-
#
|
|
6
|
-
# In applying this licence, ECMWF does not waive the privileges and immunities
|
|
7
|
-
# granted to it by virtue of its status as an intergovernmental organisation
|
|
8
|
-
# nor does it submit to any jurisdiction.
|
|
9
|
-
|
|
10
|
-
from typing import Any
|
|
11
|
-
|
|
12
|
-
import earthkit.data as ekd
|
|
13
|
-
|
|
14
|
-
from .legacy import legacy_filter
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
@legacy_filter(__file__)
|
|
18
|
-
def execute(context: Any, input: ekd.FieldList, *args: Any, **kwargs: Any) -> ekd.FieldList:
|
|
19
|
-
"""No operation filter that returns the input as is.
|
|
20
|
-
|
|
21
|
-
Parameters
|
|
22
|
-
----------
|
|
23
|
-
context : Any
|
|
24
|
-
The context in which the function is executed.
|
|
25
|
-
input : ekd.FieldList
|
|
26
|
-
List of input fields.
|
|
27
|
-
*args : Any
|
|
28
|
-
Additional arguments.
|
|
29
|
-
**kwargs : Any
|
|
30
|
-
Additional keyword arguments.
|
|
31
|
-
|
|
32
|
-
Returns
|
|
33
|
-
-------
|
|
34
|
-
List[Any]
|
|
35
|
-
The input list of fields.
|
|
36
|
-
"""
|
|
37
|
-
return input
|
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
# (C) Copyright 2024 Anemoi contributors.
|
|
2
|
-
#
|
|
3
|
-
# This software is licensed under the terms of the Apache Licence Version 2.0
|
|
4
|
-
# which can be obtained at http://www.apache.org/licenses/LICENSE-2.0.
|
|
5
|
-
#
|
|
6
|
-
# In applying this licence, ECMWF does not waive the privileges and immunities
|
|
7
|
-
# granted to it by virtue of its status as an intergovernmental organisation
|
|
8
|
-
# nor does it submit to any jurisdiction.
|
|
9
|
-
|
|
10
|
-
from collections import defaultdict
|
|
11
|
-
from typing import Any
|
|
12
|
-
from typing import Dict
|
|
13
|
-
|
|
14
|
-
import earthkit.data as ekd
|
|
15
|
-
from anemoi.transform.fields import new_field_from_numpy
|
|
16
|
-
from anemoi.transform.fields import new_fieldlist_from_list
|
|
17
|
-
|
|
18
|
-
from .legacy import legacy_filter
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
@legacy_filter(__file__)
|
|
22
|
-
def execute(context: Any, input: ekd.FieldList, orog: str, z: str = "z") -> ekd.FieldList:
|
|
23
|
-
"""Convert orography [m] to z (geopotential height).
|
|
24
|
-
|
|
25
|
-
Parameters
|
|
26
|
-
----------
|
|
27
|
-
context : Any
|
|
28
|
-
The context in which the function is executed.
|
|
29
|
-
input : FieldList
|
|
30
|
-
List of input fields.
|
|
31
|
-
orog : str
|
|
32
|
-
Orography parameter.
|
|
33
|
-
z : str, optional
|
|
34
|
-
Geopotential height parameter. Defaults to "z".
|
|
35
|
-
|
|
36
|
-
Returns
|
|
37
|
-
-------
|
|
38
|
-
FieldList
|
|
39
|
-
List of fields with geopotential height.
|
|
40
|
-
"""
|
|
41
|
-
result = []
|
|
42
|
-
processed_fields: Dict[tuple, Dict[str, Any]] = defaultdict(dict)
|
|
43
|
-
|
|
44
|
-
for f in input:
|
|
45
|
-
key = f.metadata(namespace="mars")
|
|
46
|
-
param = key.pop("param")
|
|
47
|
-
if param == orog:
|
|
48
|
-
key = tuple(key.items())
|
|
49
|
-
|
|
50
|
-
if param in processed_fields[key]:
|
|
51
|
-
raise ValueError(f"Duplicate field {param} for {key}")
|
|
52
|
-
|
|
53
|
-
output = f.to_numpy(flatten=True) * 9.80665
|
|
54
|
-
result.append(new_field_from_numpy(f, output, param=z))
|
|
55
|
-
else:
|
|
56
|
-
result.append(f)
|
|
57
|
-
|
|
58
|
-
return new_fieldlist_from_list(result)
|
|
@@ -1,83 +0,0 @@
|
|
|
1
|
-
# (C) Copyright 2024 Anemoi contributors.
|
|
2
|
-
#
|
|
3
|
-
# This software is licensed under the terms of the Apache Licence Version 2.0
|
|
4
|
-
# which can be obtained at http://www.apache.org/licenses/LICENSE-2.0.
|
|
5
|
-
#
|
|
6
|
-
# In applying this licence, ECMWF does not waive the privileges and immunities
|
|
7
|
-
# granted to it by virtue of its status as an intergovernmental organisation
|
|
8
|
-
# nor does it submit to any jurisdiction.
|
|
9
|
-
|
|
10
|
-
from collections import defaultdict
|
|
11
|
-
from typing import Any
|
|
12
|
-
from typing import Dict
|
|
13
|
-
from typing import Tuple
|
|
14
|
-
|
|
15
|
-
import earthkit.data as ekd
|
|
16
|
-
from anemoi.transform.fields import new_field_from_numpy
|
|
17
|
-
from anemoi.transform.fields import new_fieldlist_from_list
|
|
18
|
-
from earthkit.meteo import thermo
|
|
19
|
-
|
|
20
|
-
from .legacy import legacy_filter
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
@legacy_filter(__file__)
|
|
24
|
-
def execute(context: Any, input: ekd.FieldList, t: str, rh: str, q: str = "q") -> ekd.FieldList:
|
|
25
|
-
"""Convert relative humidity on pressure levels to specific humidity.
|
|
26
|
-
|
|
27
|
-
Parameters
|
|
28
|
-
----------
|
|
29
|
-
context : Any
|
|
30
|
-
The context in which the function is executed.
|
|
31
|
-
input : List[Any]
|
|
32
|
-
List of input fields.
|
|
33
|
-
t : str
|
|
34
|
-
Temperature parameter.
|
|
35
|
-
rh : str
|
|
36
|
-
Relative humidity parameter.
|
|
37
|
-
q : str, optional
|
|
38
|
-
Specific humidity parameter. Defaults to "q".
|
|
39
|
-
|
|
40
|
-
Returns
|
|
41
|
-
-------
|
|
42
|
-
ekd.FieldList
|
|
43
|
-
Array of fields with specific humidity.
|
|
44
|
-
"""
|
|
45
|
-
result = []
|
|
46
|
-
params: Tuple[str, str] = (t, rh)
|
|
47
|
-
pairs: Dict[Tuple[Any, ...], Dict[str, Any]] = defaultdict(dict)
|
|
48
|
-
|
|
49
|
-
# Gather all necessary fields
|
|
50
|
-
for f in input:
|
|
51
|
-
key = f.metadata(namespace="mars")
|
|
52
|
-
param = key.pop("param")
|
|
53
|
-
if param in params:
|
|
54
|
-
key = tuple(key.items())
|
|
55
|
-
|
|
56
|
-
if param in pairs[key]:
|
|
57
|
-
raise ValueError(f"Duplicate field {param} for {key}")
|
|
58
|
-
|
|
59
|
-
pairs[key][param] = f
|
|
60
|
-
if param == t:
|
|
61
|
-
result.append(f)
|
|
62
|
-
# all other parameters
|
|
63
|
-
else:
|
|
64
|
-
result.append(f)
|
|
65
|
-
|
|
66
|
-
for keys, values in pairs.items():
|
|
67
|
-
# some checks
|
|
68
|
-
|
|
69
|
-
if len(values) != 2:
|
|
70
|
-
raise ValueError("Missing fields")
|
|
71
|
-
|
|
72
|
-
t_pl = values[t].to_numpy(flatten=True)
|
|
73
|
-
rh_pl = values[rh].to_numpy(flatten=True)
|
|
74
|
-
pressure = next(
|
|
75
|
-
float(v) * 100 for k, v in keys if k in ["level", "levelist"]
|
|
76
|
-
) # Looks first for "level" then "levelist" value
|
|
77
|
-
# print(f"Handling fields for pressure level {pressure}...")
|
|
78
|
-
|
|
79
|
-
# actual conversion from rh --> q_v
|
|
80
|
-
q_pl = thermo.specific_humidity_from_relative_humidity(t_pl, rh_pl, pressure)
|
|
81
|
-
result.append(new_field_from_numpy(values[rh], q_pl, param=q))
|
|
82
|
-
|
|
83
|
-
return new_fieldlist_from_list(result)
|
|
@@ -1,84 +0,0 @@
|
|
|
1
|
-
# (C) Copyright 2024 Anemoi contributors.
|
|
2
|
-
#
|
|
3
|
-
# This software is licensed under the terms of the Apache Licence Version 2.0
|
|
4
|
-
# which can be obtained at http://www.apache.org/licenses/LICENSE-2.0.
|
|
5
|
-
#
|
|
6
|
-
# In applying this licence, ECMWF does not waive the privileges and immunities
|
|
7
|
-
# granted to it by virtue of its status as an intergovernmental organisation
|
|
8
|
-
# nor does it submit to any jurisdiction.
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
from collections import defaultdict
|
|
12
|
-
from typing import Any
|
|
13
|
-
from typing import Dict
|
|
14
|
-
|
|
15
|
-
import earthkit.data as ekd
|
|
16
|
-
from anemoi.transform.fields import new_field_from_numpy
|
|
17
|
-
from anemoi.transform.fields import new_fieldlist_from_list
|
|
18
|
-
from earthkit.data.indexing.fieldlist import FieldArray
|
|
19
|
-
from earthkit.meteo import thermo
|
|
20
|
-
|
|
21
|
-
from .legacy import legacy_filter
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
@legacy_filter(__file__)
|
|
25
|
-
def execute(context: Any, input: ekd.FieldList, t: str, q: str, rh: str = "r") -> FieldArray:
|
|
26
|
-
"""Convert specific humidity on pressure levels to relative humidity.
|
|
27
|
-
|
|
28
|
-
Parameters
|
|
29
|
-
----------
|
|
30
|
-
context : Any
|
|
31
|
-
The context in which the function is executed.
|
|
32
|
-
input : List[Any]
|
|
33
|
-
List of input fields.
|
|
34
|
-
t : str
|
|
35
|
-
Temperature parameter.
|
|
36
|
-
q : str
|
|
37
|
-
Specific humidity parameter.
|
|
38
|
-
rh : str, optional
|
|
39
|
-
Relative humidity parameter. Defaults to "r".
|
|
40
|
-
|
|
41
|
-
Returns
|
|
42
|
-
-------
|
|
43
|
-
ekd.FieldList
|
|
44
|
-
Array of fields with relative humidity.
|
|
45
|
-
"""
|
|
46
|
-
result = []
|
|
47
|
-
params: tuple[str, str] = (t, q)
|
|
48
|
-
pairs: Dict[tuple, Dict[str, Any]] = defaultdict(dict)
|
|
49
|
-
|
|
50
|
-
# Gather all necessary fields
|
|
51
|
-
for f in input:
|
|
52
|
-
key = f.metadata(namespace="mars")
|
|
53
|
-
param = key.pop("param")
|
|
54
|
-
if param in params:
|
|
55
|
-
key = tuple(key.items())
|
|
56
|
-
|
|
57
|
-
if param in pairs[key]:
|
|
58
|
-
raise ValueError(f"Duplicate field {param} for {key}")
|
|
59
|
-
|
|
60
|
-
pairs[key][param] = f
|
|
61
|
-
if param == t:
|
|
62
|
-
result.append(f)
|
|
63
|
-
# all other parameters
|
|
64
|
-
else:
|
|
65
|
-
result.append(f)
|
|
66
|
-
|
|
67
|
-
for keys, values in pairs.items():
|
|
68
|
-
# some checks
|
|
69
|
-
|
|
70
|
-
if len(values) != 2:
|
|
71
|
-
raise ValueError("Missing fields")
|
|
72
|
-
|
|
73
|
-
t_pl = values[t].to_numpy(flatten=True)
|
|
74
|
-
q_pl = values[q].to_numpy(flatten=True)
|
|
75
|
-
pressure = next(
|
|
76
|
-
float(v) * 100 for k, v in keys if k in ["level", "levelist"]
|
|
77
|
-
) # Looks first for "level" then "levelist" value
|
|
78
|
-
# print(f"Handling fields for pressure level {pressure}...")
|
|
79
|
-
|
|
80
|
-
# actual conversion from rh --> q_v
|
|
81
|
-
rh_pl = thermo.relative_humidity_from_specific_humidity(t_pl, q_pl, pressure)
|
|
82
|
-
result.append(new_field_from_numpy(values[q], rh_pl, param=rh))
|
|
83
|
-
|
|
84
|
-
return new_fieldlist_from_list(result)
|