cars.devibrate
cars-devibrate: devibrate a high resolution DSM using a low resolution DSM
Attributes
Functions
|
Computes the mean acquisition of the input images pair |
|
For a given image, compute the direction of increasing acquisition |
|
Project coordinates (x, y) on a line starting from origin with a |
|
This function takes 2 datasets containing DSM and models the |
|
Read an extract of the low resolution input DSM and return it as an Array |
|
Compute a spline dict containing estimated splines, origin |
|
Main fonction. Expects a dictionary from the CLI |
|
Main cars-devibrate entrypoint (Command Line Interface) |
Module Contents
- cars.devibrate.package_path
- cars.devibrate.GEOID_DEFAULT
- cars.devibrate.acquisition_direction(sensor1, geomodel1, sensor2, geomodel2, geometry_plugin)[source]
Computes the mean acquisition of the input images pair
- Parameters:
sensor1 – sensor image name of the first product
geomodel1 – geomodel name of the first product
sensor2 – sensor image name of the second product
geomodel2 – geomodel name of the second product
- Returns:
a tuple composed of : - the mean acquisition direction as a numpy array - the acquisition direction of the first product as a numpy array - the acquisition direction of the second product as a numpy array
- cars.devibrate.get_time_ground_direction(sensor, geomodel, geometry_plugin, x_loc: float = None, y_loc: float = None, y_offset: float = None) numpy.ndarray[source]
For a given image, compute the direction of increasing acquisition time on ground. Done by two localizations at “y” and “y+y_offset” values.
- Parameters:
sensor – sensor image name
geomodel – geomodel name
x_loc – x location in image for estimation (default=center)
y_loc – y location in image for estimation (default=1/4)
y_offset – y location in image for estimation (default=1/2)
dem – DEM for direct localisation function
geoid – path to geoid file
- Returns:
normalized direction vector as a numpy array
- cars.devibrate.project_coordinates_on_line(x_coord: float | numpy.ndarray, y_coord: float | numpy.ndarray, origin: List[float] | numpy.ndarray, vec: List[float] | numpy.ndarray) float | numpy.ndarray[source]
Project coordinates (x, y) on a line starting from origin with a direction vector vec, and return the euclidean distances between projected points and origin.
- Parameters:
x_coord – scalar or vector of coordinates x
y_coord – scalar or vector of coordinates y
origin – coordinates of origin point for line
vec – direction vector of line
- Returns:
vector of distances of projected points to origin
- cars.devibrate.lowres_initial_dem_splines_fit(lowres_dsm_from_matches: xarray.Dataset, lowres_initial_dem: xarray.Dataset, origin: numpy.ndarray, time_direction_vector: numpy.ndarray, ext: int = 3, order: int = 3, min_pts_per_time: int = 100, min_pts_along_time_direction: int = 100, butterworth_filter_order: int = 3, butterworth_critical_frequency: float = 0.05)[source]
This function takes 2 datasets containing DSM and models the difference between the two as an UnivariateSpline along the direction given by origin and time_direction_vector. Internally, it looks for the highest smoothing factor that satisfies the rmse threshold.
- Parameters:
lowres_dsm_from_matches – Dataset containing the low resolution DSM obtained from matches, as returned by the rasterization.simple_rasterization_dataset function.
lowres_initial_dem – Dataset containing the low resolution DEM, on the same grid as lowres_dsm_from_matches
origin (list(float) or np.array(float) of size 2) – coordinates of origin point for line
time_direction_vector (list(float) or np.array(float) of size 2) – direction vector of line
ext – behavior outside of interpolation domain
order – spline order
min_pts_per_time – minimum number of points for each measurement
min_pts_along_time_direction – minimum number of points for time direction
butterworth_filter_order – Order of the filter. See scipy.signal.butter
butterworth_critical_frequency – The filter critical frequency or frequencies. See scipy.signal.butter
- cars.devibrate.read_lowres_dsm(srtm_path, startx, starty, endx, endy)[source]
Read an extract of the low resolution input DSM and return it as an Array
- cars.devibrate.compute_splines(sensor1, geomodel1, sensor2, geomodel2, matches, srtm_path, geoid_path, out_dir, min_pts_per_time: int = 100, min_pts_along_time_direction: int = 100, butterworth_filter_order: int = 3, butterworth_critical_frequency: float = 0.05)[source]
Compute a spline dict containing estimated splines, origin and time_direction_vector
- cars.devibrate.cars_devibrate(used_conf, srtm_path, geoid_path, min_pts_per_time: int = 100, min_pts_along_time_direction: int = 100, butterworth_filter_order: int = 3, butterworth_critical_frequency: float = 0.05)[source]
Main fonction. Expects a dictionary from the CLI or directly the input parameters.