disdrodb 0.1.2__py3-none-any.whl → 0.1.3__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.
Files changed (123) hide show
  1. disdrodb/__init__.py +64 -34
  2. disdrodb/_config.py +5 -4
  3. disdrodb/_version.py +16 -3
  4. disdrodb/accessor/__init__.py +20 -0
  5. disdrodb/accessor/methods.py +125 -0
  6. disdrodb/api/checks.py +139 -9
  7. disdrodb/api/configs.py +4 -2
  8. disdrodb/api/info.py +10 -10
  9. disdrodb/api/io.py +237 -18
  10. disdrodb/api/path.py +81 -75
  11. disdrodb/api/search.py +6 -6
  12. disdrodb/cli/disdrodb_create_summary_station.py +91 -0
  13. disdrodb/cli/disdrodb_run_l0.py +1 -1
  14. disdrodb/cli/disdrodb_run_l0_station.py +1 -1
  15. disdrodb/cli/disdrodb_run_l0b.py +1 -1
  16. disdrodb/cli/disdrodb_run_l0b_station.py +1 -1
  17. disdrodb/cli/disdrodb_run_l0c.py +1 -1
  18. disdrodb/cli/disdrodb_run_l0c_station.py +1 -1
  19. disdrodb/cli/disdrodb_run_l2e_station.py +1 -1
  20. disdrodb/configs.py +149 -4
  21. disdrodb/constants.py +61 -0
  22. disdrodb/data_transfer/download_data.py +5 -5
  23. disdrodb/etc/configs/attributes.yaml +339 -0
  24. disdrodb/etc/configs/encodings.yaml +473 -0
  25. disdrodb/etc/products/L1/global.yaml +13 -0
  26. disdrodb/etc/products/L2E/10MIN.yaml +12 -0
  27. disdrodb/etc/products/L2E/1MIN.yaml +1 -0
  28. disdrodb/etc/products/L2E/global.yaml +22 -0
  29. disdrodb/etc/products/L2M/10MIN.yaml +12 -0
  30. disdrodb/etc/products/L2M/GAMMA_ML.yaml +8 -0
  31. disdrodb/etc/products/L2M/NGAMMA_GS_LOG_ND_MAE.yaml +6 -0
  32. disdrodb/etc/products/L2M/NGAMMA_GS_ND_MAE.yaml +6 -0
  33. disdrodb/etc/products/L2M/NGAMMA_GS_Z_MAE.yaml +6 -0
  34. disdrodb/etc/products/L2M/global.yaml +26 -0
  35. disdrodb/l0/__init__.py +13 -0
  36. disdrodb/l0/configs/LPM/l0b_cf_attrs.yml +4 -4
  37. disdrodb/l0/configs/PARSIVEL/l0b_cf_attrs.yml +1 -1
  38. disdrodb/l0/configs/PARSIVEL/l0b_encodings.yml +3 -3
  39. disdrodb/l0/configs/PARSIVEL/raw_data_format.yml +1 -1
  40. disdrodb/l0/configs/PARSIVEL2/l0b_cf_attrs.yml +5 -5
  41. disdrodb/l0/configs/PARSIVEL2/l0b_encodings.yml +3 -3
  42. disdrodb/l0/configs/PARSIVEL2/raw_data_format.yml +1 -1
  43. disdrodb/l0/configs/PWS100/l0b_cf_attrs.yml +4 -4
  44. disdrodb/l0/configs/PWS100/raw_data_format.yml +1 -1
  45. disdrodb/l0/l0a_processing.py +30 -30
  46. disdrodb/l0/l0b_nc_processing.py +108 -2
  47. disdrodb/l0/l0b_processing.py +4 -4
  48. disdrodb/l0/l0c_processing.py +5 -13
  49. disdrodb/l0/readers/LPM/NETHERLANDS/DELFT_LPM_NC.py +66 -0
  50. disdrodb/l0/readers/LPM/SLOVENIA/{CRNI_VRH.py → UL.py} +3 -0
  51. disdrodb/l0/readers/LPM/SWITZERLAND/INNERERIZ_LPM.py +195 -0
  52. disdrodb/l0/readers/PARSIVEL/GPM/PIERS.py +0 -2
  53. disdrodb/l0/readers/PARSIVEL/JAPAN/JMA.py +4 -1
  54. disdrodb/l0/readers/PARSIVEL/NCAR/PECAN_MOBILE.py +1 -1
  55. disdrodb/l0/readers/PARSIVEL/NCAR/VORTEX2_2009.py +1 -1
  56. disdrodb/l0/readers/PARSIVEL2/BELGIUM/ILVO.py +168 -0
  57. disdrodb/l0/readers/PARSIVEL2/DENMARK/DTU.py +165 -0
  58. disdrodb/l0/readers/PARSIVEL2/FINLAND/FMI_PARSIVEL2.py +69 -0
  59. disdrodb/l0/readers/PARSIVEL2/FRANCE/ENPC_PARSIVEL2.py +255 -134
  60. disdrodb/l0/readers/PARSIVEL2/FRANCE/OSUG.py +525 -0
  61. disdrodb/l0/readers/PARSIVEL2/FRANCE/SIRTA_PARSIVEL2.py +1 -1
  62. disdrodb/l0/readers/PARSIVEL2/GPM/GCPEX.py +9 -7
  63. disdrodb/l0/readers/PARSIVEL2/KIT/BURKINA_FASO.py +1 -1
  64. disdrodb/l0/readers/PARSIVEL2/KIT/TEAMX.py +123 -0
  65. disdrodb/l0/readers/PARSIVEL2/NASA/APU.py +120 -0
  66. disdrodb/l0/readers/PARSIVEL2/NCAR/FARM_PARSIVEL2.py +1 -0
  67. disdrodb/l0/readers/PARSIVEL2/NCAR/PECAN_FP3.py +1 -1
  68. disdrodb/l0/readers/PARSIVEL2/NCAR/PERILS_MIPS.py +126 -0
  69. disdrodb/l0/readers/PARSIVEL2/NCAR/PERILS_PIPS.py +165 -0
  70. disdrodb/l0/readers/PARSIVEL2/NCAR/VORTEX_SE_2016_P2.py +1 -1
  71. disdrodb/l0/readers/PARSIVEL2/NCAR/VORTEX_SE_2016_PIPS.py +20 -12
  72. disdrodb/l0/readers/PARSIVEL2/NETHERLANDS/DELFT_NC.py +2 -0
  73. disdrodb/l0/readers/PARSIVEL2/SPAIN/CENER.py +144 -0
  74. disdrodb/l0/readers/PARSIVEL2/SPAIN/CR1000DL.py +201 -0
  75. disdrodb/l0/readers/PARSIVEL2/SPAIN/LIAISE.py +137 -0
  76. disdrodb/l0/readers/PARSIVEL2/{NETHERLANDS/DELFT.py → USA/C3WE.py} +65 -85
  77. disdrodb/l0/readers/PWS100/FRANCE/ENPC_PWS100.py +105 -99
  78. disdrodb/l0/readers/PWS100/FRANCE/ENPC_PWS100_SIRTA.py +151 -0
  79. disdrodb/l0/routines.py +105 -14
  80. disdrodb/l1/__init__.py +5 -0
  81. disdrodb/l1/filters.py +34 -20
  82. disdrodb/l1/processing.py +45 -44
  83. disdrodb/l1/resampling.py +77 -66
  84. disdrodb/l1/routines.py +35 -43
  85. disdrodb/l1_env/routines.py +18 -3
  86. disdrodb/l2/__init__.py +7 -0
  87. disdrodb/l2/empirical_dsd.py +58 -10
  88. disdrodb/l2/event.py +27 -120
  89. disdrodb/l2/processing.py +267 -116
  90. disdrodb/l2/routines.py +618 -254
  91. disdrodb/metadata/standards.py +3 -1
  92. disdrodb/psd/fitting.py +463 -144
  93. disdrodb/psd/models.py +8 -5
  94. disdrodb/routines.py +3 -3
  95. disdrodb/scattering/__init__.py +16 -4
  96. disdrodb/scattering/axis_ratio.py +56 -36
  97. disdrodb/scattering/permittivity.py +486 -0
  98. disdrodb/scattering/routines.py +701 -159
  99. disdrodb/summary/__init__.py +17 -0
  100. disdrodb/summary/routines.py +4120 -0
  101. disdrodb/utils/attrs.py +68 -125
  102. disdrodb/utils/compression.py +30 -1
  103. disdrodb/utils/dask.py +59 -8
  104. disdrodb/utils/dataframe.py +61 -7
  105. disdrodb/utils/directories.py +35 -15
  106. disdrodb/utils/encoding.py +33 -19
  107. disdrodb/utils/logger.py +13 -6
  108. disdrodb/utils/manipulations.py +71 -0
  109. disdrodb/utils/subsetting.py +214 -0
  110. disdrodb/utils/time.py +165 -19
  111. disdrodb/utils/writer.py +20 -7
  112. disdrodb/utils/xarray.py +2 -4
  113. disdrodb/viz/__init__.py +13 -0
  114. disdrodb/viz/plots.py +327 -0
  115. {disdrodb-0.1.2.dist-info → disdrodb-0.1.3.dist-info}/METADATA +3 -2
  116. {disdrodb-0.1.2.dist-info → disdrodb-0.1.3.dist-info}/RECORD +121 -88
  117. {disdrodb-0.1.2.dist-info → disdrodb-0.1.3.dist-info}/entry_points.txt +1 -0
  118. disdrodb/l1/encoding_attrs.py +0 -642
  119. disdrodb/l2/processing_options.py +0 -213
  120. /disdrodb/l0/readers/PARSIVEL/SLOVENIA/{UL_FGG.py → UL.py} +0 -0
  121. {disdrodb-0.1.2.dist-info → disdrodb-0.1.3.dist-info}/WHEEL +0 -0
  122. {disdrodb-0.1.2.dist-info → disdrodb-0.1.3.dist-info}/licenses/LICENSE +0 -0
  123. {disdrodb-0.1.2.dist-info → disdrodb-0.1.3.dist-info}/top_level.txt +0 -0
