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
@@ -0,0 +1,57 @@
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
+ """DISDRODB product writers."""
20
+
21
+ import os
22
+
23
+ import xarray as xr
24
+
25
+ from disdrodb.utils.attrs import set_disdrodb_attrs
26
+ from disdrodb.utils.directories import create_directory, remove_if_exists
27
+
28
+
29
+ def write_product(ds: xr.Dataset, filepath: str, product: str, force: bool = False) -> None:
30
+ """Save the xarray dataset into a NetCDF file.
31
+
32
+ Parameters
33
+ ----------
34
+ ds : xarray.Dataset
35
+ Input xarray dataset.
36
+ filepath : str
37
+ Output file path.
38
+ product: str
39
+ DISDRODB product name.
40
+ force : bool, optional
41
+ Whether to overwrite existing data.
42
+ If ``True``, overwrite existing data into destination directories.
43
+ If ``False``, raise an error if there are already data into destination directories. This is the default.
44
+ """
45
+ # Create station directory if does not exist
46
+ create_directory(os.path.dirname(filepath))
47
+
48
+ # Check if the file already exists
49
+ # - If force=True --> Remove it
50
+ # - If force=False --> Raise error
51
+ remove_if_exists(filepath, force=force)
52
+
53
+ # Update attributes
54
+ ds = set_disdrodb_attrs(ds, product=product)
55
+
56
+ # Write netcdf
57
+ ds.to_netcdf(filepath, engine="netcdf4")
disdrodb/utils/xarray.py CHANGED
@@ -16,69 +16,160 @@
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
- """Xarray utility."""
20
-
21
- import pandas as pd
19
+ """Xarray utilities."""
20
+ import numpy as np
22
21
  import xarray as xr
23
22
  from xarray.core import dtypes
24
23
 
25
24
 
26
- def get_dataset_start_end_time(ds: xr.Dataset):
27
- """Retrieves dataset starting and ending time.
25
+ def xr_get_last_valid_idx(da_condition, dim, fill_value=None):
26
+ """
27
+ Get the index of the last True value along a specified dimension in an xarray DataArray.
28
+
29
+ This function finds the last index along the given dimension where the condition is True.
30
+ If all values are False or NaN along that dimension, the function returns ``fill_value``.
28
31
 
29
32
  Parameters
30
33
  ----------
31
- ds : xr.Dataset
32
- Input dataset
34
+ da_condition : xarray.DataArray
35
+ A boolean DataArray where True indicates valid or desired values.
36
+ Should have the dimension specified in `dim`.
37
+ dim : str
38
+ The name of the dimension along which to find the last True index.
39
+ fill_value : int or float
40
+ The fill value when all values are False or NaN along the specified dimension.
41
+ The default value is ``dim_size - 1``.
33
42
 
34
43
  Returns
35
44
  -------
36
- tuple
37
- (starting_time, ending_time)
45
+ last_idx : xarray.DataArray
46
+ An array containing the index of the last True value along the specified dimension.
47
+ If all values are False or NaN, the corresponding entry in `last_idx` will be NaN.
48
+
49
+ Notes
50
+ -----
51
+ The function works by reversing the DataArray along the specified dimension and using
52
+ `argmax` to find the first True value in the reversed array. It then calculates the
53
+ corresponding index in the original array. To handle cases where all values are False
54
+ or NaN (and `argmax` would return 0), the function checks if there is any True value
55
+ along the dimension and assigns NaN to `last_idx` where appropriate.
56
+
57
+ Examples
58
+ --------
59
+ >>> import xarray as xr
60
+ >>> da = xr.DataArray([[False, False, True], [False, False, False]], dims=["time", "my_dimension"])
61
+ >>> last_idx = xr_get_last_valid_idx(da, "my_dimension")
62
+ >>> print(last_idx)
63
+ <xarray.DataArray (time: 2)>
64
+ array([2., nan])
65
+ Dimensions without coordinates: time
66
+
67
+ In this example, for the first time step, the last True index is 2.
68
+ For the second time step, all values are False, so the function returns NaN.
38
69
 
39
70
  """
40
- starting_time = ds["time"].values[0]
41
- ending_time = ds["time"].values[-1]
42
- return (starting_time, ending_time)
71
+ # Check input is a boolean array
72
+ if not np.issubdtype(da_condition.dtype, np.bool_):
73
+ raise ValueError("`da_condition` must be a boolean DataArray.")
74
+
75
+ # Get the size of the 'dim' dimension
76
+ dim_size = da_condition.sizes[dim]
77
+
78
+ # Define default fillvalue
79
+ if fill_value is None:
80
+ fill_value = dim_size - 1
81
+
82
+ # Reverse the mask along 'dim'
83
+ da_condition_reversed = da_condition.isel({dim: slice(None, None, -1)})
43
84
 
85
+ # Check if there is any True value along the dimension for each slice
86
+ has_true = da_condition.any(dim=dim)
44
87
 
45
- def regularize_dataset(ds: xr.Dataset, freq: str, time_dim="time", method=None, fill_value=dtypes.NA):
88
+ # Find the first non-zero index in the reversed array
89
+ last_idx_from_end = da_condition_reversed.argmax(dim=dim)
90
+
91
+ # Calculate the last True index in the original array
92
+ last_idx = xr.where(
93
+ has_true,
94
+ dim_size - last_idx_from_end - 1,
95
+ fill_value,
96
+ )
97
+ return last_idx
98
+
99
+
100
+ def define_dataarray_fill_value(da):
101
+ """Define the fill value for a numerical xarray.DataArray."""
102
+ if np.issubdtype(da.dtype, np.floating):
103
+ return dtypes.NA
104
+ if np.issubdtype(da.dtype, np.integer):
105
+ if "_FillValue" in da.attrs:
106
+ return da.attrs["_FillValue"]
107
+ if "_FillValue" in da.encoding:
108
+ return da.encoding["_FillValue"]
109
+ return np.iinfo(da.dtype).max
110
+ return None
111
+
112
+
113
+ def define_dataarray_fill_value_dictionary(da):
114
+ """Define fill values for numerical variables and coordinates of a xarray.DataArray.
115
+
116
+ Return a dict of fill values:
117
+ - floating → NaN
118
+ - integer → ds[var].attrs["_FillValue"] if present, else np.iinfo(dtype).max
46
119
  """
47
- Regularize a dataset across time dimension with uniform resolution.
120
+ fill_value_dict = {}
121
+ # Add fill value of DataArray
122
+ fill_value_array = define_dataarray_fill_value(da)
123
+ if fill_value_array is not None:
124
+ fill_value_dict[da.name] = fill_value_array
125
+ # Add fill value of coordinates
126
+ fill_value_dict.update(define_dataset_fill_value_dictionary(da.coords))
127
+ # Return fill value dictionary
128
+ return fill_value_dict
48
129
 
49
- Parameters
50
- ----------
51
- ds : xr.Dataset
52
- DESCRIPTION.
53
- time_dim : TYPE, optional
54
- DESCRIPTION. The default is "time".
55
- freq : str
56
- The `freq` string to pass to pd.date_range to define the new time coordinates.
57
- Examples: freq="2min"
58
- time_dim : TYPE, optional
59
- The time dimension in the xr.Dataset. The default is "time".
60
- method : TYPE, optional
61
- Method to use for filling missing timesteps.
62
- If None, fill with fill_value. The default is None.
63
- For other possible methods, see https://docs.xarray.dev/en/stable/generated/xarray.Dataset.reindex.html
64
- fill_value : float, optional
65
- Fill value to fill missing timesteps. The default is dtypes.NA.
66
130
 
67
- Returns
68
- -------
69
- ds_reindexed : xr.Dataset
70
- Regularized dataset.
131
+ def define_dataset_fill_value_dictionary(ds):
132
+ """Define fill values for numerical variables and coordinates of a xarray.Dataset.
71
133
 
