asp_plot.sensors.dimap_v1#

Metadata readers for DIMAP v1-family camera files (SPOT 5, ALOS PRISM).

Both formats predate the DIMAP v2 layout that asp_plot.sensors.dimap handles, and they share the same v1 skeleton: a Metadata_Id header (v2 uses Metadata_Identification), scene corners in Dataset_Frame, and a Data_Strip holding Ephemeris/Points/Point samples with Location / Velocity X/Y/Z children. They differ in the two places this module splits on: how the file identifies itself, and where the attitude lives.

The reference implementations mirrored here are ASP’s SPOT_XML.cc (with LinescanSpotModel.cc for the frame conventions) and PRISM_XML.cc (with prism2asp.cc).

Unlike the DIMAP v2 and DigitalGlobe products, neither format reports attitude as quaternions: both tabulate roll/pitch/yaw directly, which is why att_df carries roll/pitch/yaw columns here instead of q1..q4 (see SensorMetadata.getAtt_df() consumers, notably asp_plot.stereo_geometry.StereoGeometryPlotter.satellite_position_orientation_plot()).

Both readers are implemented from ASP’s reader spec and have not been validated against a real delivery yet (#168, #179): parsing a scene emits a one-time warning asking for reports.

Attributes#

Classes#

DimapV1Metadata

Shared base for the DIMAP v1-family readers (SPOT 5, ALOS PRISM).

PrismMetadata

Metadata reader for ALOS PRISM DIMAP-style scene metadata.

Spot5Metadata

Metadata reader for SPOT 5 DIMAP v1 scene metadata.

Module Contents#

class asp_plot.sensors.dimap_v1.DimapV1Metadata(directory=None, image_list=None)#

Bases: asp_plot.sensors.base.SensorMetadata

Shared base for the DIMAP v1-family readers (SPOT 5, ALOS PRISM).

Holds everything the two formats share — file discovery from a directory or an explicit file list, the Dataset_Frame footprint, the Ephemeris/Points trajectory, and the roll/pitch/yaw att_df assembly. Subclasses supply the identification predicate (_is_camera_file()), the attitude block location (getAtt_df()), and the identity/summary fields (get_scene_dict()).

rpy_frame#

Human-readable name of the frame the vendor’s roll/pitch/yaw angles are expressed in, attached to att_df.attrs["rpy_frame"] and used to label the orientation plot. The two sensors do not share one (see the subclasses).

Type:

str

getEphem_gdf(root)#

Create an ephemeris GeoDataFrame from a parsed DIMAP v1 document.

Parameters:

root (xml.etree.ElementTree.Element) – Parsed Dimap_Document root element.

Returns:

Time-indexed GeoDataFrame with x, y, z positions (m) and dx, dy, dz velocities (m/s) in ECEF (EPSG:4978), plus NaN cov_* columns (DIMAP v1 provides no ephemeris covariance).

Return type:

geopandas.GeoDataFrame

get_scene_dicts()#

Return one sensor-agnostic scene dict per metadata XML.

rpy_frame = 'vendor-reported'#
class asp_plot.sensors.dimap_v1.PrismMetadata(directory=None, image_list=None)#

Bases: DimapV1Metadata

Metadata reader for ALOS PRISM DIMAP-style scene metadata.

Parses the ALOS PRISM *.DIMA/*.XML metadata that ASP’s PRISM_XML.cc reads (used by prism2asp to build CSM linescan cameras). A PRISM triplet delivers one file per view (forward, nadir, backward), each of which is one scene here.

Notes

  • Attitude is tabulated as roll/pitch/yaw in degrees under Satellite_Attitudes/Angles_List/Angles/Angle; ASP applies them with rollPitchYaw(), which converts degrees to radians.

  • Those angles are the satellite’s attitude relative to the nominal (along, across, down) orbital frame, composed as Rz(yaw) Ry(pitch) Rx(roll) — the same frame and Euler convention as the roll/pitch/yaw this package derives from quaternion sensors’ attitude, so PRISM curves are directly comparable to those. The fixed per-view mounting rotation ASP applies on top (cam2sat) is camera geometry, not satellite attitude, and is deliberately not folded in here.

  • PRISM reports no view or GSD summary angles in the metadata header, so those degrade to NaN; the sun angles are filled when present.

getAtt_df(root)#

Create an attitude DataFrame from a parsed PRISM document.

Parameters:

root (xml.etree.ElementTree.Element) – Parsed Dimap_Document root element.

Returns:

Time-indexed DataFrame with roll, pitch, yaw in degrees (as delivered) and NaN cov_* columns.

Return type:

pandas.DataFrame

get_scene_dict(xml, geteph=True)#

Get a dictionary of metadata for one ALOS PRISM scene.

Parameters:
  • xml (str) – Path to the PRISM DIMAP-style metadata file.

  • geteph (bool, optional) – Whether to extract ephemeris/attitude data, default is True.

Returns:

Sensor-agnostic scene dict (see the package docstring).

Return type:

dict

name = 'PRISM'#
rpy_frame = 'orbital frame (along, across, down)'#
class asp_plot.sensors.dimap_v1.Spot5Metadata(directory=None, image_list=None)#

Bases: DimapV1Metadata

Metadata reader for SPOT 5 DIMAP v1 scene metadata.

Parses the METADATA.DIM / *.XML scene metadata delivered with SPOT 5 HRG/HRS products, mirroring ASP’s SPOT_XML.cc (the spot5 session). Ephemeris and attitude both live in Data_Strip; the scene footprint comes from Dataset_Frame.

Notes

  • Attitude is tabulated as yaw/pitch/roll in radians under Corrected_Attitudes/Corrected_Attitude/Angles and converted to degrees here. ASP feeds the raw values straight to sin/cos in get_look_rotation_matrix, which is what fixes the unit.

  • The angles are defined in the SPOT 123-4-5 Geometry Handbook navigation frame, relative to its local orbital frame (X across-track, Y along-track, Z up), composed as Mp*Mr*My. That is a different axis assignment from the (along, across, down) frame the quaternion sensors’ roll/pitch/yaw are computed in, so the values are reported as delivered and labeled with their own frame rather than silently mixed with the others.

  • DIMAP v1 reports no satellite azimuth, so meansataz stays NaN and the pair convergence angle degrades to NaN; the incidence, viewing and sun angles that are in Scene_Source are filled.

getAtt_df(root)#

Create an attitude DataFrame from a parsed SPOT 5 document.

Parameters:

root (xml.etree.ElementTree.Element) – Parsed Dimap_Document root element.

Returns:

Time-indexed DataFrame with roll, pitch, yaw in degrees (converted from the radians on disk) and NaN cov_* columns.

Return type:

pandas.DataFrame

get_scene_dict(xml, geteph=True)#

Get a dictionary of metadata for one SPOT 5 scene.

Parameters:
  • xml (str) – Path to the SPOT 5 DIMAP v1 scene metadata file.

  • geteph (bool, optional) – Whether to extract ephemeris/attitude data, default is True.

Returns:

Sensor-agnostic scene dict (see the package docstring).

Return type:

dict

name = 'SPOT5'#
rpy_frame = 'SPOT Geometry Handbook navigation frame'#
asp_plot.sensors.dimap_v1.SUPPORTED_SPOT_MISSION_INDEXES = ('5',)#
asp_plot.sensors.dimap_v1.logger#