disdrodb 0.0.20__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.20.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.20.dist-info/AUTHORS.md +0 -18
  253. disdrodb-0.0.20.dist-info/METADATA +0 -186
  254. disdrodb-0.0.20.dist-info/RECORD +0 -168
  255. disdrodb-0.0.20.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.20.dist-info → disdrodb-0.1.0.dist-info/licenses}/LICENSE +0 -0
  264. {disdrodb-0.0.20.dist-info → disdrodb-0.1.0.dist-info}/top_level.txt +0 -0
@@ -0,0 +1,84 @@
1
+ #!/usr/bin/env python3
2
+
3
+ # -----------------------------------------------------------------------------.
4
+ # Copyright (c) 2021-2023 DISDRODB developers
5
+ #
6
+ # This program is free software: you can redistribute it and/or modify
7
+ # it under the terms of the GNU General Public License as published by
8
+ # the Free Software Foundation, either version 3 of the License, or
9
+ # (at your option) any later version.
10
+ #
11
+ # This program is distributed in the hope that it will be useful,
12
+ # but WITHOUT ANY WARRANTY; without even the implied warranty of
13
+ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
+ # GNU General Public License for more details.
15
+ #
16
+ # You should have received a copy of the GNU General Public License
17
+ # along with this program. If not, see <http://www.gnu.org/licenses/>.
18
+ # -----------------------------------------------------------------------------.
19
+ """Routine to download station data from the DISDRODB Decentralized Data Archive."""
20
+
21
+ import sys
22
+ from typing import Optional
23
+
24
+ import click
25
+
26
+ from disdrodb.data_transfer.download_data import click_download_options
27
+ from disdrodb.utils.cli import (
28
+ click_data_archive_dir_option,
29
+ click_metadata_archive_dir_option,
30
+ click_station_arguments,
31
+ parse_archive_dir,
32
+ )
33
+
34
+ sys.tracebacklimit = 0 # avoid full traceback error if occur
35
+
36
+
37
+ @click.command()
38
+ @click_station_arguments
39
+ @click_data_archive_dir_option
40
+ @click_metadata_archive_dir_option
41
+ @click_download_options
42
+ def disdrodb_download_station(
43
+ data_source: str,
44
+ campaign_name: str,
45
+ station_name: str,
46
+ data_archive_dir: Optional[str] = None,
47
+ metadata_archive_dir: Optional[str] = None,
48
+ force: bool = False,
49
+ ):
50
+ """
51
+ Download data of a single DISDRODB station from the DISDRODB remote repository.
52
+
53
+ Parameters
54
+ ----------
55
+ data_source : str
56
+ The name of the institution (for campaigns spanning multiple countries) or
57
+ the name of the country (for campaigns or sensor networks within a single country).
58
+ Must be provided in UPPER CASE.
59
+ campaign_name : str
60
+ The name of the campaign. Must be provided in UPPER CASE.
61
+ station_name : str
62
+ The name of the station.
63
+ data_archive_dir : str, optional
64
+ The base directory of DISDRODB, expected in the format ``<...>/DISDRODB``.
65
+ If not specified, the path specified in the DISDRODB active configuration will be used.
66
+ force: bool, optional
67
+ If ``True``, overwrite the already existing raw data file.
68
+ The default value is ``False``.
69
+ data_archive_dir : str (optional)
70
+ DISDRODB Data Archive directory. Format: ``<...>/DISDRODB``.
71
+ If ``None`` (the default), the disdrodb config variable ``data_archive_dir`` is used.
72
+ """
73
+ from disdrodb.data_transfer.download_data import download_station
74
+
75
+ data_archive_dir = parse_archive_dir(data_archive_dir)
76
+ metadata_archive_dir = parse_archive_dir(metadata_archive_dir)
77
+ download_station(
78
+ data_archive_dir=data_archive_dir,
79
+ metadata_archive_dir=metadata_archive_dir,
80
+ data_source=data_source,
81
+ campaign_name=campaign_name,
82
+ station_name=station_name,
83
+ force=force,
84
+ )
@@ -14,11 +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 initialize the DISDRODB station directory structure."""
17
18
  import sys
19
+ from typing import Optional
18
20
 
19
21
  import click
20
22
 
21
- from disdrodb.utils.scripts import click_base_dir_option, click_station_arguments, parse_base_dir
23
+ from disdrodb.utils.cli import (
24
+ click_data_archive_dir_option,
25
+ click_metadata_archive_dir_option,
26
+ click_station_arguments,
27
+ parse_archive_dir,
28
+ )
22
29
 
23
30
  sys.tracebacklimit = 0 # avoid full traceback error if occur
24
31
 
@@ -28,16 +35,18 @@ sys.tracebacklimit = 0 # avoid full traceback error if occur
28
35
 
29
36
  @click.command()
30
37
  @click_station_arguments
31
- @click_base_dir_option
38
+ @click_data_archive_dir_option
39
+ @click_metadata_archive_dir_option
32
40
  def disdrodb_initialize_station(
33
41
  # Station arguments
34
42
  data_source: str,
35
43
  campaign_name: str,
36
44
  station_name: str,
37
- # Processing options
38
- base_dir: str = None,
45
+ # DISDRODB root directories
46
+ data_archive_dir: Optional[str] = None,
47
+ metadata_archive_dir: Optional[str] = None,
39
48
  ):
40
- """Initialize the DISDRODB directory structure for a station.
49
+ r"""Initialize the DISDRODB directory structure for a station.
41
50
 
42
51
  It adds the relevant directories and the default issue and metadata YAML files..
43
52
 
@@ -51,19 +60,22 @@ def disdrodb_initialize_station(
51
60
  Campaign name. Must be UPPER CASE.\n
52
61
  station_name : str \n
53
62
  Station name \n
54
- base_dir : str \n
55
- Base directory of DISDRODB \n
63
+ data_archive_dir : str \n
64
+ DISDRODB Data Archive directory \n
56
65
  Format: <...>/DISDRODB \n
57
66
  If not specified, uses path specified in the DISDRODB active configuration. \n
58
67
  """
