Unverified Commit 5965330e authored by Christine Kim's avatar Christine Kim Committed by GitHub
Browse files

Mariner10 driver and test (#547)

* Added Mariner10 driver and test

* Update sensor_name and remove spacecraft_name

* Update inst_id_lookup to return M10_spacecraft

* Added light_time_correction property and updated isd

* Update CHANGELOG.md
parent bf86bf27
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -35,6 +35,9 @@ release.

## [Unreleased]

### Added
- Mariner10 IsisLabelNaifSpice driver, tests, and test data [#547](https://github.com/DOI-USGS/ale/pull/547) 

## [0.9.1] - 2023-06-05

### Changed
+100 −0
Original line number Diff line number Diff line
import spiceypy as spice
from ale.base.data_naif import NaifSpice
from ale.base.label_isis import IsisLabel
from ale.base.type_sensor import Framer
from ale.base.type_distortion import NoDistortion
from ale.base.base import Driver

class Mariner10IsisLabelNaifSpiceDriver(Framer, IsisLabel, NaifSpice, NoDistortion, Driver):
    
    @property
    def instrument_id(self):
        """
        Returns the ID of the instrument

        Returns
        -------
        : str
          Name of the instrument
        """
        inst_id_lookup = {
            "M10_VIDICON_A": "M10_SPACECRAFT",
            "M10_VIDICON_B": "M10_SPACECRAFT"
        }
        return inst_id_lookup[super().instrument_id]

    @property
    def sensor_model_version(self):
        """
        The ISIS Sensor model number for HiRise in ISIS. This is likely just 1.

        Returns
        -------
        : int
          ISIS sensor model version
        """
        return 1
    
    @property
    def sensor_name(self):
        """
        Returns the name of the instrument

        Returns
        -------
        : str
          Name of the sensor
        """
        return super().instrument_id
    
    @property
    def sensor_frame_id(self):
        """
        Hard coded sensor_frame_id based on the Isis Mariner10 camera model.

        Returns
        -------
        : int
          The sensor frame id
        """
        return -76000
    
    @property
    def ikid(self):
        """
        Returns the ikid/frame code from the ISIS label.
        
        Returns
        -------
        : int
          Naif ID used to for identifying the instrument in Spice kernels
        """
        return self.label['IsisCube']['Kernels']['NaifFrameCode']
    
    @property
    def ephemeris_start_time(self):
        """
        Returns the start ephemeris time for the image.

        Returns
        -------
        : float
          start time
        """
        return spice.str2et(self.utc_start_time.strftime("%Y-%m-%d %H:%M:%S.%f")) - (self.exposure_duration / 2.0)
    
    @property
    def light_time_correction(self):
        """
        Returns the type of light time correction and abberation correction to
        use in NAIF calls.

        Returns
        -------
        : str
          The light time and abberation correction string for use in NAIF calls.
          See https://naif.jpl.nasa.gov/pub/naif/toolkit_docs/C/req/abcorr.html
          for the different options available.
        """
        return 'NONE'
    
 No newline at end of file
+226 −0
Original line number Diff line number Diff line
{
  "isis_camera_version": 1,
  "image_lines": 700,
  "image_samples": 832,
  "name_platform": "Mariner_10",
  "name_sensor": "M10_VIDICON_A",
  "reference_height": {
    "maxheight": 1000,
    "minheight": -1000,
    "unit": "m"
  },
  "name_model": "USGS_ASTRO_FRAME_SENSOR_MODEL",
  "center_ephemeris_time": -812916168.4183488,
  "radii": {
    "semimajor": 2439.7,
    "semiminor": 2439.7,
    "unit": "km"
  },
  "body_rotation": {
    "time_dependent_frames": [
      10011,
      1
    ],
    "ck_table_start_time": -812916168.4183488,
    "ck_table_end_time": -812916168.4183488,
    "ck_table_original_size": 1,
    "ephemeris_times": [
      -812916168.4183488
    ],
    "quaternions": [
      [
        -0.041589464253201175,
        -0.036695469453297484,
        0.24381936260450102,
        -0.9682333796166442
      ]
    ],
    "angular_velocities": [
      [
        1.1326300442450132e-07,
        -5.816846505242454e-07,
        1.0892405863919202e-06
      ]
    ],
    "reference_frame": 1
  },
  "instrument_pointing": {
    "time_dependent_frames": [
      -76000,
      1
    ],
    "ck_table_start_time": -812916168.4183488,
    "ck_table_end_time": -812916168.4183488,
    "ck_table_original_size": 1,
    "ephemeris_times": [
      -812916168.4183488
    ],
    "quaternions": [
      [
        -0.4151219005736828,
        0.5204702103512857,
        0.2881986100016333,
        0.6882776539988121
      ]
    ],
    "angular_velocities": [
      [
        -0.0,
        -0.0,
        -0.0
      ]
    ],
    "reference_frame": 1,
    "constant_frames": [
      -76000
    ],
    "constant_rotation": [
      1.0,
      0.0,
      0.0,
      0.0,
      1.0,
      0.0,
      0.0,
      0.0,
      1.0
    ]
  },
  "naif_keywords": {
    "BODY199_RADII": [
      2439.7,
      2439.7,
      2439.7
    ],
    "BODY_FRAME_CODE": 10011,
    "BODY_CODE": 199,
    "INS-76110_FOCAL_LENGTH": 1493.6,
    "INS-76110_BORESIGHT_LINE": 400.0,
    "INS-76110_CK_FRAME_ID": -76000.0,
    "INS-76110_ITRANSL": [
      0.0,
      0.0,
      75.0
    ],
    "INS-76110_ITRANSS": [
      0.0,
      75.0,
      0.0
    ],
    "INS-76110_CK_REFERENCE_ID": 1.0,
    "FRAME_-76110_CLASS": 3.0,
    "INS-76110_CK_TIME_TOLERANCE": 1.0,
    "CK_-76110_SPK": -76.0,
    "INS-76110_PLATFORM_ID": -76.0,
    "FRAME_-76110_CENTER": -76.0,
    "FRAME_-76110_NAME": "VIDICON_A",
    "FRAME_-76110_CLASS_ID": -76110.0,
    "INS-76110_CK_TIME_BIAS": 0.0,
    "INS-76110_BORESIGHT_SAMPLE": 475.0,
    "CK_-76110_SCLK": -76.0,
    "INS-76110_PIXEL_PITCH": 0.013333333,
    "INS-76110_SPK_TIME_BIAS": 0.0,
    "INS-76110_TRANSX": [
      0.0,
      0.013333333,
      0.0
    ],
    "INS-76110_TRANSY": [
      0.0,
      0.0,
      0.013333333
    ],
    "BODY199_PM": [
      329.548,
      6.1385025,
      0.0
    ],
    "BODY199_POLE_RA": [
      281.01,
      -0.033,
      0.0
    ],
    "BODY199_LONG_AXIS": 0.0,
    "BODY199_POLE_DEC": [
      61.45,
      -0.005,
      0.0
    ]
  },
  "detector_sample_summing": 1,
  "detector_line_summing": 1,
  "focal_length_model": {
    "focal_length": 1493.6
  },
  "detector_center": {
    "line": 400.0,
    "sample": 475.0
  },
  "focal2pixel_lines": [
    0.0,
    0.0,
    75.0
  ],
  "focal2pixel_samples": [
    0.0,
    75.0,
    0.0
  ],
  "optical_distortion": {
    "radial": {
      "coefficients": [
        0.0,
        0.0,
        0.0
      ]
    }
  },
  "starting_detector_line": 0,
  "starting_detector_sample": 0,
  "instrument_position": {
    "spk_table_start_time": -812916168.4183488,
    "spk_table_end_time": -812916168.4183488,
    "spk_table_original_size": 1,
    "ephemeris_times": [
      -812916168.4183488
    ],
    "positions": [
      [
        -102988.65244940185,
        3813.6761044064274,
        -31476.7258130999
      ]
    ],
    "velocities": [
      [
        10.073083917183162,
        -0.6608509235485678,
        2.9052260072869664
      ]
    ],
    "reference_frame": 1
  },
  "sun_position": {
    "spk_table_start_time": -812916168.4183488,
    "spk_table_end_time": -812916168.4183488,
    "spk_table_original_size": 1,
    "ephemeris_times": [
      -812916168.4183488
    ],
    "positions": [
      [
        6487626.304499695,
        61459556.251802824,
        32153267.064496163
      ]
    ],
    "velocities": [
      [
        -38.73233838516926,
        0.39826024551668027,
        4.232611805855759
      ]
    ],
    "reference_frame": 1
  }
}
 No newline at end of file
+9 −0
Original line number Diff line number Diff line
LEAPSECONDS_KERNEL     = /isis_data/base/kernels/lsk/naif0012.tls
SPK_KERNEL             = /testdata/mariner10-driver/generated-kernels/27265.isis_0.bsp
   BODIES              = 0, 1, 199, 10, -76
   BEGIN_TIME          = 1974 MAR 29 17:50:22.619
   END_TIME            = 1974 MAR 29 17:58:37.796
   SOURCE_SPK_KERNEL   = /isis_data/mariner10/kernels/spk/MARINER_10_A_gem.bsp
      INCLUDE_COMMENTS = no
   SOURCE_SPK_KERNEL   = /isis_data/base/kernels/spk/de430.bsp
      INCLUDE_COMMENTS = no
+282 −0
Original line number Diff line number Diff line
DAFETF NAIF DAF ENCODED TRANSFER FILE
'DAF/SPK '
'2'
'6'
'SPKMERGE                                                    '
BEGIN_ARRAY 1 114
'MERCURY Mariner 10 Type 9 Segment       '
'-30741F34320262^8'
'-30741D4504B282^8'
'-4C'
'C7'
'1'
'9'
114
'-1AFFA^5'
'10DA^4'
'-8386^4'
'A13D32B6076A^1'
'-B3CF831952833^0'
'2E30D511378058^1'
'-1ACAC^5'
'109F^4'
'-8293^4'
'A124D124810218^1'
'-B3CF83172E83D8^0'
'2E30D510AABA8C^1'
'-1A95E^5'
'1064^4'
'-81A1^4'
'A124D124810218^1'
'-B2496A1D7E646^0'
'2E30D510AABA8C^1'
'-1A61^5'
'102A^4'
'-80AE^4'
'A0F40E07358528^1'
'-96DBA890E7F04^0'
'2F24A4AD487B14^1'
'-1A2C4^5'
'1001^4'
'-7FB2^4'
'A10C6F96D0D17^1'
'-96DBA890E7F04^0'
'2F24A4AD487B14^1'
'-19F75^5'
'FC7^3'
'-7EBF^4'
'A124D124810218^1'
'-AF3D382A1E256^0'
'2E4936A045BC84^1'
'-19C28^5'
'F8E^3'
'-7DCC^4'
'A10C6F94E6002^1'
'-ADB71F306E05E8^0'
'2E61982FE0BE7C^1'
'-198DA^5'
'F55^3'
'-7CD8^4'
'A124D1266C1DB8^1'
'-AC310638CAAD6^0'
'2E79F9C009652A^1'
'-1958C^5'
'F1D^3'
'-7BE4^4'
'A13D32B6076A^1'
'-AAAAED3F15E9^0'
'2E79F9C009652A^1'
'-1923D^5'
'EE5^3'
'-7AF^4'
'A124D1266C1DB8^1'
'-A924D4456124A^0'
'2E79F9C009652A^1'
'-18EF^5'
'EAE^3'
'-79FC^4'
'A10C6F96D0D17^1'
'-A79EBB4BAC6048^0'
'2E925B4FA4B17^1'
'-18BA2^5'
'E77^3'
'-7907^4'
'A124D124810218^1'
'-A79EBB49AD87F^0'
'2EAABCDEB1C464^1'
'-18854^5'
'E4^3'
'-7812^4'
'A19EF7FF8F5D48^1'
'-9861FCFB35DBF^0'
'2D3D171A93FD4C^1'
'-18501^5'
'E13^3'
'-772C^4'
'A19EB8F4749B18^1'
'-96DBA890E7F04^0'
'2D3D057526859E^1'
'-181B3^5'
'DDD^3'
'-7637^4'
'A10C6F94E6002^1'
'-A30C705C9D2978^0'
'2EC31E6E4CC65C^1'
'-17E66^5'
'DA8^3'
'-7541^4'
'A0F44CCDD327D^1'
'-A18696648522D^0'
'2EC330ABE4BB6E^1'
'-307420BC70BAB4^8'
'-3074206870BAB4^8'
'-3074201470FC3C^8'
'-30741FC070FC3C^8'
'-30741F6C713DC6^8'
'-30741F18713DC6^8'
'-30741EC4717F4E^8'
'-30741E70717F4E^8'
'-30741E1C71C0D8^8'
'-30741DC871C0D8^8'
'-30741D74720262^8'
'-30741D20720262^8'
'-30741CCC7243EA^8'
'-30741C78728574^8'
'-30741C24728574^8'
'-30741BD072C6FC^8'
'9^1'
'1^2'
END_ARRAY 1 114
BEGIN_ARRAY 2 12
'DE-0430LE-0430                          '
'-30741F34320262^8'
'-30741D4504B282^8'
'C7'
'1'
'1'
'2'
12
'BC26EB4^8'
'40A952^9'
'0^0'
'0^0'
'0^0'
'0^0'
'0^0'
'0^0'
'-34E6E34C^9'
'8152A4^9'
'8^1'
'1^1'
END_ARRAY 2 12
BEGIN_ARRAY 3 39
'DE-0430LE-0430                          '
'-30741F34320262^8'
'-30741D4504B282^8'
'A'
'0'
'1'
'2'
39
'-3073C8C^8'
'A8C^5'
'-5D6A0CF44390D4^5'
'-A6DD7F1A90B498^3'
'12469F3F7188A9^2'
'2AC5140278C45C^0'
'DAF52BA8A548A^-2'
'5B1C3483EE11D4^-4'
'63EFA9BD78B998^-5'
'-B9A6DFD745657^-6'
'-1D935EAB739EA9^-6'
'-95CF581237AC38^-7'
'-5F62665051FF7^-8'
'3861112528D1D2^5'
'-1A06692BBCF8A3^4'
'-D5C719BAE45498^1'
'-138314BC278A72^0'
'E4AA78BCB10BA8^-2'
'44FEBB5BE03BF8^-3'
'5677D29BC4FF98^-4'
'28E4F8C18DCE04^-5'
'73791785EA7A1^-6'
'254E5C68B9055^-7'
'285B00B1CFBE64^-8'
'1B10241CBD5499^5'
'-B0CD284C109A48^3'
'-644BD2CEB8AFF^1'
'-B806F8CA37FFF8^-1'
'5EED6CFB12CFD^-2'
'1C997EC2F95C01^-3'
'2E9B73D3166A2E^-4'
'1783966EC0B42E^-5'
'40AF415ADBA9FC^-6'
'232407A332E4AE^-7'
'1DDEEEB11205CE^-8'
'-307E54C^8'
'1518^6'
'23^2'
'1^1'
END_ARRAY 3 39
BEGIN_ARRAY 4 48
'DE-0430LE-0430                          '
'-30741F34320262^8'
'-30741D4504B282^8'
'1'
'0'
'1'
'2'
48
'-30790EC^8'
'546^5'
'-12165EE209BF8^7'
'C29F0AC9A1CC9^6'
'357A3132A9B00E^5'
'-62B09CE51E23C4^4'
'-2327BB56D34A8C^2'
'-C1042A52C8CE4^1'
'-263F132CA2DB5A^0'
'DE44C2F497DAF^-2'
'-FA0F6AD93D7CD^-3'
'15DCFEF2AF5A03^-3'
'-40B508CBED69C8^-5'
'8BB9F3BA175678^-6'
'24049C434442E6^-7'
'14104B18D72055^-7'
'-38676C119AD704^7'
'-2A98109765E1F2^6'
'AAB2C47C24256^5'
'11E311A80D1BF3^4'
'-111981AB8ADBBF^3'
'3B4C616D8B6292^1'
'-8C690CDD2B36F8^0'
'7D904C06291528^-2'
'-23CB3CACAA128C^-2'
'-24D69A9B45F1A6^-4'
'-2C4448D291C18^-5'
'-2640B3E911650C^-6'
'36D39E0F1F99B2^-7'
'-150DD955CC0BF5^-7'
'-1C4C924E81052A^7'
'-2AF22235DE6D18^6'
'559F72F42E08B^5'
'13CBE5ACEFC80D^4'
'-8E7BB3C71C0FE^2'
'33B473BD99DB96^1'
'-4706B9224E36F^0'
'2BFEF734D2026^-2'
'-117EF2B9839FDD^-2'
'-37FD5EA2E4B25A^-4'
'-10E4B92E12B58A^-5'
'-22A5531BB879CA^-6'
'11D64A86F054C^-7'
'-E09D5225E35338^-9'
'-307E54C^8'
'A8C^5'
'2C^2'
'1^1'
END_ARRAY 4 48
TOTAL_ARRAYS 4
 ~NAIF/SPC BEGIN COMMENTS~
; /testdata/mariner10-driver/generated-kernels/27265.isis_0.bsp LOG FILE

; Created 2023-06-12/12:16:35.00.
;
; BEGIN SPKMERGE COMMANDS

LEAPSECONDS_KERNEL   = /isis_data/base/kernels/lsk/naif0012.tls

SPK_KERNEL = /testdata/mariner10-driver/generated-kernels/27265.isis_0.bsp
SOURCE_SPK_KERNEL = /isis_data/mariner10/kernels/spk/MARINER_10_A_gem.bsp
    INCLUDE_COMMENTS = NO
    BODIES           = -76
    BEGIN_TIME       = 1974 MAR 29 17:50:22.619
    END_TIME         = 1974 MAR 29 17:58:37.796
  SOURCE_SPK_KERNEL  = /isis_data/base/kernels/spk/de430.bsp
    INCLUDE_COMMENTS = NO
    BODIES           = 1, 199, 10
    BEGIN_TIME       = 1974 MAR 29 17:50:22.619
    END_TIME         = 1974 MAR 29 17:58:37.796

; END SPKMERGE COMMANDS
 ~NAIF/SPC END COMMENTS~
Loading