disdrodb 0.3.0__py3-none-any.whl → 0.5.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 (198) hide show
  1. disdrodb/__init__.py +2 -0
  2. disdrodb/_config.py +1 -0
  3. disdrodb/_version.py +2 -2
  4. disdrodb/accessor/__init__.py +1 -0
  5. disdrodb/accessor/methods.py +1 -0
  6. disdrodb/api/checks.py +2 -4
  7. disdrodb/api/io.py +224 -24
  8. disdrodb/api/path.py +2 -4
  9. disdrodb/cli/disdrodb_check_metadata_archive.py +1 -0
  10. disdrodb/cli/disdrodb_check_products_options.py +1 -0
  11. disdrodb/cli/disdrodb_create_summary.py +6 -6
  12. disdrodb/cli/disdrodb_create_summary_station.py +2 -2
  13. disdrodb/cli/disdrodb_data_archive_directory.py +1 -0
  14. disdrodb/cli/disdrodb_download_archive.py +5 -6
  15. disdrodb/cli/disdrodb_download_metadata_archive.py +1 -0
  16. disdrodb/cli/disdrodb_download_station.py +2 -3
  17. disdrodb/cli/disdrodb_initialize_station.py +3 -3
  18. disdrodb/cli/disdrodb_metadata_archive_directory.py +1 -0
  19. disdrodb/cli/disdrodb_open_data_archive.py +1 -2
  20. disdrodb/cli/disdrodb_open_logs_directory.py +2 -3
  21. disdrodb/cli/disdrodb_open_metadata_archive.py +1 -2
  22. disdrodb/cli/disdrodb_open_metadata_directory.py +2 -3
  23. disdrodb/cli/disdrodb_open_product_directory.py +1 -2
  24. disdrodb/cli/disdrodb_open_readers_directory.py +1 -0
  25. disdrodb/cli/disdrodb_run.py +6 -6
  26. disdrodb/cli/disdrodb_run_l0.py +6 -6
  27. disdrodb/cli/disdrodb_run_l0_station.py +3 -3
  28. disdrodb/cli/disdrodb_run_l0a.py +6 -6
  29. disdrodb/cli/disdrodb_run_l0a_station.py +3 -3
  30. disdrodb/cli/disdrodb_run_l0b.py +6 -6
  31. disdrodb/cli/disdrodb_run_l0b_station.py +3 -3
  32. disdrodb/cli/disdrodb_run_l0c.py +6 -6
  33. disdrodb/cli/disdrodb_run_l0c_station.py +3 -3
  34. disdrodb/cli/disdrodb_run_l1.py +6 -6
  35. disdrodb/cli/disdrodb_run_l1_station.py +3 -3
  36. disdrodb/cli/disdrodb_run_l2e.py +6 -6
  37. disdrodb/cli/disdrodb_run_l2e_station.py +3 -3
  38. disdrodb/cli/disdrodb_run_l2m.py +6 -6
  39. disdrodb/cli/disdrodb_run_l2m_station.py +3 -3
  40. disdrodb/cli/disdrodb_run_station.py +3 -3
  41. disdrodb/cli/disdrodb_upload_archive.py +6 -7
  42. disdrodb/cli/disdrodb_upload_station.py +3 -4
  43. disdrodb/configs.py +7 -8
  44. disdrodb/constants.py +1 -0
  45. disdrodb/data_transfer/download_data.py +8 -8
  46. disdrodb/data_transfer/upload_data.py +6 -8
  47. disdrodb/data_transfer/zenodo.py +1 -1
  48. disdrodb/fall_velocity/__init__.py +1 -0
  49. disdrodb/fall_velocity/graupel.py +1 -0
  50. disdrodb/fall_velocity/hail.py +1 -0
  51. disdrodb/fall_velocity/rain.py +1 -0
  52. disdrodb/issue/checks.py +1 -0
  53. disdrodb/issue/reader.py +1 -0
  54. disdrodb/issue/writer.py +1 -2
  55. disdrodb/l0/__init__.py +1 -0
  56. disdrodb/l0/check_configs.py +21 -23
  57. disdrodb/l0/check_standards.py +0 -1
  58. disdrodb/l0/configs/LPM/l0a_encodings.yml +17 -17
  59. disdrodb/l0/configs/LPM/l0b_cf_attrs.yml +55 -55
  60. disdrodb/l0/configs/LPM/l0b_encodings.yml +17 -17
  61. disdrodb/l0/configs/LPM/raw_data_format.yml +17 -17
  62. disdrodb/l0/configs/LPM_V0/l0a_encodings.yml +2 -2
  63. disdrodb/l0/configs/LPM_V0/l0b_cf_attrs.yml +2 -2
  64. disdrodb/l0/configs/LPM_V0/l0b_encodings.yml +2 -2
  65. disdrodb/l0/configs/LPM_V0/raw_data_format.yml +2 -2
  66. disdrodb/l0/l0_reader.py +1 -0
  67. disdrodb/l0/l0a_processing.py +5 -5
  68. disdrodb/l0/l0b_nc_processing.py +1 -2
  69. disdrodb/l0/l0b_processing.py +1 -13
  70. disdrodb/l0/l0c_processing.py +2 -1
  71. disdrodb/l0/readers/LPM/ARM/ARM_LPM.py +1 -0
  72. disdrodb/l0/readers/LPM/AUSTRALIA/MELBOURNE_2007_LPM.py +17 -17
  73. disdrodb/l0/readers/LPM/BRAZIL/CHUVA_LPM.py +17 -17
  74. disdrodb/l0/readers/LPM/BRAZIL/GOAMAZON_LPM.py +17 -17
  75. disdrodb/l0/readers/LPM/GERMANY/DWD.py +55 -52
  76. disdrodb/l0/readers/LPM/ITALY/GID_LPM.py +18 -17
  77. disdrodb/l0/readers/LPM/ITALY/GID_LPM_AQ.py +277 -0
  78. disdrodb/l0/readers/LPM/ITALY/GID_LPM_PI.py +18 -17
  79. disdrodb/l0/readers/LPM/ITALY/GID_LPM_T.py +18 -17
  80. disdrodb/l0/readers/LPM/ITALY/GID_LPM_W.py +18 -18
  81. disdrodb/l0/readers/LPM/KIT/CHWALA.py +18 -17
  82. disdrodb/l0/readers/LPM/NETHERLANDS/DELFT_RWANDA_LPM_NC.py +17 -17
  83. disdrodb/l0/readers/LPM/NORWAY/HAUKELISETER_LPM.py +18 -17
  84. disdrodb/l0/readers/LPM/NORWAY/NMBU_LPM.py +18 -17
  85. disdrodb/l0/readers/LPM/SLOVENIA/ARSO.py +18 -17
  86. disdrodb/l0/readers/LPM/SLOVENIA/UL.py +18 -17
  87. disdrodb/l0/readers/LPM/SWITZERLAND/INNERERIZ_LPM.py +18 -17
  88. disdrodb/l0/readers/LPM/UK/WITHWORTH_LPM.py +18 -17
  89. disdrodb/l0/readers/LPM/USA/CHARLESTON.py +18 -17
  90. disdrodb/l0/readers/LPM/USA/DEVEX.py +255 -0
  91. disdrodb/l0/readers/LPM_V0/BELGIUM/ULIEGE.py +2 -2
  92. disdrodb/l0/readers/LPM_V0/ITALY/GID_LPM_V0.py +3 -2
  93. disdrodb/l0/readers/ODM470/OCEAN/OCEANRAIN.py +1 -0
  94. disdrodb/l0/readers/PARSIVEL/BASQUECOUNTRY/EUSKALMET_OTT.py +1 -0
  95. disdrodb/l0/readers/PARSIVEL/CHINA/CHONGQING.py +1 -0
  96. disdrodb/l0/readers/PARSIVEL/EPFL/ARCTIC_2021.py +1 -0
  97. disdrodb/l0/readers/PARSIVEL/EPFL/COMMON_2011.py +1 -0
  98. disdrodb/l0/readers/PARSIVEL/EPFL/DAVOS_2009_2011.py +1 -0
  99. disdrodb/l0/readers/PARSIVEL/EPFL/EPFL_2009.py +1 -0
  100. disdrodb/l0/readers/PARSIVEL/EPFL/EPFL_ROOF_2008.py +1 -0
  101. disdrodb/l0/readers/PARSIVEL/EPFL/EPFL_ROOF_2010.py +1 -0
  102. disdrodb/l0/readers/PARSIVEL/EPFL/EPFL_ROOF_2011.py +1 -0
  103. disdrodb/l0/readers/PARSIVEL/EPFL/EPFL_ROOF_2012.py +1 -0
  104. disdrodb/l0/readers/PARSIVEL/EPFL/GENEPI_2007.py +1 -0
  105. disdrodb/l0/readers/PARSIVEL/EPFL/GRAND_ST_BERNARD_2007.py +1 -0
  106. disdrodb/l0/readers/PARSIVEL/EPFL/GRAND_ST_BERNARD_2007_2.py +1 -0
  107. disdrodb/l0/readers/PARSIVEL/EPFL/HPICONET_2010.py +1 -0
  108. disdrodb/l0/readers/PARSIVEL/EPFL/HYMEX_LTE_SOP2.py +1 -0
  109. disdrodb/l0/readers/PARSIVEL/EPFL/HYMEX_LTE_SOP3.py +1 -0
  110. disdrodb/l0/readers/PARSIVEL/EPFL/HYMEX_LTE_SOP4.py +1 -0
  111. disdrodb/l0/readers/PARSIVEL/EPFL/PARADISO_2014.py +1 -0
  112. disdrodb/l0/readers/PARSIVEL/EPFL/PARSIVEL_2007.py +1 -0
  113. disdrodb/l0/readers/PARSIVEL/EPFL/RACLETS_2019.py +1 -0
  114. disdrodb/l0/readers/PARSIVEL/EPFL/RACLETS_2019_WJF.py +1 -0
  115. disdrodb/l0/readers/PARSIVEL/EPFL/RIETHOLZBACH_2011.py +1 -0
  116. disdrodb/l0/readers/PARSIVEL/EPFL/SAMOYLOV_2017.py +1 -0
  117. disdrodb/l0/readers/PARSIVEL/EPFL/SAMOYLOV_2019.py +1 -0
  118. disdrodb/l0/readers/PARSIVEL/EPFL/UNIL_2022.py +1 -0
  119. disdrodb/l0/readers/PARSIVEL/SLOVENIA/UL.py +1 -0
  120. disdrodb/l0/readers/PARSIVEL2/ARM/ARM_PARSIVEL2.py +1 -0
  121. disdrodb/l0/readers/PARSIVEL2/BASQUECOUNTRY/EUSKALMET_OTT2.py +1 -0
  122. disdrodb/l0/readers/PARSIVEL2/BELGIUM/ILVO.py +1 -0
  123. disdrodb/l0/readers/PARSIVEL2/DENMARK/EROSION_nc.py +1 -0
  124. disdrodb/l0/readers/PARSIVEL2/DENMARK/EROSION_raw.py +1 -0
  125. disdrodb/l0/readers/PARSIVEL2/FRANCE/ENPC_PARSIVEL2.py +1 -0
  126. disdrodb/l0/readers/PARSIVEL2/FRANCE/OSUG.py +1 -1
  127. disdrodb/l0/readers/PARSIVEL2/ITALY/HYDROX.py +1 -0
  128. disdrodb/l0/readers/PARSIVEL2/MEXICO/OH_IIUNAM_nc.py +1 -0
  129. disdrodb/l0/readers/PARSIVEL2/NCAR/FARM_PARSIVEL2.py +1 -0
  130. disdrodb/l0/readers/PARSIVEL2/NCAR/PERILS_MIPS.py +1 -0
  131. disdrodb/l0/readers/PARSIVEL2/NCAR/PERILS_PIPS.py +1 -0
  132. disdrodb/l0/readers/PARSIVEL2/NCAR/VORTEX_SE_2016_P1.py +1 -0
  133. disdrodb/l0/readers/PARSIVEL2/NCAR/VORTEX_SE_2016_PIPS.py +1 -0
  134. disdrodb/l0/readers/PARSIVEL2/PHILIPPINES/PAGASA.py +1 -0
  135. disdrodb/l0/readers/PARSIVEL2/SPAIN/GRANADA.py +1 -0
  136. disdrodb/l0/readers/PARSIVEL2/SWEDEN/SMHI.py +1 -0
  137. disdrodb/l0/readers/PARSIVEL2/USA/CW3E.py +1 -0
  138. disdrodb/l0/readers/PWS100/AUSTRIA/HOAL.py +1 -0
  139. disdrodb/l0/readers/PWS100/FRANCE/ENPC_PWS100.py +1 -0
  140. disdrodb/l0/readers/PWS100/FRANCE/ENPC_PWS100_SIRTA.py +1 -0
  141. disdrodb/l0/readers/RD80/NOAA/PSL_RD80.py +1 -0
  142. disdrodb/l0/readers/SWS250/BELGIUM/KMI.py +1 -0
  143. disdrodb/l0/readers/template_reader_raw_netcdf_data.py +1 -0
  144. disdrodb/l0/readers/template_reader_raw_text_data.py +1 -0
  145. disdrodb/l0/template_tools.py +6 -8
  146. disdrodb/l1/__init__.py +1 -0
  147. disdrodb/l1/classification.py +1 -0
  148. disdrodb/l1/resampling.py +5 -0
  149. disdrodb/l1_env/routines.py +1 -0
  150. disdrodb/l2/__init__.py +1 -0
  151. disdrodb/l2/empirical_dsd.py +1 -0
  152. disdrodb/l2/processing.py +1 -0
  153. disdrodb/metadata/checks.py +9 -10
  154. disdrodb/metadata/download.py +1 -0
  155. disdrodb/metadata/geolocation.py +2 -1
  156. disdrodb/metadata/info.py +2 -2
  157. disdrodb/metadata/search.py +0 -1
  158. disdrodb/physics/atmosphere.py +1 -0
  159. disdrodb/physics/water.py +1 -0
  160. disdrodb/physics/wrappers.py +1 -0
  161. disdrodb/psd/__init__.py +0 -1
  162. disdrodb/psd/fitting.py +1 -0
  163. disdrodb/psd/models.py +1 -0
  164. disdrodb/routines/__init__.py +1 -0
  165. disdrodb/routines/l0.py +13 -9
  166. disdrodb/routines/l1.py +17 -12
  167. disdrodb/routines/l2.py +4 -5
  168. disdrodb/routines/options.py +1 -0
  169. disdrodb/routines/options_validation.py +12 -12
  170. disdrodb/routines/wrappers.py +33 -33
  171. disdrodb/scattering/__init__.py +0 -1
  172. disdrodb/scattering/permittivity.py +1 -0
  173. disdrodb/scattering/routines.py +3 -3
  174. disdrodb/summary/routines.py +12 -5
  175. disdrodb/utils/archiving.py +2 -1
  176. disdrodb/utils/attrs.py +3 -2
  177. disdrodb/utils/compression.py +1 -2
  178. disdrodb/utils/coords.py +45 -0
  179. disdrodb/utils/dask.py +5 -2
  180. disdrodb/utils/dataframe.py +4 -3
  181. disdrodb/utils/decorators.py +2 -1
  182. disdrodb/utils/directories.py +2 -2
  183. disdrodb/utils/encoding.py +2 -1
  184. disdrodb/utils/manipulations.py +1 -0
  185. disdrodb/utils/pydantic.py +1 -0
  186. disdrodb/utils/routines.py +1 -0
  187. disdrodb/utils/time.py +3 -2
  188. disdrodb/utils/warnings.py +1 -0
  189. disdrodb/utils/writer.py +4 -0
  190. disdrodb/utils/xarray.py +1 -0
  191. disdrodb/viz/plots.py +1 -0
  192. {disdrodb-0.3.0.dist-info → disdrodb-0.5.0.dist-info}/METADATA +4 -3
  193. disdrodb-0.5.0.dist-info/RECORD +361 -0
  194. {disdrodb-0.3.0.dist-info → disdrodb-0.5.0.dist-info}/WHEEL +1 -1
  195. disdrodb-0.3.0.dist-info/RECORD +0 -358
  196. {disdrodb-0.3.0.dist-info → disdrodb-0.5.0.dist-info}/entry_points.txt +0 -0
  197. {disdrodb-0.3.0.dist-info → disdrodb-0.5.0.dist-info}/licenses/LICENSE +0 -0
  198. {disdrodb-0.3.0.dist-info → disdrodb-0.5.0.dist-info}/top_level.txt +0 -0