134
+ Return a dict of per-variable fill values:
135
+ - floating --> NaN
136
+ - integer --> ds[var].attrs["_FillValue"] if present, else the maximum allowed number.
72
137
  """
73
- start = ds[time_dim].values[0]
74
- end = ds[time_dim].values[-1]
75
- new_time_index = pd.date_range(start=pd.to_datetime(start), end=pd.to_datetime(end), freq=freq)
76
-
77
- # Regularize dataset and fill with NA values
78
- ds_reindexed = ds.reindex(
79
- {"time": new_time_index},
80
- method=method, # do not fill gaps
81
- # tolerance=tolerance, # mismatch in seconds
82
- fill_value=fill_value,
83
- )
84
- return ds_reindexed
138
+ fill_value_dict = {}
139
+ # Retrieve fill values for numerical variables and coordinates
140
+ for var in list(ds.variables):
141
+ array_fill_value = define_dataarray_fill_value(ds[var])
142
+ if array_fill_value is not None:
143
+ fill_value_dict[var] = array_fill_value
144
+ # Return fill value dictionary
145
+ return fill_value_dict
146
+
147
+
148
+ def define_fill_value_dictionary(xr_obj):
149
+ """Define fill values for numerical variables and coordinates of a xarray object.
150
+
151
+ Return a dict of per-variable fill values:
152
+ - floating --> NaN
153
+ - integer --> ds[var].attrs["_FillValue"] if present, else the maximum allowed number.
154
+ """
155
+ if isinstance(xr_obj, xr.Dataset):
156
+ return define_dataset_fill_value_dictionary(xr_obj)
157
+ return define_dataarray_fill_value_dictionary(xr_obj)
158
+
159
+
160
+ ####-----------------------------------------------------------------------------------
161
+ #### Diameter and Velocity Coordinates
162
+
163
+
164
+ def remove_diameter_coordinates(xr_obj):
165
+ """Drop diameter coordinates from xarray object."""
166
+ from disdrodb import DIAMETER_COORDS
167
+
168
+ return xr_obj.drop_vars(DIAMETER_COORDS, errors="ignore")
169
+
170
+
171
+ def remove_velocity_coordinates(xr_obj):
172
+ """Drop velocity coordinates from xarray object."""
173
+ from disdrodb import VELOCITY_COORDS
174
+
175
+ return xr_obj.drop_vars(VELOCITY_COORDS, errors="ignore")
disdrodb/utils/yaml.py CHANGED
@@ -49,4 +49,3 @@ def write_yaml(dictionary, filepath, sort_keys=False):
49
49
  """
50
50
  with open(filepath, "w") as f:
51
51
  yaml.dump(dictionary, f, sort_keys=sort_keys)
