asp_plot.csm_camera#
Plotting for CSM camera optimization / jitter results.
This module is the plotting layer of the former monolithic csm_camera.py.
The numeric analysis now lives in asp_plot.csm_analysis and the
ASP-mirrored camera-model readers in asp_plot.csm_io. Those symbols are
re-exported here for backward compatibility with notebooks and downstream code
that imported them from asp_plot.csm_camera.
Functions#
|
Generate a comprehensive summary plot comparing camera parameters. |
|
Format a numeric value with appropriate precision. |
|
Add a text annotation showing statistics to a plot. |
Module Contents#
- asp_plot.csm_camera.csm_camera_summary_plot(cam1_list, cam2_list=None, map_crs=None, title=None, trim=True, shared_scales=False, log_scale_positions=False, log_scale_angles=False, upper_magnitude_percentile=95, figsize=(20, 15), save_dir=None, fig_fn=None, add_basemap=False, **ctx_kwargs)#
Generate a comprehensive summary plot comparing camera parameters.
- Parameters:
cam1_list (list) – List containing paths to the original and optimized camera files for the first camera
cam2_list (list or None, optional) – List containing paths to the original and optimized camera files for the second camera, default is None
map_crs (int or None, optional) – EPSG code for the coordinate reference system for map plots, default is None (use ECEF)
title (str or None, optional) – Additional title text to append to the default title, default is None
trim (bool, optional) – Whether to trim data to image lines for linescan cameras, default is True
shared_scales (bool, optional) – Whether to use the same y-axis scale for all position/angle plots, default is False
log_scale_positions (bool, optional) – Whether to use logarithmic scale for position difference plots, default is False
log_scale_angles (bool, optional) – Whether to use logarithmic scale for angle difference plots, default is False
upper_magnitude_percentile (int, optional) – Percentile for setting colorbar upper limit, default is 95
figsize (tuple, optional) – Figure size (width, height) in inches, default is (20, 15)
save_dir (str or None, optional) – Directory to save the plot, default is None (don’t save)
fig_fn (str or None, optional) – Filename for the saved plot, default is None
add_basemap (bool, optional) – Whether to add a basemap to map plots, default is False
**ctx_kwargs – Additional keyword arguments passed to contextily.add_basemap()
Notes
This function creates a comprehensive visualization comparing original and optimized camera parameters. It shows the spatial distribution of position and orientation differences, as well as detailed plots of individual components (x, y, z, roll, pitch, yaw). If two cameras are provided, the comparison is shown for both cameras in a larger figure.
- asp_plot.csm_camera.format_stat_value(value)#
Format a numeric value with appropriate precision.
- Parameters:
value (float) – The numeric value to format
- Returns:
Formatted string representation of the value
- Return type:
Notes
Uses scientific notation for very small values (abs(value) < 0.01) and fixed-point notation with 2 decimal places otherwise.
- asp_plot.csm_camera.plot_stats_text(ax, mean, std, unit='m')#
Add a text annotation showing statistics to a plot.
- Parameters:
ax (matplotlib.axes.Axes) – The axis on which to add the text
mean (float) – Mean value to display
std (float) – Standard deviation value to display
unit (str, optional) – Unit to use for display, default is ‘m’
Notes
The text is displayed in the lower left corner of the plot with a white background box for readability.