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.
Files changed (135) hide show
  1. disdrodb/__init__.py +1 -5
  2. disdrodb/_version.py +2 -2
  3. disdrodb/accessor/methods.py +14 -3
  4. disdrodb/api/checks.py +10 -0
  5. disdrodb/api/create_directories.py +0 -2
  6. disdrodb/api/io.py +14 -17
  7. disdrodb/api/path.py +42 -77
  8. disdrodb/api/search.py +89 -23
  9. disdrodb/cli/disdrodb_create_summary.py +11 -1
  10. disdrodb/cli/disdrodb_create_summary_station.py +10 -0
  11. disdrodb/cli/disdrodb_run_l0.py +1 -1
  12. disdrodb/cli/disdrodb_run_l0a.py +1 -1
  13. disdrodb/cli/disdrodb_run_l0b.py +1 -1
  14. disdrodb/cli/disdrodb_run_l0c.py +1 -1
  15. disdrodb/cli/disdrodb_run_l1.py +1 -1
  16. disdrodb/cli/disdrodb_run_l2e.py +1 -1
  17. disdrodb/cli/disdrodb_run_l2m.py +1 -1
  18. disdrodb/configs.py +30 -83
  19. disdrodb/constants.py +4 -3
  20. disdrodb/data_transfer/download_data.py +4 -2
  21. disdrodb/docs.py +2 -2
  22. disdrodb/etc/products/L1/1MIN.yaml +13 -0
  23. disdrodb/etc/products/L1/LPM/1MIN.yaml +13 -0
  24. disdrodb/etc/products/L1/PARSIVEL/1MIN.yaml +13 -0
  25. disdrodb/etc/products/L1/PARSIVEL2/1MIN.yaml +13 -0
  26. disdrodb/etc/products/L1/PWS100/1MIN.yaml +13 -0
  27. disdrodb/etc/products/L1/RD80/1MIN.yaml +13 -0
  28. disdrodb/etc/products/L1/SWS250/1MIN.yaml +13 -0
  29. disdrodb/etc/products/L1/global.yaml +7 -1
  30. disdrodb/etc/products/L2E/10MIN.yaml +1 -12
  31. disdrodb/etc/products/L2E/5MIN.yaml +1 -0
  32. disdrodb/etc/products/L2E/global.yaml +1 -1
  33. disdrodb/etc/products/L2M/MODELS/GAMMA_GS_ND_MAE.yaml +6 -0
  34. disdrodb/etc/products/L2M/{GAMMA_ML.yaml → MODELS/GAMMA_ML.yaml} +1 -1
  35. disdrodb/etc/products/L2M/MODELS/LOGNORMAL_GS_LOG_ND_MAE.yaml +6 -0
  36. disdrodb/etc/products/L2M/MODELS/LOGNORMAL_GS_ND_MAE.yaml +6 -0
  37. disdrodb/etc/products/L2M/MODELS/LOGNORMAL_ML.yaml +8 -0
  38. disdrodb/etc/products/L2M/MODELS/NGAMMA_GS_R_MAE.yaml +6 -0
  39. disdrodb/etc/products/L2M/global.yaml +11 -3
  40. disdrodb/l0/check_configs.py +49 -16
  41. disdrodb/l0/configs/LPM/l0a_encodings.yml +2 -2
  42. disdrodb/l0/configs/LPM/l0b_cf_attrs.yml +2 -2
  43. disdrodb/l0/configs/LPM/l0b_encodings.yml +2 -2
  44. disdrodb/l0/configs/LPM/raw_data_format.yml +2 -2
  45. disdrodb/l0/configs/PARSIVEL/l0b_encodings.yml +1 -1
  46. disdrodb/l0/configs/PWS100/l0b_encodings.yml +1 -0
  47. disdrodb/l0/configs/SWS250/bins_diameter.yml +108 -0
  48. disdrodb/l0/configs/SWS250/bins_velocity.yml +83 -0
  49. disdrodb/l0/configs/SWS250/l0a_encodings.yml +18 -0
  50. disdrodb/l0/configs/SWS250/l0b_cf_attrs.yml +72 -0
  51. disdrodb/l0/configs/SWS250/l0b_encodings.yml +155 -0
  52. disdrodb/l0/configs/SWS250/raw_data_format.yml +148 -0
  53. disdrodb/l0/l0_reader.py +2 -2
  54. disdrodb/l0/l0b_processing.py +70 -15
  55. disdrodb/l0/l0c_processing.py +7 -3
  56. disdrodb/l0/readers/LPM/ARM/ARM_LPM.py +1 -1
  57. disdrodb/l0/readers/LPM/AUSTRALIA/MELBOURNE_2007_LPM.py +2 -2
  58. disdrodb/l0/readers/LPM/BELGIUM/ULIEGE.py +256 -0
  59. disdrodb/l0/readers/LPM/BRAZIL/CHUVA_LPM.py +2 -2
  60. disdrodb/l0/readers/LPM/BRAZIL/GOAMAZON_LPM.py +2 -2
  61. disdrodb/l0/readers/LPM/GERMANY/DWD.py +491 -0
  62. disdrodb/l0/readers/LPM/ITALY/GID_LPM.py +2 -2
  63. disdrodb/l0/readers/LPM/ITALY/GID_LPM_W.py +2 -2
  64. disdrodb/l0/readers/LPM/KIT/CHWALA.py +2 -2
  65. disdrodb/l0/readers/LPM/SLOVENIA/ARSO.py +107 -12
  66. disdrodb/l0/readers/LPM/SLOVENIA/UL.py +3 -3
  67. disdrodb/l0/readers/LPM/SWITZERLAND/INNERERIZ_LPM.py +2 -2
  68. disdrodb/l0/readers/PARSIVEL/BASQUECOUNTRY/EUSKALMET_OTT.py +227 -0
  69. disdrodb/l0/readers/PARSIVEL/{GPM → NASA}/LPVEX.py +1 -1
  70. disdrodb/l0/readers/PARSIVEL/NCAR/VORTEX2_2010.py +5 -14
  71. disdrodb/l0/readers/PARSIVEL/NCAR/VORTEX2_2010_UF.py +8 -17
  72. disdrodb/l0/readers/PARSIVEL/SLOVENIA/UL.py +117 -8
  73. disdrodb/l0/readers/PARSIVEL2/BASQUECOUNTRY/EUSKALMET_OTT2.py +232 -0
  74. disdrodb/l0/readers/PARSIVEL2/BRAZIL/CHUVA_PARSIVEL2.py +10 -14
  75. disdrodb/l0/readers/PARSIVEL2/BRAZIL/GOAMAZON_PARSIVEL2.py +10 -14
  76. disdrodb/l0/readers/PARSIVEL2/DENMARK/DTU.py +8 -14
  77. disdrodb/l0/readers/PARSIVEL2/DENMARK/EROSION_raw.py +382 -0
  78. disdrodb/l0/readers/PARSIVEL2/FINLAND/FMI_PARSIVEL2.py +4 -0
  79. disdrodb/l0/readers/PARSIVEL2/FRANCE/OSUG.py +1 -1
  80. disdrodb/l0/readers/PARSIVEL2/GREECE/NOA.py +127 -0
  81. disdrodb/l0/readers/PARSIVEL2/ITALY/HYDROX.py +239 -0
  82. disdrodb/l0/readers/PARSIVEL2/NCAR/FARM_PARSIVEL2.py +5 -11
  83. disdrodb/l0/readers/PARSIVEL2/NCAR/PERILS_MIPS.py +4 -17
  84. disdrodb/l0/readers/PARSIVEL2/NCAR/RELAMPAGO_PARSIVEL2.py +5 -14
  85. disdrodb/l0/readers/PARSIVEL2/NCAR/SNOWIE_PJ.py +10 -13
  86. disdrodb/l0/readers/PARSIVEL2/NCAR/SNOWIE_SB.py +10 -13
  87. disdrodb/l0/readers/PARSIVEL2/PHILIPPINES/PAGASA.py +232 -0
  88. disdrodb/l0/readers/PARSIVEL2/SPAIN/CENER.py +6 -18
  89. disdrodb/l0/readers/PARSIVEL2/{NASA/LPVEX.py → SPAIN/GRANADA.py} +46 -35
  90. disdrodb/l0/readers/PARSIVEL2/SWEDEN/SMHI.py +189 -0
  91. disdrodb/l0/readers/PARSIVEL2/USA/{C3WE.py → CW3E.py} +10 -28
  92. disdrodb/l0/readers/PWS100/AUSTRIA/HOAL.py +321 -0
  93. disdrodb/l0/readers/SW250/BELGIUM/KMI.py +239 -0
  94. disdrodb/l1/beard_model.py +31 -129
  95. disdrodb/l1/fall_velocity.py +136 -83
  96. disdrodb/l1/filters.py +25 -28
  97. disdrodb/l1/processing.py +16 -17
  98. disdrodb/l1/resampling.py +101 -38
  99. disdrodb/l1_env/routines.py +46 -17
  100. disdrodb/l2/empirical_dsd.py +6 -0
  101. disdrodb/l2/processing.py +6 -5
  102. disdrodb/metadata/geolocation.py +0 -2
  103. disdrodb/metadata/search.py +3 -4
  104. disdrodb/psd/fitting.py +16 -13
  105. disdrodb/routines/l0.py +2 -2
  106. disdrodb/routines/l1.py +173 -60
  107. disdrodb/routines/l2.py +148 -284
  108. disdrodb/routines/options.py +345 -0
  109. disdrodb/routines/wrappers.py +14 -1
  110. disdrodb/scattering/axis_ratio.py +90 -84
  111. disdrodb/scattering/permittivity.py +6 -0
  112. disdrodb/summary/routines.py +735 -670
  113. disdrodb/utils/archiving.py +51 -44
  114. disdrodb/utils/attrs.py +3 -1
  115. disdrodb/utils/dask.py +4 -4
  116. disdrodb/utils/dict.py +33 -0
  117. disdrodb/utils/encoding.py +6 -1
  118. disdrodb/utils/routines.py +9 -8
  119. disdrodb/utils/time.py +11 -3
  120. disdrodb/viz/__init__.py +0 -13
  121. disdrodb/viz/plots.py +231 -1
  122. {disdrodb-0.1.4.dist-info → disdrodb-0.2.0.dist-info}/METADATA +2 -1
  123. {disdrodb-0.1.4.dist-info → disdrodb-0.2.0.dist-info}/RECORD +135 -103
  124. /disdrodb/etc/products/L2M/{NGAMMA_GS_LOG_ND_MAE.yaml → MODELS/NGAMMA_GS_LOG_ND_MAE.yaml} +0 -0
  125. /disdrodb/etc/products/L2M/{NGAMMA_GS_ND_MAE.yaml → MODELS/NGAMMA_GS_ND_MAE.yaml} +0 -0
  126. /disdrodb/etc/products/L2M/{NGAMMA_GS_Z_MAE.yaml → MODELS/NGAMMA_GS_Z_MAE.yaml} +0 -0
  127. /disdrodb/l0/readers/PARSIVEL/{GPM → NASA}/IFLOODS.py +0 -0
  128. /disdrodb/l0/readers/PARSIVEL/{GPM → NASA}/MC3E.py +0 -0
  129. /disdrodb/l0/readers/PARSIVEL/{GPM → NASA}/PIERS.py +0 -0
  130. /disdrodb/l0/readers/PARSIVEL2/{GPM → NASA}/GCPEX.py +0 -0
  131. /disdrodb/l0/readers/PARSIVEL2/{GPM → NASA}/NSSTC.py +0 -0
  132. {disdrodb-0.1.4.dist-info → disdrodb-0.2.0.dist-info}/WHEEL +0 -0
  133. {disdrodb-0.1.4.dist-info → disdrodb-0.2.0.dist-info}/entry_points.txt +0 -0
  134. {disdrodb-0.1.4.dist-info → disdrodb-0.2.0.dist-info}/licenses/LICENSE +0 -0
  135. {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 'GPM EPFL NCAR'
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
  )
