cars.applications.rasterization.rasterization_wrappers ====================================================== .. py:module:: cars.applications.rasterization.rasterization_wrappers .. autoapi-nested-parse:: This module is responsible for the rasterization step: - it contains all functions related to 3D representation on a 2D raster grid TODO: refactor in several files and remove too-many-lines Functions --------- .. autoapisummary:: cars.applications.rasterization.rasterization_wrappers.compute_xy_starts_and_sizes cars.applications.rasterization.rasterization_wrappers.compute_values_1d cars.applications.rasterization.rasterization_wrappers.substring_in_list cars.applications.rasterization.rasterization_wrappers.phased_dsm cars.applications.rasterization.rasterization_wrappers.find_indexes_in_point_cloud cars.applications.rasterization.rasterization_wrappers.create_raster_dataset cars.applications.rasterization.rasterization_wrappers.classify_performance_map cars.applications.rasterization.rasterization_wrappers.update_weights cars.applications.rasterization.rasterization_wrappers.update_data Module Contents --------------- .. py:function:: compute_xy_starts_and_sizes(resolution: float, cloud: pandas.DataFrame) -> Tuple[float, float, int, int] Compute xstart, ystart, xsize and ysize of the rasterization grid from a set of points :param resolution: Resolution of rasterized cells, expressed in cloud CRS units :param cloud: set of points as returned by the create_combined_cloud function :return: a tuple (xstart, ystart, xsize, ysize) .. py:function:: compute_values_1d(x_start: float, y_start: float, x_size: int, y_size: int, resolution: float) -> Tuple[numpy.ndarray, numpy.ndarray] Compute the x and y values as 1d arrays :param x_start: x start of the rasterization grid :param y_start: y start of the rasterization grid :param x_size: x size of the rasterization grid :param y_size: y size of the rasterization grid :param resolution: Resolution of rasterized cells, in cloud CRS units or None. :return: a tuple composed of the x and y 1d arrays .. py:function:: substring_in_list(src_list, substring) Check if the list contains substring .. py:function:: phased_dsm(start: float, phase: float, resolution: float) Phased the dsm :param start: start of the roi :param phase: the point for phasing :param resolution: resolution of the dsm .. py:function:: find_indexes_in_point_cloud(cloud: pandas.DataFrame, tag: str, list_computed_layers: List[str] = None) -> List[str] Find all indexes in point cloud that contains the key tag if it needs to be computed :param cloud: Combined cloud :param tag: substring of desired columns in cloud :param list_computed_layers: list of computed output data .. py:function:: create_raster_dataset(raster: numpy.ndarray, weights_sum: numpy.ndarray, x_start: float, y_start: float, x_size: int, y_size: int, resolution: float, hgt_no_data: int, texture_no_data: int, msk_no_data: int, epsg: int, mean: numpy.ndarray, stdev: numpy.ndarray, n_pts: numpy.ndarray, n_in_cell: numpy.ndarray, msk: numpy.ndarray = None, band_im: List[str] = None, classif: numpy.ndarray = None, band_classif: List[str] = None, ambiguity: numpy.ndarray = None, layers_inf_sup: numpy.ndarray = None, layers_inf_sup_stat_index: List[int] = None, layer_inf_sup_indexes: List[str] = None, source_pc: numpy.ndarray = None, source_pc_names: List[str] = None, filling: numpy.ndarray = None, band_filling: List[str] = None, performance_map: numpy.ndarray = None, performance_map_classified: numpy.ndarray = None, performance_map_classified_index: list = None, band_performance_map: List[str] = None) -> xarray.Dataset Create final raster xarray dataset :param raster: height and colors :param x_start: x start of the rasterization grid :param y_start: y start of the rasterization grid :param x_size: x size of the rasterization grid :param y_size: y size of the rasterization grid :param resolution: Resolution of rasterized cells, expressed in cloud CRS units or None. :param hgt_no_data: no data value to use for height :param texture_no_data: no data value to use for color :param msk_no_data: no data value to use for mask and classif :param epsg: epsg code for the CRS of the final raster :param mean: mean of height and colors :param stdev: standard deviation of height and colors :param n_pts: number of points that are stricty in a cell :param n_in_cell: number of points which contribute to a cell :param msk: raster msk :param classif: raster classif :param ambiguity: raster containing the ambiguity :param layers_inf_sup: raster containing intervals inf and sup :param layers_inf_sup_stat_index: list containing index of intervals in mean and stdev rasters :param layer_inf_sup_indexes: list of band names :param source_pc: binary raster with source point cloud information :param source_pc_names: list of names of point cloud before merging : name of sensors pair or name of point cloud file :param performance_map: raster containing the raw performance map :param performance_map_classified: raster containing the classified performance map :param performance_map_classified_index: indexes of performance_map_classified :param band_performance_map: list of band names : max 2 bands: risk / interval :return: the raster xarray dataset .. py:function:: classify_performance_map(performance_map_raw, performance_map_classes, msk_no_data) Classify performance map with given classes .. py:function:: update_weights(old_weights, weights) Update weights :param weights: current weights :param old_weights: old weights :return: updated weights .. py:function:: update_data(old_data, current_data, weights, old_weights, nodata, method='basic') Update current data with old data and weigths :param old_data: old data :param current_data: current data :param weights: current weights :param old_weights: old weights :param nodata: nodata associated to tag :return: updated current data