Skip to content
Snippets Groups Projects
Unverified Commit 695d3129 authored by acpaquette's avatar acpaquette Committed by GitHub
Browse files

Minirf Fixes (#563)


* Fixes LRO minirf driver

* Reverted gitignore

* Reverted sensor_frame_id override

* Added naifkeyword test for minirf

* Added changelog entry

* Updated minirf json

* Lunar orbiter high camera (#553)

* skeleton class for LO

* lo center time and ikid

* detector center line/sample dummy values

* LO driver (processes cube w/o error)

* lo test data

* lunar orbiter tests

* removed old comment

* removed geotransform and projection from ISD

* Clementine LWIR, NIR, and HIRES Drivers (#565)

* Clementine Drivers

* Added missing kernels

* Combined to one driver

* Updated doc strings

* MSL Nadir Pointing (#564)

* Enabled nadir pointing in MSL/CAHVOR driver

* Removed commented out position changes

* Fix MSL test

* More msl fiddling

* Update for MSL Nadir pointing rotation in the cahvor mixin

* Fixed msl tests and added nadir test

* Updated ALE version in CmakeList.txt (#555)

* Ale Path Expansion Fixes (#551)

* Fixed expandvar function to expand paths completely

* Made expandvars fail if it can't expand a variable

* fixed typo

---------

Co-authored-by: default avatarJacob Cain <115182890+jrcain-usgs@users.noreply.github.com>
Co-authored-by: default avatarAmy Stamile <74275278+amystamile-usgs@users.noreply.github.com>
Co-authored-by: default avatarKelvin <krodriguez@usgs.gov>
parent c041a597
No related branches found
No related tags found
No related merge requests found
......@@ -38,6 +38,9 @@ release.
### Added
- Mariner10 IsisLabelNaifSpice driver, tests, and test data [#547](https://github.com/DOI-USGS/ale/pull/547)
### Fixed
- Fixed LRO MiniRF drivers naif keywords focal to pixel and pixel to focal translations to be correct. [#563](https://github.com/DOI-USGS/ale/pull/563)
## [0.9.1] - 2023-06-05
### Changed
......
......@@ -814,19 +814,21 @@ class LroMiniRfIsisLabelNaifSpiceDriver(Radar, NaifSpice, IsisLabel, Driver):
: float
start time
"""
return spice.str2et(self.utc_start_time.strftime("%Y-%m-%d %H:%M:%S.%f"))
return spice.str2et(self.utc_start_time.strftime("%Y-%m-%d %H:%M:%S.%f")) - self.line_exposure_duration
@property
def ephemeris_stop_time(self):
"""
Returns the stop ephemeris time for the image.
Returns the stop ephemeris time for the image. This is computed from
the start time plus the line exposure per line, plus the line exposure
removed from the start time, plus the line exposure for the final line.
Returns
-------
: float
stop time
"""
return spice.str2et(self.utc_stop_time.strftime("%Y-%m-%d %H:%M:%S.%f"))
return self.ephemeris_start_time + (self.image_lines * self.line_exposure_duration) + (self.line_exposure_duration * 2)
@property
def look_direction(self):
......@@ -846,7 +848,6 @@ class LroMiniRfIsisLabelNaifSpiceDriver(Radar, NaifSpice, IsisLabel, Driver):
Returns the Naif ID code for the sensor reference frame
We replace this with the target frame ID because the sensor operates
entirely in the target reference frame
Returns
-------
: int
......@@ -854,7 +855,28 @@ class LroMiniRfIsisLabelNaifSpiceDriver(Radar, NaifSpice, IsisLabel, Driver):
"""
return self.target_frame_id
@property
def naif_keywords(self):
"""
Adds the correct TRANSX/Y and ITRANS/L values for use in ISIS. By default
these values are placeholders in the ISIS iaks and need to be computed manully
from the ground range resolution. See RadarGroundRangeMap.cpp in ISIS for
the calculations.
Returns
-------
: dict
An updated dictionary of NAIF keywords with the correct TRANSX/Y and ITRANSS/L
values computed
"""
naif_keywords = super().naif_keywords
ground_range_resolution = self.label['IsisCube']['Instrument']["ScaledPixelHeight"]
icode = "INS" + str(self.ikid)
naif_keywords[icode + "_TRANSX"] = [-1.0 * ground_range_resolution, ground_range_resolution, 0.0]
naif_keywords[icode + "_TRANSY"] = [0.0, 0.0, 0.0]
naif_keywords[icode + "_ITRANSS"] = [1.0, 1.0 / ground_range_resolution, 0.0]
naif_keywords[icode + "_ITRANSL"] = [0.0, 0.0, 0.0]
return naif_keywords
class LroLrocWacIsisLabelIsisSpiceDriver(PushFrame, IsisLabel, IsisSpice, RadialDistortion, Driver):
@property
......
This diff is collapsed.
......@@ -261,12 +261,20 @@ class test_miniRf(unittest.TestCase):
def test_ephmeris_start_time(self):
with patch('ale.drivers.lro_drivers.spice.str2et', return_value=12345) as str2et:
assert self.driver.ephemeris_start_time == 12345
assert self.driver.ephemeris_start_time == 12344.995295578527
def test_ephmeris_stop_time(self):
with patch('ale.drivers.lro_drivers.spice.str2et', return_value=12345) as str2et:
assert self.driver.ephemeris_stop_time == 12345
assert self.driver.ephemeris_stop_time == 12348.297799453276
@patch('ale.base.data_naif.NaifSpice.naif_keywords', new_callable=PropertyMock, return_value={})
def test_naif_keywords(self, naif_keywords):
with patch("ale.base.data_naif.spice.bods2c", return_value=12345) as bods2c:
print(self.driver.naif_keywords["INS12345_ITRANSL"])
np.testing.assert_array_almost_equal(self.driver.naif_keywords["INS12345_ITRANSL"], [0.0, 0.0, 0.0])
np.testing.assert_array_almost_equal(self.driver.naif_keywords["INS12345_ITRANSS"], [1.0, 0.13333333333333, 0])
np.testing.assert_array_almost_equal(self.driver.naif_keywords["INS12345_TRANSX"], [-7.5, 7.5, 0])
np.testing.assert_array_almost_equal(self.driver.naif_keywords["INS12345_TRANSY"], [0, 0, 0])
# ========= Test WAC isislabel and naifspice driver =========
class test_wac_isis_naif(unittest.TestCase):
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment