Unverified Commit 54c3e7be authored by acpaquette's avatar acpaquette Committed by GitHub
Browse files

Small fixes (#583)

* Added missing camera version to lorri driver

* Minor fixes for ores drivers

* Minor fixes for viking drivers

* Cleaned up msi imports

* Removed drivers from disabled list that no longer need to be disabled

* Reverted enabling drivers for another PR

* Fixed orex tests

* Added changelog entries

* Added missing property tests for new horizons and viking

* Updated viking load tests failing to compare focal lengths

* Moved changelog entries to correct place

* Fixed small changelog typo
parent 6618a199
Loading
Loading
Loading
Loading
+3 −0
Original line number Original line Diff line number Diff line
@@ -42,6 +42,9 @@ release.
- Fixed landed sensors to correctly project locally [#590](https://github.com/DOI-USGS/ale/pull/590)
- 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)
- Fixed Hayabusa amica center time computation to match ISIS [#592](https://github.com/DOI-USGS/ale/pull/592)
- Set Lunar Oribter abberation correction to None as it is in ISIS [#593](https://github.com/DOI-USGS/ale/pull/593)
- Set Lunar Oribter abberation correction to None as it is in ISIS [#593](https://github.com/DOI-USGS/ale/pull/593)
- Fixed missing sensor_model_version attribute on NewHorizonsLorriIsisLabelNaifSpiceDriver [#583](https://github.com/DOI-USGS/ale/pull/583)
- Fixed missing sensor_model_version attribute on VikingIsisLabelNaifSpiceDriver [#583](https://github.com/DOI-USGS/ale/pull/583)
- Fixed incorrect distortion look up in Orex camera when working with PolyCam images [#583](https://github.com/DOI-USGS/ale/pull/583)


## [0.10.0] - 2024-01-08 
## [0.10.0] - 2024-01-08 


+1 −10
Original line number Original line Diff line number Diff line
import os
import spiceypy as spice
import json
import numpy as np
import pvl

import ale
from ale.base import Driver
from ale.base import Driver
from ale.base.label_isis import IsisLabel
from ale.base.label_isis import IsisLabel
from ale.base.data_naif import NaifSpice
from ale.base.data_naif import NaifSpice
from ale.base.type_distortion import RadialDistortion, NoDistortion
from ale.base.type_distortion import NoDistortion
from ale.base.type_sensor import Framer, LineScanner
from ale.util import generate_kernels_from_cube
from ale.base.type_sensor import Framer
from ale.base.type_sensor import Framer
from ale.base.type_distortion import NoDistortion
from ale.base.type_distortion import NoDistortion


+4 −0
Original line number Original line Diff line number Diff line
@@ -100,6 +100,10 @@ class NewHorizonsLorriIsisLabelNaifSpiceDriver(Framer, IsisLabel, NaifSpice, NoD
        self._props['exact_ck_times'] = False
        self._props['exact_ck_times'] = False
        return super().frame_chain
        return super().frame_chain
    
    
    @property
    def sensor_model_version(self):
        return 2

class NewHorizonsLeisaIsisLabelNaifSpiceDriver(LineScanner, IsisLabel, NaifSpice, NoDistortion, Driver):
class NewHorizonsLeisaIsisLabelNaifSpiceDriver(LineScanner, IsisLabel, NaifSpice, NoDistortion, Driver):
    """
    """
    Driver for reading New Horizons LEISA ISIS3 Labels.
    Driver for reading New Horizons LEISA ISIS3 Labels.
+45 −15
Original line number Original line Diff line number Diff line
@@ -7,6 +7,8 @@ from ale.base.type_sensor import Framer
from ale.base.base import Driver
from ale.base.base import Driver
from ale.base.type_distortion import RadialDistortion
from ale.base.type_distortion import RadialDistortion


from ale import util

class OsirisRexCameraIsisLabelNaifSpiceDriver(Framer, IsisLabel, NaifSpice, RadialDistortion, Driver):
class OsirisRexCameraIsisLabelNaifSpiceDriver(Framer, IsisLabel, NaifSpice, RadialDistortion, Driver):
    @property
    @property
    def instrument_id(self):
    def instrument_id(self):
@@ -27,6 +29,22 @@ class OsirisRexCameraIsisLabelNaifSpiceDriver(Framer, IsisLabel, NaifSpice, Radi
        }
        }
        return 'ORX_OCAMS_' + sensor_lookup[super().instrument_id]
        return 'ORX_OCAMS_' + sensor_lookup[super().instrument_id]
    
    
    @property
    def polyCamFocusPositionNaifId(self):
        """
        Returns the focal length specific Naif ID for USGS Astro
        IAK distortion model look ups.

        Returns
        -------
        : int
          Special focal length specific Naif ID
        """
        if self.instrument_id == "ORX_OCAMS_POLYCAM":
            return self.label['IsisCube']['Instrument']['PolyCamFocusPositionNaifId']
        else:
            return None

    @property
    @property
    def sensor_name(self):
    def sensor_name(self):
        """
        """
@@ -52,21 +70,6 @@ class OsirisRexCameraIsisLabelNaifSpiceDriver(Framer, IsisLabel, NaifSpice, Radi
        """
        """
        return self.label['IsisCube']['Instrument']['ExposureDuration'].value * 0.001
        return self.label['IsisCube']['Instrument']['ExposureDuration'].value * 0.001



    @property
    def sensor_frame_id(self):
        """
        Returns the Naif ID code for the sensor reference frame.
        This is the frame of the OsirisRex instrument itself, and is not dependent on filter.

        Returns
        -------
        : int
          Naif ID code for the sensor frame
        """
        return -64000


    @property
    @property
    def detector_center_line(self):
    def detector_center_line(self):
        """
        """
@@ -120,4 +123,31 @@ class OsirisRexCameraIsisLabelNaifSpiceDriver(Framer, IsisLabel, NaifSpice, Radi
        if self.filter_name == "UNKNOWN":
        if self.filter_name == "UNKNOWN":
            return spice.gdpool('INS{}_OD_K'.format(self.ikid),0, 3).tolist()
            return spice.gdpool('INS{}_OD_K'.format(self.ikid),0, 3).tolist()
        else:
        else:
            if self.polyCamFocusPositionNaifId != None:
                return spice.gdpool('INS{focusId}_OD_K_{filter}'.format(focusId = self.polyCamFocusPositionNaifId, filter = self.filter_name),0, 3).tolist()
            return spice.gdpool('INS{ikid}_OD_K_{filter}'.format(ikid = self.ikid, filter = self.filter_name),0, 3).tolist()
            return spice.gdpool('INS{ikid}_OD_K_{filter}'.format(ikid = self.ikid, filter = self.filter_name),0, 3).tolist()
        
    @property
    def naif_keywords(self):
        """
        Gets all default naif keywords as well as any naif keywords that
        contain the special focal length specific Naif ID

        Returns
        -------
        : dict
          Dictionary of keywords and values that ISIS creates and attaches to the label
        """
        return {**super().naif_keywords, **util.query_kernel_pool(f"*{self.polyCamFocusPositionNaifId}*")}

    @property
    def sensor_model_version(self):
        """
        Returns the ISIS camera version

        Returns
        -------
        : int
          Camera version number
        """
        return 1
 No newline at end of file
+18 −4
Original line number Original line Diff line number Diff line
@@ -132,18 +132,21 @@ class VikingIsisLabelNaifSpiceDriver(Framer, IsisLabel, NaifSpice, NoDistortion,
        """
        """
        if not hasattr(self, "_focal_length"):
        if not hasattr(self, "_focal_length"):
            if (self.spacecraft_name == "VIKING ORBITER 1"):
            if (self.spacecraft_name == "VIKING ORBITER 1"):
                if (self.sensor_name == "VISUAL_IMAGING_SUBSYSTEM_CAMERA_A"):
                if (self.sensor_name == "Visual Imaging Subsystem Camera A"):
                    self._focal_length = 474.398
                    self._focal_length = 474.398
                elif (self.sensor_name ==  "VISUAL_IMAGING_SUBSYSTEM_CAMERA_B"):
                elif (self.sensor_name ==  "Visual Imaging Subsystem Camera B"):
                    self._focal_length = 474.448
                    self._focal_length = 474.448
                    print("Setting focal")
            elif (self.spacecraft_name == "VIKING ORBITER 2"):
            elif (self.spacecraft_name == "VIKING ORBITER 2"):
                if (self.sensor_name == "VISUAL_IMAGING_SUBSYSTEM_CAMERA_A"):
                if (self.sensor_name == "Visual Imaging Subsystem Camera A"):
                    self._focal_length = 474.610
                    self._focal_length = 474.610
                elif (self.sensor_name ==  "VISUAL_IMAGING_SUBSYSTEM_CAMERA_B"):
                elif (self.sensor_name ==  "Visual Imaging Subsystem Camera B"):
                    self._focal_length = 474.101
                    self._focal_length = 474.101
            else:
            else:
                raise Exception(f"Unknown viking instrument to get focal length: {self.spacecraft_name}, {self.sensor_name}")
                raise Exception(f"Unknown viking instrument to get focal length: {self.spacecraft_name}, {self.sensor_name}")
        
        
        return self._focal_length

    @property
    @property
    def detector_center_line(self):
    def detector_center_line(self):
        return 0
        return 0
@@ -152,6 +155,17 @@ class VikingIsisLabelNaifSpiceDriver(Framer, IsisLabel, NaifSpice, NoDistortion,
    def detector_center_sample(self):
    def detector_center_sample(self):
        return 0
        return 0


    @property
    def sensor_model_version(self):
        """
        Returns the ISIS camera version

        Returns
        -------
        : int
          Camera version number
        """
        return 1




class VikingIsisLabelIsisSpiceDriver(Framer, IsisLabel, IsisSpice, NoDistortion, Driver):
class VikingIsisLabelIsisSpiceDriver(Framer, IsisLabel, IsisSpice, NoDistortion, Driver):
Loading