mex_drivers — Mars Express Driver Classes

The ale.drivers.mex_drivers module

New in version 0.8.1.

class ale.drivers.mex_drivers.MexHrscIsisLabelNaifSpiceDriver(file, num_ephem=909, num_quats=909, props={}, parsed_label=None)

Bases: LineScanner, IsisLabel, NaifSpice, RadialDistortion, Driver

property detector_center_line

Returns the center detector line.

For HRSC, we are dealing with a single line, so center line will be 0.

Returns

: float

Detector line of the principal point

property detector_center_sample

Returns the center detector sample.

For HRSC, center sample is consistent regardless of filter. This is different from ISIS’s center sample because ISIS line scan sensors use 0.5 based detector samples.

Returns

: float

Detector sample of the principal point

property ephemeris_start_time

Returns

: float

starting ephemeris time

property ephemeris_stop_time

Returns

: float

ephemeris stop time

property fikid

Naif ID code of the filter dependent instrument codes.

Expects filter_number to be defined. This should be an integer containing the filter number from the pds3 label. Expects ikid to be defined. This should be the integer Naif ID code for the instrument.

Returns

: int

Naif ID code used in calculating focal length

property focal2pixel_lines

NOTE: These values are pulled from ISIS iak kernels.

Returns

: list<double>

focal plane to detector lines

property focal2pixel_samples

NOTE: These values are pulled from ISIS iak kernels.

Returns

: list<double>

focal plane to detector samples

property ikid

Returns the Naif ID code for the HRSC head instrument

This would be the Naif ID code for the base (or “head”) instrument.

Returns

: int

Naif ID used to for identifying the instrument in Spice kernels

property instrument_id

Returns the name of the instrument

Returns

: str

Name of the instrument

property line_scan_rate

Returns

: tuple

list of lines, list of ephemeris times, and list of exposure times

property sensor_model_version

Returns

: int

ISIS sensor model version

property sensor_name

Returns the name of the instrument. Need to over-ride isis_label because InstrumentName is not defined in the ISIS label for MEX HSRC cubes.

Returns

: str

Name of the sensor

property times_table

Returns EphemerisTime, ExposureTime, and LinesStart informtation which was stored as binary information in the ISIS cube.

Returns

: dict

Dictionary with EphemerisTime, ExposureTime, and LineStart.

class ale.drivers.mex_drivers.MexHrscPds3NaifSpiceDriver(file, num_ephem=909, num_quats=909, props={}, parsed_label=None)

Bases: LineScanner, Pds3Label, NaifSpice, RadialDistortion, Driver

Driver for a PDS3 Mars Express (Mex) High Resolution Stereo Camera (HRSC) images.

NOTES

  • HRSC has 9 different filters. Each has it’s own instrument id, as well as the main/”HEAD” camera composing those filters. There is also another “SRC” instrument, making-up a total of 11 distinct sensors. It is very important to understand which code is needed when/where.

  • HRSC is a variable line scanner, and so does not maintain one exposure duration, but rather differing exposure durations per line. This information is stored within the individual records in the image data itself, with the the first 8 bytes making up the double presicion ephemeris time that the line exposure was started, and the next 4 bytes making up the float containing that line’s exposure duration.

property binary_ephemeris_times

Returns the ephemeris times taken from the binary image data.

For HRSC, the ephemeris times are imbedded in the binary data of the image. The ephemeris times start at the first byte of the line/records and are 8 bytes long.

Returns

: list

Ephemeris times

property binary_exposure_durations

Returns the exposure durations taken from the binary image data.

For HRSC, the exposure durations are imbedded in the binary data of the image. The exposure durations start at the 9th byte of the line/record and are 4 bytes long.

Returns

: list

Exposure durations

property binary_lines

Returns the lines of the binary image data.

For example, the first entry would be the first line of the image.

Returns

: list

Image lines

property detector_center_line

Returns the center detector line.

For HRSC, we are dealing with a single line, so center line will be 0.

Returns

: float

Detector line of the principal point

property detector_center_sample

Returns the center detector sample.

For HRSC, center sample is consistent regardless of filter. This is different from ISIS’s center sample because ISIS line scan sensors use 0.5 based detector samples.

Returns

: float

Detector sample of the principal point

property ephemeris_stop_time

Returns the ephemeris stop time.

For HRSC, the ephemeris stop time is calculated from the binary image data.

Returns

: float

Ephemeris stop time

property fikid

Naif ID code of the filter dependent instrument codes.

Expects filter_number to be defined. This should be an integer containing the filter number from the pds3 label. Expects ikid to be defined. This should be the integer Naif ID code for the instrument.

Returns

: int

Naif ID code used in calculating focal length

