create_catchment#

mhm_tools.pre.catchment.create_catchment(input_file, output_path, var_name, var, ftype, gauge_coords=None, coordinate_slices=None, mask_file=None, resolutions: Resolution = None, frame=1, upscale=False, latlon=True, available_mem=None, ref_catchment_area=None, max_distance_cells=5, max_error=0.1, gauge_ids=None, ncpus=1, output_vars=None, gauge_opti_method='basinex', shape_folder=None, gauge_info_file='gauges_info', id_gauges_out_path=None, raise_on_fallback=True)[source]#

Delineate global or local catchments from flow direction/DEM data.

Supports full-domain basin mapping, single- or multi-gauge delineation from coordinates and area, and optional shape-based outlet matching. Writes basin IDs, gauge ID files, masks, and optional gauge metadata/shapes.