Skip to content

Add MroHiRisePds3LabelNaifSpiceDriver for direct EDR processing #701

@michaelaye

Description

@michaelaye

Summary

ALE has MroHiRiseIsisLabelNaifSpiceDriver but no PDS3 label variant. This means HiRISE EDR files cannot be used directly with ALE — they must first go through ISIS hi2isis + spiceinit to create a cube with an ISIS label.

CTX already has both variants (MroCtxIsisLabelNaifSpiceDriver + MroCtxPds3LabelNaifSpiceDriver), enabling fully ISIS-free processing from raw PDS EDR to ISD.

Motivation

We're building a Python-native HiRISE calibration pipeline (isistools/hirisepipe) that replaces hical + histitch + cubenorm in pure Python. The last remaining ISIS dependency is hi2isis + spiceinit to create a cube for ALE's camera model. A PDS3 driver would eliminate this entirely.

With the existing MroCtxPds3LabelNaifSpiceDriver + props={'web': True} (SpiceQL web service), CTX processing is already fully ISIS-free from raw EDR to map-projected GeoTIFF. The same should be possible for HiRISE.

What's needed

A new class MroHiRisePds3LabelNaifSpiceDriver in ale/drivers/mro_drivers.py that:

  1. Parses the HiRISE PDS3 EDR label (groups: TIME_PARAMETERS, INSTRUMENT_SETTING_PARAMETERS, TEMPERATURE_PARAMETERS, IMAGE, CALIBRATION_IMAGE)
  2. Extracts instrument parameters: MRO:CPMM_NUMBER, MRO:CHANNEL_NUMBER, MRO:TDI, MRO:BINNING, MRO:SCAN_EXPOSURE_DURATION, MRO:TRIM_LINES
  3. Maps CPMM → CCD → NAIF frame code (the CPMM-to-CCD mapping is non-trivial: [0,1,2,3,12,4,10,11,5,13,6,7,8,9])
  4. Handles the LINE_SAMPLES difference (PDS3 reports 5056 including prefix/suffix, science image is 1024)

The existing MroHiRiseIsisLabelNaifSpiceDriver can serve as the reference implementation — the PDS3 variant just needs different label keyword paths.

PDS3 vs ISIS label keyword mapping

Parameter ISIS label path PDS3 label path
CPMM number Instrument.CpmmNumber INSTRUMENT_SETTING_PARAMETERS.MRO:CPMM_NUMBER
Channel Instrument.ChannelNumber INSTRUMENT_SETTING_PARAMETERS.MRO:CHANNEL_NUMBER
TDI Instrument.Tdi INSTRUMENT_SETTING_PARAMETERS.MRO:TDI
Binning Instrument.Summing INSTRUMENT_SETTING_PARAMETERS.MRO:BINNING
Start time Instrument.StartTime TIME_PARAMETERS.START_TIME
SCLK Instrument.SpacecraftClockStartCount TIME_PARAMETERS.SPACECRAFT_CLOCK_START_COUNT
Exposure Instrument.ScanExposureDuration INSTRUMENT_SETTING_PARAMETERS.MRO:SCAN_EXPOSURE_DURATION
Lines Dimensions.Lines IMAGE.LINES
Samples Dimensions.Samples IMAGE.LINE_SAMPLES (note: includes prefix/suffix)
Target Instrument.TargetName TARGET_NAME

Impact

This would enable fully ISIS-free HiRISE processing pipelines — from PDS EDR download to calibrated, map-projected GeoTIFF — using only Python packages (ale + usgscsm + csmapi).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions