cars.applications.dem_generation.dem_generation_wrappers ======================================================== .. py:module:: cars.applications.dem_generation.dem_generation_wrappers .. autoapi-nested-parse:: this module contains tools for the dem generation Functions --------- .. autoapisummary:: cars.applications.dem_generation.dem_generation_wrappers.fit_initial_elevation_on_dem_median cars.applications.dem_generation.dem_generation_wrappers.add_margin cars.applications.dem_generation.dem_generation_wrappers.compute_stats cars.applications.dem_generation.dem_generation_wrappers.edit_transform cars.applications.dem_generation.dem_generation_wrappers.reverse_dem cars.applications.dem_generation.dem_generation_wrappers.downsample_dem cars.applications.dem_generation.dem_generation_wrappers.modify_terrain_bounds cars.applications.dem_generation.dem_generation_wrappers.reproject_dem Module Contents --------------- .. py:function:: fit_initial_elevation_on_dem_median(dem_to_fit_path: str, dem_ref_path: str, dem_out_path: str) Coregistrates the two DEMs given then saves the result. The initial elevation will be cropped to reduce computation costs. Returns the transformation applied. :param dem_to_fit_path: Path to the dem to be fitted :type dem_to_fit_path: str :param dem_ref_path: Path to the dem to fit onto :type dem_ref_path: str :param dem_out_path: Path to save the resulting dem into :type dem_out_path: str :return: coregistration transformation applied :rtype: dict .. py:function:: add_margin(bbox, ratio=1) Add margin to a bounding box :param bbox: input bounding box :type bbox: rasterio.coords.BoundingBox :param ratio: factor of bbox size to add to each side of bbox :type ratio: float :return: bounding box with margins :rtype: rasterio.coords.BoundingBox .. py:function:: compute_stats(diff) Compute and display statistics of difference between two DEM : Minimum, median, percentiles and maximum :param diff: altimetric difference between two DEM :type diff: numpy.array .. py:function:: edit_transform(input_dem, resolution=None, transform=None) Change transform of an image :param input_res: path of image :type input_dem: str :param resolution: image resolution for new transform to apply :type resolution: float :param transform: new transform to apply if resolution is not given :type transform: affine.Affine .. py:function:: reverse_dem(input_dem) Compute the opposite of a DEM : Altitudes sign is changed :param input_dem: path of DEM to reverse :type input_dem: str .. py:function:: downsample_dem(input_dem, scale, interpolator, median_filter_size=None, default_alt=0) Downsample median DEM with median resampling :param input_dem: path of DEM to downsample (only one band) :type input_dem: str .. py:function:: modify_terrain_bounds(terrain_bounds, linear_margin, constant_margin, epsg) Modify the terrain bounds :param terrain_bounds: Input region of interest for DEM :type terrain_bounds: list :param margin: Margin of the output ROI in meters :type margin: int .. py:function:: reproject_dem(dsm_file_name, epsg_out, out_file_name) Reproject the DEM :param dsm_file_name: the path to dsm :type dsm_file_name: str :param epsg_out: the epsg code :type epsg_out: int :param out_file_name: the out path file :type out_file_name: str