disdrodb package#
Subpackages#
- disdrodb.accessor package
- disdrodb.api package
- Submodules
- disdrodb.api.checks module
check_campaign_name()check_campaign_names()check_data_archive_dir()check_data_availability()check_data_source()check_data_sources()check_directories_inside()check_filepaths()check_folder_partitioning()check_invalid_fields_policy()check_issue_dir()check_issue_file()check_measurement_interval()check_measurement_intervals()check_metadata_archive_dir()check_metadata_file()check_path()check_path_is_a_directory()check_product()check_product_kwargs()check_rolling()check_sample_interval()check_scattering_table_dir()check_sensor_name()check_start_end_time()check_station_inputs()check_station_names()check_time()check_url()check_valid_fields()get_current_utc_time()has_available_data()select_required_product_kwargs()
- disdrodb.api.configs module
- disdrodb.api.create_directories module
- disdrodb.api.info module
check_groups()get_campaign_name_from_filepaths()get_end_time_from_filepaths()get_info_from_filepath()get_key_from_filepath()get_key_from_filepaths()get_product_from_filepaths()get_sample_interval_from_filepaths()get_season()get_start_end_time_from_filepaths()get_start_time_from_filepaths()get_station_name_from_filepaths()get_time_component()get_version_from_filepaths()group_filepaths()infer_archive_dir_from_path()infer_campaign_name_from_path()infer_data_source_from_path()infer_disdrodb_tree_path()infer_disdrodb_tree_path_components()infer_path_info_dict()infer_path_info_tuple()
- disdrodb.api.io module
filter_by_time()filter_filepaths()find_files()is_within_time_period()open_data_archive()open_dataset()open_file_explorer()open_logs_directory()open_metadata_archive()open_metadata_directory()open_netcdf_files()open_product_directory()open_raw_files()open_readers_directory()remove_product()
- disdrodb.api.path module
define_campaign_dir()define_config_dir()define_data_dir()define_data_source_dir()define_disdrodb_path()define_file_folder_path()define_filename()define_issue_dir()define_issue_filepath()define_l0a_filename()define_l0b_filename()define_l0c_filename()define_l1_filename()define_l2e_filename()define_l2m_filename()define_logs_dir()define_metadata_dir()define_metadata_filepath()define_partitioning_tree()define_product_dir_tree()define_station_dir()define_temporal_resolution()
- disdrodb.api.search module
available_campaigns()available_data_sources()available_stations()get_required_product()is_disdrodb_data_url_specified()keep_list_info_elements_with_product_data()keep_list_info_elements_with_product_directory()keep_list_info_with_disdrodb_data_url()list_campaign_names()list_data_sources()list_station_names()
- Module contents
- disdrodb.data_transfer package
- disdrodb.issue package
- disdrodb.l0 package
- Subpackages
- Submodules
- disdrodb.l0.check_configs module
L0BEncodingSchemaL0BEncodingSchema.check_chunksizes_and_zlib()L0BEncodingSchema.check_contiguous_and_fletcher32()L0BEncodingSchema.check_contiguous_and_zlib()L0BEncodingSchema.chunksizesL0BEncodingSchema.complevelL0BEncodingSchema.contiguousL0BEncodingSchema.dtypeL0BEncodingSchema.fletcher32L0BEncodingSchema.model_configL0BEncodingSchema.model_post_init()L0BEncodingSchema.shuffleL0BEncodingSchema.zlib
RawDataFormatSchemaRawDataFormatSchema.check_list_length()RawDataFormatSchema.data_rangeRawDataFormatSchema.dimension_orderRawDataFormatSchema.field_numberRawDataFormatSchema.model_configRawDataFormatSchema.n_charactersRawDataFormatSchema.n_decimalsRawDataFormatSchema.n_digitsRawDataFormatSchema.n_naturalsRawDataFormatSchema.n_valuesRawDataFormatSchema.nan_flagsRawDataFormatSchema.valid_values
SchemaValidationExceptioncheck_all_sensors_configs()check_l0a_encoding()check_l0b_encoding()check_sensor_configs()
- disdrodb.l0.check_standards module
- disdrodb.l0.l0_reader module
available_readers()check_metadata_reader()check_reader_arguments()check_reader_exists()check_reader_reference()check_software_readers()define_reader_path()define_readers_directory()get_reader()get_reader_from_metadata()get_specific_readers_path()get_specific_readers_references()get_station_reader()is_documented_by()list_readers_paths()list_readers_references()reader_generic_docstring()
- disdrodb.l0.l0a_processing module
cast_column_dtypes()check_matching_column_number()coerce_corrupted_values_to_nan()concatenate_dataframe()drop_time_periods()drop_timesteps()generate_l0a()is_raw_array_string_not_corrupted()preprocess_reader_kwargs()read_l0a_dataframe()read_raw_text_file()remove_corrupted_rows()remove_duplicated_timesteps()remove_issue_timesteps()remove_rows_with_missing_time()replace_nan_flags()sanitize_df()set_nan_invalid_values()set_nan_outside_data_range()strip_delimiter()strip_delimiter_from_raw_arrays()strip_string_spaces()write_l0a()
- disdrodb.l0.l0b_nc_processing module
add_dataset_missing_variables()drop_time_periods()drop_timesteps()generate_l0b_from_nc()open_raw_netcdf_file()remove_issue_timesteps()rename_dataset()replace_custom_nan_flags()replace_nan_flags()sanitize_ds()set_nan_invalid_values()set_nan_outside_data_range()standardize_raw_dataset()subset_dataset()
- disdrodb.l0.l0b_processing module
- disdrodb.l0.l0c_processing module
- disdrodb.l0.routines module
- disdrodb.l0.standards module
allowed_l0_variables()get_bin_coords_dict()get_data_format_dict()get_data_range_dict()get_diameter_bin_center()get_diameter_bin_lower()get_diameter_bin_upper()get_diameter_bin_width()get_diameter_bins_dict()get_dims_size_dict()get_field_nchar_dict()get_field_ndigits_decimals_dict()get_field_ndigits_dict()get_field_ndigits_natural_dict()get_l0a_dtype()get_l0a_encodings_dict()get_l0b_cf_attrs_dict()get_l0b_encodings_dict()get_n_diameter_bins()get_n_velocity_bins()get_nan_flags_dict()get_raw_array_dims_order()get_raw_array_nvalues()get_sensor_logged_variables()get_valid_coordinates_names()get_valid_dimension_names()get_valid_names()get_valid_values_dict()get_valid_variable_names()get_variables_dimension()get_velocity_bin_center()get_velocity_bin_lower()get_velocity_bin_upper()get_velocity_bin_width()get_velocity_bins_dict()
- disdrodb.l0.template_tools module
check_column_names()get_decimal_ndigits()get_df_columns_unique_values_dict()get_natural_ndigits()get_nchar()get_ndigits()get_unique_sorted_values()infer_column_names()print_allowed_column_names()print_df_column_names()print_df_columns_unique_values()print_df_first_n_rows()print_df_random_n_rows()print_df_summary_stats()print_df_with_any_nan_rows()str_has_decimal_digits()str_is_integer()str_is_number()
- Module contents
- disdrodb.l1 package
- Submodules
- disdrodb.l1.beard_model module
get_air_density()get_air_dynamic_viscosity()get_air_pressure_at_height()get_air_temperature_at_height()get_drag_coefficient()get_fall_velocity_beard_1976()get_gravitational_acceleration()get_pure_water_compressibility()get_pure_water_density()get_pure_water_surface_tension()get_raindrop_reynolds_number()get_vapor_actual_pressure()get_vapor_actual_pressure_at_height()get_vapor_saturation_pressure()get_water_density()retrieve_fall_velocity()
- disdrodb.l1.fall_velocity module
- disdrodb.l1.filters module
- disdrodb.l1.processing module
- disdrodb.l1.resampling module
- disdrodb.l1.routines module
- Module contents
- disdrodb.l1_env package
- disdrodb.l2 package
- Submodules
- disdrodb.l2.empirical_dsd module
add_bins_metrics()compute_integral_parameters()compute_qc_bins_metrics()compute_spectrum_parameters()count_bins_with_drops()get_bin_dimensions()get_drop_average_velocity()get_drop_number_concentration()get_drop_volume()get_effective_sampling_area()get_equivalent_reflectivity_factor()get_equivalent_reflectivity_spectrum()get_kinetic_energy_spectrum()get_kinetic_energy_variables()get_kinetic_energy_variables_from_drop_number()get_liquid_water_content()get_liquid_water_content_from_moments()get_liquid_water_spectrum()get_mean_volume_drop_diameter()get_median_volume_drop_diameter()get_min_max_diameter()get_mode_diameter()get_moment()get_normalized_intercept_parameter()get_normalized_intercept_parameter_from_moments()get_quantile_volume_drop_diameter()get_rain_accumulation()get_rain_rate()get_rain_rate_contribution()get_rain_rate_from_drop_number()get_rain_rate_spectrum()get_std_volume_drop_diameter()get_total_number_concentration()
- disdrodb.l2.event module
- disdrodb.l2.processing module
- disdrodb.l2.routines module
- Module contents
- disdrodb.metadata package
- Submodules
- disdrodb.metadata.checks module
check_metadata_archive()check_metadata_archive_campaign_name()check_metadata_archive_data_source()check_metadata_archive_geolocation()check_metadata_archive_keys()check_metadata_archive_reader()check_metadata_archive_sensor_name()check_metadata_archive_station_name()check_station_metadata()check_station_metadata_geolocation()get_metadata_invalid_keys()get_metadata_missing_keys()identify_empty_metadata_keys()identify_missing_metadata_coords()
- disdrodb.metadata.download module
- disdrodb.metadata.geolocation module
- disdrodb.metadata.info module
- disdrodb.metadata.manipulation module
- disdrodb.metadata.reader module
- disdrodb.metadata.search module
- disdrodb.metadata.standards module
- disdrodb.metadata.writer module
- Module contents
- disdrodb.psd package
- Submodules
- disdrodb.psd.fitting module
apply_exponential_gs()apply_gamma_gs()apply_lognormal_gs()apply_normalized_gamma_gs()available_mom_methods()available_optimization()check_likelihood()check_mom_methods()check_optimization()check_optimization_kwargs()check_optimizer()check_probability_method()check_psd_model()check_target()check_transformation()check_truncated_likelihood()compute_gof_stats()compute_negative_log_likelihood()estimate_exponential_parameters()estimate_gamma_parameters()estimate_lognormal_parameters()estimate_model_parameters()get_adjusted_nt()get_expected_probabilities()get_exponential_parameters()get_exponential_parameters_M34()get_exponential_parameters_Zhang2008()get_exponential_parameters_gs()get_gamma_parameters()get_gamma_parameters_M012()get_gamma_parameters_M234()get_gamma_parameters_M246()get_gamma_parameters_M346()get_gamma_parameters_M456()get_gamma_parameters_gs()get_gamma_parameters_johnson2014()get_gs_parameters()get_lognormal_parameters()get_lognormal_parameters_M346()get_lognormal_parameters_gs()get_ml_parameters()get_mom_parameters()get_normalized_gamma_parameters_gs()
- disdrodb.psd.models module
BinnedPSDExponentialPSDGammaPSDLognormalPSDNormalizedGammaPSDPSDXarrayPSDavailable_psd_models()check_diameter_inputs()check_input_parameters()check_psd_model()create_psd()define_interpolator()get_exponential_moment()get_gamma_moment_v1()get_gamma_moment_v2()get_lognormal_moment()get_psd_model()get_psd_model_formula()get_required_parameters()is_scalar()
- Module contents
- disdrodb.scattering package
- Submodules
- disdrodb.scattering.axis_ratio module
available_axis_ratio_models()check_axis_ratio_model()get_axis_ratio()get_axis_ratio_andsager_1999()get_axis_ratio_battaglia_2010()get_axis_ratio_beard_1987()get_axis_ratio_brandes_2002()get_axis_ratio_model()get_axis_ratio_pruppacher_1970()get_axis_ratio_thurai_2005()get_axis_ratio_thurai_2007()
- disdrodb.scattering.permittivity module
available_permittivity_models()check_frequency_validity_range()check_permittivity_model()check_temperature_validity_range()ensure_array()get_rain_refractive_index_ellison2005()get_rain_refractive_index_liebe1991()get_rain_refractive_index_liebe1991_single()get_rain_refractive_index_turner2016()get_rayleigh_dielectric_factor()get_refractive_index()get_refractive_index_function()
- disdrodb.scattering.routines module
available_radar_bands()calculate_scatterer()check_radar_band()compute_radar_variables()ensure_numerical_frequency()ensure_rounded_unique_array()frequency_to_wavelength()get_backward_geometry()get_empirical_radar_parameters()get_forward_geometry()get_list_simulations_params()get_model_radar_parameters()get_psd_parameters()get_radar_parameters()initialize_scatterer()load_scatterer()wavelength_to_frequency()
- Module contents
- disdrodb.summary package
- Submodules
- disdrodb.summary.routines module
create_l2_dataframe()create_nd_dataframe()create_station_summary()create_table_dsd_summary()create_table_events_summary()create_table_rain_summary()define_filename()define_lognorm_max_value()fit_powerlaw()generate_station_summary()get_symbol_str()inverse_powerlaw_parameters()is_latex_engine_available()plot_ADP_KDP_ZDR()plot_A_KDP()plot_A_KDP_ZDR()plot_A_R()plot_A_Z()plot_KDP_Z()plot_KDP_Z_ZDR()plot_KED_R()plot_KEF_R()plot_KEF_Z()plot_R_KDP()plot_R_Z()plot_TKE_Z()plot_ZDR_Z()plot_dmax_relationships()plot_drop_spectrum()plot_dsd_density()plot_dsd_params_density()plot_dsd_params_relationships()plot_dsd_with_dense_lines()plot_kinetic_energy_relationships()plot_normalized_dsd_density()plot_radar_relationships()plot_raw_and_filtered_spectrums()predict_from_inverse_powerlaw()predict_from_powerlaw()prepare_latex_table_dsd_summary()prepare_latex_table_events_summary()prepare_summary_dataset()save_table_to_pdf()
- Module contents
- disdrodb.utils package
- Submodules
- disdrodb.utils.attrs module
- disdrodb.utils.cli module
- disdrodb.utils.compression module
- disdrodb.utils.dask module
- disdrodb.utils.dataframe module
- disdrodb.utils.decorators module
- disdrodb.utils.directories module
check_directory_exists()check_glob_pattern()check_glob_patterns()contains_files()contains_netcdf_or_parquet_files()copy_file()count_directories()count_files()create_directory()create_required_directory()ensure_string_path()is_empty_directory()list_directories()list_files()list_paths()remove_if_exists()remove_path_trailing_slash()rmtree_windows()
- disdrodb.utils.encoding module
- disdrodb.utils.list module
- disdrodb.utils.logger module
- disdrodb.utils.manipulations module
- disdrodb.utils.subsetting module
- disdrodb.utils.time module
check_freq()ensure_sample_interval_in_seconds()ensure_sorted_by_time()ensure_timedelta_seconds_interval()generate_time_blocks()get_dataframe_start_end_time()get_dataset_start_end_time()get_file_start_end_time()get_problematic_timestep_indices()get_resampling_information()infer_sample_interval()regularize_dataset()regularize_timesteps()seconds_to_temporal_resolution()temporal_resolution_to_seconds()
- disdrodb.utils.warnings module
- disdrodb.utils.writer module
- disdrodb.utils.xarray module
- disdrodb.utils.yaml module
- Module contents
- disdrodb.viz package
Submodules#
disdrodb.configs module#
DISDRODB Configuration File functions.
- disdrodb.configs.check_availability_radar_simulations(options)[source][source]#
Check radar simulations are possible for L2E and L2M products.
- disdrodb.configs.copy_product_default_configs(configs_path)[source][source]#
Copy the default DISDRODB products configuration directory to a custom location.
This function duplicates the entire directory of default product settings (located at
disdrodb/etc/products) into the user-specifiedconfigs_path. Once copied, you can safely edit these files without modifying the library’s built-in defaults. To have DISDRODB use your custom settings, point the global configuration at this new directory (e.g by specifyingconfigs_pathwith thedisdrodb.define_configsfunction).- Parameters:
configs_path – Destination directory where the default product configuration files will be copied. This directory must not already exist, and later needs to be referenced in your DISDRODB global configuration.
- Returns:
The path to the newly created custom product configuration directory.
- Return type:
configs_path
- disdrodb.configs.define_configs(data_archive_dir: str | None = None, metadata_archive_dir: str | None = None, scattering_table_dir: str | None = None, configs_path: str | None = None, folder_partitioning: str | None = None, zenodo_token: str | None = None, zenodo_sandbox_token: str | None = None)[source][source]#
Defines the DISDRODB configuration file with the given credentials and base directory.
- Parameters:
data_archive_dir (str) – The directory path where the DISDRODB Data Archive is located.
metadata_archive_dir (str) – The directory path where the DISDRODB Metadata Archive is located.
scattering_table_dir (str) – The directory path where to store DISDRODB T-Matrix scattering tables.
configs_path (str) – The directory path where the custom DISDRODB products configurations files are defined.
folder_partitioning (str) – The folder partitioning scheme used in the DISDRODB Data Archive. Allowed values are: - “”: No additional subdirectories, files are saved directly in <station_dir>. - “year”: Files are stored under a subdirectory for the year (<station_dir>/2025). - “year/month”: Files are stored under subdirectories by year and month (<station_dir>/2025/04). - “year/month/day”: Files are stored under subdirectories by year, month and day (<station_dir>/2025/04/01). - “year/month_name”: Files are stored under subdirectories by year and month name (<station_dir>/2025/April). - “year/quarter”: Files are stored under subdirectories by year and quarter (<station_dir>/2025/Q2).
zenodo__token (str) – Zenodo Access Token. It is required to upload stations data to Zenodo.
zenodo_sandbox_token (str) – Zenodo Sandbox Access Token. It is required to upload stations data to Zenodo Sandbox.
Notes
This function write or update the DISDRODB config YAML file. The DISDRODB config YAML file is located in the user’s home directory at
~/.config_disdrodb.yml. The configuration file is used to run the various DISDRODB operations.
- disdrodb.configs.get_data_archive_dir(data_archive_dir=None)[source][source]#
Return the DISDRODB base directory.
- disdrodb.configs.get_metadata_archive_dir(metadata_archive_dir=None)[source][source]#
Return the DISDRODB Metadata Archive Directory.
- disdrodb.configs.get_model_options(product, model_name)[source][source]#
Get DISDRODB L2M model options.
- disdrodb.configs.get_product_default_configs_path()[source][source]#
Return the paths where DISDRODB products configuration files are stored.
- disdrodb.configs.get_product_options(product, temporal_resolution=None)[source][source]#
Get options for DISDRODB products.
- disdrodb.configs.get_product_temporal_resolutions(product)[source][source]#
Get DISDRODB L2 product temporal aggregations.
- disdrodb.configs.get_scattering_table_dir(scattering_table_dir=None)[source][source]#
Return the directory where DISDRODB save pyTMatrix scattering tables.
- disdrodb.configs.read_configs() dict[str, str][source][source]#
Reads the DISDRODB configuration file and returns a dictionary with the configuration settings.
- Returns:
A dictionary containing the configuration settings for the DISDRODB.
- Return type:
- Raises:
ValueError – If the configuration file has not been defined yet. Use
disdrodb.define_configs()to specify the configuration file path and settings.
Notes
This function reads the YAML configuration file located at
~/.config_disdrodb.yml.
disdrodb.constants module#
DISDRODB constants.
disdrodb.docs module#
Open the documentation for the relevant sensor.
disdrodb.routines module#
DISDRODB CLI routine wrappers.
- disdrodb.routines.run_l0(data_sources=None, campaign_names=None, station_names=None, l0a_processing: bool = True, l0b_processing: bool = True, l0c_processing: bool = True, remove_l0a: bool = False, remove_l0b: bool = False, force: bool = False, verbose: bool = False, debugging_mode: bool = False, parallel: bool = True, data_archive_dir: str | None = None, metadata_archive_dir: str | None = None)[source][source]#
Run the L0 processing of DISDRODB stations.
This function allows to launch the processing of many DISDRODB stations with a single command. From the list of all available DISDRODB stations, it runs the processing of the stations matching the provided data_sources, campaign_names and station_names.
- Parameters:
data_sources (list) – Name of data source(s) to process. The name(s) must be UPPER CASE. If campaign_names and station are not specified, process all stations. The default value is
None.campaign_names (list) – Name of the campaign(s) to process. The name(s) must be UPPER CASE. The default value is
None.station_names (list) – Station names to process. The default value is
None.l0a_processing (bool) – Whether to launch processing to generate L0A Apache Parquet file(s) from raw data. The default value is
True.l0b_processing (bool) – Whether to launch processing to generate L0B netCDF4 file(s) from L0A data. The default value is
True.l0c_processing (bool) – Whether to launch processing to generate L0C netCDF4 file(s) from L0B data. The default value is
True.remove_l0a (bool) – Whether to keep the L0A files after having generated the L0B netCDF products. The default value is
False.remove_l0b (bool) – Whether to remove the L0B files after having produced all L0C netCDF files. The default value is
False.force (bool) – If
True, overwrite existing data into destination directories. IfFalse, raise an error if there are already data into destination directories. The default value isFalse.verbose (bool) – Whether to print detailed processing information into terminal. The default value is
False.parallel (bool) – If
True, the files are processed simultaneously in multiple processes. Each process will use a single thread to avoid issues with the HDF/netCDF library. By default, the number of process is defined withos.cpu_count(). IfFalse, the files are processed sequentially in a single process. IfFalse, multi-threading is automatically exploited to speed up I/0 tasks.debugging_mode (bool) – If
True, it reduces the amount of data to process. For L0A, it processes just the first 3 raw data files. For L0B, it processes 100 rows sampled from 3 L0A files. The default value isFalse.data_archive_dir (str (optional)) – The directory path where the DISDRODB Data Archive is located. The directory path must end with
<...>/DISDRODB. IfNone, it uses thedata_archive_dirpath specified in the DISDRODB active configuration.metadata_archive_dir – The directory path where the DISDRODB Metadata Archive is located. The directory path must end with
<...>/DISDRODB-METADATA/DISDRODB. IfNone, it uses themetadata_archive_dirpath specified in the DISDRODB active configuration.
- disdrodb.routines.run_l0_station(data_source, campaign_name, station_name, l0a_processing: bool = True, l0b_processing: bool = True, l0c_processing: bool = True, remove_l0a: bool = False, remove_l0b: bool = False, force: bool = False, verbose: bool = False, debugging_mode: bool = False, parallel: bool = True, data_archive_dir: str | None = None, metadata_archive_dir: str | None = None)[source][source]#
Run the L0 processing of a specific DISDRODB station from the terminal.
- Parameters:
data_source (str) – Institution name (when campaign data spans more than 1 country), or country (when all campaigns (or sensor networks) are inside a given country). Must be UPPER CASE.
campaign_name (str) – Campaign name. Must be UPPER CASE.
station_name (str) – Station name
l0a_processing (bool) – Whether to launch processing to generate L0A Apache Parquet file(s) from raw data. The default value is
True.l0b_processing (bool) – Whether to launch processing to generate L0B netCDF4 file(s) from L0A data. The default value is
True.l0b_processing – Whether to launch processing to generate L0C netCDF4 file(s) from L0B data. The default value is
True.l0c_processing (bool) – Whether to launch processing to generate L0C netCDF4 file(s) from L0C data. The default is True.
remove_l0a (bool) – Whether to keep the L0A files after having generated the L0B netCDF products. The default value is
False.remove_l0b (bool) – Whether to remove the L0B files after having produced L0C netCDF files. The default is False.
force (bool) – If
True, overwrite existing data into destination directories. IfFalse, raise an error if there are already data into destination directories. The default value isFalse.verbose (bool) – Whether to print detailed processing information into terminal. The default value is
True.parallel (bool) – If
True, the files are processed simultaneously in multiple processes. Each process will use a single thread to avoid issues with the HDF/netCDF library. By default, the number of process is defined withos.cpu_count(). IfFalse, the files are processed sequentially in a single process. IfFalse, multi-threading is automatically exploited to speed up I/0 tasks.debugging_mode (bool) – If
True, it reduces the amount of data to process. For L0A, it processes just the first 3 raw data files for each station. For L0B, it processes 100 rows sampled from 3 L0A files for each station. The default value isFalse.data_archive_dir (str (optional)) – The directory path where the DISDRODB Data Archive is located. The directory path must end with
<...>/DISDRODB. IfNone, it uses thedata_archive_dirpath specified in the DISDRODB active configuration.
- disdrodb.routines.run_l0a(data_sources=None, campaign_names=None, station_names=None, force: bool = False, verbose: bool = False, debugging_mode: bool = False, parallel: bool = True, data_archive_dir: str | None = None, metadata_archive_dir: str | None = None)[source][source]#
Run the L0A processing of DISDRODB stations.
This function allows to launch the processing of many DISDRODB stations with a single command. From the list of all available DISDRODB stations, it runs the processing of the stations matching the provided data_sources, campaign_names and station_names.
- Parameters:
data_sources (list) – Name of data source(s) to process. The name(s) must be UPPER CASE. If campaign_names and station are not specified, process all stations. The default value is
None.campaign_names (list) – Name of the campaign(s) to process. The name(s) must be UPPER CASE. The default value is
None.station_names (list) – Station names to process. The default value is
None.force (bool) – If
True, overwrite existing data into destination directories. IfFalse, raise an error if there are already data into destination directories. The default value isFalse.verbose (bool) – Whether to print detailed processing information into terminal. The default value is
True.parallel (bool) – If
True, the files are processed simultaneously in multiple processes. By default, the number of process is defined withos.cpu_count(). IfFalse, the files are processed sequentially in a single process.debugging_mode (bool) – If
True, it processes just the first 3 raw data files. The default value isFalse.data_archive_dir (str (optional)) – The directory path where the DISDRODB Data Archive is located. The directory path must end with
<...>/DISDRODB. IfNone, it uses thedata_archive_dirpath specified in the DISDRODB active configuration.metadata_archive_dir – The directory path where the DISDRODB Metadata Archive is located. The directory path must end with
<...>/DISDRODB-METADATA/DISDRODB. IfNone, it uses themetadata_archive_dirpath specified in the DISDRODB active configuration.
- disdrodb.routines.run_l0a_station(data_source, campaign_name, station_name, force: bool = False, verbose: bool = False, debugging_mode: bool = False, parallel: bool = True, data_archive_dir: str | None = None, metadata_archive_dir: str | None = None)[source][source]#
Run the L0A processing of a station by invoking the disdrodb_run_l0a_station command in the terminal.
- Parameters:
data_source (str) – The name of the data source.
campaign_name (str) – The name of the campaign.
station_name (str) – The name of the station.
force (bool, optional) – If
True, overwrite existing data in destination directories. The default value isFalse.verbose (bool, optional) – If
True, print detailed processing information to the terminal. The default value isFalse.debugging_mode (bool, optional) – If
True, reduce the amount of data to process for debugging. The default value isFalse.parallel (bool, optional) – If
True, process files in multiple processes simultaneously. The default value isTrue.data_archive_dir – The directory path where the local DISDRODB Data Archive is located. The directory path must end with
<...>/DISDRODB. IfNone, it uses thedata_archive_dirpath specified in the DISDRODB active configuration.metadata_archive_dir – The directory path where the DISDRODB Metadata Archive is located. The directory path must end with
<...>/DISDRODB-METADATA/DISDRODB. IfNone, it uses themetadata_archive_dirpath specified in the DISDRODB active configuration.
- disdrodb.routines.run_l0b(data_sources=None, campaign_names=None, station_names=None, remove_l0a: bool = False, force: bool = False, verbose: bool = False, debugging_mode: bool = False, parallel: bool = True, data_archive_dir: str | None = None, metadata_archive_dir: str | None = None)[source][source]#
Run the L0B processing of DISDRODB stations.
This function allows to launch the processing of many DISDRODB stations with a single command. From the list of all available DISDRODB L0A stations, it runs the processing of the stations matching the provided data_sources, campaign_names and station_names.
- Parameters:
data_sources (list) – Name of data source(s) to process. The name(s) must be UPPER CASE. If campaign_names and station are not specified, process all stations. The default value is
None.campaign_names (list) – Name of the campaign(s) to process. The name(s) must be UPPER CASE. The default value is
None.station_names (list) – Station names to process. The default value is
None.remove_l0a (bool) – Whether to keep the L0A files after having generated the L0B netCDF products. The default value is
False.force (bool) – If
True, overwrite existing data into destination directories. IfFalse, raise an error if there are already data into destination directories. The default value isFalse.verbose (bool) – Whether to print detailed processing information into terminal. The default value is
True.parallel (bool) – If
True, the files are processed simultaneously in multiple processes. By default, the number of process is defined withos.cpu_count(). IfFalse, the files are processed sequentially in a single process.debugging_mode (bool) – If
True, it reduces the amount of data to process. For L0B, it processes 100 rows sampled from 3 L0A files. The default value isFalse.data_archive_dir (str (optional)) – The directory path where the DISDRODB Data Archive is located. The directory path must end with
<...>/DISDRODB. IfNone, it uses thedata_archive_dirpath specified in the DISDRODB active configuration.metadata_archive_dir – The directory path where the DISDRODB Metadata Archive is located. The directory path must end with
<...>/DISDRODB-METADATA/DISDRODB. IfNone, it uses themetadata_archive_dirpath specified in the DISDRODB active configuration.
- disdrodb.routines.run_l0b_station(data_source, campaign_name, station_name, remove_l0a: bool = False, force: bool = False, verbose: bool = False, debugging_mode: bool = False, parallel: bool = True, data_archive_dir: str | None = None, metadata_archive_dir: str | None = None)[source][source]#
Run the L0B processing of a station by invoking the disdrodb_run_l0b_station command in the terminal.
- Parameters:
data_archive_dir – The directory path where the local DISDRODB Data Archive is located. The directory path must end with
<...>/DISDRODB. IfNone, it uses thedata_archive_dirpath specified in the DISDRODB active configuration.metadata_archive_dir – The directory path where the DISDRODB Metadata Archive is located. The directory path must end with
<...>/DISDRODB-METADATA/DISDRODB. IfNone, it uses themetadata_archive_dirpath specified in the DISDRODB active configuration.data_source (str) – The name of the data source.
campaign_name (str) – The name of the campaign.
station_name (str) – The name of the station.
remove_l0a (bool, optional) – Whether to keep the L0A files after generating L0B netCDF files. The default value is
False.force (bool, optional) – If
True, overwrite existing data in destination directories. The default value isFalse.verbose (bool, optional) – If
True, print detailed processing information to the terminal. The default value isFalse.debugging_mode (bool, optional) – If
True, reduce the amount of data processed for debugging. The default value isFalse.parallel (bool, optional) – If
True, process files in multiple processes simultaneously. The default value isTrue.
- disdrodb.routines.run_l0c(data_sources=None, campaign_names=None, station_names=None, remove_l0b: bool = False, force: bool = False, verbose: bool = False, debugging_mode: bool = False, parallel: bool = True, data_archive_dir: str | None = None, metadata_archive_dir: str | None = None)[source][source]#
Run the L0C processing of DISDRODB stations.
This function allows to launch the processing of many DISDRODB stations with a single command. From the list of all available DISDRODB stations, it runs the processing of the stations matching the provided data_sources, campaign_names and station_names.
- Parameters:
data_sources (list) – Name of data source(s) to process. The name(s) must be UPPER CASE. If campaign_names and station are not specified, process all stations. The default value is
None.campaign_names (list) – Name of the campaign(s) to process. The name(s) must be UPPER CASE. The default value is
None.station_names (list) – Station names to process. The default value is
None.remove_l0b (bool) – Whether to remove the L0B files after having produced L0C netCDF files. The default value is
False.force (bool) – If
True, overwrite existing data into destination directories. IfFalse, raise an error if there are already data into destination directories. The default value isFalse.verbose (bool) – Whether to print detailed processing information into terminal. The default value is
False.parallel (bool) – If
True, the files are processed simultaneously in multiple processes. Each process will use a single thread to avoid issues with the HDF/netCDF library. By default, the number of process is defined withos.cpu_count(). IfFalse, the files are processed sequentially in a single process. IfFalse, multi-threading is automatically exploited to speed up I/0 tasks.debugging_mode (bool) – If
True, it reduces the amount of data to process. For L1B, it processes just 3 L0B files. The default value isFalse.data_archive_dir (str (optional)) – The directory path where the DISDRODB Data Archive is located. The directory path must end with
<...>/DISDRODB. IfNone, it uses thedata_archive_dirpath specified in the DISDRODB active configuration.metadata_archive_dir – The directory path where the DISDRODB Metadata Archive is located. The directory path must end with
<...>/DISDRODB-METADATA/DISDRODB. IfNone, it uses themetadata_archive_dirpath specified in the DISDRODB active configuration.
- disdrodb.routines.run_l0c_station(data_source, campaign_name, station_name, remove_l0b: bool = False, force: bool = False, verbose: bool = False, debugging_mode: bool = False, parallel: bool = True, data_archive_dir: str | None = None, metadata_archive_dir: str | None = None)[source][source]#
Run the L0C processing of a station by invoking the disdrodb_run_l0c_station command in the terminal.
- Parameters:
data_source (str) – The name of the data source.
campaign_name (str) – The name of the campaign.
station_name (str) – The name of the station.
remove_l0b (bool, optional) – Whether to remove the L0B files after generating L0C netCDF files. The default value is
False.force (bool, optional) – If
True, overwrite existing data in destination directories. The default value isFalse.verbose (bool, optional) – If
True, print detailed processing information to the terminal. The default value isFalse.debugging_mode (bool, optional) – If
True, reduce the amount of data processed for debugging. The default value isFalse.parallel (bool, optional) – If
True, process files in multiple processes simultaneously. The default value isTrue.data_archive_dir – The directory path where the local DISDRODB Data Archive is located. The directory path must end with
<...>/DISDRODB. IfNone, it uses thedata_archive_dirpath specified in the DISDRODB active configuration.metadata_archive_dir – The directory path where the DISDRODB Metadata Archive is located. The directory path must end with
<...>/DISDRODB-METADATA/DISDRODB. IfNone, it uses themetadata_archive_dirpath specified in the DISDRODB active configuration.
- disdrodb.routines.run_l1(data_sources=None, campaign_names=None, station_names=None, force: bool = False, verbose: bool = False, debugging_mode: bool = False, parallel: bool = True, data_archive_dir: str | None = None, metadata_archive_dir: str | None = None)[source][source]#
Run the L1 processing of DISDRODB stations.
This function allows to launch the processing of many DISDRODB stations with a single command. From the list of all available DISDRODB stations, it runs the processing of the stations matching the provided data_sources, campaign_names and station_names.
- Parameters:
data_sources (list) – Name of data source(s) to process. The name(s) must be UPPER CASE. If campaign_names and station are not specified, process all stations. The default value is
None.campaign_names (list) – Name of the campaign(s) to process. The name(s) must be UPPER CASE. The default value is
None.station_names (list) – Station names to process. The default value is
None.force (bool) – If
True, overwrite existing data into destination directories. IfFalse, raise an error if there are already data into destination directories. The default value isFalse.verbose (bool) – Whether to print detailed processing information into terminal. The default value is
False.parallel (bool) – If
True, the files are processed simultaneously in multiple processes. Each process will use a single thread to avoid issues with the HDF/netCDF library. By default, the number of process is defined withos.cpu_count(). IfFalse, the files are processed sequentially in a single process. IfFalse, multi-threading is automatically exploited to speed up I/0 tasks.debugging_mode (bool) – If
True, it reduces the amount of data to process. For L1B, it processes just 3 L0B files. The default value isFalse.data_archive_dir (str (optional)) – The directory path where the DISDRODB Data Archive is located. The directory path must end with
<...>/DISDRODB. IfNone, it uses thedata_archive_dirpath specified in the DISDRODB active configuration.metadata_archive_dir – The directory path where the DISDRODB Metadata Archive is located. The directory path must end with
<...>/DISDRODB-METADATA/DISDRODB. IfNone, it uses themetadata_archive_dirpath specified in the DISDRODB active configuration.
- disdrodb.routines.run_l1_station(data_source, campaign_name, station_name, force: bool = False, verbose: bool = False, debugging_mode: bool = False, parallel: bool = True, data_archive_dir: str | None = None, metadata_archive_dir: str | None = None)[source][source]#
Run the L1 processing of a station by invoking the disdrodb_run_l1_station command in the terminal.
- Parameters:
data_source (str) – The name of the data source.
campaign_name (str) – The name of the campaign.
station_name (str) – The name of the station.
force (bool, optional) – If
True, overwrite existing data in destination directories. The default value isFalse.verbose (bool, optional) – If
True, print detailed processing information to the terminal. The default value isFalse.debugging_mode (bool, optional) – If
True, reduce the amount of data processed for debugging. The default value isFalse.parallel (bool, optional) – If
True, process files in multiple processes simultaneously. The default value isTrue.data_archive_dir – The directory path where the local DISDRODB Data Archive is located. The directory path must end with
<...>/DISDRODB. IfNone, it uses thedata_archive_dirpath specified in the DISDRODB active configuration.metadata_archive_dir – The directory path where the DISDRODB Metadata Archive is located. The directory path must end with
<...>/DISDRODB-METADATA/DISDRODB. IfNone, it uses themetadata_archive_dirpath specified in the DISDRODB active configuration.
- disdrodb.routines.run_l2e(data_sources=None, campaign_names=None, station_names=None, force: bool = False, verbose: bool = False, debugging_mode: bool = False, parallel: bool = True, data_archive_dir: str | None = None, metadata_archive_dir: str | None = None)[source][source]#
Run the L2E processing of DISDRODB stations.
This function allows to launch the processing of many DISDRODB stations with a single command. From the list of all available DISDRODB stations, it runs the processing of the stations matching the provided data_sources, campaign_names and station_names.
- Parameters:
data_sources (list) – Name of data source(s) to process. The name(s) must be UPPER CASE. If campaign_names and station are not specified, process all stations. The default value is
None.campaign_names (list) – Name of the campaign(s) to process. The name(s) must be UPPER CASE. The default value is
None.station_names (list) – Station names to process. The default value is
None.force (bool) – If
True, overwrite existing data into destination directories. IfFalse, raise an error if there are already data into destination directories. The default value isFalse.verbose (bool) – Whether to print detailed processing information into terminal. The default value is
False.parallel (bool) – If
True, the files are processed simultaneously in multiple processes. Each process will use a single thread to avoid issues with the HDF/netCDF library. By default, the number of process is defined withos.cpu_count(). IfFalse, the files are processed sequentially in a single process. IfFalse, multi-threading is automatically exploited to speed up I/0 tasks.debugging_mode (bool) – If
True, it reduces the amount of data to process. For L2E, it processes just 3 L1 files. The default value isFalse.data_archive_dir (str (optional)) – The directory path where the DISDRODB Data Archive is located. The directory path must end with
<...>/DISDRODB. IfNone, it uses thedata_archive_dirpath specified in the DISDRODB active configuration.metadata_archive_dir – The directory path where the DISDRODB Metadata Archive is located. The directory path must end with
<...>/DISDRODB-METADATA/DISDRODB. IfNone, it uses themetadata_archive_dirpath specified in the DISDRODB active configuration.
- disdrodb.routines.run_l2e_station(data_source, campaign_name, station_name, force: bool = False, verbose: bool = False, debugging_mode: bool = False, parallel: bool = True, data_archive_dir: str | None = None, metadata_archive_dir: str | None = None)[source][source]#
Run the L2E processing of a station by invoking the disdrodb_run_l2e_station command in the terminal.
- Parameters:
data_source (str) – The name of the data source.
campaign_name (str) – The name of the campaign.
station_name (str) – The name of the station.
force (bool, optional) – If
True, overwrite existing data in destination directories. The default value isFalse.verbose (bool, optional) – If
True, print detailed processing information to the terminal. The default value isFalse.debugging_mode (bool, optional) – If
True, reduce the amount of data processed for debugging. The default value isFalse.parallel (bool, optional) – If
True, process files in multiple processes simultaneously. The default value isTrue.data_archive_dir – The directory path where the local DISDRODB Data Archive is located. The directory path must end with
<...>/DISDRODB. IfNone, it uses thedata_archive_dirpath specified in the DISDRODB active configuration.metadata_archive_dir – The directory path where the DISDRODB Metadata Archive is located. The directory path must end with
<...>/DISDRODB-METADATA/DISDRODB. IfNone, it uses themetadata_archive_dirpath specified in the DISDRODB active configuration.
- disdrodb.routines.run_l2m(data_sources=None, campaign_names=None, station_names=None, force: bool = False, verbose: bool = False, debugging_mode: bool = False, parallel: bool = True, data_archive_dir: str | None = None, metadata_archive_dir: str | None = None)[source][source]#
Run the L2M processing of DISDRODB stations.
This function allows to launch the processing of many DISDRODB stations with a single command. From the list of all available DISDRODB stations, it runs the processing of the stations matching the provided data_sources, campaign_names and station_names.
- Parameters:
data_sources (list) – Name of data source(s) to process. The name(s) must be UPPER CASE. If campaign_names and station are not specified, process all stations. The default value is
None.campaign_names (list) – Name of the campaign(s) to process. The name(s) must be UPPER CASE. The default value is
None.station_names (list) – Station names to process. The default value is
None.force (bool) – If
True, overwrite existing data into destination directories. IfFalse, raise an error if there are already data into destination directories. The default value isFalse.verbose (bool) – Whether to print detailed processing information into terminal. The default value is
False.parallel (bool) – If
True, the files are processed simultaneously in multiple processes. Each process will use a single thread to avoid issues with the HDF/netCDF library. By default, the number of process is defined withos.cpu_count(). IfFalse, the files are processed sequentially in a single process. IfFalse, multi-threading is automatically exploited to speed up I/0 tasks.debugging_mode (bool) – If
True, it reduces the amount of data to process. For L2MB, it processes just 3 L0B files. The default value isFalse.data_archive_dir (str (optional)) – The directory path where the DISDRODB Data Archive is located. The directory path must end with
<...>/DISDRODB. IfNone, it uses thedata_archive_dirpath specified in the DISDRODB active configuration.metadata_archive_dir – The directory path where the DISDRODB Metadata Archive is located. The directory path must end with
<...>/DISDRODB-METADATA/DISDRODB. IfNone, it uses themetadata_archive_dirpath specified in the DISDRODB active configuration.
- disdrodb.routines.run_l2m_station(data_source, campaign_name, station_name, force: bool = False, verbose: bool = False, debugging_mode: bool = False, parallel: bool = True, data_archive_dir: str | None = None, metadata_archive_dir: str | None = None)[source][source]#
Run the L2M processing of a station by invoking the disdrodb_run_l2m_station command in the terminal.
- Parameters:
data_source (str) – The name of the data source.
campaign_name (str) – The name of the campaign.
station_name (str) – The name of the station.
force (bool, optional) – If
True, overwrite existing data in destination directories. The default value isFalse.verbose (bool, optional) – If
True, print detailed processing information to the terminal. The default value isFalse.debugging_mode (bool, optional) – If
True, reduce the amount of data processed for debugging. The default value isFalse.parallel (bool, optional) – If
True, process files in multiple processes simultaneously. The default value isTrue.data_archive_dir – The directory path where the local DISDRODB Data Archive is located. The directory path must end with
<...>/DISDRODB. IfNone, it uses thedata_archive_dirpath specified in the DISDRODB active configuration.metadata_archive_dir – The directory path where the DISDRODB Metadata Archive is located. The directory path must end with
<...>/DISDRODB-METADATA/DISDRODB. IfNone, it uses themetadata_archive_dirpath specified in the DISDRODB active configuration.
Module contents#
DISDRODB software.
- disdrodb.available_campaigns(product=None, data_sources=None, station_names=None, available_data=False, raise_error_if_empty=False, invalid_fields_policy='raise', data_archive_dir=None, metadata_archive_dir=None, **product_kwargs)[source][source]#
Return campaigns names for which stations are available.
- disdrodb.available_data_sources(product=None, campaign_names=None, station_names=None, available_data=False, raise_error_if_empty=False, invalid_fields_policy='raise', data_archive_dir=None, metadata_archive_dir=None, **product_kwargs)[source][source]#
Return data sources for which stations are available.
- disdrodb.available_readers(sensor_name, data_sources=None, return_path=False)[source][source]#
Retrieve available readers information.
- disdrodb.available_sensor_names() list[source][source]#
Get available names of sensors.
- Returns:
sensor_names – Sorted list of the available sensors
- Return type:
- disdrodb.available_stations(product=None, data_sources=None, campaign_names=None, station_names=None, return_tuple=True, available_data=False, raise_error_if_empty=False, invalid_fields_policy='raise', data_archive_dir=None, metadata_archive_dir=None, **product_kwargs)[source][source]#
Return stations information for which metadata or product data are available on disk.
This function queries the DISDRODB Metadata Archive and, optionally, the local DISDRODB Data Archive to identify stations that satisfy the specified filters.
If the DISDRODB product is not specified, it lists the stations present in the DISDRODB Metadata Archive given the specified filtering criteria. If the DISDRODB product is specified, it lists the stations present in the local DISDRODB Data Archive given the specified filtering criteria.
- Parameters:
product (str or None, optional) –
Name of the product to filter on (e.g., “RAW”, “L0A”, “L1”).
If the DISDRODB product is not specified (default), it lists the stations present in the DISDRODB Metadata Archive given the specified filtering criteria.
If the DISDRODB product is specified, it lists the stations present in the local DISDRODB Data Archive given the specified filtering criteria. The default is is None.
data_sources (str or sequence of str, optional) – One or more data source identifiers to filter stations by. The name(s) must be UPPER CASE. If None, no filtering on data source is applied. The default is is
None.campaign_names (str or sequence of str, optional) – One or more campaign names to filter stations by. The name(s) must be UPPER CASE. If None, no filtering on campaign is applied. The default is is
None.station_names (str or sequence of str, optional) – One or more station names to include. If None, all stations matching other filters are considered. The default is is
None.available_data (bool, optional) –
If
productis not specified:if available_data is False, return stations present in the DISDRODB Metadata Archive
if available_data is True, return stations with data available on the
online DISDRODB Decentralized Data Archive (i.e., stations with the disdrodb_data_url in the metadata).
If
productis specified:if available_data is False, return stations where the product directory exists in the in the local DISDRODB Data Archive
if available_data is True, return stations where product data exists in the in the local DISDRODB Data Archive.
The default is is False.
return_tuple (bool, optional) – If True, return a list of tuples
(data_source, campaign_name, station_name). If False, return only a list of station names The default is True.raise_error_if_empty (bool, optional) – If True and no stations satisfy the criteria, raise a
ValueError. If False, return an empty list/tuple. The default is False.invalid_fields_policy ({'raise', 'warn', 'ignore'}, optional) –
How to handle invalid filter values for
data_sources,campaign_names, orstation_namesthat are not present in the metadata archive:’raise’ : raise a
ValueError(default)’warn’ : emit a warning, then ignore invalid entries
’ignore’: silently drop invalid entries
data_archive_dir (str or Path-like, optional) – Path to the root of the local DISDRODB Data Archive. Required only if ``product``is specified. If None, the default data archive base directory is used. Default is None.
metadata_archive_dir (str or Path-like, optional) – Path to the root of the DISDRODB Metadata Archive. If None, the default metadata base directory is used. Default is None.
**product_kwargs (dict, optional) – Additional arguments required for some products. For example, for the “L2E” product, you need to specify
rollingandsample_interval. For the “L2M” product, you need to specify also themodel_name.
- Returns:
If
return_tuple=True, return a list of tuples(data_source, campaign_name, station_name). Ifreturn_tuple=True,, return a list of station names.- Return type:
Examples
>>> # List all stations present in the DISDRODB Metadata Archive >>> stations = available_stations() >>> # List all stations present in the online DISDRODB Data Archive >>> stations = available_stations(available_data=True) >>> # List stations with raw data available in the local DISDRODB Data Archive >>> raw_stations = available_stations(product="RAW", available_data=True) >>> # List stations of specific data sources >>> stations = available_stations(data_sources=["GPM", "EPFL"])
- disdrodb.check_metadata_archive(metadata_archive_dir: str | None = None, raise_error=False)[source][source]#
Check the archive metadata compliance.
- Parameters:
metadata_archive_dir (str (optional)) – The directory path where the DISDRODB Metadata Archive is located. The directory path must end with
<...>/DISDRODB. IfNone, it uses themetadata_archive_dirpath specified in the DISDRODB active configuration.raise_error (bool (optional)) – Whether to raise an error and interrupt the archive check if a metadata is not compliant. The default value is
False.
- Returns:
If the check succeeds, the result is
True, otherwiseFalse.- Return type:
- disdrodb.check_metadata_archive_geolocation(metadata_archive_dir: str | None = None)[source][source]#
Check the metadata files have missing or wrong geolocation..
- Parameters:
metadata_archive_dir (str (optional)) – The directory path where the DISDRODB Metadata Archive is located. The directory path must end with
<...>/DISDRODB. IfNone, it uses themetadata_archive_dirpath specified in the DISDRODB active configuration.- Returns:
If the check succeeds, the result is
True, otherwiseFalse.- Return type:
- disdrodb.check_station_metadata(data_source, campaign_name, station_name, metadata_archive_dir=None)[source][source]#
Check DISDRODB metadata compliance.
- disdrodb.define_configs(data_archive_dir: str | None = None, metadata_archive_dir: str | None = None, scattering_table_dir: str | None = None, configs_path: str | None = None, folder_partitioning: str | None = None, zenodo_token: str | None = None, zenodo_sandbox_token: str | None = None)[source][source]#
Defines the DISDRODB configuration file with the given credentials and base directory.
- Parameters:
data_archive_dir (str) – The directory path where the DISDRODB Data Archive is located.
metadata_archive_dir (str) – The directory path where the DISDRODB Metadata Archive is located.
scattering_table_dir (str) – The directory path where to store DISDRODB T-Matrix scattering tables.
configs_path (str) – The directory path where the custom DISDRODB products configurations files are defined.
folder_partitioning (str) – The folder partitioning scheme used in the DISDRODB Data Archive. Allowed values are: - “”: No additional subdirectories, files are saved directly in <station_dir>. - “year”: Files are stored under a subdirectory for the year (<station_dir>/2025). - “year/month”: Files are stored under subdirectories by year and month (<station_dir>/2025/04). - “year/month/day”: Files are stored under subdirectories by year, month and day (<station_dir>/2025/04/01). - “year/month_name”: Files are stored under subdirectories by year and month name (<station_dir>/2025/April). - “year/quarter”: Files are stored under subdirectories by year and quarter (<station_dir>/2025/Q2).
zenodo__token (str) – Zenodo Access Token. It is required to upload stations data to Zenodo.
zenodo_sandbox_token (str) – Zenodo Sandbox Access Token. It is required to upload stations data to Zenodo Sandbox.
Notes
This function write or update the DISDRODB config YAML file. The DISDRODB config YAML file is located in the user’s home directory at
~/.config_disdrodb.yml. The configuration file is used to run the various DISDRODB operations.
- disdrodb.download_archive(data_sources: str | list[str] | None = None, campaign_names: str | list[str] | None = None, station_names: str | list[str] | None = None, force: bool = False, data_archive_dir: str | None = None, metadata_archive_dir: str | None = None)[source][source]#
Download DISDRODB stations with the
disdrodb_data_urlin the metadata.- Parameters:
data_sources (str or list of str, optional) – Data source name (eg : EPFL). If not provided (
None), all data sources will be downloaded. The default value isdata_source=None.campaign_names (str or list of str, optional) – Campaign name (eg : EPFL_ROOF_2012). If not provided (
None), all campaigns will be downloaded. The default value iscampaign_name=None.station_names (str or list of str, optional) – Station name. If not provided (
None), all stations will be downloaded. The default value isstation_name=None.force (bool, optional) – If
True, overwrite the already existing raw data file. The default value isFalse.data_archive_dir (str (optional)) – DISDRODB Data Archive directory. Format:
<...>/DISDRODB. IfNone(the default), the disdrodb config variabledata_archive_diris used.
- disdrodb.download_metadata_archive(directory_path, force=False)[source][source]#
Download the DISDRODB Metadata Archive to the specified directory.
- Parameters:
- Returns:
The DISDRODB Metadata Archive directory path.
- Return type:
metadata_archive_dir
- disdrodb.download_station(data_source: str, campaign_name: str, station_name: str, force: bool = False, data_archive_dir: str | None = None, metadata_archive_dir: str | None = None) None[source][source]#
Download data of a single DISDRODB station from the DISDRODB remote repository.
- Parameters:
data_source (str) – The name of the institution (for campaigns spanning multiple countries) or the name of the country (for campaigns or sensor networks within a single country). Must be provided in UPPER CASE.
campaign_name (str) – The name of the campaign. Must be provided in UPPER CASE.
station_name (str) – The name of the station.
data_archive_dir (str (optional)) – The base directory of DISDRODB, expected in the format
<...>/DISDRODB. If not specified, the path specified in the DISDRODB active configuration will be used.force (bool, optional) – If
True, overwrite the already existing raw data file. The default value isFalse.data_archive_dir – DISDRODB Data Archive directory. Format:
<...>/DISDRODB. IfNone(the default), the disdrodb config variabledata_archive_diris used.
- disdrodb.find_files(data_source, campaign_name, station_name, product, debugging_mode: bool = False, data_archive_dir: str | None = None, glob_pattern=None, start_time=None, end_time=None, **product_kwargs)[source][source]#
Retrieve DISDRODB product files for a give station.
- Parameters:
data_source (str) – The name of the institution (for campaigns spanning multiple countries) or the name of the country (for campaigns or sensor networks within a single country). Must be provided in UPPER CASE.
campaign_name (str) – The name of the campaign. Must be provided in UPPER CASE.
station_name (str) – The name of the station.
product (str) – The name DISDRODB product.
debugging_mode (bool, optional) – If
True, it select maximum 3 files for debugging purposes. The default value isFalse.data_archive_dir (str, optional) – The base directory of DISDRODB, expected in the format
<...>/DISDRODB. If not specified, the path specified in the DISDRODB active configuration will be used.glob_pattern (str, optional) – Glob pattern to search for raw data files. The default is “*”. The argument is used only if product=”RAW”.
sample_interval (int, optional) – The sampling interval in seconds of the product. It must be specified only for product L2E and L2M !
rolling (bool, optional) – Whether the dataset has been resampled by aggregating or rolling. It must be specified only for product L2E and L2M !
model_name (str) – The model name of the statistical distribution for the DSD. It must be specified only for product L2M !
- Returns:
filepaths – List of file paths.
- Return type:
- disdrodb.generate_l0a(filepaths: list | str, reader, sensor_name, issue_dict=None, verbose=True, logger=None) DataFrame[source][source]#
Read and parse a list of raw files and generate a DISDRODB L0A dataframe.
- Parameters:
reader – DISDRODB reader function. Format: reader(filepath, logger=None)
sensor_name (str) – Name of the sensor.
issue_dict (dict, optional) – Issue dictionary providing information on timesteps to remove. The default is an empty dictionary
{}. Valid issue_dict key are'timesteps'and'time_periods'. Valid issue_dict values are list of datetime64 values (with second accuracy). To correctly format and check the validity of theissue_dict, use thedisdrodb.l0.issue.check_issue_dictfunction.verbose (bool) – Whether to verbose the processing. The default is
True.
- Returns:
Dataframe
- Return type:
- Raises:
ValueError – Input parameters can not be used or the raw file can not be processed.
- disdrodb.generate_l0b(df: DataFrame, metadata: dict, logger=None, verbose: bool = False) Dataset[source][source]#
Transform the DISDRODB L0A dataframe to the DISDRODB L0B xr.Dataset.
- Parameters:
df (pandas.DataFrame) – DISDRODB L0A dataframe. The raw drop number spectrum is reshaped to a 2D(+time) array. The raw drop concentration and velocity are reshaped to 1D(+time) arrays.
metadata (dict) – DISDRODB station metadata. To use this function outside the DISDRODB routines, the dictionary must contain the fields:
sensor_name,latitude,longitude,altitude,platform_type.verbose (bool, optional) – Whether to verbose the processing. The default value is
False.
- Returns:
DISDRODB L0B dataset.
- Return type:
- Raises:
ValueError – Error if the DISDRODB L0B xarray dataset can not be created.
- disdrodb.generate_l0b_from_nc(filepaths: list | str, reader, sensor_name, metadata, issue_dict=None, verbose=True, logger=None)[source][source]#
Read and parse a list of raw netCDF files and generate a DISDRODB L0B dataset.
- Parameters:
reader – DISDRODB reader function. Format: reader(filepath, logger=None)
sensor_name (str) – Name of the sensor.
metadata (dict) – Station metadata to attach as global attributes to the xr.Dataset.
issue_dict (dict, optional) – Issue dictionary providing information on timesteps to remove. The default is an empty dictionary
{}. Valid issue_dict key are'timesteps'and'time_periods'. Valid issue_dict values are list of datetime64 values (with second accuracy). To correctly format and check the validity of theissue_dict, use thedisdrodb.l0.issue.check_issue_dictfunction.verbose (bool) – Whether to verbose the processing. The default is
True.
- Returns:
DISDRODB L0B Dataset.
- Return type:
- Raises:
ValueError – Input parameters can not be used or the raw file can not be processed.
- disdrodb.generate_l1(ds, fall_velocity_method='Beard1976', minimum_diameter=0, maximum_diameter=10, minimum_velocity=0, maximum_velocity=12, above_velocity_fraction=0.5, above_velocity_tolerance=None, below_velocity_fraction=0.5, below_velocity_tolerance=None, small_diameter_threshold=1, small_velocity_threshold=2.5, maintain_smallest_drops=True)[source][source]#
Generate DISDRODB L1 Dataset from DISDRODB L0C Dataset.
- Parameters:
ds (xarray.Dataset) – DISDRODB L0C dataset.
fall_velocity_method (str, optional) – Method to compute fall velocity. The default method is
"Beard1976".minimum_diameter (float, optional) – Minimum diameter for filtering. The default value is 0 mm.
maximum_diameter (float, optional) – Maximum diameter for filtering. The default value is 10 mm.
minimum_velocity (float, optional) – Minimum velocity for filtering. The default value is 0 m/s.
maximum_velocity (float, optional) – Maximum velocity for filtering. The default value is 12 m/s.
above_velocity_fraction (float, optional) – Fraction of drops above velocity threshold. The default value is 0.5.
above_velocity_tolerance (float or None, optional) – Tolerance for above velocity filtering. The default value is
None.below_velocity_fraction (float, optional) – Fraction of drops below velocity threshold. The default value is 0.5.
below_velocity_tolerance (float or None, optional) – Tolerance for below velocity filtering. The default value is
None.small_diameter_threshold (float, optional) – Threshold for small diameter drops. The default value is 1.
small_velocity_threshold (float, optional) – Threshold for small velocity drops. The default value is 2.5.
maintain_smallest_drops (bool, optional) – Whether to maintain the smallest drops. The default value is
True.
- Returns:
DISRODB L1 dataset.
- Return type:
- disdrodb.generate_l2_radar(ds, frequency=None, num_points=1024, diameter_max=10, canting_angle_std=7, axis_ratio_model='Thurai2007', permittivity_model='Turner2016', water_temperature=10, elevation_angle=0, parallel=True)[source][source]#
Simulate polarimetric radar variables from empirical drop number concentration or the estimated PSD.
- Parameters:
ds (xarray.Dataset) – Dataset containing the drop number concentration variable or the PSD parameters.
frequency (str, float, or list of str and float, optional) – Frequencies in GHz for which to compute the radar parameters. Alternatively, also strings can be used to specify common radar frequencies. If
None, the common radar frequencies will be used. Seedisdrodb.scattering.available_radar_bands().num_points (int or list of integer, optional) – Number of bins into which discretize the PSD.
diameter_max (float or list of float, optional) – Maximum diameter. The default value is 10 mm.
canting_angle_std (float or list of float, optional) – Standard deviation of the canting angle. The default value is 7.
axis_ratio_model (str or list of str, optional) – Models to compute the axis ratio. The default model is
Thurai2007. See available models withdisdrodb.scattering.available_axis_ratio_models().permittivity_model (str str or list of str, optional) – Permittivity model to use to compute the refractive index and the rayleigh_dielectric_factor. The default is
Turner2016. See available models withdisdrodb.scattering.available_permittivity_models().water_temperature (float or list of float, optional) – Water temperature in degree Celsius to be used in the permittivity model. The default is 10 degC.
elevation_angle (float or list of float, optional) – Radar elevation angles in degrees. Specify 90 degrees for vertically pointing radars. The default is 0 degrees.
parallel (bool, optional) – Whether to compute radar variables in parallel. The default value is
True.
- Returns:
Dataset containing the computed radar parameters.
- Return type:
- disdrodb.generate_l2e(ds, ds_env=None, compute_spectra=False, compute_percentage_contribution=False, minimum_ndrops=1, minimum_nbins=1, minimum_rain_rate=0.01)[source][source]#
Generate the DISDRODB L2E dataset from the DISDRODB L1 dataset.
- Parameters:
ds (xarray.Dataset) –
DISDRODB L1 dataset. Alternatively, a xarray dataset with at least:
variables: drop_number, fall_velocity
dimension: DIAMETER_DIMENSION
coordinates: diameter_bin_center, diameter_bin_width, sample_interval
attributes: sensor_name
ds_env (xarray.Dataset, optional) – Environmental dataset used for fall velocity and water density estimates. If None, a default environment dataset will be loaded.
- Returns:
DISRODB L2E dataset.
- Return type:
- disdrodb.generate_l2m(ds, psd_model, optimization=None, optimization_kwargs=None, diameter_min=0, diameter_max=10, diameter_spacing=0.05, ds_env=None, fall_velocity_method='Beard1976', minimum_ndrops=1, minimum_nbins=3, minimum_rain_rate=0.01, gof_metrics=True)[source][source]#
Generate the DISDRODB L2M dataset from a DISDRODB L2E dataset.
This function estimates PSD model parameters and successively computes DSD integral parameters. Optionally, radar variables at various bands are simulated using T-matrix simulations. Goodness-of-fit metrics of the PSD can also be optionally included into the output dataset.
- Parameters:
ds (xarray.Dataset) – DISDRODB L2E dataset.
psd_model (str) – The PSD model to fit. See
disdrodb.psd.available_psd_models().ds_env (xarray.Dataset, optional) – Environmental dataset used for fall velocity and water density estimates. If None, a default environment dataset will be loaded.
diameter_min (float, optional) – Minimum PSD diameter. The default value is 0 mm.
diameter_max (float, optional) – Maximum PSD diameter. The default value is 8 mm.
diameter_spacing (float, optional) – PSD diameter spacing. The default value is 0.05 mm.
optimization (str, optional) – The fitting optimization procedure. Either “GS” (Grid Search), “ML (Maximum Likelihood) or “MOM” (Method of Moments).
optimization_kwargs (dict, optional) – Dictionary with arguments to customize the fitting procedure.
minimum_nbins (int) – Minimum number of bins with drops required to fit the PSD model. The default value is 5.
gof_metrics (bool, optional) – Whether to add goodness-of-fit metrics to the output dataset. The default is True.
- Returns:
DISDRODB L2M dataset.
- Return type:
- disdrodb.get_data_archive_dir(data_archive_dir=None)[source][source]#
Return the DISDRODB base directory.
- disdrodb.get_metadata_archive_dir(metadata_archive_dir=None)[source][source]#
Return the DISDRODB Metadata Archive Directory.
- disdrodb.get_product_options(product, temporal_resolution=None)[source][source]#
Get options for DISDRODB products.
- disdrodb.get_reader(reader_reference, sensor_name)[source][source]#
Retrieve the reader function.
- Parameters:
- Returns:
The
reader()function.- Return type:
callable
- disdrodb.get_scattering_table_dir(scattering_table_dir=None)[source][source]#
Return the directory where DISDRODB save pyTMatrix scattering tables.
- disdrodb.get_station_reader(data_source, campaign_name, station_name, metadata_archive_dir=None)[source][source]#
Retrieve the reader function of a specific DISDRODB station.
- disdrodb.open_dataset(data_source, campaign_name, station_name, product, product_kwargs=None, debugging_mode: bool = False, data_archive_dir: str | None = None, chunks=-1, parallel=False, compute=False, start_time=None, end_time=None, variables=None, **open_kwargs)[source][source]#
Retrieve DISDRODB product files for a give station.
- Parameters:
data_source (str) – The name of the institution (for campaigns spanning multiple countries) or the name of the country (for campaigns or sensor networks within a single country). Must be provided in UPPER CASE.
campaign_name (str) – The name of the campaign. Must be provided in UPPER CASE.
station_name (str) – The name of the station.
product (str) – The name DISDRODB product.
sample_interval (int, optional) – The sampling interval in seconds of the product. It must be specified only for product L2E and L2M !
rolling (bool, optional) – Whether the dataset has been resampled by aggregating or rolling. It must be specified only for product L2E and L2M !
model_name (str) – The model name of the statistical distribution for the DSD. It must be specified only for product L2M !
debugging_mode (bool, optional) – If
True, it select maximum 3 files for debugging purposes. The default value isFalse.data_archive_dir (str, optional) – The base directory of DISDRODB, expected in the format
<...>/DISDRODB. If not specified, the path specified in the DISDRODB active configuration will be used.
- Return type:
- disdrodb.open_logs_directory(data_source, campaign_name, station_name=None, data_archive_dir=None)[source][source]#
Open the DISDRODB Data Archive logs directory of a station.
- disdrodb.open_metadata_directory(data_source, campaign_name, station_name=None, metadata_archive_dir=None)[source][source]#
Open the DISDRODB Metadata Archive station(s) metadata directory.
- disdrodb.open_product_directory(product, data_source, campaign_name, station_name, data_archive_dir=None)[source][source]#
Open the DISDRODB Data Archive station product directory.
- disdrodb.open_sensor_documentation(sensor_name)[source][source]#
Open the sensor documentation PDF in the browser.
- disdrodb.read_metadata_archive(metadata_archive_dir=None, data_sources=None, campaign_names=None, station_names=None, available_data=False)[source][source]#
Read the DISDRODB Metadata Archive Database.
- Parameters:
metadata_archive_dir (str or Path-like, optional) – Path to the root of the DISDRODB Metadata Archive. If None, the default metadata base directory is used. Default is None.
data_sources (str or sequence of str, optional) – One or more data source identifiers to filter stations by. If None, no filtering on data source is applied. The default is is None.
campaign_names (str or sequence of str, optional) – One or more campaign names to filter stations by. If None, no filtering on campaign is applied. The default is is None.
station_names (str or sequence of str, optional) – One or more station names to include. If None, all stations matching other filters are considered. The default is is None.
available_data (bool, optional) – If True, only information of stations with data available in the online DISDRODB Decentralized Data Archive are returned. If False (the default), all stations present in the DISDRODB Metadata Archive matching the filtering criteria are returned,
- Return type:
- disdrodb.read_station_metadata(data_source, campaign_name, station_name, metadata_archive_dir=None)[source][source]#
Open the station metadata YAML file into a dictionary.
- Parameters:
data_source (str) – The name of the institution (for campaigns spanning multiple countries) or the name of the country (for campaigns or sensor networks within a single country). Must be provided in UPPER CASE.
campaign_name (str) – The name of the campaign. Must be provided in UPPER CASE.
station_name (str) – The name of the station.
metadata_archive_dir (str, optional) – The directory path where the DISDRODB Metadata Archive is located. If not specified, the path specified in the DISDRODB active configuration will be used. Expected path format:
<...>/DISDRODB.
- Returns:
metadata – The station metadata dictionary
- Return type:
dictionary
- disdrodb.run_l0(data_sources=None, campaign_names=None, station_names=None, l0a_processing: bool = True, l0b_processing: bool = True, l0c_processing: bool = True, remove_l0a: bool = False, remove_l0b: bool = False, force: bool = False, verbose: bool = False, debugging_mode: bool = False, parallel: bool = True, data_archive_dir: str | None = None, metadata_archive_dir: str | None = None)[source][source]#
Run the L0 processing of DISDRODB stations.
This function allows to launch the processing of many DISDRODB stations with a single command. From the list of all available DISDRODB stations, it runs the processing of the stations matching the provided data_sources, campaign_names and station_names.
- Parameters:
data_sources (list) – Name of data source(s) to process. The name(s) must be UPPER CASE. If campaign_names and station are not specified, process all stations. The default value is
None.campaign_names (list) – Name of the campaign(s) to process. The name(s) must be UPPER CASE. The default value is
None.station_names (list) – Station names to process. The default value is
None.l0a_processing (bool) – Whether to launch processing to generate L0A Apache Parquet file(s) from raw data. The default value is
True.l0b_processing (bool) – Whether to launch processing to generate L0B netCDF4 file(s) from L0A data. The default value is
True.l0c_processing (bool) – Whether to launch processing to generate L0C netCDF4 file(s) from L0B data. The default value is
True.remove_l0a (bool) – Whether to keep the L0A files after having generated the L0B netCDF products. The default value is
False.remove_l0b (bool) – Whether to remove the L0B files after having produced all L0C netCDF files. The default value is
False.force (bool) – If
True, overwrite existing data into destination directories. IfFalse, raise an error if there are already data into destination directories. The default value isFalse.verbose (bool) – Whether to print detailed processing information into terminal. The default value is
False.parallel (bool) – If
True, the files are processed simultaneously in multiple processes. Each process will use a single thread to avoid issues with the HDF/netCDF library. By default, the number of process is defined withos.cpu_count(). IfFalse, the files are processed sequentially in a single process. IfFalse, multi-threading is automatically exploited to speed up I/0 tasks.debugging_mode (bool) – If
True, it reduces the amount of data to process. For L0A, it processes just the first 3 raw data files. For L0B, it processes 100 rows sampled from 3 L0A files. The default value isFalse.data_archive_dir (str (optional)) – The directory path where the DISDRODB Data Archive is located. The directory path must end with
<...>/DISDRODB. IfNone, it uses thedata_archive_dirpath specified in the DISDRODB active configuration.metadata_archive_dir – The directory path where the DISDRODB Metadata Archive is located. The directory path must end with
<...>/DISDRODB-METADATA/DISDRODB. IfNone, it uses themetadata_archive_dirpath specified in the DISDRODB active configuration.
- disdrodb.run_l0_station(data_source, campaign_name, station_name, l0a_processing: bool = True, l0b_processing: bool = True, l0c_processing: bool = True, remove_l0a: bool = False, remove_l0b: bool = False, force: bool = False, verbose: bool = False, debugging_mode: bool = False, parallel: bool = True, data_archive_dir: str | None = None, metadata_archive_dir: str | None = None)[source][source]#
Run the L0 processing of a specific DISDRODB station from the terminal.
- Parameters:
data_source (str) – Institution name (when campaign data spans more than 1 country), or country (when all campaigns (or sensor networks) are inside a given country). Must be UPPER CASE.
campaign_name (str) – Campaign name. Must be UPPER CASE.
station_name (str) – Station name
l0a_processing (bool) – Whether to launch processing to generate L0A Apache Parquet file(s) from raw data. The default value is
True.l0b_processing (bool) – Whether to launch processing to generate L0B netCDF4 file(s) from L0A data. The default value is
True.l0b_processing – Whether to launch processing to generate L0C netCDF4 file(s) from L0B data. The default value is
True.l0c_processing (bool) – Whether to launch processing to generate L0C netCDF4 file(s) from L0C data. The default is True.
remove_l0a (bool) – Whether to keep the L0A files after having generated the L0B netCDF products. The default value is
False.remove_l0b (bool) – Whether to remove the L0B files after having produced L0C netCDF files. The default is False.
force (bool) – If
True, overwrite existing data into destination directories. IfFalse, raise an error if there are already data into destination directories. The default value isFalse.verbose (bool) – Whether to print detailed processing information into terminal. The default value is
True.parallel (bool) – If
True, the files are processed simultaneously in multiple processes. Each process will use a single thread to avoid issues with the HDF/netCDF library. By default, the number of process is defined withos.cpu_count(). IfFalse, the files are processed sequentially in a single process. IfFalse, multi-threading is automatically exploited to speed up I/0 tasks.debugging_mode (bool) – If
True, it reduces the amount of data to process. For L0A, it processes just the first 3 raw data files for each station. For L0B, it processes 100 rows sampled from 3 L0A files for each station. The default value isFalse.data_archive_dir (str (optional)) – The directory path where the DISDRODB Data Archive is located. The directory path must end with
<...>/DISDRODB. IfNone, it uses thedata_archive_dirpath specified in the DISDRODB active configuration.
- disdrodb.run_l0a(data_sources=None, campaign_names=None, station_names=None, force: bool = False, verbose: bool = False, debugging_mode: bool = False, parallel: bool = True, data_archive_dir: str | None = None, metadata_archive_dir: str | None = None)[source][source]#
Run the L0A processing of DISDRODB stations.
This function allows to launch the processing of many DISDRODB stations with a single command. From the list of all available DISDRODB stations, it runs the processing of the stations matching the provided data_sources, campaign_names and station_names.
- Parameters:
data_sources (list) – Name of data source(s) to process. The name(s) must be UPPER CASE. If campaign_names and station are not specified, process all stations. The default value is
None.campaign_names (list) – Name of the campaign(s) to process. The name(s) must be UPPER CASE. The default value is
None.station_names (list) – Station names to process. The default value is
None.force (bool) – If
True, overwrite existing data into destination directories. IfFalse, raise an error if there are already data into destination directories. The default value isFalse.verbose (bool) – Whether to print detailed processing information into terminal. The default value is
True.parallel (bool) – If
True, the files are processed simultaneously in multiple processes. By default, the number of process is defined withos.cpu_count(). IfFalse, the files are processed sequentially in a single process.debugging_mode (bool) – If
True, it processes just the first 3 raw data files. The default value isFalse.data_archive_dir (str (optional)) – The directory path where the DISDRODB Data Archive is located. The directory path must end with
<...>/DISDRODB. IfNone, it uses thedata_archive_dirpath specified in the DISDRODB active configuration.metadata_archive_dir – The directory path where the DISDRODB Metadata Archive is located. The directory path must end with
<...>/DISDRODB-METADATA/DISDRODB. IfNone, it uses themetadata_archive_dirpath specified in the DISDRODB active configuration.
- disdrodb.run_l0a_station(data_source, campaign_name, station_name, force: bool = False, verbose: bool = False, debugging_mode: bool = False, parallel: bool = True, data_archive_dir: str | None = None, metadata_archive_dir: str | None = None)[source][source]#
Run the L0A processing of a station by invoking the disdrodb_run_l0a_station command in the terminal.
- Parameters:
data_source (str) – The name of the data source.
campaign_name (str) – The name of the campaign.
station_name (str) – The name of the station.
force (bool, optional) – If
True, overwrite existing data in destination directories. The default value isFalse.verbose (bool, optional) – If
True, print detailed processing information to the terminal. The default value isFalse.debugging_mode (bool, optional) – If
True, reduce the amount of data to process for debugging. The default value isFalse.parallel (bool, optional) – If
True, process files in multiple processes simultaneously. The default value isTrue.data_archive_dir – The directory path where the local DISDRODB Data Archive is located. The directory path must end with
<...>/DISDRODB. IfNone, it uses thedata_archive_dirpath specified in the DISDRODB active configuration.metadata_archive_dir – The directory path where the DISDRODB Metadata Archive is located. The directory path must end with
<...>/DISDRODB-METADATA/DISDRODB. IfNone, it uses themetadata_archive_dirpath specified in the DISDRODB active configuration.
- disdrodb.run_l0b(data_sources=None, campaign_names=None, station_names=None, remove_l0a: bool = False, force: bool = False, verbose: bool = False, debugging_mode: bool = False, parallel: bool = True, data_archive_dir: str | None = None, metadata_archive_dir: str | None = None)[source][source]#
Run the L0B processing of DISDRODB stations.
This function allows to launch the processing of many DISDRODB stations with a single command. From the list of all available DISDRODB L0A stations, it runs the processing of the stations matching the provided data_sources, campaign_names and station_names.
- Parameters:
data_sources (list) – Name of data source(s) to process. The name(s) must be UPPER CASE. If campaign_names and station are not specified, process all stations. The default value is
None.campaign_names (list) – Name of the campaign(s) to process. The name(s) must be UPPER CASE. The default value is
None.station_names (list) – Station names to process. The default value is
None.remove_l0a (bool) – Whether to keep the L0A files after having generated the L0B netCDF products. The default value is
False.force (bool) – If
True, overwrite existing data into destination directories. IfFalse, raise an error if there are already data into destination directories. The default value isFalse.verbose (bool) – Whether to print detailed processing information into terminal. The default value is
True.parallel (bool) – If
True, the files are processed simultaneously in multiple processes. By default, the number of process is defined withos.cpu_count(). IfFalse, the files are processed sequentially in a single process.debugging_mode (bool) – If
True, it reduces the amount of data to process. For L0B, it processes 100 rows sampled from 3 L0A files. The default value isFalse.data_archive_dir (str (optional)) – The directory path where the DISDRODB Data Archive is located. The directory path must end with
<...>/DISDRODB. IfNone, it uses thedata_archive_dirpath specified in the DISDRODB active configuration.metadata_archive_dir – The directory path where the DISDRODB Metadata Archive is located. The directory path must end with
<...>/DISDRODB-METADATA/DISDRODB. IfNone, it uses themetadata_archive_dirpath specified in the DISDRODB active configuration.
- disdrodb.run_l0b_station(data_source, campaign_name, station_name, remove_l0a: bool = False, force: bool = False, verbose: bool = False, debugging_mode: bool = False, parallel: bool = True, data_archive_dir: str | None = None, metadata_archive_dir: str | None = None)[source][source]#
Run the L0B processing of a station by invoking the disdrodb_run_l0b_station command in the terminal.
- Parameters:
data_archive_dir – The directory path where the local DISDRODB Data Archive is located. The directory path must end with
<...>/DISDRODB. IfNone, it uses thedata_archive_dirpath specified in the DISDRODB active configuration.metadata_archive_dir – The directory path where the DISDRODB Metadata Archive is located. The directory path must end with
<...>/DISDRODB-METADATA/DISDRODB. IfNone, it uses themetadata_archive_dirpath specified in the DISDRODB active configuration.data_source (str) – The name of the data source.
campaign_name (str) – The name of the campaign.
station_name (str) – The name of the station.
remove_l0a (bool, optional) – Whether to keep the L0A files after generating L0B netCDF files. The default value is
False.force (bool, optional) – If
True, overwrite existing data in destination directories. The default value isFalse.verbose (bool, optional) – If
True, print detailed processing information to the terminal. The default value isFalse.debugging_mode (bool, optional) – If
True, reduce the amount of data processed for debugging. The default value isFalse.parallel (bool, optional) – If
True, process files in multiple processes simultaneously. The default value isTrue.
- disdrodb.run_l0c(data_sources=None, campaign_names=None, station_names=None, remove_l0b: bool = False, force: bool = False, verbose: bool = False, debugging_mode: bool = False, parallel: bool = True, data_archive_dir: str | None = None, metadata_archive_dir: str | None = None)[source][source]#
Run the L0C processing of DISDRODB stations.
This function allows to launch the processing of many DISDRODB stations with a single command. From the list of all available DISDRODB stations, it runs the processing of the stations matching the provided data_sources, campaign_names and station_names.
- Parameters:
data_sources (list) – Name of data source(s) to process. The name(s) must be UPPER CASE. If campaign_names and station are not specified, process all stations. The default value is
None.campaign_names (list) – Name of the campaign(s) to process. The name(s) must be UPPER CASE. The default value is
None.station_names (list) – Station names to process. The default value is
None.remove_l0b (bool) – Whether to remove the L0B files after having produced L0C netCDF files. The default value is
False.force (bool) – If
True, overwrite existing data into destination directories. IfFalse, raise an error if there are already data into destination directories. The default value isFalse.verbose (bool) – Whether to print detailed processing information into terminal. The default value is
False.parallel (bool) – If
True, the files are processed simultaneously in multiple processes. Each process will use a single thread to avoid issues with the HDF/netCDF library. By default, the number of process is defined withos.cpu_count(). IfFalse, the files are processed sequentially in a single process. IfFalse, multi-threading is automatically exploited to speed up I/0 tasks.debugging_mode (bool) – If
True, it reduces the amount of data to process. For L1B, it processes just 3 L0B files. The default value isFalse.data_archive_dir (str (optional)) – The directory path where the DISDRODB Data Archive is located. The directory path must end with
<...>/DISDRODB. IfNone, it uses thedata_archive_dirpath specified in the DISDRODB active configuration.metadata_archive_dir – The directory path where the DISDRODB Metadata Archive is located. The directory path must end with
<...>/DISDRODB-METADATA/DISDRODB. IfNone, it uses themetadata_archive_dirpath specified in the DISDRODB active configuration.
- disdrodb.run_l0c_station(data_source, campaign_name, station_name, remove_l0b: bool = False, force: bool = False, verbose: bool = False, debugging_mode: bool = False, parallel: bool = True, data_archive_dir: str | None = None, metadata_archive_dir: str | None = None)[source][source]#
Run the L0C processing of a station by invoking the disdrodb_run_l0c_station command in the terminal.
- Parameters:
data_source (str) – The name of the data source.
campaign_name (str) – The name of the campaign.
station_name (str) – The name of the station.
remove_l0b (bool, optional) – Whether to remove the L0B files after generating L0C netCDF files. The default value is
False.force (bool, optional) – If
True, overwrite existing data in destination directories. The default value isFalse.verbose (bool, optional) – If
True, print detailed processing information to the terminal. The default value isFalse.debugging_mode (bool, optional) – If
True, reduce the amount of data processed for debugging. The default value isFalse.parallel (bool, optional) – If
True, process files in multiple processes simultaneously. The default value isTrue.data_archive_dir – The directory path where the local DISDRODB Data Archive is located. The directory path must end with
<...>/DISDRODB. IfNone, it uses thedata_archive_dirpath specified in the DISDRODB active configuration.metadata_archive_dir – The directory path where the DISDRODB Metadata Archive is located. The directory path must end with
<...>/DISDRODB-METADATA/DISDRODB. IfNone, it uses themetadata_archive_dirpath specified in the DISDRODB active configuration.
- disdrodb.run_l1(data_sources=None, campaign_names=None, station_names=None, force: bool = False, verbose: bool = False, debugging_mode: bool = False, parallel: bool = True, data_archive_dir: str | None = None, metadata_archive_dir: str | None = None)[source][source]#
Run the L1 processing of DISDRODB stations.
This function allows to launch the processing of many DISDRODB stations with a single command. From the list of all available DISDRODB stations, it runs the processing of the stations matching the provided data_sources, campaign_names and station_names.
- Parameters:
data_sources (list) – Name of data source(s) to process. The name(s) must be UPPER CASE. If campaign_names and station are not specified, process all stations. The default value is
None.campaign_names (list) – Name of the campaign(s) to process. The name(s) must be UPPER CASE. The default value is
None.station_names (list) – Station names to process. The default value is
None.force (bool) – If
True, overwrite existing data into destination directories. IfFalse, raise an error if there are already data into destination directories. The default value isFalse.verbose (bool) – Whether to print detailed processing information into terminal. The default value is
False.parallel (bool) – If
True, the files are processed simultaneously in multiple processes. Each process will use a single thread to avoid issues with the HDF/netCDF library. By default, the number of process is defined withos.cpu_count(). IfFalse, the files are processed sequentially in a single process. IfFalse, multi-threading is automatically exploited to speed up I/0 tasks.debugging_mode (bool) – If
True, it reduces the amount of data to process. For L1B, it processes just 3 L0B files. The default value isFalse.data_archive_dir (str (optional)) – The directory path where the DISDRODB Data Archive is located. The directory path must end with
<...>/DISDRODB. IfNone, it uses thedata_archive_dirpath specified in the DISDRODB active configuration.metadata_archive_dir – The directory path where the DISDRODB Metadata Archive is located. The directory path must end with
<...>/DISDRODB-METADATA/DISDRODB. IfNone, it uses themetadata_archive_dirpath specified in the DISDRODB active configuration.
- disdrodb.run_l1_station(data_source, campaign_name, station_name, force: bool = False, verbose: bool = False, debugging_mode: bool = False, parallel: bool = True, data_archive_dir: str | None = None, metadata_archive_dir: str | None = None)[source][source]#
Run the L1 processing of a station by invoking the disdrodb_run_l1_station command in the terminal.
- Parameters:
data_source (str) – The name of the data source.
campaign_name (str) – The name of the campaign.
station_name (str) – The name of the station.
force (bool, optional) – If
True, overwrite existing data in destination directories. The default value isFalse.verbose (bool, optional) – If
True, print detailed processing information to the terminal. The default value isFalse.debugging_mode (bool, optional) – If
True, reduce the amount of data processed for debugging. The default value isFalse.parallel (bool, optional) – If
True, process files in multiple processes simultaneously. The default value isTrue.data_archive_dir – The directory path where the local DISDRODB Data Archive is located. The directory path must end with
<...>/DISDRODB. IfNone, it uses thedata_archive_dirpath specified in the DISDRODB active configuration.metadata_archive_dir – The directory path where the DISDRODB Metadata Archive is located. The directory path must end with
<...>/DISDRODB-METADATA/DISDRODB. IfNone, it uses themetadata_archive_dirpath specified in the DISDRODB active configuration.
- disdrodb.run_l2e(data_sources=None, campaign_names=None, station_names=None, force: bool = False, verbose: bool = False, debugging_mode: bool = False, parallel: bool = True, data_archive_dir: str | None = None, metadata_archive_dir: str | None = None)[source][source]#
Run the L2E processing of DISDRODB stations.
This function allows to launch the processing of many DISDRODB stations with a single command. From the list of all available DISDRODB stations, it runs the processing of the stations matching the provided data_sources, campaign_names and station_names.
- Parameters:
data_sources (list) – Name of data source(s) to process. The name(s) must be UPPER CASE. If campaign_names and station are not specified, process all stations. The default value is
None.campaign_names (list) – Name of the campaign(s) to process. The name(s) must be UPPER CASE. The default value is
None.station_names (list) – Station names to process. The default value is
None.force (bool) – If
True, overwrite existing data into destination directories. IfFalse, raise an error if there are already data into destination directories. The default value isFalse.verbose (bool) – Whether to print detailed processing information into terminal. The default value is
False.parallel (bool) – If
True, the files are processed simultaneously in multiple processes. Each process will use a single thread to avoid issues with the HDF/netCDF library. By default, the number of process is defined withos.cpu_count(). IfFalse, the files are processed sequentially in a single process. IfFalse, multi-threading is automatically exploited to speed up I/0 tasks.debugging_mode (bool) – If
True, it reduces the amount of data to process. For L2E, it processes just 3 L1 files. The default value isFalse.data_archive_dir (str (optional)) – The directory path where the DISDRODB Data Archive is located. The directory path must end with
<...>/DISDRODB. IfNone, it uses thedata_archive_dirpath specified in the DISDRODB active configuration.metadata_archive_dir – The directory path where the DISDRODB Metadata Archive is located. The directory path must end with
<...>/DISDRODB-METADATA/DISDRODB. IfNone, it uses themetadata_archive_dirpath specified in the DISDRODB active configuration.
- disdrodb.run_l2e_station(data_source, campaign_name, station_name, force: bool = False, verbose: bool = False, debugging_mode: bool = False, parallel: bool = True, data_archive_dir: str | None = None, metadata_archive_dir: str | None = None)[source][source]#
Run the L2E processing of a station by invoking the disdrodb_run_l2e_station command in the terminal.
- Parameters:
data_source (str) – The name of the data source.
campaign_name (str) – The name of the campaign.
station_name (str) – The name of the station.
force (bool, optional) – If
True, overwrite existing data in destination directories. The default value isFalse.verbose (bool, optional) – If
True, print detailed processing information to the terminal. The default value isFalse.debugging_mode (bool, optional) – If
True, reduce the amount of data processed for debugging. The default value isFalse.parallel (bool, optional) – If
True, process files in multiple processes simultaneously. The default value isTrue.data_archive_dir – The directory path where the local DISDRODB Data Archive is located. The directory path must end with
<...>/DISDRODB. IfNone, it uses thedata_archive_dirpath specified in the DISDRODB active configuration.metadata_archive_dir – The directory path where the DISDRODB Metadata Archive is located. The directory path must end with
<...>/DISDRODB-METADATA/DISDRODB. IfNone, it uses themetadata_archive_dirpath specified in the DISDRODB active configuration.
- disdrodb.run_l2m(data_sources=None, campaign_names=None, station_names=None, force: bool = False, verbose: bool = False, debugging_mode: bool = False, parallel: bool = True, data_archive_dir: str | None = None, metadata_archive_dir: str | None = None)[source][source]#
Run the L2M processing of DISDRODB stations.
This function allows to launch the processing of many DISDRODB stations with a single command. From the list of all available DISDRODB stations, it runs the processing of the stations matching the provided data_sources, campaign_names and station_names.
- Parameters:
data_sources (list) – Name of data source(s) to process. The name(s) must be UPPER CASE. If campaign_names and station are not specified, process all stations. The default value is
None.campaign_names (list) – Name of the campaign(s) to process. The name(s) must be UPPER CASE. The default value is
None.station_names (list) – Station names to process. The default value is
None.force (bool) – If
True, overwrite existing data into destination directories. IfFalse, raise an error if there are already data into destination directories. The default value isFalse.verbose (bool) – Whether to print detailed processing information into terminal. The default value is
False.parallel (bool) – If
True, the files are processed simultaneously in multiple processes. Each process will use a single thread to avoid issues with the HDF/netCDF library. By default, the number of process is defined withos.cpu_count(). IfFalse, the files are processed sequentially in a single process. IfFalse, multi-threading is automatically exploited to speed up I/0 tasks.debugging_mode (bool) – If
True, it reduces the amount of data to process. For L2MB, it processes just 3 L0B files. The default value isFalse.data_archive_dir (str (optional)) – The directory path where the DISDRODB Data Archive is located. The directory path must end with
<...>/DISDRODB. IfNone, it uses thedata_archive_dirpath specified in the DISDRODB active configuration.metadata_archive_dir – The directory path where the DISDRODB Metadata Archive is located. The directory path must end with
<...>/DISDRODB-METADATA/DISDRODB. IfNone, it uses themetadata_archive_dirpath specified in the DISDRODB active configuration.
- disdrodb.run_l2m_station(data_source, campaign_name, station_name, force: bool = False, verbose: bool = False, debugging_mode: bool = False, parallel: bool = True, data_archive_dir: str | None = None, metadata_archive_dir: str | None = None)[source][source]#
Run the L2M processing of a station by invoking the disdrodb_run_l2m_station command in the terminal.
- Parameters:
data_source (str) – The name of the data source.
campaign_name (str) – The name of the campaign.
station_name (str) – The name of the station.
force (bool, optional) – If
True, overwrite existing data in destination directories. The default value isFalse.verbose (bool, optional) – If
True, print detailed processing information to the terminal. The default value isFalse.debugging_mode (bool, optional) – If
True, reduce the amount of data processed for debugging. The default value isFalse.parallel (bool, optional) – If
True, process files in multiple processes simultaneously. The default value isTrue.data_archive_dir – The directory path where the local DISDRODB Data Archive is located. The directory path must end with
<...>/DISDRODB. IfNone, it uses thedata_archive_dirpath specified in the DISDRODB active configuration.metadata_archive_dir – The directory path where the DISDRODB Metadata Archive is located. The directory path must end with
<...>/DISDRODB-METADATA/DISDRODB. IfNone, it uses themetadata_archive_dirpath specified in the DISDRODB active configuration.