@@ -18,6 +18,7 @@
18
18
  # along with this program. If not, see <http://www.gnu.org/licenses/>.
19
19
  # -----------------------------------------------------------------------------.
20
20
  """Reader for the GRAND ST BERNARD campaign."""
21
+
21
22
  import pandas as pd
22
23
 
23
24
  from disdrodb.l0.l0_reader import is_documented_by, reader_generic_docstring
@@ -16,6 +16,7 @@
16
16
  # along with this program. If not, see <http://www.gnu.org/licenses/>.
17
17
  # -----------------------------------------------------------------------------.
18
18
  """Reader for the HPICONET campaign."""
19
+
19
20
  import pandas as pd
20
21
 
21
22
  from disdrodb.l0.l0_reader import is_documented_by, reader_generic_docstring
@@ -16,6 +16,7 @@
16
16
  # along with this program. If not, see <http://www.gnu.org/licenses/>.
17
17
  # -----------------------------------------------------------------------------.
18
18
  """Reader for the HYMEX SOP2 campaign."""
19
+
19
20
  import pandas as pd
20
21
 
21
22
  from disdrodb.l0.l0_reader import is_documented_by, reader_generic_docstring
@@ -16,6 +16,7 @@
16
16
  # along with this program. If not, see <http://www.gnu.org/licenses/>.