@@ -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 'GPM EPFL NCAR'
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.
@@ -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 'GPM EPFL NCAR'
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.
@@ -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 'GPM EPFL NCAR'
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.
@@ -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 'GPM EPFL NCAR'
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.
@@ -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 'GPM EPFL NCAR'
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.
@@ -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 'GPM EPFL NCAR'
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.
@@ -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 'GPM EPFL NCAR'
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
- configs_path: Optional[str] = None,
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
- configs_path : str
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
- zenodo__token: str
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 configs_path is not None:
122
- config_dict["configs_path"] = configs_path
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 get_product_default_configs_path():
242
- """Return the paths where DISDRODB products configuration files are stored."""
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
- configs_path = os.path.join(disdrodb.__root_path__, "disdrodb", "etc", "products")
246
- return configs_path
245
+ products_configs_dir = os.path.join(disdrodb.package_dir, "etc", "products")
246
+ return products_configs_dir
247
247
 
248
248
 
249
- def check_availability_radar_simulations(options):
250
- """Check radar simulations are possible for L2E and L2M products."""
249
+ def get_products_configs_dir():
250
+ """Return the DISDRODB products configuration directory."""
251
251
  import disdrodb
252
252
 
253
- if "radar_enabled" in options and not disdrodb.is_pytmatrix_available():
254
- options["radar_enabled"] = False
255
- return options
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 copy_product_default_configs(configs_path):
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 product settings
265
+ This function duplicates the entire directory of default products settings
262
266
  (located at ``disdrodb/etc/products``) into the user-specified
