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

Updated HRSC start sample and line rate table (#305)

* Updated HRSC start sample and line rate table

* Ticked version number

* Added docs

* Extra s

* Explained how missing lines are found
parent da9b8d25
Loading
Loading
Loading
Loading
+1 −1
Original line number Original line Diff line number Diff line
@@ -7,7 +7,7 @@
# Specify the required version of CMake.
# Specify the required version of CMake.
# cmake 3.10 required for ctest/gtest integration
# cmake 3.10 required for ctest/gtest integration
cmake_minimum_required(VERSION 3.10)
cmake_minimum_required(VERSION 3.10)
project(ale VERSION 0.6.2 DESCRIPTION "Abstraction Library for Ephemerides ")
project(ale VERSION 0.6.3 DESCRIPTION "Abstraction Library for Ephemerides ")


# include what we need
# include what we need
include(GNUInstallDirs)
include(GNUInstallDirs)
+24 −13
Original line number Original line Diff line number Diff line
@@ -295,16 +295,6 @@ class MexHrscPds3NaifSpiceDriver(LineScanner, Pds3Label, NaifSpice, RadialDistor
        """
        """
        return 0.0
        return 0.0


    @property
    def detector_start_sample(self):
        """
        Returns
        -------
        : int
          Detector line corresponding to the first image sample
        """
        return self.label["SAMPLE_FIRST_PIXEL"]



    @property
    @property
    def detector_center_sample(self):
    def detector_center_sample(self):
@@ -331,13 +321,34 @@ class MexHrscPds3NaifSpiceDriver(LineScanner, Pds3Label, NaifSpice, RadialDistor
        For HRSC, the ephemeris times and exposure durations are
        For HRSC, the ephemeris times and exposure durations are
        stored in the image data.
        stored in the image data.


        In the image, every line has an entry. This method goes through
        and removes conescutive lines with the same exposure duration.
        There are also potentially missing lines in the image which this
        method accounts for.

        Returns
        Returns
        -------
        -------
        : list
        : list
          Line scan rates
          Line scan rates
        """
        """
        times = [time - self.center_ephemeris_time for time in self.binary_ephemeris_times]
        relative_times = [time - self.center_ephemeris_time for time in self.binary_ephemeris_times]
        return (self.binary_lines, times, self.binary_exposure_durations)
        start_lines = [self.binary_lines[0]]
        start_times = [relative_times[0]]
        exposure_durations = [self.binary_exposure_durations[0]]
        for line, start_time, exposure_duration in zip(self.binary_lines, relative_times, self.binary_exposure_durations):
            # Check for lines missing from the PDS image
            #
            # If more exposures fit into the time since the last entry than
            # there are lines since the last entry, then there are missing lines.
            #
            # If line are missing, add an extra entry for the line immediately
            # following them.
            skipped_lines = int( (start_time - start_times[-1]) / exposure_durations[-1] - (line - start_lines[-1]) + 0.5 ) # add 0.5 to round up
            if exposure_duration != exposure_durations[-1] or skipped_lines > 0:
                start_lines.append(line)
                start_times.append(start_time)
                exposure_durations.append(exposure_duration)
        return (start_lines, start_times, exposure_durations)




    @property
    @property
+1 −1
Original line number Original line Diff line number Diff line
@@ -4,7 +4,7 @@ import sys
from setuptools import setup, find_packages
from setuptools import setup, find_packages


NAME = "Ale"
NAME = "Ale"
VERSION = "0.6.2"
VERSION = "0.6.3"


# To install the library, run the following
# To install the library, run the following
#
#
+10 −18
Original line number Original line Diff line number Diff line
@@ -154,7 +154,7 @@ def usgscsm_compare_dict():
                "sample": 2592.0
                "sample": 2592.0
              },
              },
              "starting_detector_line": 1,
              "starting_detector_line": 1,
              "starting_detector_sample": 80,
              "starting_detector_sample": 0,
              "focal2pixel_lines": [
              "focal2pixel_lines": [
                -7113.11359717265,
                -7113.11359717265,
                0.062856784318668,
                0.062856784318668,
@@ -191,11 +191,6 @@ def usgscsm_compare_dict():
                  -94.88182842731476,
                  -94.88182842731476,
                  0.012800790786743165
                  0.012800790786743165
                ],
                ],
                [
                  1.5,
                  -94.8690276145935,
                  0.012800790786743165
                ],
                [
                [
                  15086.5,
                  15086.5,
                  101.82391116023064,
                  101.82391116023064,
@@ -581,9 +576,6 @@ class test_mex_pds3_naif(unittest.TestCase):
    def test_detector_start_line(self):
    def test_detector_start_line(self):
        assert self.driver.detector_start_line == 1
        assert self.driver.detector_start_line == 1


    def test_detector_start_sample(self):
        assert self.driver.detector_start_sample == 80

    def test_detector_center_line(self):
    def test_detector_center_line(self):
        assert self.driver.detector_center_line == 0.0
        assert self.driver.detector_center_line == 0.0


@@ -620,13 +612,13 @@ class test_mex_pds3_naif(unittest.TestCase):
                   new_callable=PropertyMock) as binary_lines, \
                   new_callable=PropertyMock) as binary_lines, \
            patch('ale.drivers.mex_drivers.MexHrscPds3NaifSpiceDriver.ephemeris_start_time',
            patch('ale.drivers.mex_drivers.MexHrscPds3NaifSpiceDriver.ephemeris_start_time',
                   new_callable=PropertyMock) as ephemeris_start_time:
                   new_callable=PropertyMock) as ephemeris_start_time:
            binary_ephemeris_times.return_value = [255744599.02748165, 255744599.04028246]
            binary_ephemeris_times.return_value =    [0, 1, 2, 3, 5, 7, 9]
            binary_exposure_durations.return_value = [0.012800790786743165, 0.012800790786743165]
            binary_exposure_durations.return_value = [1, 1, 1, 2, 2, 2, 2]
            binary_lines.return_value = [0.5, 1.5]
            binary_lines.return_value = [0.5, 1.5, 2.5, 3.5, 4.5, 5.5, 6.5]
            ephemeris_start_time.return_value = 255744592.07217148
            ephemeris_start_time.return_value = 0
            assert self.driver.line_scan_rate == ([0.5, 1.5],
            assert self.driver.line_scan_rate == ([0.5, 3.5],
                                                  [3.464854270219803, 3.4776550829410553],
                                                  [-5.5, -2.5],
                                                  [0.012800790786743165, 0.012800790786743165])
                                                  [1, 2])


    def test_sensor_model_version(self):
    def test_sensor_model_version(self):
        assert self.driver.sensor_model_version == 1
        assert self.driver.sensor_model_version == 1