17
17
  # -----------------------------------------------------------------------------.
18
18
  """Reader for HYMEX SOP3 campaign."""
19
+
19
20
  import pandas as pd
20
21
 
21
22
  from disdrodb.l0.l0_reader import is_documented_by, reader_generic_docstring
@@ -16,6 +16,7 @@
16
16
  # along with this program. If not, see <http://www.gnu.org/licenses/>.
17
17
  # -----------------------------------------------------------------------------.
18
18
  """Reader for HYMEX SOP4 campaign."""
19
+
19
20
  import pandas as pd
20
21
 
21
22
  from disdrodb.l0.l0_reader import is_documented_by, reader_generic_docstring
@@ -16,6 +16,7 @@
16
16
  # along with this program. If not, see <http://www.gnu.org/licenses/>.
17
17
  # -----------------------------------------------------------------------------.
18
18
  """Reader for PARADISO 2014 campaign."""
19
+
19
20
  import pandas as pd
20
21
 
21
22
  from disdrodb.l0.l0_reader import is_documented_by, reader_generic_docstring
@@ -16,6 +16,7 @@
16
16
  # along with this program. If not, see <http://www.gnu.org/licenses/>.
17
17
  # -----------------------------------------------------------------------------.
18
18
  """Reader for PARSIVEL 2007 campaign."""
