From c9656f6f4d32b580623a5a32d2bcac086107a617 Mon Sep 17 00:00:00 2001 From: acpaquette <acpaquette@usgs.gov> Date: Fri, 1 Mar 2024 11:07:42 -0700 Subject: [PATCH] Hayabusa amica Ephemeris Fix (#592) * Fixed hayabusa ephemeris times * Updated function doc string * Added test for new property * added changelog entry --- CHANGELOG.md | 1 + ale/drivers/hayabusa_drivers.py | 12 ++++++++++++ tests/pytests/test_hayabusa_drivers.py | 5 +++++ 3 files changed, 18 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index e9a9bc4..6aa4702 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -40,6 +40,7 @@ release. ### Fixed - Fixed landed sensors to correctly project locally [#590](https://github.com/DOI-USGS/ale/pull/590) +- Fixed Hayabusa amica center time computation to match ISIS [#592](https://github.com/DOI-USGS/ale/pull/592) ## [0.10.0] - 2024-01-08 diff --git a/ale/drivers/hayabusa_drivers.py b/ale/drivers/hayabusa_drivers.py index 04b28b8..ffdf1a1 100644 --- a/ale/drivers/hayabusa_drivers.py +++ b/ale/drivers/hayabusa_drivers.py @@ -19,6 +19,18 @@ class HayabusaAmicaIsisLabelNaifSpiceDriver(Framer, IsisLabel, NaifSpice, Radial """ lookup_table = {'AMICA': 'HAYABUSA_AMICA'} return lookup_table[super().instrument_id] + + @property + def center_ephemeris_time(self): + """ + Returns the start ephemeris time plus half the exposure duration. + + Returns + ------- + : double + Center ephemeris time for an image + """ + return self.ephemeris_start_time + self.exposure_duration / 2 @property def sensor_model_version(self): diff --git a/tests/pytests/test_hayabusa_drivers.py b/tests/pytests/test_hayabusa_drivers.py index f36384c..faff94e 100644 --- a/tests/pytests/test_hayabusa_drivers.py +++ b/tests/pytests/test_hayabusa_drivers.py @@ -37,6 +37,11 @@ class test_amica_isis_naif(unittest.TestCase): def test_instrument_id(self): assert self.driver.instrument_id == "HAYABUSA_AMICA" + + def test_center_ephemeris_time(self): + with patch('ale.drivers.hayabusa_drivers.spice.scs2e', return_value=12345) as scs2e: + assert self.driver.center_ephemeris_time == 12345 + 0.0109 + scs2e.assert_called_with(-130, '2457499394') def test_sensor_model_version(self): assert self.driver.sensor_model_version == 1 -- GitLab