52
- return None
@@ -0,0 +1,17 @@
1
+ # -----------------------------------------------------------------------------.
2
+ # Copyright (c) 2021-2023 DISDRODB developers
3
+ #
4
+ # This program is free software: you can redistribute it and/or modify
5
+ # it under the terms of the GNU General Public License as published by
6
+ # the Free Software Foundation, either version 3 of the License, or
7
+ # (at your option) any later version.
8
+ #
9
+ # This program is distributed in the hope that it will be useful,
10
+ # but WITHOUT ANY WARRANTY; without even the implied warranty of
11
+ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12
+ # GNU General Public License for more details.
13
+ #
14
+ # You should have received a copy of the GNU General Public License
15
+ # along with this program. If not, see <http://www.gnu.org/licenses/>.
16
+ # -----------------------------------------------------------------------------.
17
+ """DISDRODB Visualization Module."""
disdrodb/viz/plots.py ADDED
@@ -0,0 +1,17 @@
1
+ # -----------------------------------------------------------------------------.
2
+ # Copyright (c) 2021-2023 DISDRODB developers
3
+ #
4
+ # This program is free software: you can redistribute it and/or modify
5
+ # it under the terms of the GNU General Public License as published by
6
+ # the Free Software Foundation, either version 3 of the License, or
7
+ # (at your option) any later version.
8
+ #
9
+ # This program is distributed in the hope that it will be useful,
10
+ # but WITHOUT ANY WARRANTY; without even the implied warranty of
11
+ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12
+ # GNU General Public License for more details.
13
+ #
14
+ # You should have received a copy of the GNU General Public License
15
+ # along with this program. If not, see <http://www.gnu.org/licenses/>.
16
+ # -----------------------------------------------------------------------------.
17
+ """DISDRODB Plotting Tools."""
@@ -0,0 +1,321 @@
1
+ Metadata-Version: 2.4
2
+ Name: disdrodb
3
+ Version: 0.1.0
4
+ Summary: disdrodb provides tools to download, standardize, share and analyze global disdrometer data.
5
+ Author: Gionata Ghiggi
6
+ Project-URL: homepage, https://github.com/ltelab/disdrodb
7
+ Project-URL: repository, https://github.com/ltelab/disdrodb
8
+ Project-URL: source, https://github.com/ltelab/disdrodb
9
+ Project-URL: tracker, https://github.com/ltelab/disdrodb/issues
10
+ Project-URL: documentation, https://disdrodb.readthedocs.io
11
+ Project-URL: changelog, https://github.com/ltelab/disdrodb/blob/main/CHANGELOG.md
12
+ Keywords: python,disdrometer,parsivel,drop size distribution
13
+ Classifier: Development Status :: 1 - Planning
14
+ Classifier: Intended Audience :: Developers
15
+ Classifier: Programming Language :: Python :: 3
16
+ Classifier: Operating System :: Unix
17
+ Classifier: Operating System :: MacOS :: MacOS X
18
+ Classifier: Operating System :: Microsoft :: Windows
19
+ Requires-Python: >=3.9
20
+ Description-Content-Type: text/markdown
21
+ License-File: LICENSE
22
+ Requires-Dist: click
23
+ Requires-Dist: tqdm
24
+ Requires-Dist: pooch
25
+ Requires-Dist: donfig
26
+ Requires-Dist: requests
27
+ Requires-Dist: PyYAML
28
+ Requires-Dist: trollsift
29
+ Requires-Dist: netCDF4
30
+ Requires-Dist: pyarrow
31
+ Requires-Dist: pandas
32
+ Requires-Dist: numpy
33
+ Requires-Dist: scipy
34
+ Requires-Dist: dask[distributed]
35
+ Requires-Dist: xarray
36
+ Provides-Extra: dev
37
+ Requires-Dist: jupyter; extra == "dev"
38
+ Requires-Dist: pre-commit; extra == "dev"
39
+ Requires-Dist: pytest; extra == "dev"
40
+ Requires-Dist: pydantic>=2.0.0; extra == "dev"
41
+ Requires-Dist: pytest-cov; extra == "dev"
42
+ Requires-Dist: pytest-mock; extra == "dev"
43
+ Requires-Dist: requests-mock; extra == "dev"
44
+ Requires-Dist: setuptools; extra == "dev"
45
+ Requires-Dist: build; extra == "dev"
46
+ Requires-Dist: twine; extra == "dev"
47
+ Requires-Dist: loghub; extra == "dev"
48
+ Dynamic: license-file
49
+
50
+ # 📦 DISDRODB - A package to standardize, process and analyze global disdrometer data.
51
+
52
+ | | |
53
+ | ----------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
54
+ | Deployment | [![PyPI](https://badge.fury.io/py/disdrodb.svg?style=flat)](https://pypi.org/project/disdrodb/) [![Conda](https://img.shields.io/conda/vn/conda-forge/disdrodb.svg?logo=conda-forge&logoColor=white&style=flat)](https://anaconda.org/conda-forge/disdrodb) |
55
+ | Activity | [![PyPI Downloads](https://img.shields.io/pypi/dm/disdrodb.svg?label=PyPI%20downloads&style=flat)](https://pypi.org/project/disdrodb/) [![Conda Downloads](https://img.shields.io/conda/dn/conda-forge/disdrodb.svg?label=Conda%20downloads&style=flat)](https://anaconda.org/conda-forge/disdrodb) |
56
+ | Python Versions | [![Python Versions](https://img.shields.io/badge/Python-3.10%20%203.11%20%203.12-blue?style=flat)](https://www.python.org/downloads/) |
57
+ | Supported Systems | [![Linux](https://img.shields.io/github/actions/workflow/status/ltelab/disdrodb/.github/workflows/tests.yml?label=Linux&style=flat)](https://github.com/ltelab/disdrodb/actions/workflows/tests.yml) [![macOS](https://img.shields.io/github/actions/workflow/status/ltelab/disdrodb/.github/workflows/tests.yml?label=macOS&style=flat)](https://github.com/ltelab/disdrodb/actions/workflows/tests.yml) [![Windows](https://img.shields.io/github/actions/workflow/status/ltelab/disdrodb/.github/workflows/tests_windows.yml?label=Windows&style=flat)](https://github.com/ltelab/disdrodb/actions/workflows/tests_windows.yml) |
58
+ | Project Status | [![Project Status](https://www.repostatus.org/badges/latest/active.svg?style=flat)](https://www.repostatus.org/#active) |
59
+ | Build Status | [![Tests](https://github.com/ltelab/disdrodb/actions/workflows/tests.yml/badge.svg?style=flat)](https://github.com/ltelab/disdrodb/actions/workflows/tests.yml) [![Lint](https://github.com/ltelab/disdrodb/actions/workflows/lint.yml/badge.svg?style=flat)](https://github.com/ltelab/disdrodb/actions/workflows/lint.yml) [![Docs](https://readthedocs.org/projects/disdrodb/badge/?version=latest&style=flat)](https://disdrodb.readthedocs.io/en/latest/) |
60
+ | Linting | [![Black](https://img.shields.io/badge/code%20style-black-000000.svg?style=flat)](https://github.com/psf/black) [![Ruff](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ruff/main/assets/badge/v2.json&style=flat)](https://github.com/astral-sh/ruff) [![Codespell](https://img.shields.io/badge/Codespell-enabled-brightgreen?style=flat)](https://github.com/codespell-project/codespell) |
61
+ | Code Coverage | [![Coveralls](https://coveralls.io/repos/github/ltelab/disdrodb/badge.svg?branch=main&style=flat)](https://coveralls.io/github/ltelab/disdrodb?branch=main) [![Codecov](https://codecov.io/gh/ltelab/disdrodb/branch/main/graph/badge.svg?style=flat)](https://codecov.io/gh/ltelab/disdrodb) |
62
+ | Code Quality | [![Codefactor](https://www.codefactor.io/repository/github/ltelab/disdrodb/badge?style=flat)](https://www.codefactor.io/repository/github/ltelab/disdrodb) [![Codebeat](https://codebeat.co/badges/14ff831b-f064-4bdd-a2e2-72ffdf28a35a?style=flat)](https://codebeat.co/projects/github-com-ltelab-disdrodb-main) [![Codacy](https://app.codacy.com/project/badge/Grade/d823c50a7ad14268bd347b5aba384623?style=flat)](https://app.codacy.com/gh/ltelab/disdrodb/dashboard?utm_source=gh&utm_medium=referral&utm_content=&utm_campaign=Badge_grade) [![Codescene](https://codescene.io/projects/36773/status-badges/code-health?style=flat)](https://codescene.io/projects/36773) |
63
+ | License | [![License](https://img.shields.io/github/license/ltelab/disdrodb?style=flat)](https://github.com/ltelab/disdrodb/blob/main/LICENSE) |
64
+ | Community | [![Slack](https://img.shields.io/badge/Slack-disdrodb-green.svg?logo=slack&style=flat)](https://join.slack.com/t/disdrodbworkspace/shared_invite/zt-25l4mvgo7-cfBdXalzlWGd4Pt7H~FqoA) [![GitHub Discussions](https://img.shields.io/badge/GitHub-Discussions-green?logo=github&style=flat)](https://github.com/ltelab/disdrodb/discussions) |
65
+ | Citation | [![DOI](https://zenodo.org/badge/429018433.svg?style=flat)](https://zenodo.org/doi/10.5281/zenodo.7680581) |
66
+
67
+ [**Slack**](https://join.slack.com/t/disdrodbworkspace/shared_invite/zt-25l4mvgo7-cfBdXalzlWGd4Pt7H~FqoA) | [**Documentation**](https://disdrodb.readthedocs.io/en/latest/)
68
+
69
+ DISDRODB is part of an international joint effort to index, collect and homogenize drop size distribution (DSD) data from around the world.
70
+
71
+ The DISDRODB project also aims to establish a global standard for sharing disdrometer observations.
72
+ Built on FAIR data principles and Climate & Forecast (CF) conventions, DISDRODB standards facilitates the processing, analysis, and visualization of disdrometer data.
73
+
74
+
75
+ ## ℹ️ Software Overview
76
+
77
+ The software enables you to:
78
+
79
+ - Upload raw data of new disdrometer stations to the DISDRODB Decentralized Data Archive
80
+
81
+ - Download the raw disdrometer data from stations included in the DISDRODB Decentralized Data Archive
82
+
83
+ - Convert raw disdrometer data into a standard NetCDF format (DISDRODB L0 product)
84
+
85
+ - Generate standardized, homogenized, and quality-checked disdrometer measurements (DISDRODB L1 product)
86
+
87
+ - Compute empirical and model-based drop size distribution parameters and derive geophysical and polarimetric radar variables of interest (DISDRODB L2 product)
88
+
89
+ Currently, the DISDRODB Working Group is finalizing the development of the L1 and L2 scientific products.
90
+ If you have ideas, algorithms, data or expertise to share, or you want to contribute to the future DISDRODB products, do not hesitate to get in touch !!!
91
+
92
+ Join the [**DISDRODB Slack Workspace**](https://join.slack.com/t/disdrodbworkspace/shared_invite/zt-25l4mvgo7-cfBdXalzlWGd4Pt7H~FqoA) to meet the DISDRODB Community !
93
+
94
+ ## 🚀 Quick Start
95
+
96
+ You're about to create your very own DISDRODB Local Data Archive.
97
+
98
+ ### 📚 Download the DISDRODB Metadata Archive
99
+
100
+ The DISDRODB Metadata Archive is a collection of metadata files that describe the disdrometer stations included in DISDRODB.
101
+
102
+ To download the DISDRODB Metadata Archive, navigate to the desired directory and run:
103
+
104
+ ```bash
105
+
106
+ git clone https://github.com/ltelab/DISDRODB-METADATA.git
107
+
108
+ ```
109
+
110
+ This command will download a directory called `DISDRODB-METADATA`.
111
+
112
+ Alternatively, you can download a static version of the DISDRODB Metadata Archive using:
113
+
114
+ ```bash
115
+ disdrodb_download_metadata_archive /custom/path/where/to/download/DISDRODB-METADATA
116
+ ```
117
+
118
+ ### 📚 Define the DISDRODB Configuration File
119
+
120
+ The disdrodb software needs to know where the local DISDRODB Metadata Archive
121
+ is stored on your local machine, as well as where you want to download the raw stations data
122
+ as well as where to save the DISDRODB products you will generate.
123
+
124
+ Within the `disdrodb` package, the argument `metadata_archive_dir` refers to the base directory of your local DISDRODB Metadata Archive, while `data_archive_dir` refers to the base directory of your local DISDRODB Data Archive.
125
+
126
+ The `metadata_archive_dir` path corresponds to the `DISDRODB` directory within the `DISDRODB-METADATA` archive.
127
+ The `data_archive_dir` path corresponds to `DISDRODB` directory of choice where
128
+ all DISDRODB products will be saved.
129
+
130
+ To facilitate the creation of the DISDRODB Configuration File, you can adapt and run in python the following code snippet.
131
+ Please note that on Windows these paths must end with `\DISDRODB`, while on macOS/Linux they must end with `/DISDRODB`.
132
+
133
+ ```python
134
+ import disdrodb
135
+
136
+ metadata_archive_dir = "/<path_to>/DISDRODB-METADATA/DISDRODB"
137
+ data_archive_dir = "/<path_of_choice_to_the_local_data_archive>/DISDRODB"
138
+ disdrodb.define_configs(
139
+ metadata_archive_dir=metadata_archive_dir, data_archive_dir=data_archive_dir
140
+ )
141
+ ```
142
+
143
+ By running this command, the disdrodb software will write a `.config_disdrodb.yml` file into your home directory (i.e. `~/.config_disdrodb.yml`)
144
+ that will be used as default configuration file when running the disdrodb software.
145
+
146
+ If you **now close your python session and reopen a new one**, if you will run the following code snippet, you
147
+ should get the `metadata_archive_dir` and `data_archive_dir` paths you just defined in the DISDRODB Configuration File:
148
+
149
+ ```python
150
+ import disdrodb
151
+
152
+ print("DISDRODB Metadata Archive Directory: ", disdrodb.get_metadata_archive_dir())
153
+ print("DISDRODB Data Archive Directory: ", disdrodb.get_data_archive_dir())
154
+ ```
155
+
156
+ You can also verify and print the default DISDRODB Metadata Archive and Data Archive directories
157
+ by typing the following command in the terminal:
158
+
159
+ ```bash
160
+
161
+ disdrodb_data_archive_directory
162
+ disdrodb_metadata_archive_directory
163
+
164
+ ```
165
+
166
+ ### 📥 Download the DISDRODB Raw Data Archive
167
+
168
+ To download all data stored into the DISDRODB Decentralized Data Archive, you just have to run the following command:
169
+
170
+ ```bash
171
+ disdrodb_download_archive
172
+ ```
173
+
174
+ If you aim to download data from a specific source (e.g., EPFL), run:
175
+
176
+ ```bash
177
+ disdrodb_download_archive --data-sources EPFL
178
+ ```
179
+
180
+ Type `disdrodb_download_archive --help` to see further options.
181
+
182
+ To open the local DISDRODB Data Archive directory, type:
183
+
184
+ ```bash
185
+ disdrodb_open_data_archive
186
+ ```
187
+
188
+ ### 💫 Transform the raw data to standardized netCDF files
189
+
190
+ If you want to convert all stations raw data into standardized netCDF4 files, run the following command in the terminal:
191
+
192
+ ```bash
193
+ disdrodb_run_l0
194
+ ```
195
+
196
+ Type `disdrodb_run_l0 --help` to see further options.
197
+
198
+ ### 💫 Generate the DISDRODB L1 and L2 products
199
+
200
+ To generate the DISDRODB L1 and L2 products, run the following commands in the terminal:
201
+
202
+ ```bash
203
+ disdrodb_run_l1
204
+ ```
205
+ ```bash
206
+ disdrodb_run_l2e
207
+ ```
208
+ ```bash
209
+ disdrodb_run_l2m
210
+ ```
211
+
212
+ ### 💫 Open analysis-ready DISDRODB products
213
+
214
+ The disdrodb software `open_dataset` function enable to lazy open all station files of
215
+ a DISDRODB product into a `xarray.Dataset` (or `pandas.DataFrame` for the DISDRODB L0A product).
216
+
217
+ ```python
218
+ import disdrodb
219
+
220
+ # Define station arguments
221
+ data_source = "EPFL"
222
+ campaign_name = "HYMEX_LTE_SOP3"
223
+ station_name = "10"
224
+
225
+ # Open all station files of a specific product
226
+ ds = disdrodb.open_dataset(
227
+ product="L0C",
228
+ # Station arguments
229
+ data_source=data_source,
230
+ campaign_name=campaign_name,
231
+ station_name=station_name,
232
+ )
233
+ ds
234
+ ```
235
+
236
+ This allows you to jump directly into analyzing disdrometer data without worrying about processing steps.
237
+
238
+ ### 💫 Explore the DISDRODB Metadata Archive
239
+
240
+ To explore the DISDRODB Metadata Archive, you can type into the terminal:
241
+
242
+ ```bash
243
+ disdrodb_open_metadata_archive
244
+ ```
245
+
246
+ If you wish to analyze the DISDRODB Metadata Archive information of all stations,
247
+ the `read_metadata_archive` python function returns all stations metadata information into an easy to analyze `pandas.DataFrame`:
248
+
249
+ ```python
250
+ import disdrodb
251
+
252
+ df = disdrodb.read_metadata_archive()
253
+ print(df)
254
+ ```
255
+
256
+ ## 📖 Explore the DISDRODB documentation
257
+
258
+ With this introduction, we just scratched the surface of the disdrodb software capabilities.
259
+ To discover more about the DISDRODB products, the download and processing options, or how to contribute your own data to DISDRODB,
260
+ please read the software documentation available at [https://disdrodb.readthedocs.io/en/latest/](https://disdrodb.readthedocs.io/en/latest/).
261
+
262
+ ## 🛠️ Installation
263
+
264
+ ### conda
265
+
266
+ DISDRODB can be installed via [conda][conda_link] on Linux, Mac, and Windows.
267
+ Install the package by typing the following command in the terminal:
268
+
269
+ ```bash
270
+ conda install disdrodb
271
+ ```
272
+
273
+ In case conda-forge is not set up for your system yet, see the easy to follow instructions on [conda-forge][conda_forge_link].
274
+
275
+ ### pip
276
+
277
+ DISDRODB can be installed also via [pip][pip_link] on Linux, Mac, and Windows.
278
+ On Windows you can install [WinPython][winpy_link] to get Python and pip running.
279
+
280
+ Then, install the DISDRODB package by typing the following command in the terminal:
281
+
282
+ ```bash
283
+ pip install disdrodb
284
+ ```
285
+
286
+ To install the latest development version via pip, see the [documentation][dev_install_link].
287
+
288
+ ## 💭 Feedback and Contributing Guidelines
289
+
290
+ If you aim to contribute your data or discuss the future development of DISDRODB,
291
+ we highly recommend to join the [**DISDRODB Slack Workspace**](https://join.slack.com/t/disdrodbworkspace/shared_invite/zt-25l4mvgo7-cfBdXalzlWGd4Pt7H~FqoA)
292
+
293
+ Feel free to also open a [GitHub Issue](https://github.com/ltelab/disdrodb/issues) or a
294
+ [GitHub Discussion](https://github.com/ltelab/disdrodb/discussions) specific to your questions or ideas.
295
+
296
+ ## ✍️ Contributors
297
+
298
+ - [Gionata Ghiggi](https://people.epfl.ch/gionata.ghiggi)
299
+ - [Kim Candolfi](https://github.com/KimCandolfi)
300
+ - [Régis Longchamp](https://people.epfl.ch/regis.longchamp)
301
+ - [Charlotte Gisèle Weil](https://people.epfl.ch/charlotte.weil)
302
+ - [Jacopo Grazioli](https://people.epfl.ch/jacopo.grazioli)
303
+ - [Alexis Berne](https://people.epfl.ch/alexis.berne?lang=en)
304
+
305
+ ## Citation
306
+
307
+ You can cite the DISDRODB software by:
308
+
309
+ > Gionata Ghiggi, Kim Candolfi, Régis Longchamp, Charlotte Weil, Alexis Berne (2023). ltelab/disdrodb Zenodo. https://doi.org/10.5281/zenodo.7680581
310
+
311
+ If you want to cite a specific version, have a look at the [Zenodo site](https://doi.org/10.5281/zenodo.7680581)
312
+
313
+ ## License
314
+
315
+ The content of this repository is released under the terms of the [GPL 3.0 license](LICENSE).
316
+
317
+ [conda_forge_link]: https://github.com/conda-forge/disdrodb-feedstock#installing-disdrodb
318
+ [conda_link]: https://docs.conda.io/en/latest/miniconda.html
319
+ [dev_install_link]: https://disdrodb.readthedocs.io/en/latest/installation.html#installation-for-contributors
320
+ [pip_link]: https://pypi.org/project/disdrodb
321
+ [winpy_link]: https://winpython.github.io/