asp_plot.csm_analysis#
Camera-model analysis: turn original/optimized camera pairs into the
position- and orientation-difference GeoDataFrame consumed by the plotting
layer (csm_camera.py).
This module owns the asp_plot-specific analysis (get_orbit_plot_gdf,
reproject_ecef, poly_fit) and builds on the ASP-mirrored readers in
csm_io.py.
Functions#
|
Create a GeoDataFrame containing camera positions and orientation differences. |
|
Fit a linear polynomial to data and return the fitted values. |
|
Reproject ECEF coordinates to a specified EPSG coordinate system. |
Module Contents#
- asp_plot.csm_analysis.get_orbit_plot_gdf(original_camera, optimized_camera, map_crs=None, trim=True)#
Create a GeoDataFrame containing camera positions and orientation differences.
- Parameters:
original_camera (str) – Path to the original camera file
optimized_camera (str) – Path to the optimized camera file
map_crs (int or None, optional) – EPSG code for the target coordinate system, default is None (keep ECEF)
trim (bool, optional) – Whether to trim data to only the first and last image lines for linescan cameras, default is True
- Returns:
A GeoDataFrame containing camera positions and orientation data with columns for position differences, angle differences, and original values
- Return type:
geopandas.GeoDataFrame
Notes
This function compares the original and optimized camera models and calculates the differences in position and orientation. For linescan cameras, it optionally trims the data to only include samples corresponding to the actual image lines.
- asp_plot.csm_analysis.poly_fit(X, Y)#
Fit a linear polynomial to data and return the fitted values.
- Parameters:
X (array-like) – Independent variable values
Y (array-like) – Dependent variable values
- Returns:
Fitted Y values from a degree 1 polynomial fit
- Return type:
- asp_plot.csm_analysis.reproject_ecef(positions, to_epsg=4326)#
Reproject ECEF coordinates to a specified EPSG coordinate system.
- Parameters:
positions (numpy.ndarray) – A 2D array of ECEF coordinates, where each row represents a point
to_epsg (int, optional) – The EPSG code of the target coordinate system, default is 4326 (WGS84)
- Returns:
A 2D array of reprojected coordinates in the target EPSG coordinate system
- Return type:
Notes
ECEF (Earth-Centered, Earth-Fixed) coordinates are a 3D Cartesian coordinate system with the origin at the center of the Earth. This function converts those coordinates to a different coordinate system specified by an EPSG code.