19
+
19
20
  import pandas as pd
20
21
 
21
22
  from disdrodb.l0.l0_reader import is_documented_by, reader_generic_docstring
@@ -16,6 +16,7 @@
16
16
  # along with this program. If not, see <http://www.gnu.org/licenses/>.
17
17
  # -----------------------------------------------------------------------------.
18
18
  """Reader for RACLETS 2019 campaign."""
19
+
19
20
  import pandas as pd
20
21
 
21
22
  from disdrodb.l0.l0_reader import is_documented_by, reader_generic_docstring
@@ -16,6 +16,7 @@
16
16
  # along with this program. If not, see <http://www.gnu.org/licenses/>.
17
17
  # -----------------------------------------------------------------------------.
18
18
  """Reader for RACLETS WJF 2019 station."""
19
+
19
20
  import pandas as pd
20
21
 
21
22
  from disdrodb.l0.l0_reader import is_documented_by, reader_generic_docstring
@@ -16,6 +16,7 @@
16
16
  # along with this program. If not, see <http://www.gnu.org/licenses/>.
17
17
  # -----------------------------------------------------------------------------.
18
18
  """Reader for RIETHOLZBACH 2011 campaign."""
19
+
19
20
  import pandas as pd
20
21
 
21
22
  from disdrodb.l0.l0_reader import is_documented_by, reader_generic_docstring
@@ -16,6 +16,7 @@
16
16
  # along with this program. If not, see <http://www.gnu.org/licenses/>.
17
17
  # -----------------------------------------------------------------------------.
18
18
  """Reader for SAMOYLOV 2017 campaign."""
19
+
19
20
  import numpy as np
20
21
  import pandas as pd
21
22
 
@@ -16,6 +16,7 @@
16
16
  # along with this program. If not, see <http://www.gnu.org/licenses/>.
17
17
  # -----------------------------------------------------------------------------.
18
18
  """Reader for SAMOYLOV 2019 campaign."""
19
+
19
20
  import pandas as pd
20
21
 
21
22
  from disdrodb.l0.l0_reader import is_documented_by, reader_generic_docstring
@@ -16,6 +16,7 @@
16
16
  # along with this program. If not, see <http://www.gnu.org/licenses/>.
17
17
  # -----------------------------------------------------------------------------.
18
18
  """Reader for UNIL 2022 campaign."""
19
+
19
20
  import pandas as pd
20
21
 
21
22
  from disdrodb.l0.l0_reader import is_documented_by, reader_generic_docstring
@@ -16,6 +16,7 @@
16
16
  # along with this program. If not, see <http://www.gnu.org/licenses/>.
17
17
  # -----------------------------------------------------------------------------.
18
18
  """Reader for EPFL 2009 campaign."""
19
+
19
20
  import pandas as pd
20
21
 
21
22
  from disdrodb.l0.l0_reader import is_documented_by, reader_generic_docstring
@@ -16,6 +16,7 @@
16
16
  # along with this program. If not, see <http://www.gnu.org/licenses/>.
17
17
  # -----------------------------------------------------------------------------.
18
18
  """Reader for ARM OTT PARSIVEL2 sensor."""
19
+
19
20
  from disdrodb.l0.l0_reader import is_documented_by, reader_generic_docstring
20
21
  from disdrodb.l0.l0b_nc_processing import open_raw_netcdf_file, replace_custom_nan_flags, standardize_raw_dataset
21
22
 
@@ -15,6 +15,7 @@
15
15
  # along with this program. If not, see <http://www.gnu.org/licenses/>.
16
16
  # -----------------------------------------------------------------------------.
17
17
  """DISDRODB reader for EUSKALMET OTT Parsivel 2 raw data."""
18
+
18
19
  # import os
