disdrodb 0.0.21__py3-none-any.whl → 0.1.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 (264) hide show
  1. disdrodb/__init__.py +132 -15
  2. disdrodb/_config.py +4 -2
  3. disdrodb/_version.py +9 -4
  4. disdrodb/api/checks.py +264 -237
  5. disdrodb/api/configs.py +4 -8
  6. disdrodb/api/create_directories.py +235 -290
  7. disdrodb/api/info.py +217 -26
  8. disdrodb/api/io.py +295 -269
  9. disdrodb/api/path.py +597 -173
  10. disdrodb/api/search.py +486 -0
  11. disdrodb/{metadata/scripts → cli}/disdrodb_check_metadata_archive.py +12 -7
  12. disdrodb/{utils/pandas.py → cli/disdrodb_data_archive_directory.py} +9 -18
  13. disdrodb/cli/disdrodb_download_archive.py +86 -0
  14. disdrodb/cli/disdrodb_download_metadata_archive.py +53 -0
  15. disdrodb/cli/disdrodb_download_station.py +84 -0
  16. disdrodb/{api/scripts → cli}/disdrodb_initialize_station.py +22 -10
  17. disdrodb/cli/disdrodb_metadata_archive_directory.py +32 -0
  18. disdrodb/{data_transfer/scripts/disdrodb_download_station.py → cli/disdrodb_open_data_archive.py} +22 -22
  19. disdrodb/cli/disdrodb_open_logs_directory.py +69 -0
  20. disdrodb/{data_transfer/scripts/disdrodb_upload_station.py → cli/disdrodb_open_metadata_archive.py} +22 -24
  21. disdrodb/cli/disdrodb_open_metadata_directory.py +71 -0
  22. disdrodb/cli/disdrodb_open_product_directory.py +74 -0
  23. disdrodb/cli/disdrodb_open_readers_directory.py +32 -0
  24. disdrodb/{l0/scripts → cli}/disdrodb_run_l0.py +38 -31
  25. disdrodb/{l0/scripts → cli}/disdrodb_run_l0_station.py +32 -30
  26. disdrodb/{l0/scripts → cli}/disdrodb_run_l0a.py +30 -21
  27. disdrodb/{l0/scripts → cli}/disdrodb_run_l0a_station.py +24 -33
  28. disdrodb/{l0/scripts → cli}/disdrodb_run_l0b.py +30 -21
  29. disdrodb/{l0/scripts → cli}/disdrodb_run_l0b_station.py +25 -34
  30. disdrodb/cli/disdrodb_run_l0c.py +130 -0
  31. disdrodb/cli/disdrodb_run_l0c_station.py +129 -0
  32. disdrodb/cli/disdrodb_run_l1.py +122 -0
  33. disdrodb/cli/disdrodb_run_l1_station.py +121 -0
  34. disdrodb/cli/disdrodb_run_l2e.py +122 -0
  35. disdrodb/cli/disdrodb_run_l2e_station.py +122 -0
  36. disdrodb/cli/disdrodb_run_l2m.py +122 -0
  37. disdrodb/cli/disdrodb_run_l2m_station.py +122 -0
  38. disdrodb/cli/disdrodb_upload_archive.py +105 -0
  39. disdrodb/cli/disdrodb_upload_station.py +98 -0
  40. disdrodb/configs.py +90 -25
  41. disdrodb/data_transfer/__init__.py +22 -0
  42. disdrodb/data_transfer/download_data.py +87 -90
  43. disdrodb/data_transfer/upload_data.py +64 -37
  44. disdrodb/data_transfer/zenodo.py +15 -18
  45. disdrodb/docs.py +1 -1
  46. disdrodb/issue/__init__.py +17 -4
  47. disdrodb/issue/checks.py +10 -23
  48. disdrodb/issue/reader.py +9 -12
  49. disdrodb/issue/writer.py +14 -17
  50. disdrodb/l0/__init__.py +17 -26
  51. disdrodb/l0/check_configs.py +35 -23
  52. disdrodb/l0/check_standards.py +32 -42
  53. disdrodb/l0/configs/{Thies_LPM → LPM}/bins_diameter.yml +44 -44
  54. disdrodb/l0/configs/{Thies_LPM → LPM}/bins_velocity.yml +40 -40
  55. disdrodb/l0/configs/LPM/l0a_encodings.yml +80 -0
  56. disdrodb/l0/configs/{Thies_LPM → LPM}/l0b_cf_attrs.yml +62 -59
  57. disdrodb/l0/configs/{Thies_LPM → LPM}/l0b_encodings.yml +9 -9
  58. disdrodb/l0/configs/{Thies_LPM → LPM}/raw_data_format.yml +245 -245
  59. disdrodb/l0/configs/{OTT_Parsivel → PARSIVEL}/bins_diameter.yml +66 -66
  60. disdrodb/l0/configs/{OTT_Parsivel → PARSIVEL}/bins_velocity.yml +64 -64
  61. disdrodb/l0/configs/PARSIVEL/l0a_encodings.yml +32 -0
  62. disdrodb/l0/configs/{OTT_Parsivel → PARSIVEL}/l0b_cf_attrs.yml +22 -20
  63. disdrodb/l0/configs/{OTT_Parsivel → PARSIVEL}/l0b_encodings.yml +17 -17
  64. disdrodb/l0/configs/{OTT_Parsivel → PARSIVEL}/raw_data_format.yml +77 -77
  65. disdrodb/l0/configs/{OTT_Parsivel2 → PARSIVEL2}/bins_diameter.yml +64 -64
  66. disdrodb/l0/configs/{OTT_Parsivel2 → PARSIVEL2}/bins_velocity.yml +64 -64
  67. disdrodb/l0/configs/PARSIVEL2/l0a_encodings.yml +39 -0
  68. disdrodb/l0/configs/{OTT_Parsivel2 → PARSIVEL2}/l0b_cf_attrs.yml +24 -22
  69. disdrodb/l0/configs/{OTT_Parsivel2 → PARSIVEL2}/l0b_encodings.yml +20 -20
  70. disdrodb/l0/configs/{OTT_Parsivel2 → PARSIVEL2}/raw_data_format.yml +98 -98
  71. disdrodb/l0/configs/{RD_80 → RD80}/bins_diameter.yml +40 -40
  72. disdrodb/l0/configs/RD80/l0a_encodings.yml +16 -0
  73. disdrodb/l0/configs/{RD_80 → RD80}/l0b_cf_attrs.yml +3 -3
  74. disdrodb/l0/configs/RD80/l0b_encodings.yml +135 -0
  75. disdrodb/l0/configs/{RD_80 → RD80}/raw_data_format.yml +48 -48
  76. disdrodb/l0/l0_reader.py +216 -340
  77. disdrodb/l0/l0a_processing.py +237 -208
  78. disdrodb/l0/l0b_nc_processing.py +227 -80
  79. disdrodb/l0/l0b_processing.py +93 -173
  80. disdrodb/l0/l0c_processing.py +627 -0
  81. disdrodb/l0/readers/{ARM → LPM/ARM}/ARM_LPM.py +36 -58
  82. disdrodb/l0/readers/LPM/AUSTRALIA/MELBOURNE_2007_LPM.py +226 -0
  83. disdrodb/l0/readers/LPM/BRAZIL/CHUVA_LPM.py +185 -0
  84. disdrodb/l0/readers/LPM/BRAZIL/GOAMAZON_LPM.py +183 -0
  85. disdrodb/l0/readers/LPM/ITALY/GID_LPM.py +179 -0
  86. disdrodb/l0/readers/{UK → LPM/UK}/DIVEN.py +14 -35
  87. disdrodb/l0/readers/PARSIVEL/AUSTRALIA/MELBOURNE_2007_PARSIVEL.py +157 -0
  88. disdrodb/l0/readers/PARSIVEL/CHINA/CHONGQING.py +113 -0
  89. disdrodb/l0/readers/{EPFL → PARSIVEL/EPFL}/ARCTIC_2021.py +40 -57
  90. disdrodb/l0/readers/{EPFL → PARSIVEL/EPFL}/COMMON_2011.py +37 -54
  91. disdrodb/l0/readers/{EPFL → PARSIVEL/EPFL}/DAVOS_2009_2011.py +34 -51
  92. disdrodb/l0/readers/{EPFL → PARSIVEL/EPFL}/EPFL_2009.py +34 -51
  93. disdrodb/l0/readers/{EPFL/PARADISO_2014.py → PARSIVEL/EPFL/EPFL_ROOF_2008.py} +38 -50
  94. disdrodb/l0/readers/PARSIVEL/EPFL/EPFL_ROOF_2010.py +105 -0
  95. disdrodb/l0/readers/{EPFL → PARSIVEL/EPFL}/EPFL_ROOF_2011.py +34 -51
  96. disdrodb/l0/readers/{EPFL → PARSIVEL/EPFL}/EPFL_ROOF_2012.py +33 -51
  97. disdrodb/l0/readers/{EPFL → PARSIVEL/EPFL}/GENEPI_2007.py +25 -44
  98. disdrodb/l0/readers/{EPFL → PARSIVEL/EPFL}/GRAND_ST_BERNARD_2007.py +25 -44
  99. disdrodb/l0/readers/{EPFL → PARSIVEL/EPFL}/GRAND_ST_BERNARD_2007_2.py +25 -44
  100. disdrodb/l0/readers/{EPFL → PARSIVEL/EPFL}/HPICONET_2010.py +34 -51
  101. disdrodb/l0/readers/{EPFL/EPFL_ROOF_2010.py → PARSIVEL/EPFL/HYMEX_LTE_SOP2.py} +37 -50
  102. disdrodb/l0/readers/PARSIVEL/EPFL/HYMEX_LTE_SOP3.py +111 -0
  103. disdrodb/l0/readers/{EPFL → PARSIVEL/EPFL}/HYMEX_LTE_SOP4.py +36 -54
  104. disdrodb/l0/readers/{EPFL → PARSIVEL/EPFL}/LOCARNO_2018.py +34 -52
  105. disdrodb/l0/readers/{EPFL → PARSIVEL/EPFL}/LOCARNO_2019.py +38 -56
  106. disdrodb/l0/readers/PARSIVEL/EPFL/PARADISO_2014.py +105 -0
  107. disdrodb/l0/readers/{EPFL → PARSIVEL/EPFL}/PARSIVEL_2007.py +27 -45
  108. disdrodb/l0/readers/{EPFL → PARSIVEL/EPFL}/PLATO_2019.py +24 -44
  109. disdrodb/l0/readers/PARSIVEL/EPFL/RACLETS_2019.py +140 -0
  110. disdrodb/l0/readers/{EPFL → PARSIVEL/EPFL}/RACLETS_2019_WJF.py +41 -59
  111. disdrodb/l0/readers/{EPFL → PARSIVEL/EPFL}/RIETHOLZBACH_2011.py +34 -51
  112. disdrodb/l0/readers/PARSIVEL/EPFL/SAMOYLOV_2017.py +117 -0
  113. disdrodb/l0/readers/PARSIVEL/EPFL/SAMOYLOV_2019.py +137 -0
  114. disdrodb/l0/readers/{EPFL → PARSIVEL/EPFL}/UNIL_2022.py +42 -55
  115. disdrodb/l0/readers/PARSIVEL/GPM/IFLOODS.py +104 -0
  116. disdrodb/l0/readers/{GPM → PARSIVEL/GPM}/LPVEX.py +29 -48
  117. disdrodb/l0/readers/PARSIVEL/GPM/MC3E.py +184 -0
  118. disdrodb/l0/readers/PARSIVEL/NCAR/CCOPE_2015.py +113 -0
  119. disdrodb/l0/readers/{NCAR/VORTEX_SE_2016_P1.py → PARSIVEL/NCAR/OWLES_MIPS.py} +46 -72
  120. disdrodb/l0/readers/PARSIVEL/NCAR/PECAN_MOBILE.py +125 -0
  121. disdrodb/l0/readers/{NCAR/OWLES_MIPS.py → PARSIVEL/NCAR/PLOWS_MIPS.py} +45 -64
  122. disdrodb/l0/readers/PARSIVEL/NCAR/VORTEX2_2009.py +114 -0
  123. disdrodb/l0/readers/PARSIVEL/NCAR/VORTEX2_2010.py +176 -0
  124. disdrodb/l0/readers/PARSIVEL/NCAR/VORTEX2_2010_UF.py +183 -0
  125. disdrodb/l0/readers/{ARM/ARM_LD.py → PARSIVEL2/ARM/ARM_PARSIVEL2.py} +27 -50
  126. disdrodb/l0/readers/PARSIVEL2/BRAZIL/CHUVA_PARSIVEL2.py +163 -0
  127. disdrodb/l0/readers/PARSIVEL2/BRAZIL/GOAMAZON_PARSIVEL2.py +163 -0
  128. disdrodb/l0/readers/{DENMARK → PARSIVEL2/DENMARK}/EROSION_nc.py +14 -35
  129. disdrodb/l0/readers/PARSIVEL2/FRANCE/SIRTA_PARSIVEL2.py +119 -0
  130. disdrodb/l0/readers/PARSIVEL2/GPM/GCPEX.py +104 -0
  131. disdrodb/l0/readers/PARSIVEL2/GPM/NSSTC.py +176 -0
  132. disdrodb/l0/readers/PARSIVEL2/ITALY/GID_PARSIVEL2.py +32 -0
  133. disdrodb/l0/readers/PARSIVEL2/MEXICO/OH_IIUNAM_nc.py +56 -0
  134. disdrodb/l0/readers/PARSIVEL2/NCAR/PECAN_FP3.py +120 -0
  135. disdrodb/l0/readers/{NCAR → PARSIVEL2/NCAR}/PECAN_MIPS.py +45 -64
  136. disdrodb/l0/readers/PARSIVEL2/NCAR/RELAMPAGO_PARSIVEL2.py +181 -0
  137. disdrodb/l0/readers/PARSIVEL2/NCAR/SNOWIE_PJ.py +160 -0
  138. disdrodb/l0/readers/PARSIVEL2/NCAR/SNOWIE_SB.py +160 -0
  139. disdrodb/l0/readers/{NCAR/PLOWS_MIPS.py → PARSIVEL2/NCAR/VORTEX_SE_2016_P1.py} +49 -66
  140. disdrodb/l0/readers/PARSIVEL2/NCAR/VORTEX_SE_2016_P2.py +118 -0
  141. disdrodb/l0/readers/PARSIVEL2/NCAR/VORTEX_SE_2016_PIPS.py +152 -0
  142. disdrodb/l0/readers/PARSIVEL2/NETHERLANDS/DELFT.py +166 -0
  143. disdrodb/l0/readers/{NCAR/RELAMPAGO_RD80.py → RD80/BRAZIL/CHUVA_RD80.py} +36 -60
  144. disdrodb/l0/readers/{BRAZIL → RD80/BRAZIL}/GOAMAZON_RD80.py +36 -55
  145. disdrodb/l0/readers/{NCAR → RD80/NCAR}/CINDY_2011_RD80.py +35 -54
  146. disdrodb/l0/readers/{BRAZIL/CHUVA_RD80.py → RD80/NCAR/RELAMPAGO_RD80.py} +40 -54
  147. disdrodb/l0/readers/template_reader_raw_netcdf_data.py +62 -0
  148. disdrodb/l0/readers/{reader_template.py → template_reader_raw_text_data.py} +20 -44
  149. disdrodb/l0/routines.py +885 -581
  150. disdrodb/l0/standards.py +72 -236
  151. disdrodb/l0/template_tools.py +104 -109
  152. disdrodb/l1/__init__.py +17 -0
  153. disdrodb/l1/beard_model.py +716 -0
  154. disdrodb/l1/encoding_attrs.py +620 -0
  155. disdrodb/l1/fall_velocity.py +260 -0
  156. disdrodb/l1/filters.py +192 -0
  157. disdrodb/l1/processing.py +200 -0
  158. disdrodb/l1/resampling.py +236 -0
  159. disdrodb/l1/routines.py +357 -0
  160. disdrodb/l1_env/__init__.py +17 -0
  161. disdrodb/l1_env/routines.py +38 -0
  162. disdrodb/l2/__init__.py +17 -0
  163. disdrodb/l2/empirical_dsd.py +1735 -0
  164. disdrodb/l2/event.py +388 -0
  165. disdrodb/l2/processing.py +519 -0
  166. disdrodb/l2/processing_options.py +213 -0
  167. disdrodb/l2/routines.py +868 -0
  168. disdrodb/metadata/__init__.py +9 -2
  169. disdrodb/metadata/checks.py +165 -118
  170. disdrodb/metadata/download.py +81 -0
  171. disdrodb/metadata/geolocation.py +146 -0
  172. disdrodb/metadata/info.py +20 -13
  173. disdrodb/metadata/manipulation.py +1 -1
  174. disdrodb/metadata/reader.py +59 -8
  175. disdrodb/metadata/search.py +77 -144
  176. disdrodb/metadata/standards.py +7 -8
  177. disdrodb/metadata/writer.py +8 -14
  178. disdrodb/psd/__init__.py +38 -0
  179. disdrodb/psd/fitting.py +2146 -0
  180. disdrodb/psd/models.py +774 -0
  181. disdrodb/routines.py +1176 -0
  182. disdrodb/scattering/__init__.py +28 -0
  183. disdrodb/scattering/axis_ratio.py +344 -0
  184. disdrodb/scattering/routines.py +456 -0
  185. disdrodb/utils/__init__.py +17 -0
  186. disdrodb/utils/attrs.py +208 -0
  187. disdrodb/utils/cli.py +269 -0
  188. disdrodb/utils/compression.py +60 -42
  189. disdrodb/utils/dask.py +62 -0
  190. disdrodb/utils/decorators.py +110 -0
  191. disdrodb/utils/directories.py +107 -46
  192. disdrodb/utils/encoding.py +127 -0
  193. disdrodb/utils/list.py +29 -0
  194. disdrodb/utils/logger.py +168 -46
  195. disdrodb/utils/time.py +657 -0
  196. disdrodb/utils/warnings.py +30 -0
  197. disdrodb/utils/writer.py +57 -0
  198. disdrodb/utils/xarray.py +138 -47
  199. disdrodb/utils/yaml.py +0 -1
  200. disdrodb/viz/__init__.py +17 -0
  201. disdrodb/viz/plots.py +17 -0
  202. disdrodb-0.1.0.dist-info/METADATA +321 -0
  203. disdrodb-0.1.0.dist-info/RECORD +216 -0
  204. {disdrodb-0.0.21.dist-info → disdrodb-0.1.0.dist-info}/WHEEL +1 -1
  205. disdrodb-0.1.0.dist-info/entry_points.txt +30 -0
  206. disdrodb/data_transfer/scripts/disdrodb_download_archive.py +0 -53
  207. disdrodb/data_transfer/scripts/disdrodb_upload_archive.py +0 -57
  208. disdrodb/l0/configs/OTT_Parsivel/l0a_encodings.yml +0 -32
  209. disdrodb/l0/configs/OTT_Parsivel2/l0a_encodings.yml +0 -39
  210. disdrodb/l0/configs/RD_80/l0a_encodings.yml +0 -16
  211. disdrodb/l0/configs/RD_80/l0b_encodings.yml +0 -135
  212. disdrodb/l0/configs/Thies_LPM/l0a_encodings.yml +0 -80
  213. disdrodb/l0/io.py +0 -257
  214. disdrodb/l0/l0_processing.py +0 -1091
  215. disdrodb/l0/readers/AUSTRALIA/MELBOURNE_2007_OTT.py +0 -178
  216. disdrodb/l0/readers/AUSTRALIA/MELBOURNE_2007_THIES.py +0 -247
  217. disdrodb/l0/readers/BRAZIL/CHUVA_LPM.py +0 -204
  218. disdrodb/l0/readers/BRAZIL/CHUVA_OTT.py +0 -183
  219. disdrodb/l0/readers/BRAZIL/GOAMAZON_LPM.py +0 -204
  220. disdrodb/l0/readers/BRAZIL/GOAMAZON_OTT.py +0 -183
  221. disdrodb/l0/readers/CHINA/CHONGQING.py +0 -131
  222. disdrodb/l0/readers/EPFL/EPFL_ROOF_2008.py +0 -128
  223. disdrodb/l0/readers/EPFL/HYMEX_LTE_SOP2.py +0 -127
  224. disdrodb/l0/readers/EPFL/HYMEX_LTE_SOP3.py +0 -129
  225. disdrodb/l0/readers/EPFL/RACLETS_2019.py +0 -158
  226. disdrodb/l0/readers/EPFL/SAMOYLOV_2017.py +0 -136
  227. disdrodb/l0/readers/EPFL/SAMOYLOV_2019.py +0 -158
  228. disdrodb/l0/readers/FRANCE/SIRTA_OTT2.py +0 -138
  229. disdrodb/l0/readers/GPM/GCPEX.py +0 -123
  230. disdrodb/l0/readers/GPM/IFLOODS.py +0 -123
  231. disdrodb/l0/readers/GPM/MC3E.py +0 -123
  232. disdrodb/l0/readers/GPM/NSSTC.py +0 -164
  233. disdrodb/l0/readers/ITALY/GID.py +0 -199
  234. disdrodb/l0/readers/MEXICO/OH_IIUNAM_nc.py +0 -92
  235. disdrodb/l0/readers/NCAR/CCOPE_2015.py +0 -133
  236. disdrodb/l0/readers/NCAR/PECAN_FP3.py +0 -137
  237. disdrodb/l0/readers/NCAR/PECAN_MOBILE.py +0 -144
  238. disdrodb/l0/readers/NCAR/RELAMPAGO_OTT.py +0 -195
  239. disdrodb/l0/readers/NCAR/SNOWIE_PJ.py +0 -172
  240. disdrodb/l0/readers/NCAR/SNOWIE_SB.py +0 -179
  241. disdrodb/l0/readers/NCAR/VORTEX2_2009.py +0 -133
  242. disdrodb/l0/readers/NCAR/VORTEX2_2010.py +0 -188
  243. disdrodb/l0/readers/NCAR/VORTEX2_2010_UF.py +0 -191
  244. disdrodb/l0/readers/NCAR/VORTEX_SE_2016_P2.py +0 -135
  245. disdrodb/l0/readers/NCAR/VORTEX_SE_2016_PIPS.py +0 -170
  246. disdrodb/l0/readers/NETHERLANDS/DELFT.py +0 -187
  247. disdrodb/l0/readers/SPAIN/SBEGUERIA.py +0 -179
  248. disdrodb/l0/scripts/disdrodb_run_l0b_concat.py +0 -93
  249. disdrodb/l0/scripts/disdrodb_run_l0b_concat_station.py +0 -85
  250. disdrodb/utils/netcdf.py +0 -452
  251. disdrodb/utils/scripts.py +0 -102
  252. disdrodb-0.0.21.dist-info/AUTHORS.md +0 -18
  253. disdrodb-0.0.21.dist-info/METADATA +0 -186
  254. disdrodb-0.0.21.dist-info/RECORD +0 -168
  255. disdrodb-0.0.21.dist-info/entry_points.txt +0 -15
  256. /disdrodb/l0/configs/{RD_80 → RD80}/bins_velocity.yml +0 -0
  257. /disdrodb/l0/manuals/{Thies_LPM.pdf → LPM.pdf} +0 -0
  258. /disdrodb/l0/manuals/{ODM_470.pdf → ODM470.pdf} +0 -0
  259. /disdrodb/l0/manuals/{OTT_Parsivel.pdf → PARSIVEL.pdf} +0 -0
  260. /disdrodb/l0/manuals/{OTT_Parsivel2.pdf → PARSIVEL2.pdf} +0 -0
  261. /disdrodb/l0/manuals/{PWS_100.pdf → PWS100.pdf} +0 -0
  262. /disdrodb/l0/manuals/{RD_80.pdf → RD80.pdf} +0 -0
  263. {disdrodb-0.0.21.dist-info → disdrodb-0.1.0.dist-info/licenses}/LICENSE +0 -0
  264. {disdrodb-0.0.21.dist-info → disdrodb-0.1.0.dist-info}/top_level.txt +0 -0