263
- ``configs_path``. Once copied, you can safely edit these files without
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 ``configs_path`` with the ``disdrodb.define_configs`` function).
270
+ (e.g by specifying ``products_configs_dir`` with the ``disdrodb.define_configs`` function).
267
271
 
268
272
  Parameters
269
273
  ----------
270
- configs_path:
271
- Destination directory where the default product configuration files
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
- configs_path
281
+ products_configs_dir
278
282
  The path to the newly created custom product configuration directory.
279
283
 
280
284
  """
281
- source_dir_path = get_product_default_configs_path()
282
- if os.path.exists(configs_path):
283
- raise FileExistsError(f"The {configs_path} directory already exists!")
284
- configs_path = shutil.copytree(source_dir_path, configs_path)
285
- return configs_path
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
- "L2E": ["rolling", "sample_interval"],
51
- "L2M": ["rolling", "sample_interval", "model_name"],
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 __root_path__
29
+ from disdrodb import package_dir
30
30
 
31
31
  check_sensor_name(sensor_name)
32
- docs_filepath = os.path.join(__root_path__, "disdrodb", "l0", "manuals", sensor_name + ".pdf")
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
- fall_velocity_method: "Beard1976"
8
+ fall_velocity_model: "Beard1976"
3
9
  minimum_diameter: 0
4
10
  maximum_diameter: 10
5
11
  minimum_velocity: 0
@@ -1,12 +1 @@
1
- archive_options:
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,4 +1,4 @@
1
- temporal_resolutions: ["1MIN", "5MIN", "10MIN", "ROLL1MIN"]
1
+ temporal_resolutions: ["1MIN"] # "5MIN", "10MIN", "ROLL1MIN"]
2
2
  archive_options:
3
3
  strategy: time_block
4
4
  strategy_options:
@@ -0,0 +1,6 @@
1
+ psd_model: "GammaPSD"
2
+ optimization: "GS"
3
+ optimization_kwargs:
4
+ target: "ND"
5
+ transformation: "identity"
6
+ error_order: 1
@@ -1,7 +1,7 @@
1
1
  psd_model: "GammaPSD"
2
2
  optimization: "ML"
3
3
  optimization_kwargs:
4
- init_method: "M346"
4
+ init_method: "None"
5
5
  probability_method: "cdf"
6
6
  likelihood: "multinomial"
7
7
  truncated_likelihood: True
@@ -0,0 +1,6 @@
1
+ psd_model: "LognormalPSD"
2
+ optimization: "GS"
3
+ optimization_kwargs:
4
+ target: "ND"
5
+ transformation: "log"
6
+ error_order: 1
@@ -0,0 +1,6 @@
1
+ psd_model: "LognormalPSD"
2
+ optimization: "GS"
3
+ optimization_kwargs:
4
+ target: "ND"
5
+ transformation: "identity"
6
+ error_order: 1
@@ -0,0 +1,8 @@
1
+ psd_model: "LognormalPSD"
2
+ optimization: "ML"
3
+ optimization_kwargs:
4
+ init_method: "None"
5
+ probability_method: "cdf"
6
+ likelihood: "multinomial"
7
+ truncated_likelihood: True
8
+ optimizer: "Nelder-Mead"
@@ -0,0 +1,6 @@
1
+ psd_model: "NormalizedGammaPSD"
2
+ optimization: "GS"
3
+ optimization_kwargs:
4
+ target: "R"
5
+ transformation: "identity"
6
+ error_order: 1
@@ -1,12 +1,20 @@
1
- temporal_resolutions: ["1MIN", "5MIN", "10MIN"]
2
- models: ["GAMMA_ML", "NGAMMA_GS_LOG_ND_MAE"]
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
- fall_velocity_method: "Beard1976"
17
+ fall_velocity_model: "Beard1976"
10
18
  diameter_min: 0
11
19
  diameter_max: 10
12
20
  diameter_spacing: 0.05