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,620 @@
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
+ """Attributes and encoding options for DISDRODB products."""
18
+
19
+
20
+ def get_attrs_dict():
21
+ """Temporary attributes."""
22
+ attrs_dict = {
23
+ #### L1
24
+ "drop_number": {
25
+ "description": "Counts of drops per diameter and velocity class",
26
+ "long_name": "Drop counts per diameter and velocity class",
27
+ "units": "",
28
+ },
29
+ "drop_counts": {
30
+ "description": "Counts of drops per diameter class",
31
+ "long_name": "Drop counts per diameter class",
32
+ "units": "",
33
+ },
34
+ "Dmin": {
35
+ "description": "Minimum drop diameter",
36
+ "long_name": "Minimum drop diameter",
37
+ "units": "mm",
38
+ },
39
+ "Dmax": {
40
+ "description": "Maximum drop diameter",
41
+ "long_name": "Maximum drop diameter",
42
+ "units": "mm",
43
+ },
44
+ "fall_velocity": {
45
+ "description": "Estimated drop fall velocity per diameter class",
46
+ "long_name": "Estimated drop fall velocity",
47
+ "units": "m s-1",
48
+ },
49
+ "drop_average_velocity": {
50
+ "description": "Average measured drop fall velocity per diameter class",
51
+ "long_name": "Measured average drop fall velocity",
52
+ "units": "m s-1",
53
+ },
54
+ "n_drops_selected": {
55
+ "description": "Total number of selected drops",
56
+ "long_name": "Total number of selected drops",
57
+ "units": "",
58
+ },
59
+ "n_drops_discarded": {
60
+ "description": "Total number of discarded drops",
61
+ "long_name": "Total number of discarded drops",
62
+ "units": "",
63
+ },
64
+ "n_bins_with_drops": {
65
+ "description": "Number of diameter bins with drops",
66
+ "long_name": "Number of diameter bins with drops",
67
+ "units": "",
68
+ },
69
+ #### L2
70
+ "drop_number_concentration": {
71
+ "description": "Number concentration of drops per diameter class per unit volume",
72
+ "long_name": "Drop number concentration per diameter class",
73
+ "units": "m-3 mm-1",
74
+ },
75
+ "drop_volume": {
76
+ "standard_name": "",
77
+ "units": "mm3",
78
+ "long_name": "Volume of Drops per Diameter Class",
79
+ },
80
+ "drop_total_volume": {
81
+ "standard_name": "",
82
+ "units": "mm3",
83
+ "long_name": "Total Volume of Drops",
84
+ },
85
+ "drop_relative_volume_ratio": {
86
+ "standard_name": "",
87
+ "units": "",
88
+ "long_name": "Relative Volume Ratio of Drops",
89
+ },
90
+ "KEmin": {
91
+ "standard_name": "",
92
+ "units": "J",
93
+ "long_name": "Minimum Drop Kinetic Energy",
94
+ },
95
+ "KEmax": {
96
+ "standard_name": "",
97
+ "units": "J",
98
+ "long_name": "Maximum Drop Kinetic Energy",
99
+ },
100
+ "E": {
101
+ "description": "Kinetic energy per unit rainfall depth",
102
+ "standard_name": "",
103
+ "units": "J m-2 mm-1",
104
+ "long_name": "Rainfall Kinetic Energy",
105
+ },
106
+ "KE": {
107
+ "standard_name": "",
108
+ "units": "J m-2 h-1",
109
+ "long_name": "Kinetic Energy Density Flux",
110
+ },
111
+ "M1": {
112
+ "standard_name": "",
113
+ "units": "m-3 mm",
114
+ "long_name": "First Moment of the Drop Size Distribution",
115
+ },
116
+ "M2": {
117
+ "standard_name": "",
118
+ "units": "m-3 mm2",
119
+ "long_name": "Second Moment of the Drop Size Distribution",
120
+ },
121
+ "M3": {
122
+ "standard_name": "",
123
+ "units": "m-3 mm3",
124
+ "long_name": "Third Moment of the Drop Size Distribution",
125
+ },
126
+ "M4": {
127
+ "standard_name": "",
128
+ "units": "m-3 mm4",
129
+ "long_name": "Fourth Moment of the Drop Size Distribution",
130
+ },
131
+ "M5": {
132
+ "standard_name": "",
133
+ "units": "m-3 mm5",
134
+ "long_name": "Fifth Moment of the Drop Size Distribution",
135
+ },
136
+ "M6": {
137
+ "standard_name": "",
138
+ "units": "m-3 mm6",
139
+ "long_name": "Sixth Moment of the Drop Size Distribution",
140
+ },
141
+ "Nt": {
142
+ "standard_name": "number_concentration_of_rain_drops_in_air",
143
+ "units": "m-3",
144
+ "long_name": "Total Number Concentration",
145
+ },
146
+ "R": {
147
+ "standard_name": "rainfall_rate",
148
+ "units": "mm h-1",
149
+ "long_name": "Instantaneous Rainfall Rate",
150
+ },
151
+ "P": {
152
+ "standard_name": "precipitation_amount",
153
+ "units": "mm",
154
+ "long_name": "Rain Accumulation",
155
+ },
156
+ "Z": {
157
+ "standard_name": "equivalent_reflectivity_factor",
158
+ "units": "dBZ",
159
+ "long_name": "Equivalent Radar Reflectivity Factor",
160
+ },
161
+ "W": {
162
+ "description": "Water Mass of the Drop Size Distribution",
163
+ "standard_name": "mass_concentration_of_liquid_water_in_air",
164
+ "units": "g m-3",
165
+ "long_name": "Liquid Water Content",
166
+ },
167
+ "D10": {
168
+ "standard_name": "",
169
+ "units": "mm",
170
+ "long_name": "10th Percentile Drop Diameter",
171
+ },
172
+ "D50": {
173
+ "standard_name": "median_volume_diameter",
174
+ "units": "mm",
175
+ "long_name": "Median Volume Drop Diameter",
176
+ },
177
+ "D90": {
178
+ "standard_name": "",
179
+ "units": "mm",
180
+ "long_name": "90th Percentile Drop Diameter",
181
+ },
182
+ "Dmode": {
183
+ "standard_name": "",
184
+ "units": "mm",
185
+ "long_name": "Mode Diameter of the Drop Size Distribution",
186
+ },
187
+ "Dm": {
188
+ "standard_name": "Dm",
189
+ "units": "mm",
190
+ "long_name": "Mean Volume Diameter",
191
+ },
192
+ "sigma_m": {
193
+ "standard_name": "",
194
+ "units": "mm",
195
+ "long_name": "Standard Deviation of Mass Spectrum",
196
+ },
197
+ "Nw": {
198
+ "standard_name": "normalized_intercept_parameter",
199
+ "units": "mm-1 m-3", # TODO
200
+ "long_name": "Normalized Intercept Parameter of a Normalized Gamma Distribution",
201
+ },
202
+ "N0": {
203
+ "standard_name": "intercept_parameter",
204
+ "units": "mm-1 m-3", # TODO
205
+ "long_name": "Intercept Parameter of the Modeled Drop Size Distribution",
206
+ },
207
+ "mu": {
208
+ "standard_name": "shape_parameter",
209
+ "units": "1", # TODO
210
+ "long_name": "Shape Parameter of the Modeled Drop Size Distribution",
211
+ },
212
+ "Lambda": {
213
+ "standard_name": "distribution_slope",
214
+ "units": "1/mm", # TODO
215
+ "long_name": "Slope Parameter of the Modeled Drop Size Distribution",
216
+ },
217
+ "sigma": {
218
+ "standard_name": "distribution_slope",
219
+ "units": "1/mm", # TODO
220
+ "long_name": "Slope Parameter of the Modeled Lognormal Distribution",
221
+ },
222
+ # Radar variables
223
+ "Zh": {
224
+ "description": "Radar reflectivity factor at horizontal polarization",
225
+ "long_name": "Horizontal Reflectivity",
226
+ "units": "dBZ",
227
+ },
228
+ "Zdr": {
229
+ "description": "Differential reflectivity",
230
+ "long_name": "Differential Reflectivity",
231
+ "units": "dB",
232
+ },
233
+ "rho_hv": {
234
+ "description": "Correlation coefficient between horizontally and vertically polarized reflectivity",
235
+ "long_name": "Copolarized Correlation Coefficient",
236
+ "units": "",
237
+ },
238
+ "ldr": {
239
+ "description": "Linear depolarization ratio",
240
+ "long_name": "Linear Depolarization Ratio",
241
+ "units": "dB",
242
+ },
243
+ "Kdp": {
244
+ "description": "Specific differential phase",
245
+ "long_name": "Specific Differential Phase",
246
+ "units": "deg/km",
247
+ },
248
+ "Ai": {
249
+ "description": "Specific attenuation",
250
+ "long_name": "Specific attenuation",
251
+ "units": "dB/km",
252
+ },
253
+ }
254
+ return attrs_dict
255
+
256
+
257
+ def get_encoding_dict():
258
+ """Temporary encoding dictionary."""
259
+ encoding_dict = {
260
+ "M1": {
261
+ "dtype": "float32",
262
+ "zlib": True,
263
+ "complevel": 3,
264
+ "shuffle": True,
265
+ "fletcher32": False,
266
+ "contiguous": False,
267
+ },
268
+ "M2": {
269
+ "dtype": "float32",
270
+ "zlib": True,
271
+ "complevel": 3,
272
+ "shuffle": True,
273
+ "fletcher32": False,
274
+ "contiguous": False,
275
+ },
276
+ "M3": {
277
+ "dtype": "float32",
278
+ "zlib": True,
279
+ "complevel": 3,
280
+ "shuffle": True,
281
+ "fletcher32": False,
282
+ "contiguous": False,
283
+ },
284
+ "M4": {
285
+ "dtype": "float32",
286
+ "zlib": True,
287
+ "complevel": 3,
288
+ "shuffle": True,
289
+ "fletcher32": False,
290
+ "contiguous": False,
291
+ },
292
+ "M5": {
293
+ "dtype": "float32",
294
+ "zlib": True,
295
+ "complevel": 3,
296
+ "shuffle": True,
297
+ "fletcher32": False,
298
+ "contiguous": False,
299
+ },
300
+ "M6": {
301
+ "dtype": "float32",
302
+ "zlib": True,
303
+ "complevel": 3,
304
+ "shuffle": True,
305
+ "fletcher32": False,
306
+ "contiguous": False,
307
+ },
308
+ "Nt": {
309
+ "dtype": "float32",
310
+ "zlib": True,
311
+ "complevel": 3,
312
+ "shuffle": True,
313
+ "fletcher32": False,
314
+ "contiguous": False,
315
+ },
316
+ "R": {
317
+ "dtype": "uint16",
318
+ "scale_factor": 0.01,
319
+ "_FillValue": 65535,
320
+ "zlib": True,
321
+ "complevel": 3,
322
+ "shuffle": True,
323
+ "fletcher32": False,
324
+ "contiguous": False,
325
+ },
326
+ "P": {
327
+ "dtype": "float32",
328
+ "zlib": True,
329
+ "complevel": 3,
330
+ "shuffle": True,
331
+ "fletcher32": False,
332
+ "contiguous": False,
333
+ },
334
+ "Z": {
335
+ "dtype": "uint16",
336
+ "scale_factor": 0.01,
337
+ "add_offset": -60,
338
+ "_FillValue": 65535,
339
+ "zlib": True,
340
+ "complevel": 3,
341
+ "shuffle": True,
342
+ "fletcher32": False,
343
+ "contiguous": False,
344
+ },
345
+ "W": {
346
+ "dtype": "float32",
347
+ "zlib": True,
348
+ "complevel": 3,
349
+ "shuffle": True,
350
+ "fletcher32": False,
351
+ "contiguous": False,
352
+ },
353
+ "Dm": {
354
+ "dtype": "uint16",
355
+ "scale_factor": 0.001,
356
+ "_FillValue": 65535,
357
+ "zlib": True,
358
+ "complevel": 3,
359
+ "shuffle": True,
360
+ "fletcher32": False,
361
+ "contiguous": False,
362
+ },
363
+ "sigma_m": {
364
+ "dtype": "uint16",
365
+ "scale_factor": 0.001,
366
+ "_FillValue": 65535,
367
+ "zlib": True,
368
+ "complevel": 3,
369
+ "shuffle": True,
370
+ "fletcher32": False,
371
+ "contiguous": False,
372
+ },
373
+ "Dmode": {
374
+ "dtype": "uint16",
375
+ "scale_factor": 0.001,
376
+ "_FillValue": 65535,
377
+ "zlib": True,
378
+ "complevel": 3,
379
+ "shuffle": True,
380
+ "fletcher32": False,
381
+ "contiguous": False,
382
+ },
383
+ "Nw": {
384
+ "dtype": "float32",
385
+ "zlib": True,
386
+ "complevel": 3,
387
+ "shuffle": True,
388
+ "fletcher32": False,
389
+ "contiguous": False,
390
+ },
391
+ "D50": {
392
+ "dtype": "uint16",
393
+ "scale_factor": 0.001,
394
+ "_FillValue": 65535,
395
+ "zlib": True,
396
+ "complevel": 3,
397
+ "shuffle": True,
398
+ "fletcher32": False,
399
+ "contiguous": False,
400
+ },
401
+ "D10": {
402
+ "dtype": "uint16",
403
+ "scale_factor": 0.001,
404
+ "_FillValue": 65535,
405
+ "zlib": True,
406
+ "complevel": 3,
407
+ "shuffle": True,
408
+ "fletcher32": False,
409
+ "contiguous": False,
410
+ },
411
+ "D90": {
412
+ "dtype": "uint16",
413
+ "scale_factor": 0.001,
414
+ "_FillValue": 65535,
415
+ "zlib": True,
416
+ "complevel": 3,
417
+ "shuffle": True,
418
+ "fletcher32": False,
419
+ "contiguous": False,
420
+ },
421
+ "drop_number": {
422
+ "dtype": "uint32",
423
+ "zlib": True,
424
+ "complevel": 3,
425
+ "shuffle": True,
426
+ "fletcher32": False,
427
+ "contiguous": False,
428
+ "_FillValue": 4294967295,
429
+ },
430
+ "drop_counts": {
431
+ "dtype": "uint32",
432
+ "zlib": True,
433
+ "complevel": 3,
434
+ "shuffle": True,
435
+ "fletcher32": False,
436
+ "contiguous": False,
437
+ "_FillValue": 4294967295,
438
+ },
439
+ "n_drops_selected": {
440
+ "dtype": "uint32",
441
+ "zlib": True,
442
+ "complevel": 3,
443
+ "shuffle": True,
444
+ "fletcher32": False,
445
+ "contiguous": False,
446
+ "_FillValue": 4294967295,
447
+ },
448
+ "n_drops_discarded": {
449
+ "dtype": "uint32",
450
+ "zlib": True,
451
+ "complevel": 3,
452
+ "shuffle": True,
453
+ "fletcher32": False,
454
+ "contiguous": False,
455
+ "_FillValue": 4294967295,
456
+ },
457
+ "n_bins_with_drops": {
458
+ "dtype": "uint8",
459
+ "_FillValue": 255,
460
+ "zlib": True,
461
+ "complevel": 3,
462
+ "shuffle": True,
463
+ "fletcher32": False,
464
+ "contiguous": False,
465
+ },
466
+ "Dmin": {
467
+ "dtype": "uint16",
468
+ "scale_factor": 0.001,
469
+ "_FillValue": 65535,
470
+ "zlib": True,
471
+ "complevel": 3,
472
+ "shuffle": True,
473
+ "fletcher32": False,
474
+ "contiguous": False,
475
+ },
476
+ "Dmax": {
477
+ "dtype": "uint16",
478
+ "scale_factor": 0.001,
479
+ "_FillValue": 65535,
480
+ "zlib": True,
481
+ "complevel": 3,
482
+ "shuffle": True,
483
+ "fletcher32": False,
484
+ "contiguous": False,
485
+ },
486
+ "drop_average_velocity": {
487
+ "dtype": "uint16",
488
+ "scale_factor": 0.001,
489
+ "_FillValue": 65535,
490
+ "zlib": True,
491
+ "complevel": 3,
492
+ "shuffle": True,
493
+ "fletcher32": False,
494
+ "contiguous": False,
495
+ },
496
+ "fall_velocity": {
497
+ "dtype": "uint16",
498
+ "scale_factor": 0.001,
499
+ "_FillValue": 65535,
500
+ "zlib": True,
501
+ "complevel": 3,
502
+ "shuffle": True,
503
+ "fletcher32": False,
504
+ "contiguous": False,
505
+ },
506
+ "drop_number_concentration": {
507
+ "dtype": "float32",
508
+ "zlib": True,
509
+ "complevel": 3,
510
+ "shuffle": True,
511
+ "fletcher32": False,
512
+ "contiguous": False,
513
+ },
514
+ "drop_volume": {
515
+ "dtype": "float32",
516
+ "zlib": True,
517
+ "complevel": 3,
518
+ "shuffle": True,
519
+ "fletcher32": False,
520
+ "contiguous": False,
521
+ },
522
+ "drop_total_volume": {
523
+ "dtype": "float32",
524
+ "zlib": True,
525
+ "complevel": 3,
526
+ "shuffle": True,
527
+ "fletcher32": False,
528
+ "contiguous": False,
529
+ },
530
+ "drop_relative_volume_ratio": {
531
+ "dtype": "float32",
532
+ "zlib": True,
533
+ "complevel": 3,
534
+ "shuffle": True,
535
+ "fletcher32": False,
536
+ "contiguous": False,
537
+ },
538
+ "KEmin": {
539
+ "dtype": "float32",
540
+ "zlib": True,
541
+ "complevel": 3,
542
+ "shuffle": True,
543
+ "fletcher32": False,
544
+ "contiguous": False,
545
+ },
546
+ "KEmax": {
547
+ "dtype": "float32",
548
+ "zlib": True,
549
+ "complevel": 3,
550
+ "shuffle": True,
551
+ "fletcher32": False,
552
+ "contiguous": False,
553
+ },
554
+ "E": {
555
+ "dtype": "float32",
556
+ "zlib": True,
557
+ "complevel": 3,
558
+ "shuffle": True,
559
+ "fletcher32": False,
560
+ "contiguous": False,
561
+ },
562
+ "KE": {
563
+ "dtype": "float32",
564
+ "zlib": True,
565
+ "complevel": 3,
566
+ "shuffle": True,
567
+ "fletcher32": False,
568
+ "contiguous": False,
569
+ },
570
+ # Radar variables
571
+ "Zh": {
572
+ "dtype": "float32",
573
+ "zlib": True,
574
+ "complevel": 3,
575
+ "shuffle": True,
576
+ "fletcher32": False,
577
+ "contiguous": False,
578
+ },
579
+ "Zdr": {
580
+ "dtype": "float32",
581
+ "zlib": True,
582
+ "complevel": 3,
583
+ "shuffle": True,
584
+ "fletcher32": False,
585
+ "contiguous": False,
586
+ },
587
+ "rho_hv": {
588
+ "dtype": "float32",
589
+ "zlib": True,
590
+ "complevel": 3,
591
+ "shuffle": True,
592
+ "fletcher32": False,
593
+ "contiguous": False,
594
+ },
595
+ "ldr": {
596
+ "dtype": "float32",
597
+ "zlib": True,
598
+ "complevel": 3,
599
+ "shuffle": True,
600
+ "fletcher32": False,
601
+ "contiguous": False,
602
+ },
603
+ "Kdp": {
604
+ "dtype": "float32",
605
+ "zlib": True,
606
+ "complevel": 3,
607
+ "shuffle": True,
608
+ "fletcher32": False,
609
+ "contiguous": False,
610
+ },
611
+ "Ai": {
612
+ "dtype": "float32",
613
+ "zlib": True,
614
+ "complevel": 3,
615
+ "shuffle": True,
616
+ "fletcher32": False,
617
+ "contiguous": False,
618
+ },
619
+ }
620
+ return encoding_dict