19
20
  # import tempfile
20
21
  # from disdrodb.utils.compression import unzip_file_on_terminal
@@ -15,6 +15,7 @@
15
15
  # along with this program. If not, see <http://www.gnu.org/licenses/>.
16
16
  # -----------------------------------------------------------------------------.
17
17
  """DISDRODB reader for UGENT ILVO Parsivel2 raw text data."""
18
+
18
19
  import tarfile
19
20
 
20
21
  import numpy as np
@@ -16,6 +16,7 @@
16
16
  # along with this program. If not, see <http://www.gnu.org/licenses/>.
17
17
  # -----------------------------------------------------------------------------.
18
18
  """Reader for the EROSION campaign in Denmark."""
19
+
19
20
  from disdrodb.l0.l0_reader import is_documented_by, reader_generic_docstring
20
21
  from disdrodb.l0.l0b_nc_processing import open_raw_netcdf_file, standardize_raw_dataset
21
22
 
@@ -15,6 +15,7 @@
15
15
  # along with this program. If not, see <http://www.gnu.org/licenses/>.
16
16
  # -----------------------------------------------------------------------------.
17
17
  """Reader for the EROSION campaign in Denmark."""
18
+
18
19
  import numpy as np
19
20
  import pandas as pd
20
21
 
@@ -15,6 +15,7 @@
15
15
  # along with this program. If not, see <http://www.gnu.org/licenses/>.
16
16
  # -----------------------------------------------------------------------------.
17
17
  """DISDRODB reader for ENPC PARSIVEL2 raw text data."""
18
+
18
19
  # import os
19
20
  # import tempfile
20
21
  # from disdrodb.utils.compression import unzip_file_on_terminal
@@ -357,7 +357,7 @@ def select_only_valid_rows(df, expected_n_values, logger, filepath):
357
357
  unique_values, counts = np.unique(n_values_per_row, return_counts=True)
358
358
 
359
359
  # Determine the valid number of values
360
- valid_counts = [(val, count) for val, count in zip(unique_values, counts) if val in expected_n_values]
360
+ valid_counts = [(val, count) for val, count in zip(unique_values, counts, strict=True) if val in expected_n_values]
361
361
  if not valid_counts:
