disdrodb 0.0.21__py3-none-any.whl → 0.1.1__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.
- disdrodb/__init__.py +132 -15
- disdrodb/_config.py +4 -2
- disdrodb/_version.py +9 -4
- disdrodb/api/checks.py +264 -237
- disdrodb/api/configs.py +4 -8
- disdrodb/api/create_directories.py +235 -290
- disdrodb/api/info.py +217 -26
- disdrodb/api/io.py +306 -270
- disdrodb/api/path.py +597 -173
- disdrodb/api/search.py +486 -0
- disdrodb/{metadata/scripts → cli}/disdrodb_check_metadata_archive.py +12 -7
- disdrodb/{utils/pandas.py → cli/disdrodb_data_archive_directory.py} +9 -18
- disdrodb/cli/disdrodb_download_archive.py +86 -0
- disdrodb/cli/disdrodb_download_metadata_archive.py +53 -0
- disdrodb/cli/disdrodb_download_station.py +84 -0
- disdrodb/{api/scripts → cli}/disdrodb_initialize_station.py +22 -10
- disdrodb/cli/disdrodb_metadata_archive_directory.py +32 -0
- disdrodb/{data_transfer/scripts/disdrodb_download_station.py → cli/disdrodb_open_data_archive.py} +22 -22
- disdrodb/cli/disdrodb_open_logs_directory.py +69 -0
- disdrodb/{data_transfer/scripts/disdrodb_upload_station.py → cli/disdrodb_open_metadata_archive.py} +22 -24
- disdrodb/cli/disdrodb_open_metadata_directory.py +71 -0
- disdrodb/cli/disdrodb_open_product_directory.py +74 -0
- disdrodb/cli/disdrodb_open_readers_directory.py +32 -0
- disdrodb/{l0/scripts → cli}/disdrodb_run_l0.py +38 -31
- disdrodb/{l0/scripts → cli}/disdrodb_run_l0_station.py +32 -30
- disdrodb/{l0/scripts → cli}/disdrodb_run_l0a.py +30 -21
- disdrodb/{l0/scripts → cli}/disdrodb_run_l0a_station.py +24 -33
- disdrodb/{l0/scripts → cli}/disdrodb_run_l0b.py +30 -21
- disdrodb/{l0/scripts → cli}/disdrodb_run_l0b_station.py +25 -34
- disdrodb/cli/disdrodb_run_l0c.py +130 -0
- disdrodb/cli/disdrodb_run_l0c_station.py +129 -0
- disdrodb/cli/disdrodb_run_l1.py +122 -0
- disdrodb/cli/disdrodb_run_l1_station.py +121 -0
- disdrodb/cli/disdrodb_run_l2e.py +122 -0
- disdrodb/cli/disdrodb_run_l2e_station.py +122 -0
- disdrodb/cli/disdrodb_run_l2m.py +122 -0
- disdrodb/cli/disdrodb_run_l2m_station.py +122 -0
- disdrodb/cli/disdrodb_upload_archive.py +105 -0
- disdrodb/cli/disdrodb_upload_station.py +98 -0
- disdrodb/configs.py +90 -25
- disdrodb/data_transfer/__init__.py +22 -0
- disdrodb/data_transfer/download_data.py +87 -90
- disdrodb/data_transfer/upload_data.py +64 -37
- disdrodb/data_transfer/zenodo.py +15 -18
- disdrodb/docs.py +1 -1
- disdrodb/issue/__init__.py +17 -4
- disdrodb/issue/checks.py +10 -23
- disdrodb/issue/reader.py +9 -12
- disdrodb/issue/writer.py +14 -17
- disdrodb/l0/__init__.py +17 -26
- disdrodb/l0/check_configs.py +35 -23
- disdrodb/l0/check_standards.py +46 -51
- disdrodb/l0/configs/{Thies_LPM → LPM}/bins_diameter.yml +44 -44
- disdrodb/l0/configs/{Thies_LPM → LPM}/bins_velocity.yml +40 -40
- disdrodb/l0/configs/LPM/l0a_encodings.yml +80 -0
- disdrodb/l0/configs/{Thies_LPM → LPM}/l0b_cf_attrs.yml +84 -65
- disdrodb/l0/configs/{Thies_LPM → LPM}/l0b_encodings.yml +50 -9
- disdrodb/l0/configs/{Thies_LPM → LPM}/raw_data_format.yml +285 -245
- disdrodb/l0/configs/{OTT_Parsivel → PARSIVEL}/bins_diameter.yml +66 -66
- disdrodb/l0/configs/{OTT_Parsivel → PARSIVEL}/bins_velocity.yml +64 -64
- disdrodb/l0/configs/PARSIVEL/l0a_encodings.yml +32 -0
- disdrodb/l0/configs/{OTT_Parsivel → PARSIVEL}/l0b_cf_attrs.yml +23 -21
- disdrodb/l0/configs/{OTT_Parsivel → PARSIVEL}/l0b_encodings.yml +17 -17
- disdrodb/l0/configs/{OTT_Parsivel → PARSIVEL}/raw_data_format.yml +77 -77
- disdrodb/l0/configs/{OTT_Parsivel2 → PARSIVEL2}/bins_diameter.yml +64 -64
- disdrodb/l0/configs/{OTT_Parsivel2 → PARSIVEL2}/bins_velocity.yml +64 -64
- disdrodb/l0/configs/PARSIVEL2/l0a_encodings.yml +39 -0
- disdrodb/l0/configs/{OTT_Parsivel2 → PARSIVEL2}/l0b_cf_attrs.yml +28 -26
- disdrodb/l0/configs/{OTT_Parsivel2 → PARSIVEL2}/l0b_encodings.yml +20 -20
- disdrodb/l0/configs/{OTT_Parsivel2 → PARSIVEL2}/raw_data_format.yml +107 -107
- disdrodb/l0/configs/PWS100/bins_diameter.yml +173 -0
- disdrodb/l0/configs/PWS100/bins_velocity.yml +173 -0
- disdrodb/l0/configs/PWS100/l0a_encodings.yml +19 -0
- disdrodb/l0/configs/PWS100/l0b_cf_attrs.yml +76 -0
- disdrodb/l0/configs/PWS100/l0b_encodings.yml +176 -0
- disdrodb/l0/configs/PWS100/raw_data_format.yml +182 -0
- disdrodb/l0/configs/{RD_80 → RD80}/bins_diameter.yml +40 -40
- disdrodb/l0/configs/RD80/l0a_encodings.yml +16 -0
- disdrodb/l0/configs/{RD_80 → RD80}/l0b_cf_attrs.yml +3 -3
- disdrodb/l0/configs/RD80/l0b_encodings.yml +135 -0
- disdrodb/l0/configs/{RD_80 → RD80}/raw_data_format.yml +46 -50
- disdrodb/l0/l0_reader.py +216 -340
- disdrodb/l0/l0a_processing.py +237 -208
- disdrodb/l0/l0b_nc_processing.py +227 -80
- disdrodb/l0/l0b_processing.py +96 -174
- disdrodb/l0/l0c_processing.py +627 -0
- disdrodb/l0/readers/{ARM → LPM/ARM}/ARM_LPM.py +36 -58
- disdrodb/l0/readers/LPM/AUSTRALIA/MELBOURNE_2007_LPM.py +236 -0
- disdrodb/l0/readers/LPM/BRAZIL/CHUVA_LPM.py +185 -0
- disdrodb/l0/readers/LPM/BRAZIL/GOAMAZON_LPM.py +185 -0
- disdrodb/l0/readers/LPM/ITALY/GID_LPM.py +195 -0
- disdrodb/l0/readers/LPM/ITALY/GID_LPM_W.py +210 -0
- disdrodb/l0/readers/{BRAZIL/GOAMAZON_LPM.py → LPM/KIT/CHWALA.py} +97 -76
- disdrodb/l0/readers/LPM/SLOVENIA/ARSO.py +197 -0
- disdrodb/l0/readers/LPM/SLOVENIA/CRNI_VRH.py +197 -0
- disdrodb/l0/readers/{UK → LPM/UK}/DIVEN.py +14 -35
- disdrodb/l0/readers/PARSIVEL/AUSTRALIA/MELBOURNE_2007_PARSIVEL.py +157 -0
- disdrodb/l0/readers/PARSIVEL/CHINA/CHONGQING.py +113 -0
- disdrodb/l0/readers/{EPFL → PARSIVEL/EPFL}/ARCTIC_2021.py +40 -57
- disdrodb/l0/readers/{EPFL → PARSIVEL/EPFL}/COMMON_2011.py +37 -54
- disdrodb/l0/readers/{EPFL → PARSIVEL/EPFL}/DAVOS_2009_2011.py +34 -51
- disdrodb/l0/readers/{EPFL → PARSIVEL/EPFL}/EPFL_2009.py +34 -51
- disdrodb/l0/readers/{EPFL/PARADISO_2014.py → PARSIVEL/EPFL/EPFL_ROOF_2008.py} +38 -50
- disdrodb/l0/readers/PARSIVEL/EPFL/EPFL_ROOF_2010.py +105 -0
- disdrodb/l0/readers/{EPFL → PARSIVEL/EPFL}/EPFL_ROOF_2011.py +34 -51
- disdrodb/l0/readers/{EPFL → PARSIVEL/EPFL}/EPFL_ROOF_2012.py +33 -51
- disdrodb/l0/readers/{EPFL → PARSIVEL/EPFL}/GENEPI_2007.py +25 -44
- disdrodb/l0/readers/{EPFL → PARSIVEL/EPFL}/GRAND_ST_BERNARD_2007.py +25 -44
- disdrodb/l0/readers/{EPFL → PARSIVEL/EPFL}/GRAND_ST_BERNARD_2007_2.py +25 -44
- disdrodb/l0/readers/{EPFL → PARSIVEL/EPFL}/HPICONET_2010.py +34 -51
- disdrodb/l0/readers/{EPFL/EPFL_ROOF_2010.py → PARSIVEL/EPFL/HYMEX_LTE_SOP2.py} +37 -50
- disdrodb/l0/readers/PARSIVEL/EPFL/HYMEX_LTE_SOP3.py +111 -0
- disdrodb/l0/readers/{EPFL → PARSIVEL/EPFL}/HYMEX_LTE_SOP4.py +36 -54
- disdrodb/l0/readers/{EPFL → PARSIVEL/EPFL}/LOCARNO_2018.py +34 -52
- disdrodb/l0/readers/{EPFL → PARSIVEL/EPFL}/LOCARNO_2019.py +38 -56
- disdrodb/l0/readers/PARSIVEL/EPFL/PARADISO_2014.py +105 -0
- disdrodb/l0/readers/{EPFL → PARSIVEL/EPFL}/PARSIVEL_2007.py +27 -45
- disdrodb/l0/readers/{EPFL → PARSIVEL/EPFL}/PLATO_2019.py +24 -44
- disdrodb/l0/readers/PARSIVEL/EPFL/RACLETS_2019.py +140 -0
- disdrodb/l0/readers/{EPFL → PARSIVEL/EPFL}/RACLETS_2019_WJF.py +41 -59
- disdrodb/l0/readers/{EPFL → PARSIVEL/EPFL}/RIETHOLZBACH_2011.py +34 -51
- disdrodb/l0/readers/PARSIVEL/EPFL/SAMOYLOV_2017.py +117 -0
- disdrodb/l0/readers/PARSIVEL/EPFL/SAMOYLOV_2019.py +137 -0
- disdrodb/l0/readers/{EPFL → PARSIVEL/EPFL}/UNIL_2022.py +42 -55
- disdrodb/l0/readers/PARSIVEL/GPM/IFLOODS.py +104 -0
- disdrodb/l0/readers/{GPM → PARSIVEL/GPM}/LPVEX.py +29 -48
- disdrodb/l0/readers/PARSIVEL/GPM/MC3E.py +184 -0
- disdrodb/l0/readers/PARSIVEL/KIT/BURKINA_FASO.py +133 -0
- disdrodb/l0/readers/PARSIVEL/NCAR/CCOPE_2015.py +113 -0
- disdrodb/l0/readers/{NCAR/VORTEX_SE_2016_P1.py → PARSIVEL/NCAR/OWLES_MIPS.py} +46 -72
- disdrodb/l0/readers/PARSIVEL/NCAR/PECAN_MOBILE.py +125 -0
- disdrodb/l0/readers/{NCAR/OWLES_MIPS.py → PARSIVEL/NCAR/PLOWS_MIPS.py} +45 -64
- disdrodb/l0/readers/PARSIVEL/NCAR/VORTEX2_2009.py +114 -0
- disdrodb/l0/readers/PARSIVEL/NCAR/VORTEX2_2010.py +176 -0
- disdrodb/l0/readers/PARSIVEL/NCAR/VORTEX2_2010_UF.py +183 -0
- disdrodb/l0/readers/PARSIVEL/SLOVENIA/UL_FGG.py +121 -0
- disdrodb/l0/readers/{ARM/ARM_LD.py → PARSIVEL2/ARM/ARM_PARSIVEL2.py} +27 -50
- disdrodb/l0/readers/PARSIVEL2/BRAZIL/CHUVA_PARSIVEL2.py +163 -0
- disdrodb/l0/readers/PARSIVEL2/BRAZIL/GOAMAZON_PARSIVEL2.py +163 -0
- disdrodb/l0/readers/{DENMARK → PARSIVEL2/DENMARK}/EROSION_nc.py +14 -35
- disdrodb/l0/readers/PARSIVEL2/FRANCE/ENPC_PARSIVEL2.py +189 -0
- disdrodb/l0/readers/PARSIVEL2/FRANCE/SIRTA_PARSIVEL2.py +119 -0
- disdrodb/l0/readers/PARSIVEL2/GPM/GCPEX.py +104 -0
- disdrodb/l0/readers/PARSIVEL2/GPM/NSSTC.py +176 -0
- disdrodb/l0/readers/PARSIVEL2/ITALY/GID_PARSIVEL2.py +32 -0
- disdrodb/l0/readers/PARSIVEL2/MEXICO/OH_IIUNAM_nc.py +56 -0
- disdrodb/l0/readers/PARSIVEL2/NCAR/PECAN_FP3.py +120 -0
- disdrodb/l0/readers/{NCAR → PARSIVEL2/NCAR}/PECAN_MIPS.py +45 -64
- disdrodb/l0/readers/PARSIVEL2/NCAR/RELAMPAGO_PARSIVEL2.py +181 -0
- disdrodb/l0/readers/PARSIVEL2/NCAR/SNOWIE_PJ.py +160 -0
- disdrodb/l0/readers/PARSIVEL2/NCAR/SNOWIE_SB.py +160 -0
- disdrodb/l0/readers/{NCAR/PLOWS_MIPS.py → PARSIVEL2/NCAR/VORTEX_SE_2016_P1.py} +49 -66
- disdrodb/l0/readers/PARSIVEL2/NCAR/VORTEX_SE_2016_P2.py +118 -0
- disdrodb/l0/readers/PARSIVEL2/NCAR/VORTEX_SE_2016_PIPS.py +152 -0
- disdrodb/l0/readers/PARSIVEL2/NETHERLANDS/DELFT.py +166 -0
- disdrodb/l0/readers/PWS100/FRANCE/ENPC_PWS100.py +150 -0
- disdrodb/l0/readers/{NCAR/RELAMPAGO_RD80.py → RD80/BRAZIL/CHUVA_RD80.py} +36 -60
- disdrodb/l0/readers/{BRAZIL → RD80/BRAZIL}/GOAMAZON_RD80.py +36 -55
- disdrodb/l0/readers/{NCAR → RD80/NCAR}/CINDY_2011_RD80.py +35 -54
- disdrodb/l0/readers/{BRAZIL/CHUVA_RD80.py → RD80/NCAR/RELAMPAGO_RD80.py} +40 -54
- disdrodb/l0/readers/RD80/NOAA/PSL_RD80.py +274 -0
- disdrodb/l0/readers/template_reader_raw_netcdf_data.py +62 -0
- disdrodb/l0/readers/{reader_template.py → template_reader_raw_text_data.py} +20 -44
- disdrodb/l0/routines.py +885 -581
- disdrodb/l0/standards.py +77 -238
- disdrodb/l0/template_tools.py +105 -110
- disdrodb/l1/__init__.py +17 -0
- disdrodb/l1/beard_model.py +716 -0
- disdrodb/l1/encoding_attrs.py +635 -0
- disdrodb/l1/fall_velocity.py +260 -0
- disdrodb/l1/filters.py +192 -0
- disdrodb/l1/processing.py +202 -0
- disdrodb/l1/resampling.py +236 -0
- disdrodb/l1/routines.py +358 -0
- disdrodb/l1_env/__init__.py +17 -0
- disdrodb/l1_env/routines.py +38 -0
- disdrodb/l2/__init__.py +17 -0
- disdrodb/l2/empirical_dsd.py +1833 -0
- disdrodb/l2/event.py +388 -0
- disdrodb/l2/processing.py +528 -0
- disdrodb/l2/processing_options.py +213 -0
- disdrodb/l2/routines.py +868 -0
- disdrodb/metadata/__init__.py +9 -2
- disdrodb/metadata/checks.py +180 -124
- disdrodb/metadata/download.py +81 -0
- disdrodb/metadata/geolocation.py +146 -0
- disdrodb/metadata/info.py +20 -13
- disdrodb/metadata/manipulation.py +3 -3
- disdrodb/metadata/reader.py +59 -8
- disdrodb/metadata/search.py +77 -144
- disdrodb/metadata/standards.py +83 -80
- disdrodb/metadata/writer.py +10 -16
- disdrodb/psd/__init__.py +38 -0
- disdrodb/psd/fitting.py +2146 -0
- disdrodb/psd/models.py +774 -0
- disdrodb/routines.py +1412 -0
- disdrodb/scattering/__init__.py +28 -0
- disdrodb/scattering/axis_ratio.py +344 -0
- disdrodb/scattering/routines.py +456 -0
- disdrodb/utils/__init__.py +17 -0
- disdrodb/utils/attrs.py +208 -0
- disdrodb/utils/cli.py +269 -0
- disdrodb/utils/compression.py +60 -42
- disdrodb/utils/dask.py +62 -0
- disdrodb/utils/dataframe.py +342 -0
- disdrodb/utils/decorators.py +110 -0
- disdrodb/utils/directories.py +107 -46
- disdrodb/utils/encoding.py +127 -0
- disdrodb/utils/list.py +29 -0
- disdrodb/utils/logger.py +168 -46
- disdrodb/utils/time.py +657 -0
- disdrodb/utils/warnings.py +30 -0
- disdrodb/utils/writer.py +57 -0
- disdrodb/utils/xarray.py +138 -47
- disdrodb/utils/yaml.py +0 -1
- disdrodb/viz/__init__.py +17 -0
- disdrodb/viz/plots.py +17 -0
- disdrodb-0.1.1.dist-info/METADATA +294 -0
- disdrodb-0.1.1.dist-info/RECORD +232 -0
- {disdrodb-0.0.21.dist-info → disdrodb-0.1.1.dist-info}/WHEEL +1 -1
- disdrodb-0.1.1.dist-info/entry_points.txt +30 -0
- disdrodb/data_transfer/scripts/disdrodb_download_archive.py +0 -53
- disdrodb/data_transfer/scripts/disdrodb_upload_archive.py +0 -57
- disdrodb/l0/configs/OTT_Parsivel/l0a_encodings.yml +0 -32
- disdrodb/l0/configs/OTT_Parsivel2/l0a_encodings.yml +0 -39
- disdrodb/l0/configs/RD_80/l0a_encodings.yml +0 -16
- disdrodb/l0/configs/RD_80/l0b_encodings.yml +0 -135
- disdrodb/l0/configs/Thies_LPM/l0a_encodings.yml +0 -80
- disdrodb/l0/io.py +0 -257
- disdrodb/l0/l0_processing.py +0 -1091
- disdrodb/l0/readers/AUSTRALIA/MELBOURNE_2007_OTT.py +0 -178
- disdrodb/l0/readers/AUSTRALIA/MELBOURNE_2007_THIES.py +0 -247
- disdrodb/l0/readers/BRAZIL/CHUVA_LPM.py +0 -204
- disdrodb/l0/readers/BRAZIL/CHUVA_OTT.py +0 -183
- disdrodb/l0/readers/BRAZIL/GOAMAZON_OTT.py +0 -183
- disdrodb/l0/readers/CHINA/CHONGQING.py +0 -131
- disdrodb/l0/readers/EPFL/EPFL_ROOF_2008.py +0 -128
- disdrodb/l0/readers/EPFL/HYMEX_LTE_SOP2.py +0 -127
- disdrodb/l0/readers/EPFL/HYMEX_LTE_SOP3.py +0 -129
- disdrodb/l0/readers/EPFL/RACLETS_2019.py +0 -158
- disdrodb/l0/readers/EPFL/SAMOYLOV_2017.py +0 -136
- disdrodb/l0/readers/EPFL/SAMOYLOV_2019.py +0 -158
- disdrodb/l0/readers/FRANCE/SIRTA_OTT2.py +0 -138
- disdrodb/l0/readers/GPM/GCPEX.py +0 -123
- disdrodb/l0/readers/GPM/IFLOODS.py +0 -123
- disdrodb/l0/readers/GPM/MC3E.py +0 -123
- disdrodb/l0/readers/GPM/NSSTC.py +0 -164
- disdrodb/l0/readers/ITALY/GID.py +0 -199
- disdrodb/l0/readers/MEXICO/OH_IIUNAM_nc.py +0 -92
- disdrodb/l0/readers/NCAR/CCOPE_2015.py +0 -133
- disdrodb/l0/readers/NCAR/PECAN_FP3.py +0 -137
- disdrodb/l0/readers/NCAR/PECAN_MOBILE.py +0 -144
- disdrodb/l0/readers/NCAR/RELAMPAGO_OTT.py +0 -195
- disdrodb/l0/readers/NCAR/SNOWIE_PJ.py +0 -172
- disdrodb/l0/readers/NCAR/SNOWIE_SB.py +0 -179
- disdrodb/l0/readers/NCAR/VORTEX2_2009.py +0 -133
- disdrodb/l0/readers/NCAR/VORTEX2_2010.py +0 -188
- disdrodb/l0/readers/NCAR/VORTEX2_2010_UF.py +0 -191
- disdrodb/l0/readers/NCAR/VORTEX_SE_2016_P2.py +0 -135
- disdrodb/l0/readers/NCAR/VORTEX_SE_2016_PIPS.py +0 -170
- disdrodb/l0/readers/NETHERLANDS/DELFT.py +0 -187
- disdrodb/l0/readers/SPAIN/SBEGUERIA.py +0 -179
- disdrodb/l0/scripts/disdrodb_run_l0b_concat.py +0 -93
- disdrodb/l0/scripts/disdrodb_run_l0b_concat_station.py +0 -85
- disdrodb/utils/netcdf.py +0 -452
- disdrodb/utils/scripts.py +0 -102
- disdrodb-0.0.21.dist-info/AUTHORS.md +0 -18
- disdrodb-0.0.21.dist-info/METADATA +0 -186
- disdrodb-0.0.21.dist-info/RECORD +0 -168
- disdrodb-0.0.21.dist-info/entry_points.txt +0 -15
- /disdrodb/l0/configs/{RD_80 → RD80}/bins_velocity.yml +0 -0
- /disdrodb/l0/manuals/{Thies_LPM.pdf → LPM.pdf} +0 -0
- /disdrodb/l0/manuals/{ODM_470.pdf → ODM470.pdf} +0 -0
- /disdrodb/l0/manuals/{OTT_Parsivel.pdf → PARSIVEL.pdf} +0 -0
- /disdrodb/l0/manuals/{OTT_Parsivel2.pdf → PARSIVEL2.pdf} +0 -0
- /disdrodb/l0/manuals/{PWS_100.pdf → PWS100.pdf} +0 -0
- /disdrodb/l0/manuals/{RD_80.pdf → RD80.pdf} +0 -0
- {disdrodb-0.0.21.dist-info → disdrodb-0.1.1.dist-info/licenses}/LICENSE +0 -0
- {disdrodb-0.0.21.dist-info → disdrodb-0.1.1.dist-info}/top_level.txt +0 -0
disdrodb/utils/writer.py
ADDED
|
@@ -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
|
|
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
|
|
27
|
-
"""
|
|
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
|
-
|
|
32
|
-
|
|
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
|
-
|
|
37
|
-
|
|
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
|
-
|
|
41
|
-
|
|
42
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
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
disdrodb/viz/__init__.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 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,294 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: disdrodb
|
|
3
|
+
Version: 0.1.1
|
|
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 | [](https://pypi.org/project/disdrodb/) [](https://anaconda.org/conda-forge/disdrodb) |
|
|
55
|
+
| Activity | [](https://pypi.org/project/disdrodb/) [](https://anaconda.org/conda-forge/disdrodb) |
|
|
56
|
+
| Python Versions | [](https://www.python.org/downloads/) |
|
|
57
|
+
| Supported Systems | [](https://github.com/ltelab/disdrodb/actions/workflows/tests.yml) [](https://github.com/ltelab/disdrodb/actions/workflows/tests.yml) [](https://github.com/ltelab/disdrodb/actions/workflows/tests_windows.yml) |
|
|
58
|
+
| Project Status | [](https://www.repostatus.org/#active) |
|
|
59
|
+
| Build Status | [](https://github.com/ltelab/disdrodb/actions/workflows/tests.yml) [](https://github.com/ltelab/disdrodb/actions/workflows/lint.yml) [](https://disdrodb.readthedocs.io/en/latest/) |
|
|
60
|
+
| Linting | [](https://github.com/psf/black) [](https://github.com/astral-sh/ruff) [](https://github.com/codespell-project/codespell) |
|
|
61
|
+
| Code Coverage | [](https://coveralls.io/github/ltelab/disdrodb?branch=main) [](https://codecov.io/gh/ltelab/disdrodb) |
|
|
62
|
+
| Code Quality | [](https://www.codefactor.io/repository/github/ltelab/disdrodb) [](https://codebeat.co/projects/github-com-ltelab-disdrodb-main) [](https://app.codacy.com/gh/ltelab/disdrodb/dashboard?utm_source=gh&utm_medium=referral&utm_content=&utm_campaign=Badge_grade) [](https://codescene.io/projects/36773) |
|
|
63
|
+
| License | [](https://github.com/ltelab/disdrodb/blob/main/LICENSE) |
|
|
64
|
+
| Community | [](https://join.slack.com/t/disdrodbworkspace/shared_invite/zt-25l4mvgo7-cfBdXalzlWGd4Pt7H~FqoA) [](https://github.com/ltelab/disdrodb/discussions) |
|
|
65
|
+
| Citation | [](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 facilitate the processing, analysis and visualization of disdrometer data.
|
|
73
|
+
|
|
74
|
+
## ℹ️ Software Overview
|
|
75
|
+
|
|
76
|
+
The software enables you to:
|
|
77
|
+
|
|
78
|
+
- Upload raw data of new disdrometer stations to the DISDRODB Decentralized Data Archive
|
|
79
|
+
|
|
80
|
+
- Download the raw disdrometer data from stations included in the DISDRODB Decentralized Data Archive
|
|
81
|
+
|
|
82
|
+
- Convert raw disdrometer data into a standard NetCDF format (DISDRODB L0 product)
|
|
83
|
+
|
|
84
|
+
- Generate standardized, homogenized, and quality-checked disdrometer measurements (DISDRODB L1 product)
|
|
85
|
+
|
|
86
|
+
- Compute empirical and model-based drop size distribution parameters and derive geophysical and polarimetric radar variables of interest (DISDRODB L2 product)
|
|
87
|
+
|
|
88
|
+
Currently, the DISDRODB Working Group is finalizing the development of the L1 and L2 scientific products.
|
|
89
|
+
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!!!
|
|
90
|
+
|
|
91
|
+
Join the [**DISDRODB Slack Workspace**](https://join.slack.com/t/disdrodbworkspace/shared_invite/zt-25l4mvgo7-cfBdXalzlWGd4Pt7H~FqoA) to meet the DISDRODB Community!
|
|
92
|
+
|
|
93
|
+
## 🚀 Quick Start
|
|
94
|
+
|
|
95
|
+
Create your own DISDRODB Local Data Archive.
|
|
96
|
+
|
|
97
|
+
### 📚 Download the DISDRODB Metadata Archive
|
|
98
|
+
|
|
99
|
+
The DISDRODB Metadata Archive is a collection of metadata files that describe the disdrometer stations included in DISDRODB.
|
|
100
|
+
|
|
101
|
+
To download the DISDRODB Metadata Archive, navigate to the desired directory and run:
|
|
102
|
+
|
|
103
|
+
```bash
|
|
104
|
+
git clone https://github.com/ltelab/DISDRODB-METADATA.git
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
Or download a static snapshot without using git:
|
|
108
|
+
|
|
109
|
+
```bash
|
|
110
|
+
disdrodb_download_metadata_archive /path/to/DISDRODB-METADATA
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
### 📚 Define the DISDRODB Configuration File
|
|
114
|
+
|
|
115
|
+
The disdrodb software requires to know two directories:
|
|
116
|
+
|
|
117
|
+
- `metadata_archive_dir`: the base of your local DISDRODB Metadata Archive
|
|
118
|
+
- `data_archive_dir`: the base of your local DISDRODB Data Archive
|
|
119
|
+
|
|
120
|
+
On Windows, paths must end with `\DISDRODB`; on macOS/Linux, they must end with `/DISDRODB`.
|
|
121
|
+
|
|
122
|
+
```python
|
|
123
|
+
import disdrodb
|
|
124
|
+
|
|
125
|
+
metadata_archive_dir = "/<path_to>/DISDRODB-METADATA/DISDRODB"
|
|
126
|
+
data_archive_dir = "/<path_to>/DISDRODB"
|
|
127
|
+
disdrodb.define_configs(
|
|
128
|
+
metadata_archive_dir=metadata_archive_dir, data_archive_dir=data_archive_dir
|
|
129
|
+
)
|
|
130
|
+
```
|
|
131
|
+
|
|
132
|
+
This creates a `.config_disdrodb.yml` file in your home directory (e.g., `~/.config_disdrodb.yml`).
|
|
133
|
+
|
|
134
|
+
To verify the configuration, open a new Python session and run:
|
|
135
|
+
|
|
136
|
+
```python
|
|
137
|
+
import disdrodb
|
|
138
|
+
|
|
139
|
+
print("Metadata Archive Directory:", disdrodb.get_metadata_archive_dir())
|
|
140
|
+
print("Data Archive Directory:", disdrodb.get_data_archive_dir())
|
|
141
|
+
```
|
|
142
|
+
|
|
143
|
+
Or in the shell:
|
|
144
|
+
|
|
145
|
+
```bash
|
|
146
|
+
disdrodb_metadata_archive_directory
|
|
147
|
+
disdrodb_data_archive_directory
|
|
148
|
+
```
|
|
149
|
+
|
|
150
|
+
### 📥 Download the DISDRODB Raw Data Archive
|
|
151
|
+
|
|
152
|
+
To download all data stored into the DISDRODB Decentralized Data Archive,
|
|
153
|
+
you just have to run the following command:
|
|
154
|
+
|
|
155
|
+
```bash
|
|
156
|
+
disdrodb_download_archive
|
|
157
|
+
```
|
|
158
|
+
|
|
159
|
+
To download from a specific source (e.g., EPFL):
|
|
160
|
+
|
|
161
|
+
```bash
|
|
162
|
+
disdrodb_download_archive --data-sources EPFL
|
|
163
|
+
```
|
|
164
|
+
|
|
165
|
+
Type `disdrodb_download_archive --help` to see further options.
|
|
166
|
+
|
|
167
|
+
To open the local DISDRODB Data Archive directory, type:
|
|
168
|
+
|
|
169
|
+
```bash
|
|
170
|
+
disdrodb_open_data_archive
|
|
171
|
+
```
|
|
172
|
+
|
|
173
|
+
### 💫 Transform Raw Data to Standardized netCDFs
|
|
174
|
+
|
|
175
|
+
If you want to convert all stations raw data into standardized netCDF4 files, run the following command in the terminal:
|
|
176
|
+
|
|
177
|
+
```bash
|
|
178
|
+
disdrodb_run_l0
|
|
179
|
+
```
|
|
180
|
+
|
|
181
|
+
Type `disdrodb_run_l0 --help` to see further options.
|
|
182
|
+
|
|
183
|
+
### 💫 Generate DISDRODB L1 and p2 products
|
|
184
|
+
|
|
185
|
+
To generate DISDRODB L1 and L2 products, run the following commands in the terminal:
|
|
186
|
+
|
|
187
|
+
```bash
|
|
188
|
+
disdrodb_run_l1
|
|
189
|
+
disdrodb_run_l2e
|
|
190
|
+
disdrodb_run_l2m
|
|
191
|
+
```
|
|
192
|
+
|
|
193
|
+
### 💫 Analyze Analysis‐Ready Products
|
|
194
|
+
|
|
195
|
+
The software’s `open_dataset` function **lazily** opens all station files of a given product:
|
|
196
|
+
|
|
197
|
+
```python
|
|
198
|
+
import disdrodb
|
|
199
|
+
|
|
200
|
+
ds = disdrodb.open_dataset(
|
|
201
|
+
product="L0C",
|
|
202
|
+
data_source="EPFL",
|
|
203
|
+
campaign_name="HYMEX_LTE_SOP3",
|
|
204
|
+
station_name="10",
|
|
205
|
+
)
|
|
206
|
+
ds
|
|
207
|
+
```
|
|
208
|
+
|
|
209
|
+
This allows you to jump directly into analyzing disdrometer data without worrying about processing steps.
|
|
210
|
+
|
|
211
|
+
### 💫 Explore the DISDRODB Metadata Archive
|
|
212
|
+
|
|
213
|
+
To explore the DISDRODB Metadata Archive, you can type into the terminal:
|
|
214
|
+
|
|
215
|
+
```bash
|
|
216
|
+
disdrodb_open_metadata_archive
|
|
217
|
+
```
|
|
218
|
+
|
|
219
|
+
If you wish to analyze the DISDRODB Metadata Archive information of all stations,
|
|
220
|
+
the `read_metadata_archive` python function returns all stations metadata information into an easy to analyze `pandas.DataFrame`:
|
|
221
|
+
|
|
222
|
+
```python
|
|
223
|
+
import disdrodb
|
|
224
|
+
|
|
225
|
+
df = disdrodb.read_metadata_archive()
|
|
226
|
+
print(df)
|
|
227
|
+
```
|
|
228
|
+
|
|
229
|
+
## 📖 Explore the DISDRODB documentation
|
|
230
|
+
|
|
231
|
+
With this introduction, we just scratched the surface of the disdrodb software capabilities.
|
|
232
|
+
To discover more about the DISDRODB products, the download and processing options, or how to contribute your own data to DISDRODB,
|
|
233
|
+
please read the software documentation available at [https://disdrodb.readthedocs.io/en/latest/](https://disdrodb.readthedocs.io/en/latest/).
|
|
234
|
+
|
|
235
|
+
## 🛠️ Installation
|
|
236
|
+
|
|
237
|
+
### conda
|
|
238
|
+
|
|
239
|
+
DISDRODB can be installed via [conda][conda_link] on Linux, Mac, and Windows.
|
|
240
|
+
Install the package by typing the following command in the terminal:
|
|
241
|
+
|
|
242
|
+
```bash
|
|
243
|
+
conda install disdrodb
|
|
244
|
+
```
|
|
245
|
+
|
|
246
|
+
In case conda-forge is not set up for your system yet, see the easy to follow instructions on [conda-forge][conda_forge_link].
|
|
247
|
+
|
|
248
|
+
### pip
|
|
249
|
+
|
|
250
|
+
DISDRODB can be installed also via [pip][pip_link] on Linux, Mac, and Windows.
|
|
251
|
+
On Windows you can install [WinPython][winpy_link] to get Python and pip running.
|
|
252
|
+
|
|
253
|
+
Then, install the DISDRODB package by typing the following command in the terminal:
|
|
254
|
+
|
|
255
|
+
```bash
|
|
256
|
+
pip install disdrodb
|
|
257
|
+
```
|
|
258
|
+
|
|
259
|
+
To install the latest development version via pip, see the [documentation][dev_install_link].
|
|
260
|
+
|
|
261
|
+
## 💭 Feedback and Contributing Guidelines
|
|
262
|
+
|
|
263
|
+
If you aim to contribute your data or discuss the future development of DISDRODB,
|
|
264
|
+
we highly recommend to join the [**DISDRODB Slack Workspace**](https://join.slack.com/t/disdrodbworkspace/shared_invite/zt-25l4mvgo7-cfBdXalzlWGd4Pt7H~FqoA)
|
|
265
|
+
|
|
266
|
+
Feel free to also open a [GitHub Issue](https://github.com/ltelab/disdrodb/issues) or a
|
|
267
|
+
[GitHub Discussion](https://github.com/ltelab/disdrodb/discussions) specific to your questions or ideas.
|
|
268
|
+
|
|
269
|
+
## ✍️ Contributors
|
|
270
|
+
|
|
271
|
+
- [Gionata Ghiggi](https://people.epfl.ch/gionata.ghiggi)
|
|
272
|
+
- [Kim Candolfi](https://github.com/KimCandolfi)
|
|
273
|
+
- [Régis Longchamp](https://people.epfl.ch/regis.longchamp)
|
|
274
|
+
- [Charlotte Gisèle Weil](https://people.epfl.ch/charlotte.weil)
|
|
275
|
+
- [Jacopo Grazioli](https://people.epfl.ch/jacopo.grazioli)
|
|
276
|
+
- [Alexis Berne](https://people.epfl.ch/alexis.berne?lang=en)
|
|
277
|
+
|
|
278
|
+
## Citation
|
|
279
|
+
|
|
280
|
+
You can cite the DISDRODB software by:
|
|
281
|
+
|
|
282
|
+
> Gionata Ghiggi, Kim Candolfi, Régis Longchamp, Charlotte Weil, Alexis Berne (2023). ltelab/disdrodb Zenodo. https://doi.org/10.5281/zenodo.7680581
|
|
283
|
+
|
|
284
|
+
If you want to cite a specific version, have a look at the [Zenodo site](https://doi.org/10.5281/zenodo.7680581)
|
|
285
|
+
|
|
286
|
+
## License
|
|
287
|
+
|
|
288
|
+
The content of this repository is released under the terms of the [GPL 3.0 license](LICENSE).
|
|
289
|
+
|
|
290
|
+
[conda_forge_link]: https://github.com/conda-forge/disdrodb-feedstock#installing-disdrodb
|
|
291
|
+
[conda_link]: https://docs.conda.io/en/latest/miniconda.html
|
|
292
|
+
[dev_install_link]: https://disdrodb.readthedocs.io/en/latest/installation.html#installation-for-contributors
|
|
293
|
+
[pip_link]: https://pypi.org/project/disdrodb
|
|
294
|
+
[winpy_link]: https://winpython.github.io/
|