disdrodb 0.1.4__py3-none-any.whl → 0.2.0__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 +1 -5
- disdrodb/_version.py +2 -2
- disdrodb/accessor/methods.py +14 -3
- disdrodb/api/checks.py +10 -0
- disdrodb/api/create_directories.py +0 -2
- disdrodb/api/io.py +14 -17
- disdrodb/api/path.py +42 -77
- disdrodb/api/search.py +89 -23
- disdrodb/cli/disdrodb_create_summary.py +11 -1
- disdrodb/cli/disdrodb_create_summary_station.py +10 -0
- disdrodb/cli/disdrodb_run_l0.py +1 -1
- disdrodb/cli/disdrodb_run_l0a.py +1 -1
- disdrodb/cli/disdrodb_run_l0b.py +1 -1
- disdrodb/cli/disdrodb_run_l0c.py +1 -1
- disdrodb/cli/disdrodb_run_l1.py +1 -1
- disdrodb/cli/disdrodb_run_l2e.py +1 -1
- disdrodb/cli/disdrodb_run_l2m.py +1 -1
- disdrodb/configs.py +30 -83
- disdrodb/constants.py +4 -3
- disdrodb/data_transfer/download_data.py +4 -2
- disdrodb/docs.py +2 -2
- disdrodb/etc/products/L1/1MIN.yaml +13 -0
- disdrodb/etc/products/L1/LPM/1MIN.yaml +13 -0
- disdrodb/etc/products/L1/PARSIVEL/1MIN.yaml +13 -0
- disdrodb/etc/products/L1/PARSIVEL2/1MIN.yaml +13 -0
- disdrodb/etc/products/L1/PWS100/1MIN.yaml +13 -0
- disdrodb/etc/products/L1/RD80/1MIN.yaml +13 -0
- disdrodb/etc/products/L1/SWS250/1MIN.yaml +13 -0
- disdrodb/etc/products/L1/global.yaml +7 -1
- disdrodb/etc/products/L2E/10MIN.yaml +1 -12
- disdrodb/etc/products/L2E/5MIN.yaml +1 -0
- disdrodb/etc/products/L2E/global.yaml +1 -1
- disdrodb/etc/products/L2M/MODELS/GAMMA_GS_ND_MAE.yaml +6 -0
- disdrodb/etc/products/L2M/{GAMMA_ML.yaml → MODELS/GAMMA_ML.yaml} +1 -1
- disdrodb/etc/products/L2M/MODELS/LOGNORMAL_GS_LOG_ND_MAE.yaml +6 -0
- disdrodb/etc/products/L2M/MODELS/LOGNORMAL_GS_ND_MAE.yaml +6 -0
- disdrodb/etc/products/L2M/MODELS/LOGNORMAL_ML.yaml +8 -0
- disdrodb/etc/products/L2M/MODELS/NGAMMA_GS_R_MAE.yaml +6 -0
- disdrodb/etc/products/L2M/global.yaml +11 -3
- disdrodb/l0/check_configs.py +49 -16
- disdrodb/l0/configs/LPM/l0a_encodings.yml +2 -2
- disdrodb/l0/configs/LPM/l0b_cf_attrs.yml +2 -2
- disdrodb/l0/configs/LPM/l0b_encodings.yml +2 -2
- disdrodb/l0/configs/LPM/raw_data_format.yml +2 -2
- disdrodb/l0/configs/PARSIVEL/l0b_encodings.yml +1 -1
- disdrodb/l0/configs/PWS100/l0b_encodings.yml +1 -0
- disdrodb/l0/configs/SWS250/bins_diameter.yml +108 -0
- disdrodb/l0/configs/SWS250/bins_velocity.yml +83 -0
- disdrodb/l0/configs/SWS250/l0a_encodings.yml +18 -0
- disdrodb/l0/configs/SWS250/l0b_cf_attrs.yml +72 -0
- disdrodb/l0/configs/SWS250/l0b_encodings.yml +155 -0
- disdrodb/l0/configs/SWS250/raw_data_format.yml +148 -0
- disdrodb/l0/l0_reader.py +2 -2
- disdrodb/l0/l0b_processing.py +70 -15
- disdrodb/l0/l0c_processing.py +7 -3
- disdrodb/l0/readers/LPM/ARM/ARM_LPM.py +1 -1
- disdrodb/l0/readers/LPM/AUSTRALIA/MELBOURNE_2007_LPM.py +2 -2
- disdrodb/l0/readers/LPM/BELGIUM/ULIEGE.py +256 -0
- disdrodb/l0/readers/LPM/BRAZIL/CHUVA_LPM.py +2 -2
- disdrodb/l0/readers/LPM/BRAZIL/GOAMAZON_LPM.py +2 -2
- disdrodb/l0/readers/LPM/GERMANY/DWD.py +491 -0
- disdrodb/l0/readers/LPM/ITALY/GID_LPM.py +2 -2
- disdrodb/l0/readers/LPM/ITALY/GID_LPM_W.py +2 -2
- disdrodb/l0/readers/LPM/KIT/CHWALA.py +2 -2
- disdrodb/l0/readers/LPM/SLOVENIA/ARSO.py +107 -12
- disdrodb/l0/readers/LPM/SLOVENIA/UL.py +3 -3
- disdrodb/l0/readers/LPM/SWITZERLAND/INNERERIZ_LPM.py +2 -2
- disdrodb/l0/readers/PARSIVEL/BASQUECOUNTRY/EUSKALMET_OTT.py +227 -0
- disdrodb/l0/readers/PARSIVEL/{GPM → NASA}/LPVEX.py +1 -1
- disdrodb/l0/readers/PARSIVEL/NCAR/VORTEX2_2010.py +5 -14
- disdrodb/l0/readers/PARSIVEL/NCAR/VORTEX2_2010_UF.py +8 -17
- disdrodb/l0/readers/PARSIVEL/SLOVENIA/UL.py +117 -8
- disdrodb/l0/readers/PARSIVEL2/BASQUECOUNTRY/EUSKALMET_OTT2.py +232 -0
- disdrodb/l0/readers/PARSIVEL2/BRAZIL/CHUVA_PARSIVEL2.py +10 -14
- disdrodb/l0/readers/PARSIVEL2/BRAZIL/GOAMAZON_PARSIVEL2.py +10 -14
- disdrodb/l0/readers/PARSIVEL2/DENMARK/DTU.py +8 -14
- disdrodb/l0/readers/PARSIVEL2/DENMARK/EROSION_raw.py +382 -0
- disdrodb/l0/readers/PARSIVEL2/FINLAND/FMI_PARSIVEL2.py +4 -0
- disdrodb/l0/readers/PARSIVEL2/FRANCE/OSUG.py +1 -1
- disdrodb/l0/readers/PARSIVEL2/GREECE/NOA.py +127 -0
- disdrodb/l0/readers/PARSIVEL2/ITALY/HYDROX.py +239 -0
- disdrodb/l0/readers/PARSIVEL2/NCAR/FARM_PARSIVEL2.py +5 -11
- disdrodb/l0/readers/PARSIVEL2/NCAR/PERILS_MIPS.py +4 -17
- disdrodb/l0/readers/PARSIVEL2/NCAR/RELAMPAGO_PARSIVEL2.py +5 -14
- disdrodb/l0/readers/PARSIVEL2/NCAR/SNOWIE_PJ.py +10 -13
- disdrodb/l0/readers/PARSIVEL2/NCAR/SNOWIE_SB.py +10 -13
- disdrodb/l0/readers/PARSIVEL2/PHILIPPINES/PAGASA.py +232 -0
- disdrodb/l0/readers/PARSIVEL2/SPAIN/CENER.py +6 -18
- disdrodb/l0/readers/PARSIVEL2/{NASA/LPVEX.py → SPAIN/GRANADA.py} +46 -35
- disdrodb/l0/readers/PARSIVEL2/SWEDEN/SMHI.py +189 -0
- disdrodb/l0/readers/PARSIVEL2/USA/{C3WE.py → CW3E.py} +10 -28
- disdrodb/l0/readers/PWS100/AUSTRIA/HOAL.py +321 -0
- disdrodb/l0/readers/SW250/BELGIUM/KMI.py +239 -0
- disdrodb/l1/beard_model.py +31 -129
- disdrodb/l1/fall_velocity.py +136 -83
- disdrodb/l1/filters.py +25 -28
- disdrodb/l1/processing.py +16 -17
- disdrodb/l1/resampling.py +101 -38
- disdrodb/l1_env/routines.py +46 -17
- disdrodb/l2/empirical_dsd.py +6 -0
- disdrodb/l2/processing.py +6 -5
- disdrodb/metadata/geolocation.py +0 -2
- disdrodb/metadata/search.py +3 -4
- disdrodb/psd/fitting.py +16 -13
- disdrodb/routines/l0.py +2 -2
- disdrodb/routines/l1.py +173 -60
- disdrodb/routines/l2.py +148 -284
- disdrodb/routines/options.py +345 -0
- disdrodb/routines/wrappers.py +14 -1
- disdrodb/scattering/axis_ratio.py +90 -84
- disdrodb/scattering/permittivity.py +6 -0
- disdrodb/summary/routines.py +735 -670
- disdrodb/utils/archiving.py +51 -44
- disdrodb/utils/attrs.py +3 -1
- disdrodb/utils/dask.py +4 -4
- disdrodb/utils/dict.py +33 -0
- disdrodb/utils/encoding.py +6 -1
- disdrodb/utils/routines.py +9 -8
- disdrodb/utils/time.py +11 -3
- disdrodb/viz/__init__.py +0 -13
- disdrodb/viz/plots.py +231 -1
- {disdrodb-0.1.4.dist-info → disdrodb-0.2.0.dist-info}/METADATA +2 -1
- {disdrodb-0.1.4.dist-info → disdrodb-0.2.0.dist-info}/RECORD +135 -103
- /disdrodb/etc/products/L2M/{NGAMMA_GS_LOG_ND_MAE.yaml → MODELS/NGAMMA_GS_LOG_ND_MAE.yaml} +0 -0
- /disdrodb/etc/products/L2M/{NGAMMA_GS_ND_MAE.yaml → MODELS/NGAMMA_GS_ND_MAE.yaml} +0 -0
- /disdrodb/etc/products/L2M/{NGAMMA_GS_Z_MAE.yaml → MODELS/NGAMMA_GS_Z_MAE.yaml} +0 -0
- /disdrodb/l0/readers/PARSIVEL/{GPM → NASA}/IFLOODS.py +0 -0
- /disdrodb/l0/readers/PARSIVEL/{GPM → NASA}/MC3E.py +0 -0
- /disdrodb/l0/readers/PARSIVEL/{GPM → NASA}/PIERS.py +0 -0
- /disdrodb/l0/readers/PARSIVEL2/{GPM → NASA}/GCPEX.py +0 -0
- /disdrodb/l0/readers/PARSIVEL2/{GPM → NASA}/NSSTC.py +0 -0
- {disdrodb-0.1.4.dist-info → disdrodb-0.2.0.dist-info}/WHEEL +0 -0
- {disdrodb-0.1.4.dist-info → disdrodb-0.2.0.dist-info}/entry_points.txt +0 -0
- {disdrodb-0.1.4.dist-info → disdrodb-0.2.0.dist-info}/licenses/LICENSE +0 -0
- {disdrodb-0.1.4.dist-info → disdrodb-0.2.0.dist-info}/top_level.txt +0 -0
|
@@ -39,6 +39,14 @@ sys.tracebacklimit = 0 # avoid full traceback error if occur
|
|
|
39
39
|
@click_data_archive_dir_option
|
|
40
40
|
@click_metadata_archive_dir_option
|
|
41
41
|
@click.option("-p", "--parallel", type=bool, show_default=True, default=False, help="Read files in parallel")
|
|
42
|
+
@click.option(
|
|
43
|
+
"-t",
|
|
44
|
+
"--temporal_resolution",
|
|
45
|
+
type=str,
|
|
46
|
+
show_default=True,
|
|
47
|
+
default="1MIN",
|
|
48
|
+
help="Temporal resolution of the L2E product to be used for the summary.",
|
|
49
|
+
)
|
|
42
50
|
def disdrodb_create_summary(
|
|
43
51
|
# Stations options
|
|
44
52
|
data_sources: Optional[str] = None,
|
|
@@ -46,6 +54,7 @@ def disdrodb_create_summary(
|
|
|
46
54
|
station_names: Optional[str] = None,
|
|
47
55
|
# Processing options:
|
|
48
56
|
parallel=False,
|
|
57
|
+
temporal_resolution="1MIN",
|
|
49
58
|
# DISDRODB root directories
|
|
50
59
|
data_archive_dir: Optional[str] = None,
|
|
51
60
|
metadata_archive_dir: Optional[str] = None,
|
|
@@ -58,7 +67,7 @@ def disdrodb_create_summary(
|
|
|
58
67
|
Name of data source(s) to process.
|
|
59
68
|
The name(s) must be UPPER CASE.
|
|
60
69
|
If campaign_names and station are not specified, process all stations.
|
|
61
|
-
To specify multiple data sources, write i.e.: --data_sources '
|
|
70
|
+
To specify multiple data sources, write i.e.: --data_sources 'NASA EPFL NCAR'
|
|
62
71
|
campaign_names : str
|
|
63
72
|
Name of the campaign(s) for which to create stations summaries.
|
|
64
73
|
The name(s) must be UPPER CASE.
|
|
@@ -92,6 +101,7 @@ def disdrodb_create_summary(
|
|
|
92
101
|
station_names=station_names,
|
|
93
102
|
# Options
|
|
94
103
|
parallel=parallel,
|
|
104
|
+
temporal_resolution=temporal_resolution,
|
|
95
105
|
# DISDRODB root directory
|
|
96
106
|
data_archive_dir=data_archive_dir,
|
|
97
107
|
metadata_archive_dir=metadata_archive_dir,
|
|
@@ -36,6 +36,14 @@ sys.tracebacklimit = 0 # avoid full traceback error if occur
|
|
|
36
36
|
@click_station_arguments
|
|
37
37
|
@click_data_archive_dir_option
|
|
38
38
|
@click.option("-p", "--parallel", type=bool, show_default=True, default=False, help="Read files in parallel")
|
|
39
|
+
@click.option(
|
|
40
|
+
"-t",
|
|
41
|
+
"--temporal_resolution",
|
|
42
|
+
type=str,
|
|
43
|
+
show_default=True,
|
|
44
|
+
default="1MIN",
|
|
45
|
+
help="Temporal resolution of the L2E product to be used for the summary.",
|
|
46
|
+
)
|
|
39
47
|
def disdrodb_create_summary_station(
|
|
40
48
|
# Station arguments
|
|
41
49
|
data_source: str,
|
|
@@ -43,6 +51,7 @@ def disdrodb_create_summary_station(
|
|
|
43
51
|
station_name: str,
|
|
44
52
|
# Processing options:
|
|
45
53
|
parallel=False,
|
|
54
|
+
temporal_resolution="1MIN",
|
|
46
55
|
# DISDRODB root directories
|
|
47
56
|
data_archive_dir: Optional[str] = None,
|
|
48
57
|
):
|
|
@@ -81,6 +90,7 @@ def disdrodb_create_summary_station(
|
|
|
81
90
|
station_name=station_name,
|
|
82
91
|
# Options
|
|
83
92
|
parallel=parallel,
|
|
93
|
+
temporal_resolution=temporal_resolution,
|
|
84
94
|
# DISDRODB root directory
|
|
85
95
|
data_archive_dir=data_archive_dir,
|
|
86
96
|
)
|
disdrodb/cli/disdrodb_run_l0.py
CHANGED
|
@@ -75,7 +75,7 @@ def disdrodb_run_l0(
|
|
|
75
75
|
Name of data source(s) to process.
|
|
76
76
|
The name(s) must be UPPER CASE.
|
|
77
77
|
If campaign_names and station are not specified, process all stations.
|
|
78
|
-
To specify multiple data sources, write i.e.: --data_sources '
|
|
78
|
+
To specify multiple data sources, write i.e.: --data_sources 'NASA EPFL NCAR'
|
|
79
79
|
campaign_names : str
|
|
80
80
|
Name of the campaign(s) to process.
|
|
81
81
|
The name(s) must be UPPER CASE.
|
disdrodb/cli/disdrodb_run_l0a.py
CHANGED
|
@@ -65,7 +65,7 @@ def disdrodb_run_l0a(
|
|
|
65
65
|
Name of data source(s) to process.
|
|
66
66
|
The name(s) must be UPPER CASE.
|
|
67
67
|
If campaign_names and station are not specified, process all stations.
|
|
68
|
-
To specify multiple data sources, write i.e.: --data_sources '
|
|
68
|
+
To specify multiple data sources, write i.e.: --data_sources 'NASA EPFL NCAR'
|
|
69
69
|
campaign_names : str
|
|
70
70
|
Name of the campaign(s) to process.
|
|
71
71
|
The name(s) must be UPPER CASE.
|
disdrodb/cli/disdrodb_run_l0b.py
CHANGED
|
@@ -68,7 +68,7 @@ def disdrodb_run_l0b(
|
|
|
68
68
|
Name of data source(s) to process.
|
|
69
69
|
The name(s) must be UPPER CASE.
|
|
70
70
|
If campaign_names and station are not specified, process all stations.
|
|
71
|
-
To specify multiple data sources, write i.e.: --data_sources '
|
|
71
|
+
To specify multiple data sources, write i.e.: --data_sources 'NASA EPFL NCAR'
|
|
72
72
|
campaign_names : str
|
|
73
73
|
Name of the campaign(s) to process.
|
|
74
74
|
The name(s) must be UPPER CASE.
|
disdrodb/cli/disdrodb_run_l0c.py
CHANGED
|
@@ -69,7 +69,7 @@ def disdrodb_run_l0c(
|
|
|
69
69
|
Name of data source(s) to process.
|
|
70
70
|
The name(s) must be UPPER CASE.
|
|
71
71
|
If campaign_names and station are not specified, process all stations.
|
|
72
|
-
To specify multiple data sources, write i.e.: --data_sources '
|
|
72
|
+
To specify multiple data sources, write i.e.: --data_sources 'NASA EPFL NCAR'
|
|
73
73
|
campaign_names : str
|
|
74
74
|
Name of the campaign(s) to process.
|
|
75
75
|
The name(s) must be UPPER CASE.
|
disdrodb/cli/disdrodb_run_l1.py
CHANGED
|
@@ -65,7 +65,7 @@ def disdrodb_run_l1(
|
|
|
65
65
|
Name of data source(s) to process.
|
|
66
66
|
The name(s) must be UPPER CASE.
|
|
67
67
|
If campaign_names and station are not specified, process all stations.
|
|
68
|
-
To specify multiple data sources, write i.e.: --data_sources '
|
|
68
|
+
To specify multiple data sources, write i.e.: --data_sources 'NASA EPFL NCAR'
|
|
69
69
|
campaign_names : str
|
|
70
70
|
Name of the campaign(s) to process.
|
|
71
71
|
The name(s) must be UPPER CASE.
|
disdrodb/cli/disdrodb_run_l2e.py
CHANGED
|
@@ -65,7 +65,7 @@ def disdrodb_run_l2e(
|
|
|
65
65
|
Name of data source(s) to process.
|
|
66
66
|
The name(s) must be UPPER CASE.
|
|
67
67
|
If campaign_names and station are not specified, process all stations.
|
|
68
|
-
To specify multiple data sources, write i.e.: --data_sources '
|
|
68
|
+
To specify multiple data sources, write i.e.: --data_sources 'NASA EPFL NCAR'
|
|
69
69
|
campaign_names : str
|
|
70
70
|
Name of the campaign(s) to process.
|
|
71
71
|
The name(s) must be UPPER CASE.
|
disdrodb/cli/disdrodb_run_l2m.py
CHANGED
|
@@ -65,7 +65,7 @@ def disdrodb_run_l2m(
|
|
|
65
65
|
Name of data source(s) to process.
|
|
66
66
|
The name(s) must be UPPER CASE.
|
|
67
67
|
If campaign_names and station are not specified, process all stations.
|
|
68
|
-
To specify multiple data sources, write i.e.: --data_sources '
|
|
68
|
+
To specify multiple data sources, write i.e.: --data_sources 'NASA EPFL NCAR'
|
|
69
69
|
campaign_names : str
|
|
70
70
|
Name of the campaign(s) to process.
|
|
71
71
|
The name(s) must be UPPER CASE.
|
disdrodb/configs.py
CHANGED
|
@@ -37,7 +37,7 @@ def define_configs(
|
|
|
37
37
|
data_archive_dir: Optional[str] = None,
|
|
38
38
|
metadata_archive_dir: Optional[str] = None,
|
|
39
39
|
scattering_table_dir: Optional[str] = None,
|
|
40
|
-
|
|
40
|
+
products_configs_dir: Optional[str] = None,
|
|
41
41
|
folder_partitioning: Optional[str] = None,
|
|
42
42
|
zenodo_token: Optional[str] = None,
|
|
43
43
|
zenodo_sandbox_token: Optional[str] = None,
|
|
@@ -53,7 +53,7 @@ def define_configs(
|
|
|
53
53
|
The directory path where the DISDRODB Metadata Archive is located.
|
|
54
54
|
scattering_table_dir : str
|
|
55
55
|
The directory path where to store DISDRODB T-Matrix scattering tables.
|
|
56
|
-
|
|
56
|
+
products_configs_dir : str
|
|
57
57
|
The directory path where the custom DISDRODB products configurations files are defined.
|
|
58
58
|
folder_partitioning : str
|
|
59
59
|
The folder partitioning scheme used in the DISDRODB Data Archive.
|
|
@@ -64,7 +64,7 @@ def define_configs(
|
|
|
64
64
|
- "year/month/day": Files are stored under subdirectories by year, month and day (<station_dir>/2025/04/01).
|
|
65
65
|
- "year/month_name": Files are stored under subdirectories by year and month name (<station_dir>/2025/April).
|
|
66
66
|
- "year/quarter": Files are stored under subdirectories by year and quarter (<station_dir>/2025/Q2).
|
|
67
|
-
|
|
67
|
+
zenodo_token: str
|
|
68
68
|
Zenodo Access Token. It is required to upload stations data to Zenodo.
|
|
69
69
|
zenodo_sandbox_token: str
|
|
70
70
|
Zenodo Sandbox Access Token. It is required to upload stations data to Zenodo Sandbox.
|
|
@@ -118,8 +118,8 @@ def define_configs(
|
|
|
118
118
|
if zenodo_sandbox_token is not None:
|
|
119
119
|
config_dict["zenodo_sandbox_token"] = zenodo_sandbox_token
|
|
120
120
|
|
|
121
|
-
if
|
|
122
|
-
config_dict["
|
|
121
|
+
if products_configs_dir is not None:
|
|
122
|
+
config_dict["products_configs_dir"] = products_configs_dir
|
|
123
123
|
|
|
124
124
|
# Write the DISDRODB config file
|
|
125
125
|
write_yaml(config_dict, filepath, sort_keys=False)
|
|
@@ -238,105 +238,52 @@ def get_zenodo_token(sandbox: bool):
|
|
|
238
238
|
return token
|
|
239
239
|
|
|
240
240
|
|
|
241
|
-
def
|
|
242
|
-
"""Return the
|
|
241
|
+
def get_default_products_configs_dir():
|
|
242
|
+
"""Return the directory path where DISDRODB products default configuration files are stored."""
|
|
243
243
|
import disdrodb
|
|
244
244
|
|
|
245
|
-
|
|
246
|
-
return
|
|
245
|
+
products_configs_dir = os.path.join(disdrodb.package_dir, "etc", "products")
|
|
246
|
+
return products_configs_dir
|
|
247
247
|
|
|
248
248
|
|
|
249
|
-
def
|
|
250
|
-
"""
|
|
249
|
+
def get_products_configs_dir():
|
|
250
|
+
"""Return the DISDRODB products configuration directory."""
|
|
251
251
|
import disdrodb
|
|
252
252
|
|
|
253
|
-
if "
|
|
254
|
-
|
|
255
|
-
|
|
253
|
+
if os.environ.get("PYTEST_CURRENT_TEST"):
|
|
254
|
+
products_configs_dir = os.path.join(disdrodb.package_dir, "tests", "products")
|
|
255
|
+
else:
|
|
256
|
+
products_configs_dir = disdrodb.config.get("products_configs_dir", None)
|
|
257
|
+
if products_configs_dir is None:
|
|
258
|
+
products_configs_dir = get_default_products_configs_dir()
|
|
259
|
+
return products_configs_dir
|
|
256
260
|
|
|
257
261
|
|
|
258
|
-
def
|
|
262
|
+
def copy_default_products_configs(products_configs_dir):
|
|
259
263
|
"""Copy the default DISDRODB products configuration directory to a custom location.
|
|
260
264
|
|
|
261
|
-
This function duplicates the entire directory of default
|
|
265
|
+
This function duplicates the entire directory of default products settings
|
|
262
266
|
(located at ``disdrodb/etc/products``) into the user-specified
|
|
263
|
-
``
|
|
267
|
+
``products_configs_dir``. Once copied, you can safely edit these files without
|
|
264
268
|
modifying the library's built-in defaults. To have DISDRODB use your
|
|
265
269
|
custom settings, point the global configuration at this new directory
|
|
266
|
-
(e.g by specifying ``
|
|
270
|
+
(e.g by specifying ``products_configs_dir`` with the ``disdrodb.define_configs`` function).
|
|
267
271
|
|
|
268
272
|
Parameters
|
|
269
273
|
----------
|
|
270
|
-
|
|
271
|
-
|
|
274
|
+
products_configs_dir:
|
|
275
|
+
Directory where the default products configuration files
|
|
272
276
|
will be copied. This directory must not already exist, and later
|
|
273
277
|
needs to be referenced in your DISDRODB global configuration.
|
|
274
278
|
|
|
275
279
|
Returns
|
|
276
280
|
-------
|
|
277
|
-
|
|
281
|
+
products_configs_dir
|
|
278
282
|
The path to the newly created custom product configuration directory.
|
|
279
283
|
|
|
280
284
|
"""
|
|
281
|
-
source_dir_path =
|
|
282
|
-
if os.path.exists(
|
|
283
|
-
raise FileExistsError(f"The {
|
|
284
|
-
|
|
285
|
-
return
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
def get_product_options(product, temporal_resolution=None):
|
|
289
|
-
"""Get options for DISDRODB products."""
|
|
290
|
-
import disdrodb
|
|
291
|
-
from disdrodb.api.checks import check_product
|
|
292
|
-
|
|
293
|
-
# Define configs path
|
|
294
|
-
if os.environ.get("PYTEST_CURRENT_TEST"):
|
|
295
|
-
configs_path = os.path.join(disdrodb.__root_path__, "disdrodb", "tests", "products")
|
|
296
|
-
else:
|
|
297
|
-
configs_path = disdrodb.config.get("configs_path", get_product_default_configs_path())
|
|
298
|
-
|
|
299
|
-
# Validate DISDRODB products configuration
|
|
300
|
-
validate_product_configuration(configs_path)
|
|
301
|
-
|
|
302
|
-
# Check product
|
|
303
|
-
check_product(product)
|
|
304
|
-
|
|
305
|
-
# Retrieve global product options
|
|
306
|
-
global_options = read_yaml(os.path.join(configs_path, product, "global.yaml"))
|
|
307
|
-
if temporal_resolution is None:
|
|
308
|
-
global_options = check_availability_radar_simulations(global_options)
|
|
309
|
-
return global_options
|
|
310
|
-
|
|
311
|
-
# If temporal resolutions are specified, drop 'temporal_resolutions' key
|
|
312
|
-
global_options.pop("temporal_resolutions", None)
|
|
313
|
-
custom_options_path = os.path.join(configs_path, product, f"{temporal_resolution}.yaml")
|
|
314
|
-
if not os.path.exists(custom_options_path):
|
|
315
|
-
return global_options
|
|
316
|
-
custom_options = read_yaml(custom_options_path)
|
|
317
|
-
options = global_options.copy()
|
|
318
|
-
options.update(custom_options)
|
|
319
|
-
options = check_availability_radar_simulations(options)
|
|
320
|
-
return options
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
def get_product_temporal_resolutions(product):
|
|
324
|
-
"""Get DISDRODB L2 product temporal aggregations."""
|
|
325
|
-
# Check only L2E and L2M
|
|
326
|
-
return get_product_options(product)["temporal_resolutions"]
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
def get_model_options(product, model_name):
|
|
330
|
-
"""Get DISDRODB L2M model options."""
|
|
331
|
-
import disdrodb
|
|
332
|
-
|
|
333
|
-
configs_path = disdrodb.config.get("configs_path", get_product_default_configs_path())
|
|
334
|
-
model_options_path = os.path.join(configs_path, product, f"{model_name}.yaml")
|
|
335
|
-
model_options = read_yaml(model_options_path)
|
|
336
|
-
return model_options
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
def validate_product_configuration(configs_path):
|
|
340
|
-
"""Validate the DISDRODB products configuration files."""
|
|
341
|
-
# TODO: Implement validation of DISDRODB products configuration files with pydantic
|
|
342
|
-
pass
|
|
285
|
+
source_dir_path = get_default_products_configs_dir()
|
|
286
|
+
if os.path.exists(products_configs_dir):
|
|
287
|
+
raise FileExistsError(f"The {products_configs_dir} directory already exists!")
|
|
288
|
+
products_configs_dir = shutil.copytree(source_dir_path, products_configs_dir)
|
|
289
|
+
return products_configs_dir
|
disdrodb/constants.py
CHANGED
|
@@ -41,14 +41,15 @@ COORDINATES = [
|
|
|
41
41
|
"time",
|
|
42
42
|
"sample_interval",
|
|
43
43
|
]
|
|
44
|
-
OPTICAL_SENSORS = ["PARSIVEL", "PARSIVEL2", "LPM", "PWS100"]
|
|
44
|
+
OPTICAL_SENSORS = ["PARSIVEL", "PARSIVEL2", "LPM", "PWS100", "SWS250"]
|
|
45
45
|
IMPACT_SENSORS = ["RD80"]
|
|
46
46
|
|
|
47
47
|
PRODUCTS = ["RAW", "L0A", "L0B", "L0C", "L1", "L2E", "L2M"]
|
|
48
48
|
|
|
49
49
|
PRODUCTS_ARGUMENTS = {
|
|
50
|
-
"
|
|
51
|
-
"
|
|
50
|
+
"L1": ["temporal_resolution"],
|
|
51
|
+
"L2E": ["temporal_resolution"],
|
|
52
|
+
"L2M": ["temporal_resolution", "model_name"],
|
|
52
53
|
}
|
|
53
54
|
|
|
54
55
|
PRODUCTS_REQUIREMENTS = {
|
|
@@ -166,8 +166,8 @@ def download_archive(
|
|
|
166
166
|
metadata_archive_dir=metadata_archive_dir,
|
|
167
167
|
force=force,
|
|
168
168
|
)
|
|
169
|
-
except Exception:
|
|
170
|
-
print(" - Download error: {e}")
|
|
169
|
+
except Exception as e:
|
|
170
|
+
print(f" - Download error: {e}")
|
|
171
171
|
print(" ")
|
|
172
172
|
|
|
173
173
|
|
|
@@ -397,6 +397,8 @@ def build_webserver_wget_command(url: str, cut_dirs: int, dst_dir: str, force: b
|
|
|
397
397
|
"-r",
|
|
398
398
|
"-np",
|
|
399
399
|
"-nH",
|
|
400
|
+
"--reject",
|
|
401
|
+
"index.html*", # avoid to download Apache autoindex index.html
|
|
400
402
|
f"--cut-dirs={cut_dirs}",
|
|
401
403
|
]
|
|
402
404
|
if force:
|
disdrodb/docs.py
CHANGED
|
@@ -26,10 +26,10 @@ from disdrodb.api.checks import check_sensor_name
|
|
|
26
26
|
|
|
27
27
|
def open_sensor_documentation(sensor_name):
|
|
28
28
|
"""Open the sensor documentation PDF in the browser."""
|
|
29
|
-
from disdrodb import
|
|
29
|
+
from disdrodb import package_dir
|
|
30
30
|
|
|
31
31
|
check_sensor_name(sensor_name)
|
|
32
|
-
docs_filepath = os.path.join(
|
|
32
|
+
docs_filepath = os.path.join(package_dir, "l0", "manuals", sensor_name + ".pdf")
|
|
33
33
|
webbrowser.open(docs_filepath)
|
|
34
34
|
|
|
35
35
|
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
product_options:
|
|
2
|
+
fall_velocity_model: "Beard1976"
|
|
3
|
+
minimum_diameter: 0
|
|
4
|
+
maximum_diameter: 10
|
|
5
|
+
minimum_velocity: 0
|
|
6
|
+
maximum_velocity: 12
|
|
7
|
+
above_velocity_fraction: 0.5
|
|
8
|
+
above_velocity_tolerance: null
|
|
9
|
+
below_velocity_fraction: 0.5
|
|
10
|
+
below_velocity_tolerance: null
|
|
11
|
+
small_diameter_threshold: 1
|
|
12
|
+
small_velocity_threshold: 2.5
|
|
13
|
+
maintain_smallest_drops: True
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
product_options:
|
|
2
|
+
fall_velocity_model: "Beard1976"
|
|
3
|
+
minimum_diameter: 0
|
|
4
|
+
maximum_diameter: 10
|
|
5
|
+
minimum_velocity: 0
|
|
6
|
+
maximum_velocity: 12
|
|
7
|
+
above_velocity_fraction: 0.5
|
|
8
|
+
above_velocity_tolerance: null
|
|
9
|
+
below_velocity_fraction: 0.5
|
|
10
|
+
below_velocity_tolerance: null
|
|
11
|
+
small_diameter_threshold: 1
|
|
12
|
+
small_velocity_threshold: 2.5
|
|
13
|
+
maintain_smallest_drops: True
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
product_options:
|
|
2
|
+
fall_velocity_model: "Beard1976"
|
|
3
|
+
minimum_diameter: 0
|
|
4
|
+
maximum_diameter: 10
|
|
5
|
+
minimum_velocity: 0
|
|
6
|
+
maximum_velocity: 12
|
|
7
|
+
above_velocity_fraction: 0.6
|
|
8
|
+
above_velocity_tolerance: null
|
|
9
|
+
below_velocity_fraction: 0.6
|
|
10
|
+
below_velocity_tolerance: null
|
|
11
|
+
small_diameter_threshold: 1
|
|
12
|
+
small_velocity_threshold: 2.5
|
|
13
|
+
maintain_smallest_drops: True
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
product_options:
|
|
2
|
+
fall_velocity_model: "Beard1976"
|
|
3
|
+
minimum_diameter: 0
|
|
4
|
+
maximum_diameter: 10
|
|
5
|
+
minimum_velocity: 0
|
|
6
|
+
maximum_velocity: 12
|
|
7
|
+
above_velocity_fraction: 0.5
|
|
8
|
+
above_velocity_tolerance: null
|
|
9
|
+
below_velocity_fraction: 0.5
|
|
10
|
+
below_velocity_tolerance: null
|
|
11
|
+
small_diameter_threshold: 1
|
|
12
|
+
small_velocity_threshold: 2.5
|
|
13
|
+
maintain_smallest_drops: True
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
product_options:
|
|
2
|
+
fall_velocity_model: "Beard1976"
|
|
3
|
+
minimum_diameter: 0
|
|
4
|
+
maximum_diameter: 10
|
|
5
|
+
minimum_velocity: 0
|
|
6
|
+
maximum_velocity: 12
|
|
7
|
+
above_velocity_fraction: 0.5
|
|
8
|
+
above_velocity_tolerance: null
|
|
9
|
+
below_velocity_fraction: 0.5
|
|
10
|
+
below_velocity_tolerance: null
|
|
11
|
+
small_diameter_threshold: 1
|
|
12
|
+
small_velocity_threshold: 2.5
|
|
13
|
+
maintain_smallest_drops: True
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
product_options:
|
|
2
|
+
fall_velocity_model: "Beard1976"
|
|
3
|
+
minimum_diameter: 0
|
|
4
|
+
maximum_diameter: 10
|
|
5
|
+
minimum_velocity: 0
|
|
6
|
+
maximum_velocity: 12
|
|
7
|
+
above_velocity_fraction: 0.5
|
|
8
|
+
above_velocity_tolerance: null
|
|
9
|
+
below_velocity_fraction: 0.5
|
|
10
|
+
below_velocity_tolerance: null
|
|
11
|
+
small_diameter_threshold: 1
|
|
12
|
+
small_velocity_threshold: 2.5
|
|
13
|
+
maintain_smallest_drops: True
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
product_options:
|
|
2
|
+
fall_velocity_model: "Beard1976"
|
|
3
|
+
minimum_diameter: 0
|
|
4
|
+
maximum_diameter: 10
|
|
5
|
+
minimum_velocity: 0
|
|
6
|
+
maximum_velocity: 12
|
|
7
|
+
above_velocity_fraction: 0.5
|
|
8
|
+
above_velocity_tolerance: null
|
|
9
|
+
below_velocity_fraction: 0.5
|
|
10
|
+
below_velocity_tolerance: null
|
|
11
|
+
small_diameter_threshold: 1
|
|
12
|
+
small_velocity_threshold: 2.5
|
|
13
|
+
maintain_smallest_drops: True
|
|
@@ -1,5 +1,11 @@
|
|
|
1
|
+
temporal_resolutions: ["1MIN", "5MIN", "10MIN", "ROLL1MIN", "5MIN"]
|
|
2
|
+
archive_options:
|
|
3
|
+
strategy: time_block
|
|
4
|
+
strategy_options:
|
|
5
|
+
freq: day
|
|
6
|
+
folder_partitioning: "year"
|
|
1
7
|
product_options:
|
|
2
|
-
|
|
8
|
+
fall_velocity_model: "Beard1976"
|
|
3
9
|
minimum_diameter: 0
|
|
4
10
|
maximum_diameter: 10
|
|
5
11
|
minimum_velocity: 0
|
|
@@ -1,12 +1 @@
|
|
|
1
|
-
|
|
2
|
-
strategy: event
|
|
3
|
-
strategy_options:
|
|
4
|
-
min_drops: 5
|
|
5
|
-
neighbor_min_size: 2
|
|
6
|
-
neighbor_time_interval: "5MIN"
|
|
7
|
-
event_max_time_gap: "6H"
|
|
8
|
-
event_min_duration: "5MIN"
|
|
9
|
-
event_min_size: 3
|
|
10
|
-
folder_partitioning: "year/month"
|
|
11
|
-
product_options:
|
|
12
|
-
minimum_ndrops: 0
|
|
1
|
+
radar_enabled: True
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
radar_enabled: True
|
|
@@ -1,12 +1,20 @@
|
|
|
1
|
-
temporal_resolutions: ["1MIN"
|
|
2
|
-
models:
|
|
1
|
+
temporal_resolutions: ["1MIN"] #, "5MIN", "10MIN"]
|
|
2
|
+
models:
|
|
3
|
+
[
|
|
4
|
+
"GAMMA_ML",
|
|
5
|
+
"GAMMA_GS_ND_MAE",
|
|
6
|
+
"NGAMMA_GS_LOG_ND_MAE",
|
|
7
|
+
"NGAMMA_GS_ND_MAE",
|
|
8
|
+
"LOGNORMAL_ML",
|
|
9
|
+
"LOGNORMAL_GS_ND_MAE",
|
|
10
|
+
]
|
|
3
11
|
archive_options:
|
|
4
12
|
strategy: time_block
|
|
5
13
|
strategy_options:
|
|
6
14
|
freq: month
|
|
7
15
|
folder_partitioning: ""
|
|
8
16
|
product_options:
|
|
9
|
-
|
|
17
|
+
fall_velocity_model: "Beard1976"
|
|
10
18
|
diameter_min: 0
|
|
11
19
|
diameter_max: 10
|
|
12
20
|
diameter_spacing: 0.05
|