362
362
  raise ValueError(
363
363
  f"{filepath} has no rows with expected number of values: {expected_n_values}."
@@ -16,6 +16,7 @@
16
16
  # along with this program. If not, see <http://www.gnu.org/licenses/>.
17
17
  # -----------------------------------------------------------------------------.
18
18
  """Reader for HYDROX PARSIVEL2 disdrometer located at Trafoi (Italy)."""
19
+
19
20
  import os
20
21
 
21
22
  import pandas as pd
@@ -16,6 +16,7 @@
16
16
  # along with this program. If not, see <http://www.gnu.org/licenses/>.
17
17
  # -----------------------------------------------------------------------------.
18
18
  """Reader for MEXICO OH_IIUNAM OTT PARSIVEL2 Mexico City Network."""
19
+
19
20
  from disdrodb.l0.l0_reader import is_documented_by, reader_generic_docstring
20
21
  from disdrodb.l0.l0b_nc_processing import open_raw_netcdf_file, standardize_raw_dataset
21
22
 
@@ -16,6 +16,7 @@
16
16
  # along with this program. If not, see <http://www.gnu.org/licenses/>.
17
17
  # -----------------------------------------------------------------------------.
18
18
  """Reader for CSWR FARM disdrometer data (used in PERILS and RELAMPAGO campaign)."""
19
+
19
20
  import pandas as pd
20
21
 
21
22
  from disdrodb.l0.l0_reader import is_documented_by, reader_generic_docstring
@@ -16,6 +16,7 @@
16
16
  # along with this program. If not, see <http://www.gnu.org/licenses/>.
17
17
  # -----------------------------------------------------------------------------.
18
18
  """Reader for the PERILS 2022 and 2023 MIPS and RADAPS files."""
19
+
19
20
  import pandas as pd
20
21
 
21
22
  from disdrodb.l0.l0_reader import is_documented_by, reader_generic_docstring
@@ -16,6 +16,7 @@
16
16
  # along with this program. If not, see <http://www.gnu.org/licenses/>.
17
17
  # -----------------------------------------------------------------------------.
18
18
  """Reader for the PERILS 2022 and 2023 PIPS files."""
19
+
19
20
  import pandas as pd
20
21
 
21
22
  from disdrodb.l0.l0_reader import is_documented_by, reader_generic_docstring
@@ -15,6 +15,7 @@
15
15
  # along with this program. If not, see <http://www.gnu.org/licenses/>.
16
16
  # -----------------------------------------------------------------------------.
17
17
  """Reader for the VORTEX SE 2016 PARSIVEL2 NCAR data."""
18
+
18
19
  import pandas as pd
19
20
 
20
21
  from disdrodb.l0.l0_reader import is_documented_by, reader_generic_docstring
@@ -16,6 +16,7 @@
16
16
  # along with this program. If not, see <http://www.gnu.org/licenses/>.
17
17
  # -----------------------------------------------------------------------------.
18
18
  """Reader for the PERILS 2022 and 2023 PIPS files."""
19
+
19
20
  import os
20
21
 
21
22
  import pandas as pd
@@ -15,6 +15,7 @@
15
15
  # along with this program. If not, see <http://www.gnu.org/licenses/>.
16
16
  # -----------------------------------------------------------------------------.
17
17
  """DISDRODB reader for PANGASA PARSIVEL2 raw text data."""
18
+
18
19
  # import os
19
20
  # import tempfile
20
21
  # from disdrodb.utils.compression import unzip_file_on_terminal
@@ -15,6 +15,7 @@
15
15
  # along with this program. If not, see <http://www.gnu.org/licenses/>.
16
16
  # -----------------------------------------------------------------------------.
17
17
  """DISDRODB reader for Granada Parsivel2 raw text data."""
18
+
18
19
  import pandas as pd
19
20
 
20
21
  from disdrodb.l0.l0_reader import is_documented_by, reader_generic_docstring
@@ -16,6 +16,7 @@
16
16
  # along with this program. If not, see <http://www.gnu.org/licenses/>.
17
17
  # -----------------------------------------------------------------------------.
18
18
  """Reader for SHMI OTT Parsivel2."""
19
+
19
20
  import pandas as pd
20
21
 
21
22
  from disdrodb.l0.l0_reader import is_documented_by, reader_generic_docstring
@@ -16,6 +16,7 @@
16
16
  # along with this program. If not, see <http://www.gnu.org/licenses/>.
17
17
  # -----------------------------------------------------------------------------.
18
18
  """Reader for the OTT Parsivel2 sensors of the CW3E network."""
19
+
19
20
  import pandas as pd
20
21
 
21
22
  from disdrodb.l0.l0_reader import is_documented_by, reader_generic_docstring
@@ -15,6 +15,7 @@
15
15
  # along with this program. If not, see <http://www.gnu.org/licenses/>.
16
16
  # -----------------------------------------------------------------------------.
17
17
  """DISDRODB reader for TU Wien PWS100 raw text data."""
18
+
18
19
  import os
19
20
 
20
21
  import pandas as pd
@@ -15,6 +15,7 @@
15
15
  # along with this program. If not, see <http://www.gnu.org/licenses/>.
16
16
  # -----------------------------------------------------------------------------.
17
17
  """DISDRODB reader for ENPC PWS100 raw text data."""
18
+
18
19
  import pandas as pd
19
20
 
20
21
  from disdrodb.l0.l0_reader import is_documented_by, reader_generic_docstring
@@ -15,6 +15,7 @@
15
15
  # along with this program. If not, see <http://www.gnu.org/licenses/>.
16
16
  # -----------------------------------------------------------------------------.
17
17
  """DISDRODB reader for ENPC PWS100 raw text data."""
18
+
18
19
  import zipfile
19
20
 
20
21
  import pandas as pd
@@ -15,6 +15,7 @@
15
15
  # along with this program. If not, see <http://www.gnu.org/licenses/>.
16
16
  # -----------------------------------------------------------------------------.
17
17
  """DISDRODB Reader for NOAA PSL RD80 stations."""
18
+
18
19
  import os
19
20
  import re
20
21
 
@@ -15,6 +15,7 @@
15
15
  # along with this program. If not, see <http://www.gnu.org/licenses/>.
16
16
  # -----------------------------------------------------------------------------.
17
17
  """DISDRODB reader for KMI Biral SWS250 sensors."""
18
+
18
19
  import pandas as pd
19
20
 
20
21
  from disdrodb.l0.l0_reader import is_documented_by, reader_generic_docstring
@@ -15,6 +15,7 @@
15
15
  # along with this program. If not, see <http://www.gnu.org/licenses/>.
16
16
  # -----------------------------------------------------------------------------.
17
17
  """DISDRODB reader template for raw text data."""
18
+
18
19
  from disdrodb.l0.l0_reader import is_documented_by, reader_generic_docstring
19
20
  from disdrodb.l0.l0b_nc_processing import open_raw_netcdf_file, replace_custom_nan_flags, standardize_raw_dataset
20
21
 
@@ -15,6 +15,7 @@
15
15
  # along with this program. If not, see <http://www.gnu.org/licenses/>.
16
16
  # -----------------------------------------------------------------------------.
17
17
  """DISDRODB reader template for raw text data."""
18
+
18
19
  from disdrodb.l0.l0_reader import is_documented_by, reader_generic_docstring
19
20
  from disdrodb.l0.l0a_processing import read_raw_text_file
20
21
 
@@ -16,8 +16,6 @@
16
16
  # -----------------------------------------------------------------------------.
17
17
  """Useful tools helping in the implementation of the DISDRODB L0 readers."""
18
18
 
19
- from typing import Optional, Union
20
-
21
19
  import numpy as np
22
20
  import pandas as pd
23
21
 
@@ -163,7 +161,7 @@ def _print_df_summary(df, indices, columns, print_column_names):
163
161
  df_summary = df.describe()
164
162
  df_summary = df_summary.loc[summary_stats]
165
163
  # Print summary stats
166
- for i, column in zip(indices, columns):
164
+ for i, column in zip(indices, columns, strict=True):
167
165
  tmp_df = df_summary[[column]]
168
166
  tmp_df.columns = [""]
169
167
  _print_column_index(i, column_name=column, print_column_names=print_column_names)
@@ -172,7 +170,7 @@ def _print_df_summary(df, indices, columns, print_column_names):
172
170
 
173
171
  def print_df_summary_stats(
174
172
  df: pd.DataFrame,
175
- column_indices: Optional[Union[int, slice, list]] = None,
173
+ column_indices: int | slice | list | None = None,
176
174
  print_column_names: bool = True,
177
175
  ):
178
176
  """Create a columns statistics summary.
@@ -224,7 +222,7 @@ def get_unique_sorted_values(array):
224
222
 
225
223
  def print_df_columns_unique_values(
226
224
  df: pd.DataFrame,
227
- column_indices: Optional[Union[int, slice, list]] = None,
225
+ column_indices: int | slice | list | None = None,
228
226
  print_column_names: bool = True,
229
227
  ) -> None:
230
228
  """Print columns' unique values.
@@ -241,7 +239,7 @@ def print_df_columns_unique_values(
241
239
  """
242
240
  column_indices, columns = _get_selected_column_names(df, column_indices)
243
241
  # Printing
244
- for i, column in zip(column_indices, columns):
242
+ for i, column in zip(column_indices, columns, strict=True):
245
243
  _print_column_index(i, column_name=column, print_column_names=print_column_names)
246
244
  _print_value(get_unique_sorted_values(df[column]))
247
245
 
@@ -252,7 +250,7 @@ def print_df_columns_unique_values(
252
250
 
253
251
  def get_df_columns_unique_values_dict(
254
252
  df: pd.DataFrame,
255
- column_indices: Optional[Union[int, slice, list]] = None,
253
+ column_indices: int | slice | list | None = None,
256
254
  column_names: bool = True,
257
255
  ):
258
256
  """Create a dictionary {column: unique values}.
@@ -270,7 +268,7 @@ def get_df_columns_unique_values_dict(
270
268
  column_indices, columns = _get_selected_column_names(df, column_indices)
271
269
  # Create dictionary
272
270
  d = {}
273
- for i, column in zip(column_indices, columns):
271
+ for i, column in zip(column_indices, columns, strict=True):
274
272
  key = column if column_names else "Column " + str(i)
275
273
  d[key] = get_unique_sorted_values(df[column])
276
274
  # Return
disdrodb/l1/__init__.py CHANGED
@@ -15,6 +15,7 @@
15
15
  # along with this program. If not, see <http://www.gnu.org/licenses/>.
16
16
  # -----------------------------------------------------------------------------.
17
17
  """DISDRODB L1 module."""
18
+
18
19
  from disdrodb.l1.processing import generate_l1
19
20
 
20
21
  __all__ = [
@@ -1,5 +1,6 @@
1
1
  # -----------------------------------------------------------------------------.
2
2
  """DISDRODB hydrometeor classification and QC module."""
3
+
3
4
  import numpy as np
4
5
  import pandas as pd
5
6
  import xarray as xr
disdrodb/l1/resampling.py CHANGED
@@ -15,6 +15,7 @@
15
15
  # along with this program. If not, see <http://www.gnu.org/licenses/>.
16
16
  # -----------------------------------------------------------------------------.
17
17
  """Utilities for temporal resampling."""
18
+
18
19
  import numpy as np
19
20
  import pandas as pd
20
21
  import xarray as xr
@@ -310,6 +311,10 @@ def resample_dataset(ds, sample_interval, temporal_resolution):
310
311
  # Add attributes
311
312
  ds_resampled.attrs = attrs
312
313
 
314
+ # Add back crs coordinate
315
+ if "crs" in ds:
316
+ ds_resampled = ds_resampled.assign_coords({"crs": ds["crs"]})
317
+
313
318
  # Add accumulation_interval as new sample_interval coordinate
314
319
  ds_resampled = add_sample_interval(ds_resampled, sample_interval=accumulation_interval)
315
320
  return ds_resampled
@@ -15,6 +15,7 @@
15
15
  # along with this program. If not, see <http://www.gnu.org/licenses/>.
16
16
  # -----------------------------------------------------------------------------.
17
17
  """Core functions for DISDRODB ENV production."""
18
+
18
19
  import numpy as np
19
20
  import xarray as xr
20
21
 
disdrodb/l2/__init__.py CHANGED
@@ -15,6 +15,7 @@
15
15
  # along with this program. If not, see <http://www.gnu.org/licenses/>.
16
16
  # -----------------------------------------------------------------------------.
17
17
  """Module for DISDRODB L2 production."""
18
+
18
19
  from disdrodb.l2.processing import generate_l2_radar, generate_l2e, generate_l2m
19
20
 
20
21
  __all__ = [
@@ -20,6 +20,7 @@ The functions of this module expects xarray.DataArray objects as input.
20
20
  Zeros and NaN values input arrays are correctly processed.
21
21
  Infinite values should be removed beforehand or otherwise are propagated throughout the computations.
22
22
  """
23
+
23
24
  import numpy as np
24
25
  import xarray as xr
25
26
 
disdrodb/l2/processing.py CHANGED
@@ -15,6 +15,7 @@
15
15
  # along with this program. If not, see <http://www.gnu.org/licenses/>.
16
16
  # -----------------------------------------------------------------------------.
17
17
  """Implement DISDRODB L2 processing."""
18
+
18
19
  import numpy as np
19
20
  import xarray as xr
20
21
 
@@ -17,7 +17,6 @@
17
17
  """Check metadata."""
18
18
 
19
19
  import os
20
- from typing import Optional, Union
21
20
 
22
21
  import numpy as np
23
22
 
@@ -190,7 +189,7 @@ def check_station_metadata_geolocation(metadata, raise_error_if_unknown=True) ->
190
189
  _check_lonlat_validity(longitude=longitude, latitude=latitude, raise_error_if_unknown=raise_error_if_unknown)
191
190
 
192
191
 
193
- def check_metadata_archive_geolocation(metadata_archive_dir: Optional[str] = None, raise_error_if_unknown=True):
192
+ def check_metadata_archive_geolocation(metadata_archive_dir: str | None = None, raise_error_if_unknown=True):
194
193
  """Check the metadata files have missing or wrong geolocation..
195
194
 
196
195
  Parameters
@@ -259,7 +258,7 @@ def check_station_metadata(data_source, campaign_name, station_name, metadata_ar
259
258
  check_metadata_reader(metadata)
260
259
 
261
260
 
262
- def check_metadata_archive(metadata_archive_dir: Optional[str] = None, raise_error=False):
261
+ def check_metadata_archive(metadata_archive_dir: str | None = None, raise_error=False):
263
262
  """Check the archive metadata compliance.
264
263
 
265
264
  Parameters
@@ -334,7 +333,7 @@ def identify_missing_metadata_coords(metadata_filepaths: str) -> None:
334
333
  check_station_metadata_geolocation(metadata)
335
334
 
336
335
 
337
- def identify_empty_metadata_keys(metadata_filepaths: list, keys: Union[str, list]) -> None:
336
+ def identify_empty_metadata_keys(metadata_filepaths: list, keys: str | list) -> None:
338
337
  """Identify empty metadata keys.
339
338
 
340
339
  Parameters
@@ -358,7 +357,7 @@ def identify_empty_metadata_keys(metadata_filepaths: list, keys: Union[str, list
358
357
  #### Metadata Archive Utilities
359
358
 
360
359
 
361
- def check_metadata_archive_keys(metadata_archive_dir: Optional[str] = None) -> bool:
360
+ def check_metadata_archive_keys(metadata_archive_dir: str | None = None) -> bool:
362
361
  """Check that all metadata files have valid keys.
363
362
 
364
363
  Parameters
@@ -405,7 +404,7 @@ def check_metadata_archive_keys(metadata_archive_dir: Optional[str] = None) -> b
405
404
  return is_valid
406
405
 
407
406
 
408
- def check_metadata_archive_campaign_name(metadata_archive_dir: Optional[str] = None) -> bool:
407
+ def check_metadata_archive_campaign_name(metadata_archive_dir: str | None = None) -> bool:
409
408
  """Check metadata ``campaign_name``.
410
409
 
411
410
  Parameters
@@ -451,7 +450,7 @@ def check_metadata_archive_campaign_name(metadata_archive_dir: Optional[str] = N
451
450
  return is_valid
452
451
 
453
452
 
454
- def check_metadata_archive_data_source(metadata_archive_dir: Optional[str] = None) -> bool:
453
+ def check_metadata_archive_data_source(metadata_archive_dir: str | None = None) -> bool:
455
454
  """Check metadata ``data_source``.
456
455
 
457
456
  Parameters
@@ -497,7 +496,7 @@ def check_metadata_archive_data_source(metadata_archive_dir: Optional[str] = Non
497
496
  return is_valid
498
497
 
499
498
 
500
- def check_metadata_archive_sensor_name(metadata_archive_dir: Optional[str] = None) -> bool:
499
+ def check_metadata_archive_sensor_name(metadata_archive_dir: str | None = None) -> bool:
501
500
  """Check metadata ``sensor_name``.
502
501
 
503
502
  Parameters
@@ -543,7 +542,7 @@ def check_metadata_archive_sensor_name(metadata_archive_dir: Optional[str] = Non
543
542
  return is_valid
544
543
 
545
544
 
546
- def check_metadata_archive_station_name(metadata_archive_dir: Optional[str] = None) -> bool:
545
+ def check_metadata_archive_station_name(metadata_archive_dir: str | None = None) -> bool:
547
546
  """Check metadata ``station_name``.
548
547
 
549
548
  Parameters
@@ -589,7 +588,7 @@ def check_metadata_archive_station_name(metadata_archive_dir: Optional[str] = No
589
588
  return is_valid
590
589
 
591
590
 
592
- def check_metadata_archive_reader(metadata_archive_dir: Optional[str] = None) -> bool:
591
+ def check_metadata_archive_reader(metadata_archive_dir: str | None = None) -> bool:
593
592
  """Check if the ``reader`` key is available and there is the associated reader.
594
593
 
595
594
  Parameters
@@ -15,6 +15,7 @@
15
15
  # along with this program. If not, see <http://www.gnu.org/licenses/>.
16
16
  # -----------------------------------------------------------------------------.
17
17
  """Routine to download the DISDRODB Metadata Archive from GitHub."""
18
+
18
19
  import io
19
20
  import os
20
21
  import shutil
@@ -15,6 +15,7 @@
15
15
  # along with this program. If not, see <http://www.gnu.org/licenses/>.
16
16
  # -----------------------------------------------------------------------------.
17
17
  """Metadata tools to verify/complete geolocation information."""
18
+
18
19
  import time
19
20
 
20
21
  import numpy as np
@@ -124,7 +125,7 @@ def infer_altitudes(lats, lons, dem="aster30m"):
124
125
  block_lons = lons[i : i + max_locations]
125
126
 
126
127
  # Create the list_coords string in the format "lat1,lon1|lat2,lon2|..."
127
- list_coords = "|".join([f"{lat},{lon}" for lat, lon in zip(block_lats, block_lons)])
128
+ list_coords = "|".join([f"{lat},{lon}" for lat, lon in zip(block_lats, block_lons, strict=True)])
128
129
 
129
130
  # Define API URL
130
131
  url = f"https://api.opentopodata.org/v1/{dem}?locations={list_coords}&interpolation=nearest"
disdrodb/metadata/info.py CHANGED
@@ -15,8 +15,8 @@
15
15
  # along with this program. If not, see <http://www.gnu.org/licenses/>.
16
16
  # -----------------------------------------------------------------------------.
17
17
  """Test Metadata Info Extraction."""
18
+
18
19
  import os
19
- from typing import Optional
20
20
 
21
21
  from disdrodb.api.info import (
22
22
  infer_campaign_name_from_path,
@@ -27,7 +27,7 @@ from disdrodb.metadata.reader import read_station_metadata
27
27
  from disdrodb.metadata.search import get_list_metadata
28
28
 
29
29
 
30
- def get_archive_metadata_key_value(key: str, return_tuple: bool = True, metadata_archive_dir: Optional[str] = None):
30
+ def get_archive_metadata_key_value(key: str, return_tuple: bool = True, metadata_archive_dir: str | None = None):
31
31
  """Return the values of a metadata key for all the archive.
32
32
 
33
33
  Parameters
@@ -16,7 +16,6 @@
16
16
  # -----------------------------------------------------------------------------.
17
17
  """Routines to manipulate the DISDRODB Metadata Archive."""
18
18
 
19
-
20
19
  from disdrodb.api.path import define_metadata_filepath
21
20
  from disdrodb.api.search import available_stations
22
21