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#
Shared base for the DIMAP v1-family readers (SPOT 5, ALOS PRISM). |
|
Metadata reader for ALOS PRISM DIMAP-style scene metadata. |
|
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.SensorMetadataShared 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_Framefootprint, theEphemeris/Pointstrajectory, and the roll/pitch/yawatt_dfassembly. 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:
- getEphem_gdf(root)#
Create an ephemeris GeoDataFrame from a parsed DIMAP v1 document.
- Parameters:
root (xml.etree.ElementTree.Element) – Parsed
Dimap_Documentroot element.- Returns:
Time-indexed GeoDataFrame with
x, y, zpositions (m) anddx, dy, dzvelocities (m/s) in ECEF (EPSG:4978), plus NaNcov_*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:
DimapV1MetadataMetadata reader for ALOS PRISM DIMAP-style scene metadata.
Parses the ALOS PRISM
*.DIMA/*.XMLmetadata that ASP’sPRISM_XML.ccreads (used byprism2aspto 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 withrollPitchYaw(), 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_Documentroot element.- Returns:
Time-indexed DataFrame with
roll,pitch,yawin degrees (as delivered) and NaNcov_*columns.- Return type:
pandas.DataFrame
- get_scene_dict(xml, geteph=True)#
Get a dictionary of metadata for one ALOS PRISM scene.
- name = 'PRISM'#
- rpy_frame = 'orbital frame (along, across, down)'#
- class asp_plot.sensors.dimap_v1.Spot5Metadata(directory=None, image_list=None)#
Bases:
DimapV1MetadataMetadata reader for SPOT 5 DIMAP v1 scene metadata.
Parses the
METADATA.DIM/*.XMLscene metadata delivered with SPOT 5 HRG/HRS products, mirroring ASP’sSPOT_XML.cc(thespot5session). Ephemeris and attitude both live inData_Strip; the scene footprint comes fromDataset_Frame.Notes
Attitude is tabulated as yaw/pitch/roll in radians under
Corrected_Attitudes/Corrected_Attitude/Anglesand converted to degrees here. ASP feeds the raw values straight tosin/cosinget_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
meansatazstays NaN and the pair convergence angle degrades to NaN; the incidence, viewing and sun angles that are inScene_Sourceare filled.
- getAtt_df(root)#
Create an attitude DataFrame from a parsed SPOT 5 document.
- Parameters:
root (xml.etree.ElementTree.Element) – Parsed
Dimap_Documentroot element.- Returns:
Time-indexed DataFrame with
roll,pitch,yawin degrees (converted from the radians on disk) and NaNcov_*columns.- Return type:
pandas.DataFrame
- get_scene_dict(xml, geteph=True)#
Get a dictionary of metadata for one SPOT 5 scene.
- 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#