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.
- disdrodb/__init__.py +2 -0
- disdrodb/_config.py +1 -0
- disdrodb/_version.py +2 -2
- disdrodb/accessor/__init__.py +1 -0
- disdrodb/accessor/methods.py +1 -0
- disdrodb/api/checks.py +2 -4
- disdrodb/api/io.py +224 -24
- disdrodb/api/path.py +2 -4
- disdrodb/cli/disdrodb_check_metadata_archive.py +1 -0
- disdrodb/cli/disdrodb_check_products_options.py +1 -0
- disdrodb/cli/disdrodb_create_summary.py +6 -6
- disdrodb/cli/disdrodb_create_summary_station.py +2 -2
- disdrodb/cli/disdrodb_data_archive_directory.py +1 -0
- disdrodb/cli/disdrodb_download_archive.py +5 -6
- disdrodb/cli/disdrodb_download_metadata_archive.py +1 -0
- disdrodb/cli/disdrodb_download_station.py +2 -3
- disdrodb/cli/disdrodb_initialize_station.py +3 -3
- disdrodb/cli/disdrodb_metadata_archive_directory.py +1 -0
- disdrodb/cli/disdrodb_open_data_archive.py +1 -2
- disdrodb/cli/disdrodb_open_logs_directory.py +2 -3
- disdrodb/cli/disdrodb_open_metadata_archive.py +1 -2
- disdrodb/cli/disdrodb_open_metadata_directory.py +2 -3
- disdrodb/cli/disdrodb_open_product_directory.py +1 -2
- disdrodb/cli/disdrodb_open_readers_directory.py +1 -0
- disdrodb/cli/disdrodb_run.py +6 -6
- disdrodb/cli/disdrodb_run_l0.py +6 -6
- disdrodb/cli/disdrodb_run_l0_station.py +3 -3
- disdrodb/cli/disdrodb_run_l0a.py +6 -6
- disdrodb/cli/disdrodb_run_l0a_station.py +3 -3
- disdrodb/cli/disdrodb_run_l0b.py +6 -6
- disdrodb/cli/disdrodb_run_l0b_station.py +3 -3
- disdrodb/cli/disdrodb_run_l0c.py +6 -6
- disdrodb/cli/disdrodb_run_l0c_station.py +3 -3
- disdrodb/cli/disdrodb_run_l1.py +6 -6
- disdrodb/cli/disdrodb_run_l1_station.py +3 -3
- disdrodb/cli/disdrodb_run_l2e.py +6 -6
- disdrodb/cli/disdrodb_run_l2e_station.py +3 -3
- disdrodb/cli/disdrodb_run_l2m.py +6 -6
- disdrodb/cli/disdrodb_run_l2m_station.py +3 -3
- disdrodb/cli/disdrodb_run_station.py +3 -3
- disdrodb/cli/disdrodb_upload_archive.py +6 -7
- disdrodb/cli/disdrodb_upload_station.py +3 -4
- disdrodb/configs.py +7 -8
- disdrodb/constants.py +1 -0
- disdrodb/data_transfer/download_data.py +8 -8
- disdrodb/data_transfer/upload_data.py +6 -8
- disdrodb/data_transfer/zenodo.py +1 -1
- disdrodb/fall_velocity/__init__.py +1 -0
- disdrodb/fall_velocity/graupel.py +1 -0
- disdrodb/fall_velocity/hail.py +1 -0
- disdrodb/fall_velocity/rain.py +1 -0
- disdrodb/issue/checks.py +1 -0
- disdrodb/issue/reader.py +1 -0
- disdrodb/issue/writer.py +1 -2
- disdrodb/l0/__init__.py +1 -0
- disdrodb/l0/check_configs.py +21 -23
- disdrodb/l0/check_standards.py +0 -1
- disdrodb/l0/configs/LPM/l0a_encodings.yml +17 -17
- disdrodb/l0/configs/LPM/l0b_cf_attrs.yml +55 -55
- disdrodb/l0/configs/LPM/l0b_encodings.yml +17 -17
- disdrodb/l0/configs/LPM/raw_data_format.yml +17 -17
- disdrodb/l0/configs/LPM_V0/l0a_encodings.yml +2 -2
- disdrodb/l0/configs/LPM_V0/l0b_cf_attrs.yml +2 -2
- disdrodb/l0/configs/LPM_V0/l0b_encodings.yml +2 -2
- disdrodb/l0/configs/LPM_V0/raw_data_format.yml +2 -2
- disdrodb/l0/l0_reader.py +1 -0
- disdrodb/l0/l0a_processing.py +5 -5
- disdrodb/l0/l0b_nc_processing.py +1 -2
- disdrodb/l0/l0b_processing.py +1 -13
- disdrodb/l0/l0c_processing.py +2 -1
- disdrodb/l0/readers/LPM/ARM/ARM_LPM.py +1 -0
- disdrodb/l0/readers/LPM/AUSTRALIA/MELBOURNE_2007_LPM.py +17 -17
- disdrodb/l0/readers/LPM/BRAZIL/CHUVA_LPM.py +17 -17
- disdrodb/l0/readers/LPM/BRAZIL/GOAMAZON_LPM.py +17 -17
- disdrodb/l0/readers/LPM/GERMANY/DWD.py +55 -52
- disdrodb/l0/readers/LPM/ITALY/GID_LPM.py +18 -17
- disdrodb/l0/readers/LPM/ITALY/GID_LPM_AQ.py +277 -0
- disdrodb/l0/readers/LPM/ITALY/GID_LPM_PI.py +18 -17
- disdrodb/l0/readers/LPM/ITALY/GID_LPM_T.py +18 -17
- disdrodb/l0/readers/LPM/ITALY/GID_LPM_W.py +18 -18
- disdrodb/l0/readers/LPM/KIT/CHWALA.py +18 -17
- disdrodb/l0/readers/LPM/NETHERLANDS/DELFT_RWANDA_LPM_NC.py +17 -17
- disdrodb/l0/readers/LPM/NORWAY/HAUKELISETER_LPM.py +18 -17
- disdrodb/l0/readers/LPM/NORWAY/NMBU_LPM.py +18 -17
- disdrodb/l0/readers/LPM/SLOVENIA/ARSO.py +18 -17
- disdrodb/l0/readers/LPM/SLOVENIA/UL.py +18 -17
- disdrodb/l0/readers/LPM/SWITZERLAND/INNERERIZ_LPM.py +18 -17
- disdrodb/l0/readers/LPM/UK/WITHWORTH_LPM.py +18 -17
- disdrodb/l0/readers/LPM/USA/CHARLESTON.py +18 -17
- disdrodb/l0/readers/LPM/USA/DEVEX.py +255 -0
- disdrodb/l0/readers/LPM_V0/BELGIUM/ULIEGE.py +2 -2
- disdrodb/l0/readers/LPM_V0/ITALY/GID_LPM_V0.py +3 -2
- disdrodb/l0/readers/ODM470/OCEAN/OCEANRAIN.py +1 -0
- disdrodb/l0/readers/PARSIVEL/BASQUECOUNTRY/EUSKALMET_OTT.py +1 -0
- disdrodb/l0/readers/PARSIVEL/CHINA/CHONGQING.py +1 -0
- disdrodb/l0/readers/PARSIVEL/EPFL/ARCTIC_2021.py +1 -0
- disdrodb/l0/readers/PARSIVEL/EPFL/COMMON_2011.py +1 -0
- disdrodb/l0/readers/PARSIVEL/EPFL/DAVOS_2009_2011.py +1 -0
- disdrodb/l0/readers/PARSIVEL/EPFL/EPFL_2009.py +1 -0
- disdrodb/l0/readers/PARSIVEL/EPFL/EPFL_ROOF_2008.py +1 -0
- disdrodb/l0/readers/PARSIVEL/EPFL/EPFL_ROOF_2010.py +1 -0
- disdrodb/l0/readers/PARSIVEL/EPFL/EPFL_ROOF_2011.py +1 -0
- disdrodb/l0/readers/PARSIVEL/EPFL/EPFL_ROOF_2012.py +1 -0
- disdrodb/l0/readers/PARSIVEL/EPFL/GENEPI_2007.py +1 -0
- disdrodb/l0/readers/PARSIVEL/EPFL/GRAND_ST_BERNARD_2007.py +1 -0
- disdrodb/l0/readers/PARSIVEL/EPFL/GRAND_ST_BERNARD_2007_2.py +1 -0
- disdrodb/l0/readers/PARSIVEL/EPFL/HPICONET_2010.py +1 -0
- disdrodb/l0/readers/PARSIVEL/EPFL/HYMEX_LTE_SOP2.py +1 -0
- disdrodb/l0/readers/PARSIVEL/EPFL/HYMEX_LTE_SOP3.py +1 -0
- disdrodb/l0/readers/PARSIVEL/EPFL/HYMEX_LTE_SOP4.py +1 -0
- disdrodb/l0/readers/PARSIVEL/EPFL/PARADISO_2014.py +1 -0
- disdrodb/l0/readers/PARSIVEL/EPFL/PARSIVEL_2007.py +1 -0
- disdrodb/l0/readers/PARSIVEL/EPFL/RACLETS_2019.py +1 -0
- disdrodb/l0/readers/PARSIVEL/EPFL/RACLETS_2019_WJF.py +1 -0
- disdrodb/l0/readers/PARSIVEL/EPFL/RIETHOLZBACH_2011.py +1 -0
- disdrodb/l0/readers/PARSIVEL/EPFL/SAMOYLOV_2017.py +1 -0
- disdrodb/l0/readers/PARSIVEL/EPFL/SAMOYLOV_2019.py +1 -0
- disdrodb/l0/readers/PARSIVEL/EPFL/UNIL_2022.py +1 -0
- disdrodb/l0/readers/PARSIVEL/SLOVENIA/UL.py +1 -0
- disdrodb/l0/readers/PARSIVEL2/ARM/ARM_PARSIVEL2.py +1 -0
- disdrodb/l0/readers/PARSIVEL2/BASQUECOUNTRY/EUSKALMET_OTT2.py +1 -0
- disdrodb/l0/readers/PARSIVEL2/BELGIUM/ILVO.py +1 -0
- disdrodb/l0/readers/PARSIVEL2/DENMARK/EROSION_nc.py +1 -0
- disdrodb/l0/readers/PARSIVEL2/DENMARK/EROSION_raw.py +1 -0
- disdrodb/l0/readers/PARSIVEL2/FRANCE/ENPC_PARSIVEL2.py +1 -0
- disdrodb/l0/readers/PARSIVEL2/FRANCE/OSUG.py +1 -1
- disdrodb/l0/readers/PARSIVEL2/ITALY/HYDROX.py +1 -0
- disdrodb/l0/readers/PARSIVEL2/MEXICO/OH_IIUNAM_nc.py +1 -0
- disdrodb/l0/readers/PARSIVEL2/NCAR/FARM_PARSIVEL2.py +1 -0
- disdrodb/l0/readers/PARSIVEL2/NCAR/PERILS_MIPS.py +1 -0
- disdrodb/l0/readers/PARSIVEL2/NCAR/PERILS_PIPS.py +1 -0
- disdrodb/l0/readers/PARSIVEL2/NCAR/VORTEX_SE_2016_P1.py +1 -0
- disdrodb/l0/readers/PARSIVEL2/NCAR/VORTEX_SE_2016_PIPS.py +1 -0
- disdrodb/l0/readers/PARSIVEL2/PHILIPPINES/PAGASA.py +1 -0
- disdrodb/l0/readers/PARSIVEL2/SPAIN/GRANADA.py +1 -0
- disdrodb/l0/readers/PARSIVEL2/SWEDEN/SMHI.py +1 -0
- disdrodb/l0/readers/PARSIVEL2/USA/CW3E.py +1 -0
- disdrodb/l0/readers/PWS100/AUSTRIA/HOAL.py +1 -0
- disdrodb/l0/readers/PWS100/FRANCE/ENPC_PWS100.py +1 -0
- disdrodb/l0/readers/PWS100/FRANCE/ENPC_PWS100_SIRTA.py +1 -0
- disdrodb/l0/readers/RD80/NOAA/PSL_RD80.py +1 -0
- disdrodb/l0/readers/SWS250/BELGIUM/KMI.py +1 -0
- disdrodb/l0/readers/template_reader_raw_netcdf_data.py +1 -0
- disdrodb/l0/readers/template_reader_raw_text_data.py +1 -0
- disdrodb/l0/template_tools.py +6 -8
- disdrodb/l1/__init__.py +1 -0
- disdrodb/l1/classification.py +1 -0
- disdrodb/l1/resampling.py +5 -0
- disdrodb/l1_env/routines.py +1 -0
- disdrodb/l2/__init__.py +1 -0
- disdrodb/l2/empirical_dsd.py +1 -0
- disdrodb/l2/processing.py +1 -0
- disdrodb/metadata/checks.py +9 -10
- disdrodb/metadata/download.py +1 -0
- disdrodb/metadata/geolocation.py +2 -1
- disdrodb/metadata/info.py +2 -2
- disdrodb/metadata/search.py +0 -1
- disdrodb/physics/atmosphere.py +1 -0
- disdrodb/physics/water.py +1 -0
- disdrodb/physics/wrappers.py +1 -0
- disdrodb/psd/__init__.py +0 -1
- disdrodb/psd/fitting.py +1 -0
- disdrodb/psd/models.py +1 -0
- disdrodb/routines/__init__.py +1 -0
- disdrodb/routines/l0.py +13 -9
- disdrodb/routines/l1.py +17 -12
- disdrodb/routines/l2.py +4 -5
- disdrodb/routines/options.py +1 -0
- disdrodb/routines/options_validation.py +12 -12
- disdrodb/routines/wrappers.py +33 -33
- disdrodb/scattering/__init__.py +0 -1
- disdrodb/scattering/permittivity.py +1 -0
- disdrodb/scattering/routines.py +3 -3
- disdrodb/summary/routines.py +12 -5
- disdrodb/utils/archiving.py +2 -1
- disdrodb/utils/attrs.py +3 -2
- disdrodb/utils/compression.py +1 -2
- disdrodb/utils/coords.py +45 -0
- disdrodb/utils/dask.py +5 -2
- disdrodb/utils/dataframe.py +4 -3
- disdrodb/utils/decorators.py +2 -1
- disdrodb/utils/directories.py +2 -2
- disdrodb/utils/encoding.py +2 -1
- disdrodb/utils/manipulations.py +1 -0
- disdrodb/utils/pydantic.py +1 -0
- disdrodb/utils/routines.py +1 -0
- disdrodb/utils/time.py +3 -2
- disdrodb/utils/warnings.py +1 -0
- disdrodb/utils/writer.py +4 -0
- disdrodb/utils/xarray.py +1 -0
- disdrodb/viz/plots.py +1 -0
- {disdrodb-0.3.0.dist-info → disdrodb-0.5.0.dist-info}/METADATA +4 -3
- disdrodb-0.5.0.dist-info/RECORD +361 -0
- {disdrodb-0.3.0.dist-info → disdrodb-0.5.0.dist-info}/WHEEL +1 -1
- disdrodb-0.3.0.dist-info/RECORD +0 -358
- {disdrodb-0.3.0.dist-info → disdrodb-0.5.0.dist-info}/entry_points.txt +0 -0
- {disdrodb-0.3.0.dist-info → disdrodb-0.5.0.dist-info}/licenses/LICENSE +0 -0
- {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 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
|
"""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
|
|
@@ -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 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 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
|
|
disdrodb/l0/template_tools.py
CHANGED
|
@@ -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:
|
|
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:
|
|
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:
|
|
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
disdrodb/l1/classification.py
CHANGED
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
|
disdrodb/l1_env/routines.py
CHANGED
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__ = [
|
disdrodb/l2/empirical_dsd.py
CHANGED
|
@@ -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
disdrodb/metadata/checks.py
CHANGED
|
@@ -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:
|
|
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:
|
|
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:
|
|
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:
|
|
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:
|
|
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:
|
|
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:
|
|
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:
|
|
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:
|
|
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
|
disdrodb/metadata/download.py
CHANGED
|
@@ -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
|
disdrodb/metadata/geolocation.py
CHANGED
|
@@ -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:
|
|
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
|
disdrodb/metadata/search.py
CHANGED
|
@@ -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
|
|