@@ -1,213 +0,0 @@
1
- import os
2
-
3
- # TODO: Write to YAML
4
- # TODO: radar_simulation_enabled: differentiate between L2E and L2M:
5
-
6
- DEFAULT_CONFIG = {
7
- "global_settings": {
8
- "time_integration": [
9
- "1MIN",
10
- "5MIN",
11
- "10MIN",
12
- "ROLL1MIN",
13
- ], # ["10S", "30S", "1MIN", "5MIN", "10MIN", "15MIN", "30MIN", "1H", "ROLL5MIN", "ROLL10MIN"],
14
- # Radar options
15
- "radar_simulation_enabled": False,
16
- "radar_simulation_options": {
17
- "radar_band": ["S", "C", "X", "Ku", "Ka", "W"],
18
- "canting_angle_std": 7,
19
- "diameter_max": 10,
20
- "axis_ratio": "Thurai2007",
21
- },
22
- # L2E options
23
- # "l2e_options": {}
24
- # L2M options
25
- "l2m_options": {
26
- "fall_velocity_method": "Beard1976",
27
- "diameter_min": 0,
28
- "diameter_max": 10,
29
- "diameter_spacing": 0.05,
30
- "gof_metrics": True,
31
- "min_nbins": 4,
32
- "remove_timesteps_with_few_bins": False,
33
- "mask_timesteps_with_few_bins": False,
34
- "models": {
35
- # PSD models fitting options
36
- "GAMMA_ML": {
37
- "psd_model": "GammaPSD",
38
- "optimization": "ML",
39
- "optimization_kwargs": {
40
- "init_method": "M346",
41
- "probability_method": "cdf",
42
- "likelihood": "multinomial",
43
- "truncated_likelihood": True,
44
- "optimizer": "Nelder-Mead",
45
- },
46
- },
47
- "NGAMMA_GS_LOG_ND_MAE": {
48
- "psd_model": "NormalizedGammaPSD",
49
- "optimization": "GS",
50
- "optimization_kwargs": {
51
- "target": "ND",
52
- "transformation": "log",
53
- "error_order": 1, # MAE
54
- },
55
- },
56
- # "NGAMMA_GS_ND_MAE": {
57
- # "psd_model": "NormalizedGammaPSD",
58
- # "optimization": "GS",
59
- # "optimization_kwargs": {
60
- # "target": "ND",
61
- # "transformation": "identity",
62
- # "error_order": 1, # MAE
63
- # },
64
- # },
65
- # "NGAMMA_GS_Z": {
66
- # "psd_model": "NormalizedGammaPSD",
67
- # "optimization": "GS",
68
- # "optimization_kwargs": {
69
- # "target": "Z",
70
- # "transformation": "identity", # unused
71
- # "error_order": 1, # unused
72
- # },
73
- # },
74
- },
75
- },
76
- },
77
- "specific_settings": {
78
- "10S": {
79
- "radar_simulation_enabled": False,
80
- },
81
- "30S": {
82
- "radar_simulation_enabled": False,
83
- },
84
- "10MIN": {
85
- "radar_simulation_enabled": False,
86
- },
87
- "15MIN": {
88
- "radar_simulation_enabled": False,
89
- },
90
- "30MIN": {
91
- "radar_simulation_enabled": False,
92
- },
93
- "1H": {
94
- "radar_simulation_enabled": False,
95
- },
96
- "ROLL10MIN": {
97
- "radar_simulation_enabled": False,
98
- },
99
- },
100
- }
101
-
102
- TEST_CONFIG = {
103
- "global_settings": {
104
- "time_integration": [
105
- "1MIN",
106
- "10MIN",
107
- "ROLL1MIN",
108
- "ROLL10MIN",
109
- ], # ["10S", "30S", "1MIN", "5MIN", "10MIN", "15MIN", "30MIN", "1H", "ROLL5MIN", "ROLL10MIN"],
110
- # Radar options
111
- "radar_simulation_enabled": False,
112
- "radar_simulation_options": {
113
- "radar_band": ["S", "C", "X", "Ku", "Ka", "W"],
114
- "canting_angle_std": 7,
115
- "diameter_max": 10,
116
- "axis_ratio": "Thurai2007",
117
- },
118
- # L2E options
119
- # "l2e_options": {}
120
- # L2M options
121
- "l2m_options": {
122
- "fall_velocity_method": "Beard1976",
123
- "diameter_min": 0,
124
- "diameter_max": 10,
125
- "diameter_spacing": 0.05,
126
- "gof_metrics": True,
127
- "min_nbins": 4,
128
- "remove_timesteps_with_few_bins": False,
129
- "mask_timesteps_with_few_bins": False,
130
- "models": {
131
- # PSD models fitting options
132
- "GAMMA_ML": {
133
- "psd_model": "GammaPSD",
134
- "optimization": "ML",
135
- "optimization_kwargs": {
136
- "init_method": "M346",
137
- "probability_method": "cdf",
138
- "likelihood": "multinomial",
139
- "truncated_likelihood": True,
140
- "optimizer": "Nelder-Mead",
141
- },
142
- },
143
- "NGAMMA_GS_LOG_ND_MAE": {
144
- "psd_model": "NormalizedGammaPSD",
145
- "optimization": "GS",
146
- "optimization_kwargs": {
147
- "target": "ND",
148
- "transformation": "log",
149
- "error_order": 1, # MAE
150
- },
151
- },
152
- # "NGAMMA_GS_ND_MAE": {
153
- # "psd_model": "NormalizedGammaPSD",
154
- # "optimization": "GS",
155
- # "optimization_kwargs": {
156
- # "target": "ND",
157
- # "transformation": "identity",
158
- # "error_order": 1, # MAE
159
- # },
160
- # },
161
- # "NGAMMA_GS_Z": {
162
- # "psd_model": "NormalizedGammaPSD",
163
- # "optimization": "GS",
164
- # "optimization_kwargs": {
165
- # "target": "Z",
166
- # "transformation": "identity", # unused
167
- # "error_order": 1, # unused
168
- # },
169
- # },
170
- },
171
- },
172
- },
173
- "specific_settings": {
174
- "10S": {
175
- "radar_simulation_enabled": False,
176
- },
177
- "30S": {
178
- "radar_simulation_enabled": False,
179
- },
180
- "10MIN": {
181
- "radar_simulation_enabled": False,
182
- },
183
- "15MIN": {
184
- "radar_simulation_enabled": False,
185
- },
186
- "30MIN": {
187
- "radar_simulation_enabled": False,
188
- },
189
- "1H": {
190
- "radar_simulation_enabled": False,
191
- },
192
- "ROLL10MIN": {
193
- "radar_simulation_enabled": False,
194
- },
195
- },
196
- }
197
-
198
-
199
- def get_l2_processing_options():
200
- """Retrieve L2 processing options."""
201
- # TODO: Implement validation !
202
- l2_options_dict = {}
203
- # Define config to use
204
- config = TEST_CONFIG if os.environ.get("PYTEST_CURRENT_TEST") else DEFAULT_CONFIG
205
- # Define global L2 options
206
- for tt in config["global_settings"]["time_integration"]:
207
- l2_options_dict[tt] = config["global_settings"].copy()
208
- _ = l2_options_dict[tt].pop("time_integration", None)
209
- # Add specific settings
210
- for tt, product_options in config["specific_settings"].items():
211
- if tt in l2_options_dict:
212
- l2_options_dict[tt].update(product_options)
213
- return l2_options_dict