disdrodb 0.1.2__py3-none-any.whl → 0.1.4__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.
- disdrodb/__init__.py +68 -34
- disdrodb/_config.py +5 -4
- disdrodb/_version.py +16 -3
- disdrodb/accessor/__init__.py +20 -0
- disdrodb/accessor/methods.py +125 -0
- disdrodb/api/checks.py +177 -24
- disdrodb/api/configs.py +3 -3
- disdrodb/api/info.py +13 -13
- disdrodb/api/io.py +281 -22
- disdrodb/api/path.py +184 -195
- disdrodb/api/search.py +18 -9
- disdrodb/cli/disdrodb_create_summary.py +103 -0
- disdrodb/cli/disdrodb_create_summary_station.py +91 -0
- disdrodb/cli/disdrodb_run_l0.py +1 -1
- disdrodb/cli/disdrodb_run_l0_station.py +1 -1
- disdrodb/cli/disdrodb_run_l0a_station.py +1 -1
- disdrodb/cli/disdrodb_run_l0b.py +1 -1
- disdrodb/cli/disdrodb_run_l0b_station.py +3 -3
- disdrodb/cli/disdrodb_run_l0c.py +1 -1
- disdrodb/cli/disdrodb_run_l0c_station.py +3 -3
- disdrodb/cli/disdrodb_run_l1_station.py +2 -2
- disdrodb/cli/disdrodb_run_l2e_station.py +2 -2
- disdrodb/cli/disdrodb_run_l2m_station.py +2 -2
- disdrodb/configs.py +149 -4
- disdrodb/constants.py +61 -0
- disdrodb/data_transfer/download_data.py +127 -11
- disdrodb/etc/configs/attributes.yaml +339 -0
- disdrodb/etc/configs/encodings.yaml +473 -0
- disdrodb/etc/products/L1/global.yaml +13 -0
- disdrodb/etc/products/L2E/10MIN.yaml +12 -0
- disdrodb/etc/products/L2E/1MIN.yaml +1 -0
- disdrodb/etc/products/L2E/global.yaml +22 -0
- disdrodb/etc/products/L2M/10MIN.yaml +12 -0
- disdrodb/etc/products/L2M/GAMMA_ML.yaml +8 -0
- disdrodb/etc/products/L2M/NGAMMA_GS_LOG_ND_MAE.yaml +6 -0
- disdrodb/etc/products/L2M/NGAMMA_GS_ND_MAE.yaml +6 -0
- disdrodb/etc/products/L2M/NGAMMA_GS_Z_MAE.yaml +6 -0
- disdrodb/etc/products/L2M/global.yaml +26 -0
- disdrodb/issue/writer.py +2 -0
- disdrodb/l0/__init__.py +13 -0
- disdrodb/l0/configs/LPM/l0b_cf_attrs.yml +4 -4
- disdrodb/l0/configs/PARSIVEL/l0b_cf_attrs.yml +1 -1
- disdrodb/l0/configs/PARSIVEL/l0b_encodings.yml +3 -3
- disdrodb/l0/configs/PARSIVEL/raw_data_format.yml +1 -1
- disdrodb/l0/configs/PARSIVEL2/l0b_cf_attrs.yml +5 -5
- disdrodb/l0/configs/PARSIVEL2/l0b_encodings.yml +3 -3
- disdrodb/l0/configs/PARSIVEL2/raw_data_format.yml +1 -1
- disdrodb/l0/configs/PWS100/l0b_cf_attrs.yml +4 -4
- disdrodb/l0/configs/PWS100/raw_data_format.yml +1 -1
- disdrodb/l0/l0a_processing.py +37 -32
- disdrodb/l0/l0b_nc_processing.py +118 -8
- disdrodb/l0/l0b_processing.py +30 -65
- disdrodb/l0/l0c_processing.py +369 -259
- disdrodb/l0/readers/LPM/ARM/ARM_LPM.py +7 -0
- disdrodb/l0/readers/LPM/NETHERLANDS/DELFT_LPM_NC.py +66 -0
- disdrodb/l0/readers/LPM/SLOVENIA/{CRNI_VRH.py → UL.py} +3 -0
- disdrodb/l0/readers/LPM/SWITZERLAND/INNERERIZ_LPM.py +195 -0
- disdrodb/l0/readers/PARSIVEL/GPM/PIERS.py +0 -2
- disdrodb/l0/readers/PARSIVEL/JAPAN/JMA.py +4 -1
- disdrodb/l0/readers/PARSIVEL/NCAR/PECAN_MOBILE.py +1 -1
- disdrodb/l0/readers/PARSIVEL/NCAR/VORTEX2_2009.py +1 -1
- disdrodb/l0/readers/PARSIVEL2/ARM/ARM_PARSIVEL2.py +4 -0
- disdrodb/l0/readers/PARSIVEL2/BELGIUM/ILVO.py +168 -0
- disdrodb/l0/readers/PARSIVEL2/CANADA/UQAM_NC.py +69 -0
- disdrodb/l0/readers/PARSIVEL2/DENMARK/DTU.py +165 -0
- disdrodb/l0/readers/PARSIVEL2/FINLAND/FMI_PARSIVEL2.py +69 -0
- disdrodb/l0/readers/PARSIVEL2/FRANCE/ENPC_PARSIVEL2.py +255 -134
- disdrodb/l0/readers/PARSIVEL2/FRANCE/OSUG.py +525 -0
- disdrodb/l0/readers/PARSIVEL2/FRANCE/SIRTA_PARSIVEL2.py +1 -1
- disdrodb/l0/readers/PARSIVEL2/GPM/GCPEX.py +9 -7
- disdrodb/l0/readers/PARSIVEL2/KIT/BURKINA_FASO.py +1 -1
- disdrodb/l0/readers/PARSIVEL2/KIT/TEAMX.py +123 -0
- disdrodb/l0/readers/PARSIVEL2/{NETHERLANDS/DELFT.py → MPI/BCO_PARSIVEL2.py} +41 -71
- disdrodb/l0/readers/PARSIVEL2/MPI/BOWTIE.py +220 -0
- disdrodb/l0/readers/PARSIVEL2/NASA/APU.py +120 -0
- disdrodb/l0/readers/PARSIVEL2/NASA/LPVEX.py +109 -0
- disdrodb/l0/readers/PARSIVEL2/NCAR/FARM_PARSIVEL2.py +1 -0
- disdrodb/l0/readers/PARSIVEL2/NCAR/PECAN_FP3.py +1 -1
- disdrodb/l0/readers/PARSIVEL2/NCAR/PERILS_MIPS.py +126 -0
- disdrodb/l0/readers/PARSIVEL2/NCAR/PERILS_PIPS.py +165 -0
- disdrodb/l0/readers/PARSIVEL2/NCAR/VORTEX_SE_2016_P2.py +1 -1
- disdrodb/l0/readers/PARSIVEL2/NCAR/VORTEX_SE_2016_PIPS.py +20 -12
- disdrodb/l0/readers/PARSIVEL2/NETHERLANDS/DELFT_NC.py +5 -0
- disdrodb/l0/readers/PARSIVEL2/SPAIN/CENER.py +144 -0
- disdrodb/l0/readers/PARSIVEL2/SPAIN/CR1000DL.py +201 -0
- disdrodb/l0/readers/PARSIVEL2/SPAIN/LIAISE.py +137 -0
- disdrodb/l0/readers/PARSIVEL2/USA/C3WE.py +146 -0
- disdrodb/l0/readers/PWS100/FRANCE/ENPC_PWS100.py +105 -99
- disdrodb/l0/readers/PWS100/FRANCE/ENPC_PWS100_SIRTA.py +151 -0
- disdrodb/l1/__init__.py +5 -0
- disdrodb/l1/fall_velocity.py +46 -0
- disdrodb/l1/filters.py +34 -20
- disdrodb/l1/processing.py +46 -45
- disdrodb/l1/resampling.py +77 -66
- disdrodb/l1_env/routines.py +18 -3
- disdrodb/l2/__init__.py +7 -0
- disdrodb/l2/empirical_dsd.py +58 -10
- disdrodb/l2/processing.py +268 -117
- disdrodb/metadata/checks.py +132 -125
- disdrodb/metadata/standards.py +3 -1
- disdrodb/psd/fitting.py +631 -345
- disdrodb/psd/models.py +9 -6
- disdrodb/routines/__init__.py +54 -0
- disdrodb/{l0/routines.py → routines/l0.py} +316 -355
- disdrodb/{l1/routines.py → routines/l1.py} +76 -116
- disdrodb/routines/l2.py +1019 -0
- disdrodb/{routines.py → routines/wrappers.py} +98 -10
- disdrodb/scattering/__init__.py +16 -4
- disdrodb/scattering/axis_ratio.py +61 -37
- disdrodb/scattering/permittivity.py +504 -0
- disdrodb/scattering/routines.py +746 -184
- disdrodb/summary/__init__.py +17 -0
- disdrodb/summary/routines.py +4196 -0
- disdrodb/utils/archiving.py +434 -0
- disdrodb/utils/attrs.py +68 -125
- disdrodb/utils/cli.py +5 -5
- disdrodb/utils/compression.py +30 -1
- disdrodb/utils/dask.py +121 -9
- disdrodb/utils/dataframe.py +61 -7
- disdrodb/utils/decorators.py +31 -0
- disdrodb/utils/directories.py +35 -15
- disdrodb/utils/encoding.py +37 -19
- disdrodb/{l2 → utils}/event.py +15 -173
- disdrodb/utils/logger.py +14 -7
- disdrodb/utils/manipulations.py +81 -0
- disdrodb/utils/routines.py +166 -0
- disdrodb/utils/subsetting.py +214 -0
- disdrodb/utils/time.py +35 -177
- disdrodb/utils/writer.py +20 -7
- disdrodb/utils/xarray.py +5 -4
- disdrodb/viz/__init__.py +13 -0
- disdrodb/viz/plots.py +398 -0
- {disdrodb-0.1.2.dist-info → disdrodb-0.1.4.dist-info}/METADATA +4 -3
- {disdrodb-0.1.2.dist-info → disdrodb-0.1.4.dist-info}/RECORD +139 -98
- {disdrodb-0.1.2.dist-info → disdrodb-0.1.4.dist-info}/entry_points.txt +2 -0
- disdrodb/l1/encoding_attrs.py +0 -642
- disdrodb/l2/processing_options.py +0 -213
- disdrodb/l2/routines.py +0 -868
- /disdrodb/l0/readers/PARSIVEL/SLOVENIA/{UL_FGG.py → UL.py} +0 -0
- {disdrodb-0.1.2.dist-info → disdrodb-0.1.4.dist-info}/WHEEL +0 -0
- {disdrodb-0.1.2.dist-info → disdrodb-0.1.4.dist-info}/licenses/LICENSE +0 -0
- {disdrodb-0.1.2.dist-info → disdrodb-0.1.4.dist-info}/top_level.txt +0 -0
disdrodb/psd/models.py
CHANGED
|
@@ -32,7 +32,7 @@ import xarray as xr
|
|
|
32
32
|
from scipy.interpolate import PchipInterpolator, interp1d
|
|
33
33
|
from scipy.special import gamma as gamma_f
|
|
34
34
|
|
|
35
|
-
from disdrodb import DIAMETER_DIMENSION
|
|
35
|
+
from disdrodb.constants import DIAMETER_DIMENSION
|
|
36
36
|
from disdrodb.utils.warnings import suppress_warnings
|
|
37
37
|
|
|
38
38
|
# Check if pytmatrix is available
|
|
@@ -79,7 +79,7 @@ def check_diameter_inputs(D):
|
|
|
79
79
|
raise ValueError("Expecting a 1-dimensional diameter array.")
|
|
80
80
|
if D.size == 0:
|
|
81
81
|
raise ValueError("Expecting a non-empty diameter array.")
|
|
82
|
-
return xr.DataArray(D, dims=DIAMETER_DIMENSION)
|
|
82
|
+
return D # If xr.DataArray(D, dims=DIAMETER_DIMENSION) make pytmatrix failing !
|
|
83
83
|
raise TypeError(f"Invalid diameter type: {type(D)}")
|
|
84
84
|
|
|
85
85
|
|
|
@@ -93,7 +93,7 @@ def get_psd_model_formula(psd_model):
|
|
|
93
93
|
return PSD_MODELS_DICT[psd_model].formula
|
|
94
94
|
|
|
95
95
|
|
|
96
|
-
def create_psd(psd_model, parameters):
|
|
96
|
+
def create_psd(psd_model, parameters):
|
|
97
97
|
"""Define a PSD from a dictionary or xr.Dataset of parameters."""
|
|
98
98
|
psd_class = get_psd_model(psd_model)
|
|
99
99
|
psd = psd_class.from_parameters(parameters)
|
|
@@ -121,6 +121,8 @@ class XarrayPSD(PSD):
|
|
|
121
121
|
def __call__(self, D):
|
|
122
122
|
"""Compute the PSD."""
|
|
123
123
|
D = check_diameter_inputs(D)
|
|
124
|
+
if self.has_xarray_parameters() and not np.isscalar(D):
|
|
125
|
+
D = xr.DataArray(D, dims=DIAMETER_DIMENSION)
|
|
124
126
|
with suppress_warnings():
|
|
125
127
|
return self.formula(D=D, **self.parameters)
|
|
126
128
|
|
|
@@ -302,7 +304,7 @@ class ExponentialPSD(XarrayPSD):
|
|
|
302
304
|
Lambda: the inverse scale parameter
|
|
303
305
|
|
|
304
306
|
Args (call):
|
|
305
|
-
D: the particle diameter.
|
|
307
|
+
D: the particle diameter in millimeter.
|
|
306
308
|
|
|
307
309
|
Returns (call):
|
|
308
310
|
The PSD value for the given diameter.
|
|
@@ -377,7 +379,7 @@ class GammaPSD(ExponentialPSD):
|
|
|
377
379
|
mu: the shape parameter [-]
|
|
378
380
|
|
|
379
381
|
Args (call):
|
|
380
|
-
D: the particle diameter.
|
|
382
|
+
D: the particle diameter in millimeter.
|
|
381
383
|
|
|
382
384
|
Returns (call):
|
|
383
385
|
The PSD value for the given diameter.
|
|
@@ -478,7 +480,7 @@ class NormalizedGammaPSD(XarrayPSD):
|
|
|
478
480
|
mu: the shape parameter.
|
|
479
481
|
|
|
480
482
|
Args (call):
|
|
481
|
-
D: the particle diameter.
|
|
483
|
+
D: the particle diameter in millimeter.
|
|
482
484
|
|
|
483
485
|
Returns (call):
|
|
484
486
|
The PSD value for the given diameter.
|
|
@@ -695,6 +697,7 @@ class BinnedPSD(PSD):
|
|
|
695
697
|
"""
|
|
696
698
|
# Ensure D is numpy array of correct dimension
|
|
697
699
|
D = np.asanyarray(check_diameter_inputs(D))
|
|
700
|
+
|
|
698
701
|
# Define interpolator
|
|
699
702
|
interpolator = define_interpolator(
|
|
700
703
|
bin_edges=self.bin_edges,
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
# -----------------------------------------------------------------------------.
|
|
2
|
+
# Copyright (c) 2021-2023 DISDRODB developers
|
|
3
|
+
#
|
|
4
|
+
# This program is free software: you can redistribute it and/or modify
|
|
5
|
+
# it under the terms of the GNU General Public License as published by
|
|
6
|
+
# the Free Software Foundation, either version 3 of the License, or
|
|
7
|
+
# (at your option) any later version.
|
|
8
|
+
#
|
|
9
|
+
# This program is distributed in the hope that it will be useful,
|
|
10
|
+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
11
|
+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
12
|
+
# GNU General Public License for more details.
|
|
13
|
+
#
|
|
14
|
+
# You should have received a copy of the GNU General Public License
|
|
15
|
+
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
16
|
+
# -----------------------------------------------------------------------------.
|
|
17
|
+
"""DISDRODB L0 software."""
|
|
18
|
+
from disdrodb.routines.wrappers import (
|
|
19
|
+
create_summary,
|
|
20
|
+
create_summary_station,
|
|
21
|
+
run_l0,
|
|
22
|
+
run_l0_station,
|
|
23
|
+
run_l0a,
|
|
24
|
+
run_l0a_station,
|
|
25
|
+
run_l0b,
|
|
26
|
+
run_l0b_station,
|
|
27
|
+
run_l0c,
|
|
28
|
+
run_l0c_station,
|
|
29
|
+
run_l1,
|
|
30
|
+
run_l1_station,
|
|
31
|
+
run_l2e,
|
|
32
|
+
run_l2e_station,
|
|
33
|
+
run_l2m,
|
|
34
|
+
run_l2m_station,
|
|
35
|
+
)
|
|
36
|
+
|
|
37
|
+
__all__ = [
|
|
38
|
+
"create_summary",
|
|
39
|
+
"create_summary_station",
|
|
40
|
+
"run_l0",
|
|
41
|
+
"run_l0_station",
|
|
42
|
+
"run_l0a",
|
|
43
|
+
"run_l0a_station",
|
|
44
|
+
"run_l0b",
|
|
45
|
+
"run_l0b_station",
|
|
46
|
+
"run_l0c",
|
|
47
|
+
"run_l0c_station",
|
|
48
|
+
"run_l1",
|
|
49
|
+
"run_l1_station",
|
|
50
|
+
"run_l2e",
|
|
51
|
+
"run_l2e_station",
|
|
52
|
+
"run_l2m",
|
|
53
|
+
"run_l2m_station",
|
|
54
|
+
]
|