Commit fbf328b8 authored by Jesse Mapel's avatar Jesse Mapel Committed by Stuart Sides
Browse files

Added code to account for ISIS ccd center (#231)

* Tweaked ctx ISIS ccd center

* Updated detector centers to account for ISIS coordinates
parent 013a3978
Loading
Loading
Loading
Loading
+12 −2
Original line number Diff line number Diff line
@@ -216,12 +216,17 @@ class DawnFcPds3NaifSpiceDriver(Pds3Label, NaifSpice, Framer, Driver):
        Returns center detector sample acquired from Spice Kernels.
        Expects ikid to be defined. This should be the integer Naid ID code for
        the instrument.

        We have to add 0.5 to the CCD Center because the Dawn IK defines the
        detector pixels as 0.0 being the center of the first pixel so they are
        -0.5 based.

        Returns
        -------
        : float
          center detector sample
        """
        return float(spice.gdpool('INS{}_CCD_CENTER'.format(self.ikid), 0, 2)[0])
        return float(spice.gdpool('INS{}_CCD_CENTER'.format(self.ikid), 0, 2)[0]) + 0.5

    @property
    def detector_center_line(self):
@@ -229,9 +234,14 @@ class DawnFcPds3NaifSpiceDriver(Pds3Label, NaifSpice, Framer, Driver):
        Returns center detector line acquired from Spice Kernels.
        Expects ikid to be defined. This should be the integer Naid ID code for
        the instrument.

        We have to add 0.5 to the CCD Center because the Dawn IK defines the
        detector pixels as 0.0 being the center of the first pixel so they are
        -0.5 based.

        Returns
        -------
        : float
          center detector line
        """
        return float(spice.gdpool('INS{}_CCD_CENTER'.format(self.ikid), 0, 2)[1])
        return float(spice.gdpool('INS{}_CCD_CENTER'.format(self.ikid), 0, 2)[1]) + 0.5
+4 −2
Original line number Diff line number Diff line
@@ -232,13 +232,15 @@ class KaguyaTcPds3NaifSpiceDriver(Pds3Label,NaifSpice, LineScanner, Driver):
        Returnce the center detector sample of the image. Expects tc_id to be
        defined. This should be a string of the form LISM_TC1 or LISM_TC2.

        We subtract 0.5 from the ISIS center line because ISIS detector
        coordinates are 0.5 based.

        Returns
        -------
        : int
          The detector sample of the principle point
        """
        # Pixels are 0 based, not one based, so subtract 1
        return spice.gdpool('INS{}_CENTER'.format(self.ikid), 0, 2)[0]-1
        return spice.gdpool('INS{}_CENTER'.format(self.ikid), 0, 2)[0] - 0.5

    @property
    def _sensor_orientation(self):
+18 −5
Original line number Diff line number Diff line
@@ -138,6 +138,19 @@ class LroLrocPds3LabelNaifSpiceDriver(NaifSpice, Pds3Label, LineScanner, Driver)
        """
        return 'NONE'

    @property
    def detector_center_sample(self):
        """
        The center of the CCD in detector pixels
        ISIS uses 0.5 based CCD samples, so we need to convert to 0 based.

        Returns
        -------
        float :
            The center sample of the CCD
        """
        return super().detector_center_sample - 0.5

    @property
    def ephemeris_start_time(self):
        """
+16 −4
Original line number Diff line number Diff line
@@ -151,12 +151,15 @@ class MessengerMdisPds3NaifSpiceDriver(Pds3Label, NaifSpice, Framer, Driver):
        Expects ikid to be defined. This should be the integer Naid ID code for
        the instrument.

        We subtract 0.5 from the ISIS center sample because ISIS detector
        coordinates are 0.5 based.

        Returns
        -------
        : float
          center detector sample
        """
        return float(spice.gdpool('INS{}_BORESIGHT'.format(self.ikid), 0, 3)[0])
        return float(spice.gdpool('INS{}_BORESIGHT'.format(self.ikid), 0, 3)[0]) - 0.5

    @property
    def detector_center_line(self):
@@ -165,12 +168,15 @@ class MessengerMdisPds3NaifSpiceDriver(Pds3Label, NaifSpice, Framer, Driver):
        Expects ikid to be defined. This should be the integer Naid ID code for
        the instrument.

        We subtract 0.5 from the ISIS center line because ISIS detector
        coordinates are 0.5 based.

        Returns
        -------
        : float
          center detector line
        """
        return float(spice.gdpool('INS{}_BORESIGHT'.format(self.ikid), 0, 3)[1])
        return float(spice.gdpool('INS{}_BORESIGHT'.format(self.ikid), 0, 3)[1]) - 0.5

    @property
    def sensor_model_version(self):
@@ -359,12 +365,15 @@ class MessengerMdisIsisLabelNaifSpiceDriver(IsisLabel, NaifSpice, Framer, Driver
        Expects ikid to be defined. This should be the integer Naid ID code for
        the instrument.

        We subtract 0.5 from the ISIS center sample because ISIS detector
        coordinates are 0.5 based.

        Returns
        -------
        : float
          detector center sample
        """
        return float(spice.gdpool('INS{}_BORESIGHT'.format(self.ikid), 0, 3)[0])
        return float(spice.gdpool('INS{}_BORESIGHT'.format(self.ikid), 0, 3)[0]) - 0.5


    @property
@@ -374,12 +383,15 @@ class MessengerMdisIsisLabelNaifSpiceDriver(IsisLabel, NaifSpice, Framer, Driver
        Expects ikid to be defined. This should be the integer Naid ID code for
        the instrument.

        We subtract 0.5 from the ISIS center line because ISIS detector
        coordinates are 0.5 based.

        Returns
        -------
        : float
          detector center line
        """
        return float(spice.gdpool('INS{}_BORESIGHT'.format(self.ikid), 0, 3)[1])
        return float(spice.gdpool('INS{}_BORESIGHT'.format(self.ikid), 0, 3)[1]) - 0.5

    @property
    def sensor_model_version(self):
+5 −4
Original line number Diff line number Diff line
@@ -289,7 +289,7 @@ class MexHrscPds3NaifSpiceDriver(LineScanner, Pds3Label, NaifSpice, RadialDistor
        """
        Returns the center detector line.

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

        Returns
        -------
@@ -298,7 +298,6 @@ class MexHrscPds3NaifSpiceDriver(LineScanner, Pds3Label, NaifSpice, RadialDistor
        """
        return 0.0


    @property
    def detector_start_sample(self):
        """
@@ -315,14 +314,16 @@ class MexHrscPds3NaifSpiceDriver(LineScanner, Pds3Label, NaifSpice, RadialDistor
        """
        Returns the center detector sample.

        For HRSC, center sample is consistent regardless of filter.
        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
        """
        return 2592.5
        return 2592.0


    @property
Loading