@@ -14,34 +14,40 @@
14
14
  # You should have received a copy of the GNU General Public License
15
15
  # along with this program. If not, see <http://www.gnu.org/licenses/>.
16
16
  # -----------------------------------------------------------------------------.
17
+ """Script to run the DISDRODB L0 processing."""
17
18
  import sys
19
+ from typing import Optional
18
20
 
19
21
  import click
20
22
 
21
- from disdrodb.l0.routines import (
23
+ from disdrodb.utils.cli import (
24
+ click_data_archive_dir_option,
22
25
  click_l0_archive_options,
23
- click_l0_processing_options,
24
- click_l0_stations_options,
26
+ click_metadata_archive_dir_option,
27
+ click_processing_options,
28
+ click_stations_options,
29
+ parse_archive_dir,
30
+ parse_arg_to_list,
25
31
  )
26
- from disdrodb.utils.scripts import click_base_dir_option, parse_arg_to_list, parse_base_dir
27
32
 
28
33
  sys.tracebacklimit = 0 # avoid full traceback error if occur
29
34
 
30
35
 
31
36
  @click.command()
32
- @click_l0_stations_options
37
+ @click_stations_options
33
38
  @click_l0_archive_options
34
- @click_l0_processing_options
35
- @click_base_dir_option
39
+ @click_processing_options
40
+ @click_data_archive_dir_option
41
+ @click_metadata_archive_dir_option
36
42
  def disdrodb_run_l0(
37
- # L0 disdrodb stations options
38
- data_sources: str = None,
39
- campaign_names: str = None,
40
- station_names: str = None,
43
+ # Stations options
44
+ data_sources: Optional[str] = None,
45
+ campaign_names: Optional[str] = None,
46
+ station_names: Optional[str] = None,
41
47
  # L0 archive options
42
48
  l0a_processing: bool = True,
43
49
  l0b_processing: bool = True,
44
- l0b_concat: bool = True,
50
+ l0c_processing: bool = True,
45
51
  remove_l0a: bool = False,
46
52
  remove_l0b: bool = False,
47
53
  # Processing options
@@ -49,7 +55,9 @@ def disdrodb_run_l0(
49
55
  verbose: bool = True,
50
56
  parallel: bool = True,
51
57
  debugging_mode: bool = False,
52
- base_dir: str = None,
58
+ # DISDRODB root directories
59
+ data_archive_dir: Optional[str] = None,
60
+ metadata_archive_dir: Optional[str] = None,
53
61
  ):
54
62
  """
55
63
  Run the L0 processing of DISDRODB stations.
@@ -60,9 +68,8 @@ def disdrodb_run_l0(
60
68
 
61
69
  Parameters
62
70
  ----------
63
-
64
- base_dir : str
65
- Base directory of DISDRODB
71
+ data_archive_dir : str
72
+ DISDRODB Data Archive directory
66
73
  Format: <...>/DISDRODB
67
74
  data_sources : str
68
75
  Name of data source(s) to process.
@@ -82,17 +89,14 @@ def disdrodb_run_l0(
82
89
  l0b_processing : bool
83
90
  Whether to launch processing to generate L0B netCDF4 file(s) from L0A data.
84
91
  The default is True.
85
- l0b_concat : bool
86
- Whether to concatenate all raw files into a single L0B netCDF file.
87
- If l0b_concat=True, all raw files will be saved into a single L0B netCDF file.
88
- If l0b_concat=False, each raw file will be converted into the corresponding L0B netCDF file.
89
- The default is False.
92
+ l0c_processing : bool
93
+ Whether to launch processing to generate L0C netCDF4 file(s) from L0C data.
94
+ The default is True.
90
95
  remove_l0a : bool
91
96
  Whether to keep the L0A files after having generated the L0B netCDF products.
92
97
  The default is False.
93
98
  remove_l0b : bool
94
- Whether to remove the L0B files after having concatenated all L0B netCDF files.
95
- It takes places only if l0b_concat = True
99
+ Whether to remove the L0B files after having produced L0C netCDF files.
96
100
  The default is False.
97
101
  force : bool
98
102
  If True, overwrite existing data into destination directories.
@@ -113,29 +117,33 @@ def disdrodb_run_l0(
113
117
  For L0A, it processes just the first 3 raw data files.
114
118
  For L0B, it processes just the first 100 rows of 3 L0A files.
115
119
  The default is False.
116
- base_dir : str
117
- Base directory of DISDRODB
120
+ data_archive_dir : str
121
+ DISDRODB Data Archive directory
118
122
  Format: <...>/DISDRODB
119
123
  If not specified, uses path specified in the DISDRODB active configuration.
120
124
  """
121
- from disdrodb.l0.routines import run_disdrodb_l0
125
+ from disdrodb.routines import run_l0
122
126
 
123
127
  # Parse data_sources, campaign_names and station arguments
124
- base_dir = parse_base_dir(base_dir)
128
+ data_archive_dir = parse_archive_dir(data_archive_dir)
129
+ metadata_archive_dir = parse_archive_dir(metadata_archive_dir)
125
130
  data_sources = parse_arg_to_list(data_sources)
126
131
  campaign_names = parse_arg_to_list(campaign_names)
127
132
  station_names = parse_arg_to_list(station_names)
128
133
 
129
134
  # Run processing
130
- run_disdrodb_l0(
131
- base_dir=base_dir,
135
+ run_l0(
136
+ # DISDRODB root directories
137
+ data_archive_dir=data_archive_dir,
138
+ metadata_archive_dir=metadata_archive_dir,
139
+ # Stations options
132
140
  data_sources=data_sources,
133
141
  campaign_names=campaign_names,
134
142
  station_names=station_names,
135
143
  # L0 archive options
136
144
  l0a_processing=l0a_processing,
137
145
  l0b_processing=l0b_processing,
138
- l0b_concat=l0b_concat,
146
+ l0c_processing=l0c_processing,
139
147
  remove_l0a=remove_l0a,
140
148
  remove_l0b=remove_l0b,
141
149
  # Processing options
@@ -144,4 +152,3 @@ def disdrodb_run_l0(
144
152
  debugging_mode=debugging_mode,
145
153
  parallel=parallel,
146
154
  )
147
- return None
@@ -14,18 +14,19 @@
14
14
  # You should have received a copy of the GNU General Public License
15
15
  # along with this program. If not, see <http://www.gnu.org/licenses/>.
16
16
  # -----------------------------------------------------------------------------.
17
+ """Script to run the DISDRODB L0 station processing."""
17
18
  import sys
19
+ from typing import Optional
18
20
 
19
21
  import click
20
22
 
21
- from disdrodb.l0.routines import (
23
+ from disdrodb.utils.cli import (
24
+ click_data_archive_dir_option,
22
25
  click_l0_archive_options,
23
- click_l0_processing_options,
24
- )
25
- from disdrodb.utils.scripts import (
26
- click_base_dir_option,
26
+ click_metadata_archive_dir_option,
27
+ click_processing_options,
27
28
  click_station_arguments,
28
- parse_base_dir,
29
+ parse_archive_dir,
29
30
  )
30
31
 
31
32
  sys.tracebacklimit = 0 # avoid full traceback error if occur
@@ -36,9 +37,10 @@ sys.tracebacklimit = 0 # avoid full traceback error if occur
36
37
 
37
38
  @click.command()
38
39
  @click_station_arguments
39
- @click_l0_processing_options
40
+ @click_processing_options
40
41
  @click_l0_archive_options
41
- @click_base_dir_option
42
+ @click_data_archive_dir_option
43
+ @click_metadata_archive_dir_option
42
44
  def disdrodb_run_l0_station(
43
45
  # Station arguments
44
46
  data_source: str,
@@ -47,7 +49,7 @@ def disdrodb_run_l0_station(
47
49
  # L0 archive options
48
50
  l0a_processing: bool = True,
49
51
  l0b_processing: bool = True,
50
- l0b_concat: bool = True,
52
+ l0c_processing: bool = True,
51
53
  remove_l0a: bool = False,
52
54
  remove_l0b: bool = False,
53
55
  # Processing options
@@ -55,9 +57,11 @@ def disdrodb_run_l0_station(
55
57
  verbose: bool = True,
56
58
  parallel: bool = True,
57
59
  debugging_mode: bool = False,
58
- base_dir: str = None,
60
+ # DISDRODB root directories
61
+ data_archive_dir: Optional[str] = None,
62
+ metadata_archive_dir: Optional[str] = None,
59
63
  ):
60
- """Run the L0 processing of a specific DISDRODB station from the terminal.
64
+ r"""Run the L0 processing of a specific DISDRODB station from the terminal.
61
65
 
62
66
  Parameters \n
63
67
  ---------- \n
@@ -74,19 +78,16 @@ def disdrodb_run_l0_station(
74
78
  The default is True.\n
75
79
  l0b_processing : bool \n
76
80
  Whether to launch processing to generate L0B netCDF4 file(s) from L0A data.\n
77
- he default is True.\n
78
- l0b_concat : bool \n
79
- Whether to concatenate all raw files into a single L0B netCDF file.\n
80
- If l0b_concat=True, all raw files will be saved into a single L0B netCDF file.\n
81
- If l0b_concat=False, each raw file will be converted into the corresponding L0B netCDF file.\n
82
- The default is False.\n
81
+ The default is True.\n
82
+ l0c_processing : bool
83
+ Whether to launch processing to generate L0C netCDF4 file(s) from L0C data.
84
+ The default is True.
83
85
  remove_l0a : bool \n
84
86
  Whether to keep the L0A files after having generated the L0B netCDF products.\n
85
87
  The default is False.\n
86
- remove_l0b : bool \n
87
- Whether to remove the L0B files after having concatenated all L0B netCDF files.\n
88
- It takes places only if l0b_concat=True\n
89
- The default is False.\n
88
+ remove_l0b : bool
89
+ Whether to remove the L0B files after having produced L0C netCDF files.
90
+ The default is False.
90
91
  force : bool \n
91
92
  If True, overwrite existing data into destination directories.\n
92
93
  If False, raise an error if there are already data into destination directories.\n
@@ -106,24 +107,27 @@ def disdrodb_run_l0_station(
106
107
  For L0A, it processes just the first 3 raw data files for each station.\n
107
108
  For L0B, it processes just the first 100 rows of 3 L0A files for each station.\n
108
109
  The default is False.\n
109
- base_dir : str \n
110
- Base directory of DISDRODB \n
110
+ data_archive_dir : str \n
111
+ DISDRODB Data Archive directory \n
111
112
  Format: <...>/DISDRODB \n
112
113
  If not specified, uses path specified in the DISDRODB active configuration. \n
113
114
  """
114
- from disdrodb.l0.routines import run_disdrodb_l0_station
115
+ from disdrodb.routines import run_l0_station
115
116
 
116
- base_dir = parse_base_dir(base_dir)
117
+ data_archive_dir = parse_archive_dir(data_archive_dir)
117
118
 
118
- run_disdrodb_l0_station(
119
- base_dir=base_dir,
119
+ run_l0_station(
120
+ # DISDRODB root directories
121
+ data_archive_dir=data_archive_dir,
122
+ metadata_archive_dir=metadata_archive_dir,
123
+ # Station arguments
120
124
  data_source=data_source,
121
125
  campaign_name=campaign_name,
122
126
  station_name=station_name,
123
127
  # L0 archive options
124
128
  l0a_processing=l0a_processing,
125
129
  l0b_processing=l0b_processing,
126
- l0b_concat=l0b_concat,
130
+ l0c_processing=l0c_processing,
127
131
  remove_l0a=remove_l0a,
128
132
  remove_l0b=remove_l0b,
129
133
  # Processing options
@@ -132,5 +136,3 @@ def disdrodb_run_l0_station(
132
136
  debugging_mode=debugging_mode,
133
137
  parallel=parallel,
134
138
  )
135
-
136
- return None
@@ -15,34 +15,42 @@
15
15
  # You should have received a copy of the GNU General Public License
16
16
  # along with this program. If not, see <http://www.gnu.org/licenses/>.
17
17
  # -----------------------------------------------------------------------------.
18
+ """Script to run the DISDRODB L0A processing."""
18
19
  import sys
20
+ from typing import Optional
19
21
 
20
22
  import click
21
23
 
22
- from disdrodb.l0.routines import (
23
- click_l0_processing_options,
24
- click_l0_stations_options,
24
+ from disdrodb.utils.cli import (
25
+ click_data_archive_dir_option,
26
+ click_metadata_archive_dir_option,
27
+ click_processing_options,
28
+ click_stations_options,
29
+ parse_archive_dir,
30
+ parse_arg_to_list,
25
31
  )
26
- from disdrodb.utils.scripts import click_base_dir_option, parse_arg_to_list, parse_base_dir
27
32
 
28
33
  sys.tracebacklimit = 0 # avoid full traceback error if occur
29
34
 
30
35
 
31
36
  @click.command()
32
- @click_l0_stations_options
33
- @click_l0_processing_options
34
- @click_base_dir_option
37
+ @click_stations_options
38
+ @click_processing_options
39
+ @click_data_archive_dir_option
40
+ @click_metadata_archive_dir_option
35
41
  def disdrodb_run_l0a(
36
- # L0 disdrodb stations options
37
- data_sources: str = None,
38
- campaign_names: str = None,
39
- station_names: str = None,
42
+ # Stations options
43
+ data_sources: Optional[str] = None,
44
+ campaign_names: Optional[str] = None,
45
+ station_names: Optional[str] = None,
40
46
  # Processing options
41
47
  force: bool = False,
42
48
  verbose: bool = True,
43
49
  parallel: bool = True,
44
50
  debugging_mode: bool = False,
45
- base_dir: str = None,
51
+ # DISDRODB root directories
52
+ data_archive_dir: Optional[str] = None,
53
+ metadata_archive_dir: Optional[str] = None,
46
54
  ):
47
55
  """
48
56
  Run the L0A processing of DISDRODB stations.
@@ -53,7 +61,6 @@ def disdrodb_run_l0a(
53
61
 
54
62
  Parameters
55
63
  ----------
56
-
57
64
  data_sources : str
58
65
  Name of data source(s) to process.
59
66
  The name(s) must be UPPER CASE.
@@ -84,22 +91,26 @@ def disdrodb_run_l0a(
84
91
  If True, it reduces the amount of data to process.
85
92
  It processes just the first 3 raw data files for each station.
86
93
  The default is False.
87
- base_dir : str
88
- Base directory of DISDRODB
94
+ data_archive_dir : str
95
+ DISDRODB Data Archive directory
89
96
  Format: <...>/DISDRODB
90
97
  If not specified, uses path specified in the DISDRODB active configuration.
91
98
  """
92
- from disdrodb.l0.routines import run_disdrodb_l0a
99
+ from disdrodb.routines import run_l0a
93
100
 
94
101
  # Parse data_sources, campaign_names and station arguments
95
- base_dir = parse_base_dir(base_dir)
102
+ data_archive_dir = parse_archive_dir(data_archive_dir)
103
+ metadata_archive_dir = parse_archive_dir(metadata_archive_dir)
96
104
  data_sources = parse_arg_to_list(data_sources)
97
105
  campaign_names = parse_arg_to_list(campaign_names)
98
106
  station_names = parse_arg_to_list(station_names)
99
107
 
100
108
  # Run processing
101
- run_disdrodb_l0a(
102
- base_dir=base_dir,
109
+ run_l0a(
110
+ # DISDRODB root directories
111
+ data_archive_dir=data_archive_dir,
112
+ metadata_archive_dir=metadata_archive_dir,
113
+ # Stations options
103
114
  data_sources=data_sources,
104
115
  campaign_names=campaign_names,
105
116
  station_names=station_names,
@@ -109,5 +120,3 @@ def disdrodb_run_l0a(
109
120
  debugging_mode=debugging_mode,
110
121
  parallel=parallel,
111
122
  )
112
-
113
- return None
@@ -14,15 +14,18 @@
14
14
  # You should have received a copy of the GNU General Public License
15
15
  # along with this program. If not, see <http://www.gnu.org/licenses/>.
16
16
  # -----------------------------------------------------------------------------.
17
+ """Script to run the DISDRODB L0A station processing."""
17
18
  import sys
19
+ from typing import Optional
18
20
 
19
21
  import click
20
22
 
21
- from disdrodb.l0.routines import click_l0_processing_options
22
- from disdrodb.utils.scripts import (
23
- click_base_dir_option,
23
+ from disdrodb.utils.cli import (
24
+ click_data_archive_dir_option,
25
+ click_metadata_archive_dir_option,
26
+ click_processing_options,
24
27
  click_station_arguments,
25
- parse_base_dir,
28
+ parse_archive_dir,
26
29
  )
27
30
 
28
31
  sys.tracebacklimit = 0 # avoid full traceback error if occur
@@ -33,8 +36,9 @@ sys.tracebacklimit = 0 # avoid full traceback error if occur
33
36
 
34
37
  @click.command()
35
38
  @click_station_arguments
36
- @click_l0_processing_options
37
- @click_base_dir_option
39
+ @click_processing_options
40
+ @click_data_archive_dir_option
41
+ @click_metadata_archive_dir_option
38
42
  def disdrodb_run_l0a_station(
39
43
  # Station arguments
40
44
  data_source: str,
@@ -45,7 +49,9 @@ def disdrodb_run_l0a_station(
45
49
  verbose: bool = False,
46
50
  parallel: bool = True,
47
51
  debugging_mode: bool = False,
48
- base_dir: str = None,
52
+ # DISDRODB root directories
53
+ data_archive_dir: Optional[str] = None,
54
+ metadata_archive_dir: Optional[str] = None,
49
55
  ):
50
56
  """
51
57
  Run the L0A processing of a specific DISDRODB station from the terminal.
@@ -78,37 +84,21 @@ def disdrodb_run_l0a_station(
78
84
  If True, it reduces the amount of data to process.
79
85
  It processes just the first 3 raw data files.
80
86
  The default is False.
81
- base_dir : str
82
- Base directory of DISDRODB.
87
+ data_archive_dir : str
88
+ DISDRODB Data Archive directory.
83
89
  Format: <...>/DISDRODB
84
90
  If not specified, uses path specified in the DISDRODB active configuration.
85
91
  """
86
- import os
92
+ from disdrodb.l0.routines import run_l0a_station
93
+ from disdrodb.utils.dask import close_dask_cluster, initialize_dask_cluster
87
94
 
88
- import dask
89
- from dask.distributed import Client, LocalCluster
90
-
91
- from disdrodb.l0.l0_processing import run_l0a_station
92
-
93
- base_dir = parse_base_dir(base_dir)
95
+ data_archive_dir = parse_archive_dir(data_archive_dir)
96
+ metadata_archive_dir = parse_archive_dir(metadata_archive_dir)
94
97
 
95
98
  # -------------------------------------------------------------------------.
96
99
  # If parallel=True, set the dask environment
97
100
  if parallel:
98
- # Set HDF5_USE_FILE_LOCKING to avoid going stuck with HDF
99
- os.environ["HDF5_USE_FILE_LOCKING"] = "FALSE"
100
- # Retrieve the number of process to run
101
- available_workers = os.cpu_count() - 2 # if not set, all CPUs
102
- num_workers = dask.config.get("num_workers", available_workers)
103
- # Create dask.distributed local cluster
104
- cluster = LocalCluster(
105
- n_workers=num_workers,
106
- threads_per_worker=1,
107
- processes=True,
108
- # memory_limit='8GB',
109
- # silence_logs=False,
110
- )
111
- Client(cluster)
101
+ cluster, client = initialize_dask_cluster()
112
102
  # -------------------------------------------------------------------------.
113
103
 
114
104
  run_l0a_station(
@@ -121,11 +111,12 @@ def disdrodb_run_l0a_station(
121
111
  verbose=verbose,
122
112
  debugging_mode=debugging_mode,
123
113
  parallel=parallel,
124
- base_dir=base_dir,
114
+ # DISDRODB root directories
115
+ data_archive_dir=data_archive_dir,
116
+ metadata_archive_dir=metadata_archive_dir,
125
117
  )
126
118
 
127
119
  # -------------------------------------------------------------------------.
128
120
  # Close the cluster
129
121
  if parallel:
130
- cluster.close()
131
- return None
122
+ close_dask_cluster(cluster, client)
@@ -15,37 +15,45 @@
15
15
  # You should have received a copy of the GNU General Public License
16
16
  # along with this program. If not, see <http://www.gnu.org/licenses/>.
17
17
  # -----------------------------------------------------------------------------.
18
+ """Script to run the DISDRODB L0B processing."""
18
19
  import sys
20
+ from typing import Optional
19
21
 
20
22
  import click
21
23
 
22
- from disdrodb.l0.routines import (
23
- click_l0_processing_options,
24
- click_l0_stations_options,
24
+ from disdrodb.utils.cli import (
25
+ click_data_archive_dir_option,
26
+ click_metadata_archive_dir_option,
27
+ click_processing_options,
25
28
  click_remove_l0a_option,
29
+ click_stations_options,
30
+ parse_archive_dir,
31
+ parse_arg_to_list,
26
32
  )
27
- from disdrodb.utils.scripts import click_base_dir_option, parse_arg_to_list, parse_base_dir
28
33
 
29
34
  sys.tracebacklimit = 0 # avoid full traceback error if occur
30
35
 
31
36
 
32
37
  @click.command()
33
- @click_l0_stations_options
34
- @click_l0_processing_options
38
+ @click_stations_options
39
+ @click_processing_options
35
40
  @click_remove_l0a_option
36
- @click_base_dir_option
41
+ @click_data_archive_dir_option
42
+ @click_metadata_archive_dir_option
37
43
  def disdrodb_run_l0b(
38
- # L0 disdrodb stations options
39
- data_sources: str = None,
40
- campaign_names: str = None,
41
- station_names: str = None,
44
+ # Stations options
45
+ data_sources: Optional[str] = None,
46
+ campaign_names: Optional[str] = None,
47
+ station_names: Optional[str] = None,
42
48
  # Processing options
43
49
  force: bool = False,
44
50
  verbose: bool = True,
45
51
  parallel: bool = True,
46
52
  debugging_mode: bool = False,
47
53
  remove_l0a: bool = False,
48
- base_dir: str = None,
54
+ # DISDRODB root directories
55
+ data_archive_dir: Optional[str] = None,
56
+ metadata_archive_dir: Optional[str] = None,
49
57
  ):
50
58
  """
51
59
  Run the L0B processing of DISDRODB stations.
@@ -56,7 +64,6 @@ def disdrodb_run_l0b(
56
64
 
57
65
  Parameters
58
66
  ----------
59
-
60
67
  data_sources : str
61
68
  Name of data source(s) to process.
62
69
  The name(s) must be UPPER CASE.
@@ -87,22 +94,26 @@ def disdrodb_run_l0b(
87
94
  If True, it reduces the amount of data to process.
88
95
  It processes just the first 100 rows of 3 L0A files for each station.
89
96
  The default is False.
90
- base_dir : str
91
- Base directory of DISDRODB
97
+ data_archive_dir : str
98
+ DISDRODB Data Archive directory
92
99
  Format: <...>/DISDRODB
93
100
  If not specified, uses path specified in the DISDRODB active configuration.
94
101
  """
95
- from disdrodb.l0.routines import run_disdrodb_l0b
102
+ from disdrodb.routines import run_l0b
96
103
 
97
104
  # Parse data_sources, campaign_names and station arguments
98
- base_dir = parse_base_dir(base_dir)
105
+ data_archive_dir = parse_archive_dir(data_archive_dir)
106
+ metadata_archive_dir = parse_archive_dir(metadata_archive_dir)
99
107
  data_sources = parse_arg_to_list(data_sources)
100
108
  campaign_names = parse_arg_to_list(campaign_names)
101
109
  station_names = parse_arg_to_list(station_names)
102
110
 
103
111
  # Run processing
104
- run_disdrodb_l0b(
105
- base_dir=base_dir,
112
+ run_l0b(
113
+ # DISDRODB root directories
114
+ data_archive_dir=data_archive_dir,
115
+ metadata_archive_dir=metadata_archive_dir,
116
+ # Stations options
106
117
  data_sources=data_sources,
107
118
  campaign_names=campaign_names,
108
119
  station_names=station_names,
@@ -113,5 +124,3 @@ def disdrodb_run_l0b(
113
124
  parallel=parallel,
114
125
  remove_l0a=remove_l0a,
115
126
  )
116
-
117
- return None