Skip to main content
Ctrl+K
mhm_tools  documentation - Home mhm_tools  documentation - Home
  • CLI usage
  • API reference
  • About
  • mHM documentation
  • Source code
  • mHM homepage
  • CLI usage
  • API reference
  • About
  • mHM documentation
  • Source code
  • mHM homepage

Section Navigation

  • API reference

Subpackages

  • Common
    • metrics
      • esp
        • ESP
      • metrics_handler
        • calculate_esp_for_gridded_data
        • calculate_metric_per_timestep_and_average
        • calculate_mspaef_for_gridded_data
        • calculate_results_metric
        • calculate_spaef_for_gridded_data
        • calculate_waspaef_for_gridded_data
        • create_csv_from_dict
        • create_results_csv
        • normalize_results_metric
      • mspaef
        • MSPAEF
      • spaef
        • SPAEF
        • filter_nan
      • tsm
        • calculate_objectives_for_gridded_data
        • calculate_tsm_for_gridded_data
        • create_dic_of_objective_functions
        • desesonalized_nan_area_mean
        • filter_nan
        • nan_area_mean
        • norm_deviation
        • nothing
        • objective_functions
      • waspaef
        • WASPAEF
    • cli_utils
      • get_available_mem_in_unit
      • get_coords
      • get_coords_from_mask
      • parse_coords
    • constants
    • esri_grid
      • check_grid_compatibility
      • check_resolutions
      • read_grid
      • read_header
      • rescale_grid
      • standardize_header
      • write_grid
      • write_header
    • file_handler
      • ChunkType
      • GridDefinition
      • chunk_dataset
      • chunk_dataset_space_and_time
      • chunk_dataset_space_only
      • create_header
      • crop_file_by_mask
      • get_coord_values
      • get_dataset_from_path
      • get_grid
      • get_xarray_ds_from_file
      • read_ascii_to_xarray
      • set_grid
      • write_xarray_to_ascii
      • write_xarray_to_file
      • write_xarray_to_netcdf
    • logger
      • ErrorLogger
      • configure_mhm_tools_logger
      • get_log_level
      • get_lowest_level
      • log_arguments
      • log_errors
    • netcdf
      • apply_cf_baseline_metadata
      • generate_bounds
      • generate_bounds_for_all_coords
      • get_netcdf_metadata_data_vars
      • move_reserved_attrs_to_encoding
      • prepare_dataset_for_netcdf_write
      • prepare_time_bounds_encoding
      • read_dataset
      • sanitize_coordinate_encoding
      • sanitize_nc_encoding
      • set_netcdf_encoding
    • plotter
      • calculate_cdf_values
      • create_metric_summary_rows
      • plot_cdf_values
      • plot_constant_data_map
      • plot_discrete_data_map
      • plot_map
      • plot_metric_cdf_comparison
      • plot_metric_violin_comparison
      • write_metric_plot_overview_pdf
    • provenance
      • apply_output_provenance
      • creation_date
    • resolution_handler
      • Resolution
      • get_file_res
    • time_utils
      • resample_to_daily_or_hourly_adaptive
    • utils
      • align_bounds_to_l2
      • coord_to_index
      • cut_to_filled_area
      • dict_to_multiline_string
      • distance_100m_units
      • find_best_gauge_location_by_area
      • get_upscaling_factor
      • pretty_print_df
    • xarray_utils
      • climatology
      • crop_ds
      • get_clim_from_ds
      • get_coord_key
      • get_ds_extend
      • get_dtype
      • get_overlapping_time_slice
      • get_single_data_var
      • induce_data_var_from_file_name
      • normalize_lat_lon
      • snap_to_target
      • spearman_correlation
      • timedelta_to_alias
  • Post
    • bankfull
      • bankfull_discharge
      • calc_q_bkfl
      • find_nearest_idx
    • difference
      • OutputOptions
      • PlotOptions
      • calc_diff
    • discharge_evaluation
      • Q_data_to_xarray
      • boostap_statistics
      • evaludate_discharge_data
      • filter_ids_by_observed_years
      • flatten_list
      • gen_list_of_result_dicts
      • get_discharge_metric_values_by_variable
      • get_gauge_coords
      • get_grdc_for_one_gauge
      • get_hydrograph_pdf_files
      • get_sim_data_for_gauges_from_nodes
      • get_sim_data_for_one_gauge
      • load_ds
      • plot_cdf
      • plot_kde
      • plot_map
      • plot_metric_violins
    • gridded_data_evaluation
    • hydrograph
      • Catchment
      • Hydrograph
      • Objectives
      • gen_hydrograph_by_data_sets
      • get_hydrograph_from_path
    • long_term_mean
      • aggregate_files
      • cal_long_term_mean
    • mhm_run_overview
      • NmlStringAssignment
      • collect_input_netcdf_files
      • collect_input_time_reference_files
      • collect_output_flux_files
      • collect_stats_rows
      • compute_variable_stats
      • create_mhm_run_overview
      • guess_time_dim
      • parse_namelist_string_assignments
      • resolve_namelist_path
    • ratio
      • calc_ratio
    • relative_difference
      • calc_rel_diff
    • taylor_diagram
      • calc_tim_mean
      • generate_taylor_diagram
      • mask_nan
      • prepare_da
  • Pre
    • catchment
      • Catchment
      • Gauge
      • create_catchment
      • create_cell_area
      • get_transformation_matrix_nc
      • is_data_global
      • merge_catchment
      • write_gauges_out
      • write_gauges_to_csv
      • write_gauges_to_nc
    • create_id_gauges
      • create_id_gauges
      • write_gauge_id
    • create_mhm_restart_file
      • Grid
      • LatLon
      • MHMRestartFile
      • MPRRunner
      • MorphFiles
    • create_mhm_restart_from_setup
      • MHMRunner
      • MHMSetupTile
      • create_mhm_restart_from_setup
      • create_setup_tiles
      • get_crop_slices
      • merge_mhm_restart_files
      • merge_restart_files
    • crop_mhm_setup
      • LatlonFiles
      • call_create_latlon
      • crop_file
      • crop_file_with_header
      • crop_mhm_setup
      • regrid_mask
    • fill_nearest
      • fill
      • fill_dataarray_with_nearest
      • fill_nearest
      • fill_one_file
      • nearest_indices
      • read_mask
    • landcover_ascii_to_nc
      • add_time_bounds_cf
      • convert_lc_ascii_to_nc
      • parse_nml_for_landcover
    • latlon
      • add_optional_level
      • create_latlon
      • get_header_from_file
      • xy_to_latlon
    • link_folder_tree
    • merge
      • merge_files
      • merge_files_from_folder
    • pet_calc
      • calculate_pet
      • e_rad_calculator
      • get_time_and_freq
      • pet_calculator
      • validate_tmin_tmax
    • prepare_mhm_forcings
      • convert_units
      • prepare_forcings
    • regrid
      • regrid
      • regrid_file
      • regrid_xarray
    • subdomain_masks
      • CreateSubdomainMasks
      • create_subdomain_masks
  • API reference
  • Common
  • file_handler
  • GridDefinition

GridDefinition#

class mhm_tools.common.file_handler.GridDefinition(template: Dataset, dims: Tuple[str, ...])[source]#

Bases: object

Container to preserve a dataset’s spatial grid metadata.

dims: Tuple[str, ...]#
template: Dataset#

previous

ChunkType

next

chunk_dataset

On this page
  • GridDefinition
    • GridDefinition.dims
    • GridDefinition.template

© Copyright 2021 - 2026, mHM-Tools Developers.

Built with the PyData Sphinx Theme 0.20.0.