property focal2pixel_lines

Expects fikid to be defined. This must be the integer Naif id code of the filter-specific instrument.

NOTE: These values are pulled from ISIS iak kernels.

Returns

: list<double>

focal plane to detector lines

property focal2pixel_samples

Expects fikid to be defined. This must be the integer Naif id code of the filter-specific instrument.

NOTE: These values are pulled from ISIS iak kernels.

Returns

: list<double>

focal plane to detector samples

property focal_length

Returns the focal length of the filter-specific sensor

Expects fikid to be defined. This must be the integer Naif id code of the filter-specific instrument.

NOTE: These values are pulled from ISIS iak kernels.

Returns

: float

focal length

property ikid

Returns the Naif ID code for the HRSC head instrument

This would be the Naif ID code for the base (or “head”) instrument.

Returns

: int

Naif ID used to for identifying the instrument in Spice kernels

property instrument_id

Returns the short name of the instrument

MEX HRSC has nine different filters each with their own name.

Returns

property line_exposure_duration

Line exposure duration returns the time between the exposures for subsequent lines.

Since HRSC is a variable line scan camera, it does not make sense to have one exposure duration value.

Returns

: float

Returns the line exposure duration in seconds from the PDS3 label.

property line_scan_rate

Returns a 2D array of line scan rates.

For HRSC, the ephemeris times and exposure durations are stored in the image data.

In the image, every line has an entry. This method goes through and removes consecutive lines with the same exposure duration. There are also potentially missing lines in the image which this method accounts for.

Returns

: list

Line scan rates

property odtk

The coefficients for the distortion model

Returns

: list

Radial distortion coefficients. There is only one coefficient for LROC NAC l/r

property pixel2focal_x

Expects fikid to be defined. This must be the integer Naif id code of the filter-specific instrument.

NOTE: These values are pulled from ISIS iak kernels.

Returns

: list<double> detector to focal plane x

property pixel2focal_y

Expects fikid to be defined. This must be the integer Naif id code of the filter-specific instrument.

NOTE: These values are pulled from ISIS iak kernels.

Returns

: list<double> detector to focal plane y

read_image_data()

Reads data off of image and stores in binary_exposure_durations, binary_lines, and binary_ephemeris_times.

For HRSC, the exposure durations and ephemeris times are imbedded in the binary data of the image itself. Each line is stored in what is referred to as a “record” within the image. The label will have the size of each record, the number of records, and the number of records in the label, so the beginning of binary data can be calculated.

For each line/record of the binary data, the first 8 bytes make up the double presicion value of the ephemeris time, with the next 4 bytes making up the float value of the line exposure duration for the associated line. NOTE: The prefix data is always LSB, regardless of the overall file format.

property sensor_model_version

Returns

: int

ISIS sensor model version

property spacecraft_name

Spacecraft name used in various SPICE calls to acquire ephemeris data. MEX HRSC img PDS3 labels do not the have SPACECRAFT_NAME keyword, so we override it here to use the label_pds3 property for instrument_host_id

Returns

: str

Spacecraft name

class ale.drivers.mex_drivers.MexSrcPds3NaifSpiceDriver(file, num_ephem=909, num_quats=909, props={}, parsed_label=None)

Bases: Framer, Pds3Label, NaifSpice, RadialDistortion, Driver

Driver for a PDS3 Mars Express (Mex) High Resolution Stereo Camera (HRSC) - Super Resolution Channel (SRC) image.

property detector_center_line

Returns the center detector line.

Returns

: float

Detector line of the principal point

property detector_center_sample

Returns the center detector sample.

This is different from ISIS’s center sample because ISIS uses 0.5-based samples.

Returns

: float

Detector sample of the principal point

property focal2pixel_lines

NOTE: These values are pulled from ISIS iak kernels.

Returns

: list<double>

focal plane to detector lines

property focal2pixel_samples

NOTE: These values are pulled from ISIS iak kernels.

Returns

: list<double>

focal plane to detector samples

property ikid

Returns the Naif ID code for HRSC SRC.

Returns

: int

Naif ID used to for identifying the instrument in Spice kernels

property instrument_id

Returns the short name of the instrument

MEX HRSC has nine different filters each with their own name.

Returns

property odtk

The coefficients for the distortion model. No distortion model, so pass in all zeroes.

Returns

: list

Radial distortion coefficients.

property sensor_model_version

Returns

: int

ISIS sensor model version

property spacecraft_name

Spacecraft name used in various SPICE calls to acquire ephemeris data. MEX HRSC img PDS3 labels do not the have SPACECRAFT_NAME keyword, so we override it here to use the label_pds3 property for instrument_host_id

Returns

: str

Spacecraft name