59
68
  from disdrodb.api.create_directories import create_initial_station_structure
60
69
 
61
- base_dir = parse_base_dir(base_dir)
70
+ data_archive_dir = parse_archive_dir(data_archive_dir)
71
+ metadata_archive_dir = parse_archive_dir(metadata_archive_dir)
62
72
 
63
73
  create_initial_station_structure(
64
- base_dir=base_dir,
74
+ # DISDRODB root directories
75
+ data_archive_dir=data_archive_dir,
76
+ metadata_archive_dir=metadata_archive_dir,
77
+ # Station arguments
65
78
  data_source=data_source,
66
79
  campaign_name=campaign_name,
67
80
  station_name=station_name,
68
81
  )
69
- return None
@@ -0,0 +1,32 @@
1
+ #!/usr/bin/env python3
2
+
3
+ # -----------------------------------------------------------------------------.
4
+ # Copyright (c) 2021-2023 DISDRODB developers
5
+ #
6
+ # This program is free software: you can redistribute it and/or modify
7
+ # it under the terms of the GNU General Public License as published by
8
+ # the Free Software Foundation, either version 3 of the License, or
9
+ # (at your option) any later version.
10
+ #
11
+ # This program is distributed in the hope that it will be useful,
12
+ # but WITHOUT ANY WARRANTY; without even the implied warranty of
13
+ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
+ # GNU General Public License for more details.
15
+ #
16
+ # You should have received a copy of the GNU General Public License
17
+ # along with this program. If not, see <http://www.gnu.org/licenses/>.
18
+ # -----------------------------------------------------------------------------.
19
+ """Routine to print the DISDRODB Data Archive directory."""
20
+ import sys
21
+
22
+ import click
23
+
24
+ sys.tracebacklimit = 0 # avoid full traceback error if occur
25
+
26
+
27
+ @click.command()
28
+ def disdrodb_metadata_archive_directory():
29
+ """Print the DISDRODB Metadata Archive directory."""
30
+ import disdrodb
31
+
32
+ print("The DISDRODB Metadata Archive Directory is: ", disdrodb.get_metadata_archive_dir(None))
@@ -16,36 +16,36 @@
16
16
  # You should have received a copy of the GNU General Public License
17
17
  # along with this program. If not, see <http://www.gnu.org/licenses/>.
18
18
  # -----------------------------------------------------------------------------.
19
- """Routines to download station data from the DISDRODB Decentralized Data Archive."""
19
+ """Routine to open the DISDRODB Data Archive."""
20
20
 
21
21
  import sys
22
+ from typing import Optional
22
23
 
23
24
  import click
24
25
 
25
- from disdrodb.data_transfer.download_data import click_download_options
26
- from disdrodb.utils.scripts import click_base_dir_option, click_station_arguments, parse_base_dir
26
+ from disdrodb.utils.cli import (
27
+ click_data_archive_dir_option,
28
+ parse_archive_dir,
29
+ )
27
30
 
28
31
  sys.tracebacklimit = 0 # avoid full traceback error if occur
29
32
 
30
33
 
31
34
  @click.command()
32
- @click_station_arguments
33
- @click_base_dir_option
34
- @click_download_options
35
- def disdrodb_download_station(
36
- data_source: str,
37
- campaign_name: str,
38
- station_name: str,
39
- base_dir: str = None,
40
- force: bool = False,
35
+ @click_data_archive_dir_option
36
+ def disdrodb_open_data_archive(
37
+ data_archive_dir: Optional[str] = None,
41
38
  ):
42
- from disdrodb.data_transfer.download_data import download_station
43
-
44
- base_dir = parse_base_dir(base_dir)
45
- download_station(
46
- base_dir=base_dir,
47
- data_source=data_source,
48
- campaign_name=campaign_name,
49
- station_name=station_name,
50
- force=force,
51
- )
39
+ """Open the DISDRODB Data Archive.
40
+
41
+ Parameters
42
+ ----------
43
+ data_archive_dir : str, optional
44
+ The base directory of DISDRODB, expected in the format ``<...>/DISDRODB``.
45
+ If not specified, the path specified in the DISDRODB active configuration will be used.
46
+ """
47
+ from disdrodb.api.io import open_data_archive
48
+
49
+ data_archive_dir = parse_archive_dir(data_archive_dir)
50
+
51
+ open_data_archive(data_archive_dir=data_archive_dir)
@@ -0,0 +1,69 @@
1
+ #!/usr/bin/env python3
2
+
3
+ # -----------------------------------------------------------------------------.
4
+ # Copyright (c) 2021-2023 DISDRODB developers
5
+ #
6
+ # This program is free software: you can redistribute it and/or modify
7
+ # it under the terms of the GNU General Public License as published by
8
+ # the Free Software Foundation, either version 3 of the License, or
9
+ # (at your option) any later version.
10
+ #
11
+ # This program is distributed in the hope that it will be useful,
12
+ # but WITHOUT ANY WARRANTY; without even the implied warranty of
13
+ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
+ # GNU General Public License for more details.
15
+ #
16
+ # You should have received a copy of the GNU General Public License
17
+ # along with this program. If not, see <http://www.gnu.org/licenses/>.
18
+ # -----------------------------------------------------------------------------.
19
+ """Routine to open the DISDRODB Data Archive logs directory."""
20
+
21
+ import sys
22
+ from typing import Optional
23
+
24
+ import click
25
+
26
+ from disdrodb.utils.cli import (
27
+ click_data_archive_dir_option,
28
+ click_station_arguments,
29
+ parse_archive_dir,
30
+ )
31
+
32
+ sys.tracebacklimit = 0 # avoid full traceback error if occur
33
+
34
+
35
+ @click.command()
36
+ @click_station_arguments
37
+ @click_data_archive_dir_option
38
+ def disdrodb_open_logs_directory(
39
+ data_source: str,
40
+ campaign_name: str,
41
+ station_name: Optional[str] = None,
42
+ data_archive_dir: Optional[str] = None,
43
+ ):
44
+ """Open the DISDRODB Data Archive logs directory of a station.
45
+
46
+ Parameters
47
+ ----------
48
+ data_source : str
49
+ The name of the institution (for campaigns spanning multiple countries) or
50
+ the name of the country (for campaigns or sensor networks within a single country).
51
+ Must be provided in UPPER CASE.
52
+ campaign_name : str
53
+ The name of the campaign. Must be provided in UPPER CASE.
54
+ station_name : str
55
+ The name of the station.
56
+ data_archive_dir : str, optional
57
+ The base directory of DISDRODB, expected in the format ``<...>/DISDRODB``.
58
+ If not specified, the path specified in the DISDRODB active configuration will be used.
59
+ """
60
+ from disdrodb.api.io import open_logs_directory
61
+
62
+ data_archive_dir = parse_archive_dir(data_archive_dir)
63
+
64
+ open_logs_directory(
65
+ data_archive_dir=data_archive_dir,
66
+ data_source=data_source,
67
+ campaign_name=campaign_name,
68
+ station_name=station_name,
69
+ )
@@ -16,38 +16,36 @@
16
16
  # You should have received a copy of the GNU General Public License
17
17
  # along with this program. If not, see <http://www.gnu.org/licenses/>.
18
18
  # -----------------------------------------------------------------------------.
19
- """Routines to upload station data to the DISDRODB Decentralized Data Archive."""
19
+ """Routine to open the DISDRODB Metadata Data Archive."""
20
20
 
21
21
  import sys
22
+ from typing import Optional
22
23
 
23
24
  import click
24
25
 
25
- from disdrodb.data_transfer.upload_data import click_upload_options
26
- from disdrodb.utils.scripts import click_base_dir_option, click_station_arguments, parse_base_dir
26
+ from disdrodb.utils.cli import (
27
+ click_metadata_archive_dir_option,
28
+ parse_archive_dir,
29
+ )
27
30
 
28
31
  sys.tracebacklimit = 0 # avoid full traceback error if occur
29
32
 
30
33
 
31
34
  @click.command()
32
- @click_station_arguments
33
- @click_upload_options
34
- @click_base_dir_option
35
- def disdrodb_upload_station(
36
- data_source: str,
37
- campaign_name: str,
38
- station_name: str,
39
- platform: str = None,
40
- base_dir: str = None,
41
- force: bool = False,
35
+ @click_metadata_archive_dir_option
36
+ def disdrodb_open_metadata_archive(
37
+ metadata_archive_dir: Optional[str] = None,
42
38
  ):
43
- from disdrodb.data_transfer.upload_data import upload_station
44
-
45
- base_dir = parse_base_dir(base_dir)
46
- upload_station(
47
- base_dir=base_dir,
48
- data_source=data_source,
49
- campaign_name=campaign_name,
50
- station_name=station_name,
51
- platform=platform,
52
- force=force,
53
- )
39
+ """Open the DISDRODB Metadata Archive.
40
+
41
+ Parameters
42
+ ----------
43
+ metadata_archive_dir : str, optional
44
+ The base directory of DISDRODB, expected in the format ``<...>/DISDRODB``.
45
+ If not specified, the path specified in the DISDRODB active configuration will be used.
46
+ """
47
+ from disdrodb.api.io import open_metadata_archive
48
+
49
+ metadata_archive_dir = parse_archive_dir(metadata_archive_dir)
50
+
51
+ open_metadata_archive(metadata_archive_dir=metadata_archive_dir)
@@ -0,0 +1,71 @@
1
+ #!/usr/bin/env python3
2
+
3
+ # -----------------------------------------------------------------------------.
4
+ # Copyright (c) 2021-2023 DISDRODB developers
5
+ #
6
+ # This program is free software: you can redistribute it and/or modify
7
+ # it under the terms of the GNU General Public License as published by
8
+ # the Free Software Foundation, either version 3 of the License, or
9
+ # (at your option) any later version.
10
+ #
11
+ # This program is distributed in the hope that it will be useful,
12
+ # but WITHOUT ANY WARRANTY; without even the implied warranty of
13
+ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
+ # GNU General Public License for more details.
15
+ #
16
+ # You should have received a copy of the GNU General Public License
17
+ # along with this program. If not, see <http://www.gnu.org/licenses/>.
18
+ # -----------------------------------------------------------------------------.
19
+ """Routine to open the DISDRODB Data Archive logs directory."""
20
+
21
+ import sys
22
+ from typing import Optional
23
+
24
+ import click
25
+
26
+ from disdrodb.utils.cli import (
27
+ click_metadata_archive_dir_option,
28
+ click_station_arguments,
29
+ parse_archive_dir,
30
+ )
31
+
32
+ sys.tracebacklimit = 0 # avoid full traceback error if occur
33
+
34
+
35
+ @click.command()
36
+ @click_station_arguments
37
+ @click_metadata_archive_dir_option
38
+ def disdrodb_open_metadata_directory(
39
+ data_source: str,
40
+ campaign_name: str,
41
+ station_name: Optional[str] = None,
42
+ metadata_archive_dir: Optional[str] = None,
43
+ ):
44
+ """Open the DISDRODB Data Archive logs directory of a station.
45
+
46
+ Parameters
47
+ ----------
48
+ data_source : str
49
+ The name of the institution (for campaigns spanning multiple countries) or
50
+ the name of the country (for campaigns or sensor networks within a single country).
51
+ Must be provided in UPPER CASE.
52
+ campaign_name : str
53
+ The name of the campaign. Must be provided in UPPER CASE.
54
+ station_name : str
55
+ The name of the station.
56
+ metadata_archive_dir : str, optional
57
+ The directory path where the DISDRODB Metadata Archive is located.
58
+ The directory path must end with ``<...>/DISDRODB``.
59
+ If ``None``, it uses the ``metadata_archive_dir`` path specified
60
+ in the DISDRODB active configuration.
61
+ """
62
+ from disdrodb.api.io import open_metadata_directory
63
+
64
+ metadata_archive_dir = parse_archive_dir(metadata_archive_dir)
65
+
66
+ open_metadata_directory(
67
+ metadata_archive_dir=metadata_archive_dir,
68
+ data_source=data_source,
69
+ campaign_name=campaign_name,
70
+ station_name=station_name,
71
+ )
@@ -0,0 +1,74 @@
1
+ #!/usr/bin/env python3
2
+
3
+ # -----------------------------------------------------------------------------.
4
+ # Copyright (c) 2021-2023 DISDRODB developers
5
+ #
6
+ # This program is free software: you can redistribute it and/or modify
7
+ # it under the terms of the GNU General Public License as published by
8
+ # the Free Software Foundation, either version 3 of the License, or
9
+ # (at your option) any later version.
10
+ #
11
+ # This program is distributed in the hope that it will be useful,
12
+ # but WITHOUT ANY WARRANTY; without even the implied warranty of
13
+ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
+ # GNU General Public License for more details.
15
+ #
16
+ # You should have received a copy of the GNU General Public License
17
+ # along with this program. If not, see <http://www.gnu.org/licenses/>.
18
+ # -----------------------------------------------------------------------------.
19
+ """Routine to open the DISDRODB Data Archive station product directory."""
20
+
21
+ import sys
22
+ from typing import Optional
23
+
24
+ import click
25
+
26
+ from disdrodb.utils.cli import (
27
+ click_data_archive_dir_option,
28
+ click_station_arguments,
29
+ parse_archive_dir,
30
+ )
31
+
32
+ sys.tracebacklimit = 0 # avoid full traceback error if occur
33
+
34
+
35
+ @click.command()
36
+ @click.argument("product", metavar="<product>")
37
+ @click_station_arguments
38
+ @click_data_archive_dir_option
39
+ def disdrodb_open_product_directory(
40
+ product: str,
41
+ data_source: str,
42
+ campaign_name: str,
43
+ station_name: str,
44
+ data_archive_dir: Optional[str] = None,
45
+ ):
46
+ """Open the DISDRODB Data Archive logs directory of a station.
47
+
48
+ Parameters
49
+ ----------
50
+ product : str
51
+ DISDRODB product.
52
+ data_source : str
53
+ The name of the institution (for campaigns spanning multiple countries) or
54
+ the name of the country (for campaigns or sensor networks within a single country).
55
+ Must be provided in UPPER CASE.
56
+ campaign_name : str
57
+ The name of the campaign. Must be provided in UPPER CASE.
58
+ station_name : str
59
+ The name of the station.
60
+ data_archive_dir : str, optional
61
+ The base directory of DISDRODB, expected in the format ``<...>/DISDRODB``.
62
+ If not specified, the path specified in the DISDRODB active configuration will be used.
63
+ """
64
+ from disdrodb.api.io import open_product_directory
65
+
66
+ data_archive_dir = parse_archive_dir(data_archive_dir)
67
+
68
+ open_product_directory(
69
+ data_archive_dir=data_archive_dir,
70
+ product=product,
71
+ data_source=data_source,
72
+ campaign_name=campaign_name,
73
+ station_name=station_name,
74
+ )
@@ -0,0 +1,32 @@
1
+ #!/usr/bin/env python3
2
+
3
+ # -----------------------------------------------------------------------------.
4
+ # Copyright (c) 2021-2023 DISDRODB developers
5
+ #
6
+ # This program is free software: you can redistribute it and/or modify
7
+ # it under the terms of the GNU General Public License as published by
8
+ # the Free Software Foundation, either version 3 of the License, or
9
+ # (at your option) any later version.
10
+ #
11
+ # This program is distributed in the hope that it will be useful,
12
+ # but WITHOUT ANY WARRANTY; without even the implied warranty of
13
+ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
+ # GNU General Public License for more details.
15
+ #
16
+ # You should have received a copy of the GNU General Public License
17
+ # along with this program. If not, see <http://www.gnu.org/licenses/>.
18
+ # -----------------------------------------------------------------------------.
19
+ """Routine to open the disdrodb software readers directory."""
20
+ import sys
21
+
22
+ import click
23
+
24
+ sys.tracebacklimit = 0 # avoid full traceback error if occur
25
+
26
+
27
+ @click.command()
28
+ def disdrodb_open_readers_directory():
29
+ """Open the disdrodb software readers directory."""
30
+ from disdrodb.api.io import open_readers_directory
31
+
32
+ open_readers_directory()