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
|
@@ -14,15 +14,19 @@
|
|
|
14
14
|
# You should have received a copy of the GNU General Public License
|
|
15
15
|
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
16
16
|
# -----------------------------------------------------------------------------.
|
|
17
|
+
"""Script to run the DISDRODB L0B station processing."""
|
|
17
18
|
import sys
|
|
19
|
+
from typing import Optional
|
|
18
20
|
|
|
19
21
|
import click
|
|
20
22
|
|
|
21
|
-
from disdrodb.
|
|
22
|
-
|
|
23
|
-
|
|
23
|
+
from disdrodb.utils.cli import (
|
|
24
|
+
click_data_archive_dir_option,
|
|
25
|
+
click_metadata_archive_dir_option,
|
|
26
|
+
click_processing_options,
|
|
27
|
+
click_remove_l0a_option,
|
|
24
28
|
click_station_arguments,
|
|
25
|
-
|
|
29
|
+
parse_archive_dir,
|
|
26
30
|
)
|
|
27
31
|
|
|
28
32
|
sys.tracebacklimit = 0 # avoid full traceback error if occur
|
|
@@ -33,9 +37,10 @@ sys.tracebacklimit = 0 # avoid full traceback error if occur
|
|
|
33
37
|
|
|
34
38
|
@click.command()
|
|
35
39
|
@click_station_arguments
|
|
36
|
-
@
|
|
40
|
+
@click_processing_options
|
|
37
41
|
@click_remove_l0a_option
|
|
38
|
-
@
|
|
42
|
+
@click_data_archive_dir_option
|
|
43
|
+
@click_metadata_archive_dir_option
|
|
39
44
|
def disdrodb_run_l0b_station(
|
|
40
45
|
# Station arguments
|
|
41
46
|
data_source: str,
|
|
@@ -47,13 +52,14 @@ def disdrodb_run_l0b_station(
|
|
|
47
52
|
parallel: bool = True,
|
|
48
53
|
debugging_mode: bool = False,
|
|
49
54
|
remove_l0a: bool = False,
|
|
50
|
-
|
|
55
|
+
# DISDRODB root directories
|
|
56
|
+
data_archive_dir: Optional[str] = None,
|
|
57
|
+
metadata_archive_dir: Optional[str] = None,
|
|
51
58
|
):
|
|
52
59
|
"""Run the L0B processing of a specific DISDRODB station from the terminal.
|
|
53
60
|
|
|
54
61
|
Parameters
|
|
55
62
|
----------
|
|
56
|
-
|
|
57
63
|
data_source : str
|
|
58
64
|
Institution name (when campaign data spans more than 1 country),
|
|
59
65
|
or country (when all campaigns (or sensor networks) are inside a given country).
|
|
@@ -80,37 +86,21 @@ def disdrodb_run_l0b_station(
|
|
|
80
86
|
If True, it reduces the amount of data to process.
|
|
81
87
|
It processes just the first 100 rows of 3 L0A files.
|
|
82
88
|
The default is False.
|
|
83
|
-
|
|
84
|
-
|
|
89
|
+
data_archive_dir : str
|
|
90
|
+
DISDRODB Data Archive directory
|
|
85
91
|
Format: <...>/DISDRODB
|
|
86
92
|
If not specified, uses path specified in the DISDRODB active configuration.
|
|
87
93
|
"""
|
|
88
|
-
import
|
|
89
|
-
|
|
90
|
-
import dask
|
|
91
|
-
from dask.distributed import Client, LocalCluster
|
|
92
|
-
|
|
93
|
-
from disdrodb.l0.l0_processing import run_l0b_station
|
|
94
|
+
from disdrodb.l0.routines import run_l0b_station
|
|
95
|
+
from disdrodb.utils.dask import close_dask_cluster, initialize_dask_cluster
|
|
94
96
|
|
|
95
|
-
|
|
97
|
+
data_archive_dir = parse_archive_dir(data_archive_dir)
|
|
98
|
+
metadata_archive_dir = parse_archive_dir(metadata_archive_dir)
|
|
96
99
|
|
|
97
100
|
# -------------------------------------------------------------------------.
|
|
98
101
|
# If parallel=True, set the dask environment
|
|
99
102
|
if parallel:
|
|
100
|
-
|
|
101
|
-
os.environ["HDF5_USE_FILE_LOCKING"] = "FALSE"
|
|
102
|
-
# Retrieve the number of process to run
|
|
103
|
-
available_workers = os.cpu_count() - 2 # if not set, all CPUs
|
|
104
|
-
num_workers = dask.config.get("num_workers", available_workers)
|
|
105
|
-
# Create dask.distributed local cluster
|
|
106
|
-
cluster = LocalCluster(
|
|
107
|
-
n_workers=num_workers,
|
|
108
|
-
threads_per_worker=1,
|
|
109
|
-
processes=True,
|
|
110
|
-
# memory_limit='8GB',
|
|
111
|
-
# silence_logs=False,
|
|
112
|
-
)
|
|
113
|
-
Client(cluster)
|
|
103
|
+
cluster, client = initialize_dask_cluster()
|
|
114
104
|
|
|
115
105
|
# -------------------------------------------------------------------------.
|
|
116
106
|
run_l0b_station(
|
|
@@ -124,11 +114,12 @@ def disdrodb_run_l0b_station(
|
|
|
124
114
|
debugging_mode=debugging_mode,
|
|
125
115
|
parallel=parallel,
|
|
126
116
|
remove_l0a=remove_l0a,
|
|
127
|
-
|
|
117
|
+
# DISDRODB root directories
|
|
118
|
+
data_archive_dir=data_archive_dir,
|
|
119
|
+
metadata_archive_dir=metadata_archive_dir,
|
|
128
120
|
)
|
|
129
121
|
|
|
130
122
|
# -------------------------------------------------------------------------.
|
|
131
123
|
# Close the cluster
|
|
132
124
|
if parallel:
|
|
133
|
-
cluster
|
|
134
|
-
return None
|
|
125
|
+
close_dask_cluster(cluster, client)
|
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
#!/usr/bin/env python3
|
|
2
|
+
# -----------------------------------------------------------------------------.
|
|
3
|
+
# Copyright (c) 2021-2023 DISDRODB developers
|
|
4
|
+
#
|
|
5
|
+
# This program is free software: you can redistribute it and/or modify
|
|
6
|
+
# it under the terms of the GNU General Public License as published by
|
|
7
|
+
# the Free Software Foundation, either version 3 of the License, or
|
|
8
|
+
# (at your option) any later version.
|
|
9
|
+
#
|
|
10
|
+
# This program is distributed in the hope that it will be useful,
|
|
11
|
+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
12
|
+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
13
|
+
# GNU General Public License for more details.
|
|
14
|
+
#
|
|
15
|
+
# You should have received a copy of the GNU General Public License
|
|
16
|
+
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
17
|
+
# -----------------------------------------------------------------------------.
|
|
18
|
+
"""Script to run the DISDRODB L0C processing."""
|
|
19
|
+
import sys
|
|
20
|
+
from typing import Optional
|
|
21
|
+
|
|
22
|
+
import click
|
|
23
|
+
|
|
24
|
+
from disdrodb.utils.cli import (
|
|
25
|
+
click_data_archive_dir_option,
|
|
26
|
+
click_metadata_archive_dir_option,
|
|
27
|
+
click_processing_options,
|
|
28
|
+
click_remove_l0b_option,
|
|
29
|
+
click_stations_options,
|
|
30
|
+
parse_archive_dir,
|
|
31
|
+
parse_arg_to_list,
|
|
32
|
+
)
|
|
33
|
+
|
|
34
|
+
sys.tracebacklimit = 0 # avoid full traceback error if occur
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
@click.command()
|
|
38
|
+
@click_stations_options
|
|
39
|
+
@click_processing_options
|
|
40
|
+
@click_remove_l0b_option
|
|
41
|
+
@click_data_archive_dir_option
|
|
42
|
+
@click_metadata_archive_dir_option
|
|
43
|
+
def disdrodb_run_l0c(
|
|
44
|
+
# Stations options
|
|
45
|
+
data_sources: Optional[str] = None,
|
|
46
|
+
campaign_names: Optional[str] = None,
|
|
47
|
+
station_names: Optional[str] = None,
|
|
48
|
+
# L0C processing options
|
|
49
|
+
remove_l0b: bool = False,
|
|
50
|
+
# Processing options
|
|
51
|
+
force: bool = False,
|
|
52
|
+
verbose: bool = True,
|
|
53
|
+
parallel: bool = True,
|
|
54
|
+
debugging_mode: bool = False,
|
|
55
|
+
# DISDRODB root directories
|
|
56
|
+
data_archive_dir: Optional[str] = None,
|
|
57
|
+
metadata_archive_dir: Optional[str] = None,
|
|
58
|
+
):
|
|
59
|
+
"""
|
|
60
|
+
Run the L0C processing of DISDRODB stations.
|
|
61
|
+
|
|
62
|
+
This function allows to launch the processing of many DISDRODB stations with a single command.
|
|
63
|
+
From the list of all available DISDRODB stations, it runs the processing of the
|
|
64
|
+
stations matching the provided data_sources, campaign_names and station_names.
|
|
65
|
+
|
|
66
|
+
Parameters
|
|
67
|
+
----------
|
|
68
|
+
data_sources : str
|
|
69
|
+
Name of data source(s) to process.
|
|
70
|
+
The name(s) must be UPPER CASE.
|
|
71
|
+
If campaign_names and station are not specified, process all stations.
|
|
72
|
+
To specify multiple data sources, write i.e.: --data_sources 'GPM EPFL NCAR'
|
|
73
|
+
campaign_names : str
|
|
74
|
+
Name of the campaign(s) to process.
|
|
75
|
+
The name(s) must be UPPER CASE.
|
|
76
|
+
To specify multiple campaigns, write i.e.: --campaign_names 'IPEX IMPACTS'
|
|
77
|
+
station_names : str
|
|
78
|
+
Station names.
|
|
79
|
+
To specify multiple stations, write i.e.: --station_names 'station1 station2'
|
|
80
|
+
force : bool
|
|
81
|
+
If True, overwrite existing data into destination directories.
|
|
82
|
+
If False, raise an error if there are already data into destination directories.
|
|
83
|
+
The default is False.
|
|
84
|
+
verbose : bool
|
|
85
|
+
Whether to print detailed processing information into terminal.
|
|
86
|
+
The default is True.
|
|
87
|
+
parallel : bool
|
|
88
|
+
If True, the files are processed simultaneously in multiple processes.
|
|
89
|
+
Each process will use a single thread to avoid issues with the HDF/netCDF library.
|
|
90
|
+
By default, the number of process is defined with os.cpu_count().
|
|
91
|
+
However, you can customize it by typing: DASK_NUM_WORKERS=4 disdrodb_run_l0b
|
|
92
|
+
If False, the files are processed sequentially in a single process.
|
|
93
|
+
If False, multi-threading is automatically exploited to speed up I/0 tasks.
|
|
94
|
+
debugging_mode : bool
|
|
95
|
+
If True, it reduces the amount of data to process.
|
|
96
|
+
It processes just the first 100 rows of 3 L0A files for each station.
|
|
97
|
+
The default is False.
|
|
98
|
+
remove_l0b: bool, optional
|
|
99
|
+
Whether to remove the processed L0B files. The default value is ``False``.
|
|
100
|
+
data_archive_dir : str
|
|
101
|
+
DISDRODB Data Archive directory
|
|
102
|
+
Format: <...>/DISDRODB
|
|
103
|
+
If not specified, uses path specified in the DISDRODB active configuration.
|
|
104
|
+
"""
|
|
105
|
+
from disdrodb.routines import run_l0c
|
|
106
|
+
|
|
107
|
+
# Parse data_sources, campaign_names and station arguments
|
|
108
|
+
data_archive_dir = parse_archive_dir(data_archive_dir)
|
|
109
|
+
metadata_archive_dir = parse_archive_dir(metadata_archive_dir)
|
|
110
|
+
data_sources = parse_arg_to_list(data_sources)
|
|
111
|
+
campaign_names = parse_arg_to_list(campaign_names)
|
|
112
|
+
station_names = parse_arg_to_list(station_names)
|
|
113
|
+
|
|
114
|
+
# Run processing
|
|
115
|
+
run_l0c(
|
|
116
|
+
# DISDRODB root directories
|
|
117
|
+
data_archive_dir=data_archive_dir,
|
|
118
|
+
metadata_archive_dir=metadata_archive_dir,
|
|
119
|
+
# Stations options
|
|
120
|
+
data_sources=data_sources,
|
|
121
|
+
campaign_names=campaign_names,
|
|
122
|
+
station_names=station_names,
|
|
123
|
+
# L0C processing options
|
|
124
|
+
remove_l0b=remove_l0b,
|
|
125
|
+
# Processing options
|
|
126
|
+
force=force,
|
|
127
|
+
verbose=verbose,
|
|
128
|
+
debugging_mode=debugging_mode,
|
|
129
|
+
parallel=parallel,
|
|
130
|
+
)
|
|
@@ -0,0 +1,129 @@
|
|
|
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
|
+
"""Script to run the DISDRODB L0C station processing."""
|
|
18
|
+
import sys
|
|
19
|
+
from typing import Optional
|
|
20
|
+
|
|
21
|
+
import click
|
|
22
|
+
|
|
23
|
+
from disdrodb.utils.cli import (
|
|
24
|
+
click_data_archive_dir_option,
|
|
25
|
+
click_metadata_archive_dir_option,
|
|
26
|
+
click_processing_options,
|
|
27
|
+
click_remove_l0b_option,
|
|
28
|
+
click_station_arguments,
|
|
29
|
+
parse_archive_dir,
|
|
30
|
+
)
|
|
31
|
+
|
|
32
|
+
sys.tracebacklimit = 0 # avoid full traceback error if occur
|
|
33
|
+
|
|
34
|
+
# -------------------------------------------------------------------------.
|
|
35
|
+
# Click Command Line Interface decorator
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
@click.command()
|
|
39
|
+
@click_station_arguments
|
|
40
|
+
@click_processing_options
|
|
41
|
+
@click_remove_l0b_option
|
|
42
|
+
@click_data_archive_dir_option
|
|
43
|
+
@click_metadata_archive_dir_option
|
|
44
|
+
def disdrodb_run_l0c_station(
|
|
45
|
+
# Station arguments
|
|
46
|
+
data_source: str,
|
|
47
|
+
campaign_name: str,
|
|
48
|
+
station_name: str,
|
|
49
|
+
# L0C processing options
|
|
50
|
+
remove_l0b: bool = False,
|
|
51
|
+
# Processing options
|
|
52
|
+
force: bool = False,
|
|
53
|
+
verbose: bool = True,
|
|
54
|
+
parallel: bool = True,
|
|
55
|
+
debugging_mode: bool = False,
|
|
56
|
+
# DISDRODB root directories
|
|
57
|
+
data_archive_dir: Optional[str] = None,
|
|
58
|
+
metadata_archive_dir: Optional[str] = None,
|
|
59
|
+
):
|
|
60
|
+
"""Run the L0C processing of a specific DISDRODB station from the terminal.
|
|
61
|
+
|
|
62
|
+
Parameters
|
|
63
|
+
----------
|
|
64
|
+
data_source : str
|
|
65
|
+
Institution name (when campaign data spans more than 1 country),
|
|
66
|
+
or country (when all campaigns (or sensor networks) are inside a given country).
|
|
67
|
+
Must be UPPER CASE.
|
|
68
|
+
campaign_name : str
|
|
69
|
+
Campaign name. Must be UPPER CASE.
|
|
70
|
+
station_name : str
|
|
71
|
+
Station name
|
|
72
|
+
force : bool
|
|
73
|
+
If True, overwrite existing data into destination directories.
|
|
74
|
+
If False, raise an error if there are already data into destination directories.
|
|
75
|
+
The default is False.
|
|
76
|
+
verbose : bool
|
|
77
|
+
Whether to print detailed processing information into terminal.
|
|
78
|
+
The default is True.
|
|
79
|
+
parallel : bool
|
|
80
|
+
If True, the files are processed simultaneously in multiple processes.
|
|
81
|
+
Each process will use a single thread to avoid issues with the HDF/netCDF library.
|
|
82
|
+
By default, the number of process is defined with os.cpu_count().
|
|
83
|
+
However, you can customize it by typing: DASK_NUM_WORKERS=4 disdrodb_run_l0b_station
|
|
84
|
+
If False, the files are processed sequentially in a single process.
|
|
85
|
+
If False, multi-threading is automatically exploited to speed up I/0 tasks.
|
|
86
|
+
debugging_mode : bool
|
|
87
|
+
If True, it reduces the amount of data to process.
|
|
88
|
+
It processes just the first 100 rows of 3 L0A files.
|
|
89
|
+
The default is False.
|
|
90
|
+
remove_l0b: bool, optional
|
|
91
|
+
Whether to remove the processed L0B files. The default value is ``False``.
|
|
92
|
+
data_archive_dir : str
|
|
93
|
+
DISDRODB Data Archive directory
|
|
94
|
+
Format: <...>/DISDRODB
|
|
95
|
+
If not specified, uses path specified in the DISDRODB active configuration.
|
|
96
|
+
"""
|
|
97
|
+
from disdrodb.l0.routines import run_l0c_station
|
|
98
|
+
from disdrodb.utils.dask import close_dask_cluster, initialize_dask_cluster
|
|
99
|
+
|
|
100
|
+
data_archive_dir = parse_archive_dir(data_archive_dir)
|
|
101
|
+
metadata_archive_dir = parse_archive_dir(metadata_archive_dir)
|
|
102
|
+
|
|
103
|
+
# -------------------------------------------------------------------------.
|
|
104
|
+
# If parallel=True, set the dask environment
|
|
105
|
+
if parallel:
|
|
106
|
+
cluster, client = initialize_dask_cluster()
|
|
107
|
+
|
|
108
|
+
# -------------------------------------------------------------------------.
|
|
109
|
+
run_l0c_station(
|
|
110
|
+
# Station arguments
|
|
111
|
+
data_source=data_source,
|
|
112
|
+
campaign_name=campaign_name,
|
|
113
|
+
station_name=station_name,
|
|
114
|
+
# L0C processing options
|
|
115
|
+
remove_l0b=remove_l0b,
|
|
116
|
+
# Processing options
|
|
117
|
+
force=force,
|
|
118
|
+
verbose=verbose,
|
|
119
|
+
debugging_mode=debugging_mode,
|
|
120
|
+
parallel=parallel,
|
|
121
|
+
# DISDRODB root directories
|
|
122
|
+
data_archive_dir=data_archive_dir,
|
|
123
|
+
metadata_archive_dir=metadata_archive_dir,
|
|
124
|
+
)
|
|
125
|
+
|
|
126
|
+
# -------------------------------------------------------------------------.
|
|
127
|
+
# Close the cluster
|
|
128
|
+
if parallel:
|
|
129
|
+
close_dask_cluster(cluster, client)
|
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
#!/usr/bin/env python3
|
|
2
|
+
# -----------------------------------------------------------------------------.
|
|
3
|
+
# Copyright (c) 2021-2023 DISDRODB developers
|
|
4
|
+
#
|
|
5
|
+
# This program is free software: you can redistribute it and/or modify
|
|
6
|
+
# it under the terms of the GNU General Public License as published by
|
|
7
|
+
# the Free Software Foundation, either version 3 of the License, or
|
|
8
|
+
# (at your option) any later version.
|
|
9
|
+
#
|
|
10
|
+
# This program is distributed in the hope that it will be useful,
|
|
11
|
+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
12
|
+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
13
|
+
# GNU General Public License for more details.
|
|
14
|
+
#
|
|
15
|
+
# You should have received a copy of the GNU General Public License
|
|
16
|
+
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
17
|
+
# -----------------------------------------------------------------------------.
|
|
18
|
+
"""Script to run the DISDRODB L1B processing."""
|
|
19
|
+
import sys
|
|
20
|
+
from typing import Optional
|
|
21
|
+
|
|
22
|
+
import click
|
|
23
|
+
|
|
24
|
+
from disdrodb.utils.cli import (
|
|
25
|
+
click_data_archive_dir_option,
|
|
26
|
+
click_metadata_archive_dir_option,
|
|
27
|
+
click_processing_options,
|
|
28
|
+
click_stations_options,
|
|
29
|
+
parse_archive_dir,
|
|
30
|
+
parse_arg_to_list,
|
|
31
|
+
)
|
|
32
|
+
|
|
33
|
+
sys.tracebacklimit = 0 # avoid full traceback error if occur
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
@click.command()
|
|
37
|
+
@click_stations_options
|
|
38
|
+
@click_processing_options
|
|
39
|
+
@click_data_archive_dir_option
|
|
40
|
+
@click_metadata_archive_dir_option
|
|
41
|
+
def disdrodb_run_l1(
|
|
42
|
+
# Stations options
|
|
43
|
+
data_sources: Optional[str] = None,
|
|
44
|
+
campaign_names: Optional[str] = None,
|
|
45
|
+
station_names: Optional[str] = None,
|
|
46
|
+
# Processing options
|
|
47
|
+
force: bool = False,
|
|
48
|
+
verbose: bool = True,
|
|
49
|
+
parallel: bool = True,
|
|
50
|
+
debugging_mode: bool = False,
|
|
51
|
+
# DISDRODB root directories
|
|
52
|
+
data_archive_dir: Optional[str] = None,
|
|
53
|
+
metadata_archive_dir: Optional[str] = None,
|
|
54
|
+
):
|
|
55
|
+
"""
|
|
56
|
+
Run the L1 processing of DISDRODB stations.
|
|
57
|
+
|
|
58
|
+
This function allows to launch the processing of many DISDRODB stations with a single command.
|
|
59
|
+
From the list of all available DISDRODB stations, it runs the processing
|
|
60
|
+
of the stations matching the provided data_sources, campaign_names and station_names.
|
|
61
|
+
|
|
62
|
+
Parameters
|
|
63
|
+
----------
|
|
64
|
+
data_sources : str
|
|
65
|
+
Name of data source(s) to process.
|
|
66
|
+
The name(s) must be UPPER CASE.
|
|
67
|
+
If campaign_names and station are not specified, process all stations.
|
|
68
|
+
To specify multiple data sources, write i.e.: --data_sources 'GPM EPFL NCAR'
|
|
69
|
+
campaign_names : str
|
|
70
|
+
Name of the campaign(s) to process.
|
|
71
|
+
The name(s) must be UPPER CASE.
|
|
72
|
+
To specify multiple campaigns, write i.e.: --campaign_names 'IPEX IMPACTS'
|
|
73
|
+
station_names : str
|
|
74
|
+
Station names.
|
|
75
|
+
To specify multiple stations, write i.e.: --station_names 'station1 station2'
|
|
76
|
+
force : bool
|
|
77
|
+
If True, overwrite existing data into destination directories.
|
|
78
|
+
If False, raise an error if there are already data into destination directories.
|
|
79
|
+
The default is False.
|
|
80
|
+
verbose : bool
|
|
81
|
+
Whether to print detailed processing information into terminal.
|
|
82
|
+
The default is False.
|
|
83
|
+
parallel : bool
|
|
84
|
+
If True, the files are processed simultaneously in multiple processes.
|
|
85
|
+
Each process will use a single thread.
|
|
86
|
+
By default, the number of process is defined with os.cpu_count().
|
|
87
|
+
However, you can customize it by typing: DASK_NUM_WORKERS=4 disdrodb_run_l0a
|
|
88
|
+
If False, the files are processed sequentially in a single process.
|
|
89
|
+
If False, multi-threading is automatically exploited to speed up I/0 tasks.
|
|
90
|
+
debugging_mode : bool
|
|
91
|
+
If True, it reduces the amount of data to process.
|
|
92
|
+
It processes just the first 3 raw data files for each station.
|
|
93
|
+
The default is False.
|
|
94
|
+
data_archive_dir : str
|
|
95
|
+
DISDRODB Data Archive directory
|
|
96
|
+
Format: <...>/DISDRODB
|
|
97
|
+
If not specified, uses path specified in the DISDRODB active configuration.
|
|
98
|
+
"""
|
|
99
|
+
from disdrodb.routines import run_l1
|
|
100
|
+
|
|
101
|
+
# Parse data_sources, campaign_names and station arguments
|
|
102
|
+
data_archive_dir = parse_archive_dir(data_archive_dir)
|
|
103
|
+
metadata_archive_dir = parse_archive_dir(metadata_archive_dir)
|
|
104
|
+
data_sources = parse_arg_to_list(data_sources)
|
|
105
|
+
campaign_names = parse_arg_to_list(campaign_names)
|
|
106
|
+
station_names = parse_arg_to_list(station_names)
|
|
107
|
+
|
|
108
|
+
# Run processing
|
|
109
|
+
run_l1(
|
|
110
|
+
# DISDRODB root directories
|
|
111
|
+
data_archive_dir=data_archive_dir,
|
|
112
|
+
metadata_archive_dir=metadata_archive_dir,
|
|
113
|
+
# Station options
|
|
114
|
+
data_sources=data_sources,
|
|
115
|
+
campaign_names=campaign_names,
|
|
116
|
+
station_names=station_names,
|
|
117
|
+
# Processing options
|
|
118
|
+
force=force,
|
|
119
|
+
verbose=verbose,
|
|
120
|
+
debugging_mode=debugging_mode,
|
|
121
|
+
parallel=parallel,
|
|
122
|
+
)
|
|
@@ -0,0 +1,121 @@
|
|
|
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
|
+
"""Script to run the DISDRODB L1 station processing."""
|
|
18
|
+
import sys
|
|
19
|
+
from typing import Optional
|
|
20
|
+
|
|
21
|
+
import click
|
|
22
|
+
|
|
23
|
+
from disdrodb.utils.cli import (
|
|
24
|
+
click_data_archive_dir_option,
|
|
25
|
+
click_metadata_archive_dir_option,
|
|
26
|
+
click_processing_options,
|
|
27
|
+
click_station_arguments,
|
|
28
|
+
parse_archive_dir,
|
|
29
|
+
)
|
|
30
|
+
|
|
31
|
+
sys.tracebacklimit = 0 # avoid full traceback error if occur
|
|
32
|
+
|
|
33
|
+
# -------------------------------------------------------------------------.
|
|
34
|
+
# Click Command Line Interface decorator
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
@click.command()
|
|
38
|
+
@click_station_arguments
|
|
39
|
+
@click_processing_options
|
|
40
|
+
@click_data_archive_dir_option
|
|
41
|
+
@click_metadata_archive_dir_option
|
|
42
|
+
def disdrodb_run_l1_station(
|
|
43
|
+
# Station arguments
|
|
44
|
+
data_source: str,
|
|
45
|
+
campaign_name: str,
|
|
46
|
+
station_name: str,
|
|
47
|
+
# Processing options
|
|
48
|
+
force: bool = False,
|
|
49
|
+
verbose: bool = False,
|
|
50
|
+
parallel: bool = True,
|
|
51
|
+
debugging_mode: bool = False,
|
|
52
|
+
# DISDRODB root directories
|
|
53
|
+
data_archive_dir: Optional[str] = None,
|
|
54
|
+
metadata_archive_dir: Optional[str] = None,
|
|
55
|
+
):
|
|
56
|
+
"""
|
|
57
|
+
Run the L1 processing of a specific DISDRODB station from the terminal.
|
|
58
|
+
|
|
59
|
+
Parameters
|
|
60
|
+
----------
|
|
61
|
+
data_source : str
|
|
62
|
+
Institution name (when campaign data spans more than 1 country),
|
|
63
|
+
or country (when all campaigns (or sensor networks) are inside a given country).
|
|
64
|
+
Must be UPPER CASE.
|
|
65
|
+
campaign_name : str
|
|
66
|
+
Campaign name. Must be UPPER CASE.
|
|
67
|
+
station_name : str
|
|
68
|
+
Station name
|
|
69
|
+
force : bool
|
|
70
|
+
If True, overwrite existing data into destination directories.
|
|
71
|
+
If False, raise an error if there are already data into destination directories.
|
|
72
|
+
The default is False.
|
|
73
|
+
verbose : bool
|
|
74
|
+
Whether to print detailed processing information into terminal.
|
|
75
|
+
The default is True.
|
|
76
|
+
parallel : bool
|
|
77
|
+
If True, the files are processed simultaneously in multiple processes.
|
|
78
|
+
Each process will use a single thread.
|
|
79
|
+
By default, the number of process is defined with os.cpu_count().
|
|
80
|
+
However, you can customize it by typing: DASK_NUM_WORKERS=4 disdrodb_run_l0a_station
|
|
81
|
+
If False, the files are processed sequentially in a single process.
|
|
82
|
+
If False, multi-threading is automatically exploited to speed up I/0 tasks.
|
|
83
|
+
debugging_mode : bool
|
|
84
|
+
If True, it reduces the amount of data to process.
|
|
85
|
+
It processes just the first 3 raw data files.
|
|
86
|
+
The default is False.
|
|
87
|
+
data_archive_dir : str
|
|
88
|
+
DISDRODB Data Archive directory.
|
|
89
|
+
Format: <...>/DISDRODB
|
|
90
|
+
If not specified, uses path specified in the DISDRODB active configuration.
|
|
91
|
+
"""
|
|
92
|
+
from disdrodb.l1.routines import run_l1_station
|
|
93
|
+
from disdrodb.utils.dask import close_dask_cluster, initialize_dask_cluster
|
|
94
|
+
|
|
95
|
+
data_archive_dir = parse_archive_dir(data_archive_dir)
|
|
96
|
+
metadata_archive_dir = parse_archive_dir(metadata_archive_dir)
|
|
97
|
+
# -------------------------------------------------------------------------.
|
|
98
|
+
# If parallel=True, set the dask environment
|
|
99
|
+
if parallel:
|
|
100
|
+
cluster, client = initialize_dask_cluster()
|
|
101
|
+
|
|
102
|
+
# -------------------------------------------------------------------------.
|
|
103
|
+
run_l1_station(
|
|
104
|
+
# Station arguments
|
|
105
|
+
data_source=data_source,
|
|
106
|
+
campaign_name=campaign_name,
|
|
107
|
+
station_name=station_name,
|
|
108
|
+
# Processing options
|
|
109
|
+
force=force,
|
|
110
|
+
verbose=verbose,
|
|
111
|
+
debugging_mode=debugging_mode,
|
|
112
|
+
parallel=parallel,
|
|
113
|
+
# DISDRODB root directories
|
|
114
|
+
data_archive_dir=data_archive_dir,
|
|
115
|
+
metadata_archive_dir=metadata_archive_dir,
|
|
116
|
+
)
|
|
117
|
+
|
|
118
|
+
# -------------------------------------------------------------------------.
|
|
119
|
+
# Close the cluster
|
|
120
|
+
if parallel:
|
|
121
|
+
close_dask_cluster(cluster, client)
|