asp_plot.stereo_geometry#
Attributes#
Classes#
Create visualizations of stereo geometry for satellite imagery. |
Module Contents#
- class asp_plot.stereo_geometry.StereoGeometryPlotter(directory, add_basemap=True, **kwargs)#
Bases:
asp_plot.stereopair_metadata_parser.StereopairMetadataParserCreate visualizations of stereo geometry for satellite imagery.
This class extends StereopairMetadataParser to provide plotting capabilities for stereo geometry visualization, including skyplots showing satellite viewing angles and map views showing footprints and satellite positions.
- image_list#
List of XML files found in the directory (inherited from StereopairMetadataParser)
- Type:
Examples
>>> plotter = StereoGeometryPlotter('/path/to/stereo/directory') >>> plotter.dg_geom_plot(save_dir='/path/to/output', fig_fn='stereo_geom.png')
- dg_geom_plot(save_dir=None, fig_fn=None)#
Create a comprehensive stereo geometry visualization.
Generates a figure with two subplots: 1. A skyplot showing satellite viewing angles (left) 2. A map view showing satellite paths and image footprints (right)
- Parameters:
- Returns:
The created figure object (not shown automatically)
- Return type:
Notes
If both save_dir and fig_fn are provided, the figure is saved using the save_figure utility function.
The map uses a local transverse Mercator projection centered on the intersection of the two image footprints to minimize distortion.
- get_scene_string(p, key='catid1_dict')#
Format scene metadata as a string.
Creates a formatted string with key metadata for a scene, including catalog ID, GSD, viewing angles, and acquisition parameters.
- get_title(p)#
Generate a comprehensive title for stereo geometry plots.
Creates a multi-line title string that includes stereo pair name, acquisition time information, stereo geometry parameters, and key metadata for both scenes.
- Parameters:
p (dict) – Stereo pair dictionary containing metadata
- Returns:
Formatted multi-line title string
- Return type:
Notes
The title includes pairname, center datetime, time offset, convergence angle, base-to-height ratio, bisector elevation angle, asymmetry angle, intersection area, and metadata for both scenes.
- map_plot(ax, p, map_crs='EPSG:3857', title=True, tight_layout=True)#
Create a map view of satellite paths and image footprints.
Plots the satellite ground tracks (ephemeris) and the image footprints for both images in a stereo pair on a map.
- Parameters:
ax (matplotlib.axes.Axes) – Matplotlib axes object to plot on
p (dict) – Stereo pair dictionary with metadata from get_pair_dict()
map_crs (str, optional) – Coordinate reference system for the map, default is “EPSG:3857” (Web Mercator)
title (bool, optional) – Whether to add a title to the plot, default is True
tight_layout (bool, optional) – Whether to apply tight layout to the figure, default is True
- Returns:
Modifies the provided axes object in-place
- Return type:
None
Notes
Satellite footprints are shown as polygons
Satellite paths (ephemeris) are shown as point tracks
The start of each satellite path is marked with a white circle
A basemap is added if self.add_basemap is True
Credit#
Adapted from David Shean’s notebook: dshean/dgtools
- satellite_position_orientation_plot(save_dir=None, fig_fn=None)#
Create a visualization of satellite position and orientation data.
Generates a 3-row x 2-column figure (one column per scene): - Row 0: Map of satellite positions colored by position covariance std - Row 1: Roll, pitch, yaw relative to orbital reference frame over time - Row 2: Attitude covariance trace std over time
- Parameters:
- Returns:
The created figure object (not shown automatically)
- Return type:
- skyplot(ax, p, title=True, tight_layout=True)#
Create a polar plot showing satellite viewing geometry.
This plot shows the satellite azimuth and elevation angles for both images in a stereo pair on a polar plot, where azimuth is the angle and (90 - elevation) is the radius.
- Parameters:
ax (matplotlib.axes.PolarAxes) – Polar axes object to plot the skyplot on
p (dict) – Stereo pair dictionary with metadata from get_pair_dict()
title (bool, optional) – Whether to add a title to the plot, default is True
tight_layout (bool, optional) – Whether to apply tight layout to the figure, default is True
- Returns:
Modifies the provided axes object in-place
- Return type:
None
Notes
In the polar plot: - The origin represents 90° elevation (satellite directly overhead) - The outer edge represents 40° elevation (50° from zenith) - Azimuth is measured clockwise from North (0°) - The symbols represent the satellite positions for each image - The dashed line connects the two satellite positions
- add_basemap = True#
- asp_plot.stereo_geometry.logger#