Commit 2578f39d authored by acpaquette's avatar acpaquette Committed by Jesse Mapel
Browse files

GalileoSsi Driver and Tests (#434)

* Added galileo driver and tests

* Updated visual studio version

Update version of miniconda that is being used

Updated to use conda 4.8

Updated compiler flag to visual studio 19

Fixed architecture change

Removed architecture flag

Added proper architecture flag

Used the correct architecture flag

* Added placeholder doc strings

* Addressed PR feedback and updated doc strings
parent 9f51e828
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
version: '0.8.6.{build}'

image: Visual Studio 2017
image: Visual Studio 2019

platform:
  - x64
@@ -10,7 +10,7 @@ configuration:

install:
  - git submodule update --init --recursive
  - call C:\\Miniconda36-x64\Scripts\activate.bat
  - call C:\\Miniconda38-x64\Scripts\activate.bat
  - conda config --set always_yes yes --set changeps1 no
  - conda update -q conda
  - conda install conda-build anaconda-client
@@ -24,7 +24,7 @@ before_build:

build_script:
  - python ..\setup.py install
  - cmake -DCMAKE_BUILD_TYPE=RELEASE -DCMAKE_WINDOWS_EXPORT_ALL_SYMBOLS=ON -G "Visual Studio 15 2017 Win64" -DALE_BUILD_TESTS=OFF ..
  - cmake -DCMAKE_BUILD_TYPE=RELEASE -DCMAKE_WINDOWS_EXPORT_ALL_SYMBOLS=ON -G "Visual Studio 16 2019" -A x64 -DALE_BUILD_TESTS=OFF ..
  - cmake --build . --target ALL_BUILD --config Release

artifacts:
+116 −0
Original line number Diff line number Diff line
import datetime

import spiceypy as spice

import ale
from ale.base.data_naif import NaifSpice
from ale.base.label_isis import IsisLabel
from ale.base.type_sensor import Framer
from ale.base.type_distortion import RadialDistortion
from ale.base.base import Driver

ssi_id_lookup = {
    "SOLID STATE IMAGING SYSTEM" : "GLL_SSI_PLATFORM"
}

class GalileoSsiIsisLabelNaifSpiceDriver(Framer, IsisLabel, NaifSpice, RadialDistortion, Driver):

    @property
    def instrument_id(self):
        """
        Returns an instrument id for uniquely identifying the instrument, but often
        also used to be piped into Spice Kernels to acquire IKIDs. Therefore they
        the same ID the Spice expects in bods2c calls.
        Expects instrument_id to be defined in the IsisLabel mixin. This should be
        a string of the form 'SOLID STATE IMAGING SYSTEM'

        Returns
        -------
        : str
          instrument id
        """
        return ssi_id_lookup[super().instrument_id]

    @property
    def sensor_name(self):
        """
        Returns the name of the instrument

        Returns
        -------
        : str
          Name of the sensor
        """
        return self.label["IsisCube"]["Instrument"]["InstrumentId"]

    @property
    def odtk(self):
        """
        The coefficients for the radial distortion model
        Expects ikid to be defined. This must be the integer Naif id code of the instrument

        Returns
        -------
        : list
          Radial distortion coefficients
        """
        removeCoverDate = datetime.datetime.strptime("1994/04/01 00:00:00", "%Y/%m/%d %H:%M:%S");
        # Remove any timezine info from the original start time
        start_time_as_date = self.label["IsisCube"]["Instrument"]["StartTime"].replace(tzinfo=None)

        if start_time_as_date < removeCoverDate:
            key_str = "_K1_COVER"
        else:
            key_str = "_K1"
        k1 = spice.gdpool("INS" + str(self.ikid) + key_str, 0, 1);
        return k1

    @property
    def naif_keywords(self):
        """
        Adds the focal length cover keyword to the already populated naif keywords

        Returns
        -------
        : dict
          Dictionary of keywords and values that ISIS creates and attaches to the label
        """
        key = "INS" + str(self.ikid) + "_FOCAL_LENGTH_COVER";
        return {**super().naif_keywords, key: spice.gdpool(key, 0, 1)}

    @property
    def ephemeris_start_time(self):
        """
        Returns the start and stop ephemeris times for the image.

        Returns
        -------
        : float
          start time
        """
        return spice.str2et(self.utc_start_time.strftime("%Y-%m-%d %H:%M:%S.%f"))

    @property
    def center_ephemeris_time(self):
        """
        Returns the starting ephemeris time as the ssi framers center is the
        start.

        Returns
        -------
        : double
          Center ephemeris time for an image
        """
        return self.ephemeris_start_time

    @property
    def sensor_model_version(self):
        """
        Returns instrument model version

        Returns
        -------
        : int
          ISIS sensor model version
        """
        return 1
+63 −0
Original line number Diff line number Diff line
DAFETF NAIF DAF ENCODED TRANSFER FILE
'DAF/CK  '
'2'
'6'
' < DAFCAT: CK CONCATENATION >                               '
BEGIN_ARRAY 1 13
'PLTFRM 05-14-97 09:58:57 V7 CKE06B.PLT;1'
'680826607^9'
'680826E23^9'
'-12CC9'
'2'
'3'
'0'
13
'BE0DC8363F10E^0'
'A606BAA433B808^0'
'-1F5B8C3947CD9A^0'
'-1D741C98552024^0'
'BE0DF7B31DC358^0'
'A606F871D7E63^0'
'-1F5A44FFE48D2E^0'
'-1D72EA1E6BE0E3^0'
'680826607^9'
'680826E23^9'
'680826607^9'
'1^1'
'2^1'
END_ARRAY 1 13
BEGIN_ARRAY 2 19
'PLTFRM 02-17-97 14:36:59 V7 CKE06APE.PLT'
'680826607^9'
'680826E23^9'
'-12CC9'
'2'
'3'
'1'
19
'BE157BA032EB88^0'
'A60F38641E56A8^0'
'-1F2E75DE0C24EE^0'
'-1D4240220A2E6A^0'
'0^0'
'0^0'
'0^0'
'BE157BA032EB88^0'
'A60F38641E56A8^0'
'-1F2E75DE0C24EE^0'
'-1D4240220A2E6A^0'
'0^0'
'0^0'
'0^0'
'680826607^9'
'680826E23^9'
'680826607^9'
'1^1'
'2^1'
END_ARRAY 2 19
TOTAL_ARRAYS 2
 ~NAIF/SPC BEGIN COMMENTS~
This CK is for testing with the image: /Users/acpaquette/repos/ale/gllssi2isisAle1.cub

This CK was generated using the following command: {}
 ~NAIF/SPC END COMMENTS~
+111 −0
Original line number Diff line number Diff line
DAFETF NAIF DAF ENCODED TRANSFER FILE
'DAF/CK  '
'2'
'6'
' < DAFCAT: CK CONCATENATION >                               '
BEGIN_ARRAY 1 13
'PLTFRM 05-14-97 09:58:57 V7 CKE06B.PLT;1'
'6808713DE^9'
'680871897^9'
'-12CC9'
'2'
'3'
'0'
13
'890FBADD8F65C8^0'
'-D831A259309978^0'
'118E5817E3959A^-1'
'-306D7499660602^-1'
'89136BC41C9558^0'
'-D82F520D646AD8^0'
'1117DAFDA1417E^-1'
'-3079859A76F04E^-1'
'6808713DE^9'
'680871897^9'
'6808713DE^9'
'1^1'
'2^1'
END_ARRAY 1 13
BEGIN_ARRAY 2 67
'PLTFRM 02-17-97 14:36:59 V7 CKE06APE.PLT'
'6808713DE^9'
'680871897^9'
'-12CC9'
'2'
'3'
'1'
67
'8964D0EE91F45^0'
'-D7FC72940D49E8^0'
'BE031A6BD0644^-2'
'-2E53D9B126718C^-1'
'5EE947BB03A534^-2'
'28421E05634BEC^-2'
'-52678331159B6^-2'
'897B29C6ABB078^0'
'-D7EEC9E06E2A5^0'
'AEE4942D17B21^-2'
'-2BDF274197967C^-1'
'0^0'
'0^0'
'0^0'
'897B29C6ABB078^0'
'-D7EEC9E06E2A5^0'
'AEE4942D17B21^-2'
'-2BDF274197967C^-1'
'0^0'
'0^0'
'0^0'
'897B29C6ABB078^0'
'-D7EEC9E06E2A5^0'
'AEE4942D17B21^-2'
'-2BDF274197967C^-1'
'0^0'
'0^0'
'0^0'
'897AC9C473AEE^0'
'-D7EED433948CC^0'
'A1A4B6AAF7CC88^-2'
'-2D0816F2F35AC4^-1'
'-21DCF7E12AE45A^-3'
'-38161568CC0C56^-2'
'780FF6208D191^-2'
'897BD6DFB63258^0'
'-D7ED42A0E2097^0'
'71F116FD89A1CC^-2'
'-31ACC25806B49C^-1'
'-21D7855B2440FC^-3'
'-38151F4D2006DC^-2'
'78106AA04135B^-2'
'897B6A54CF061^0'
'-D7ED49369E205^0'
'64B1519A7FC808^-2'
'-32D5B371B6A46A^-1'
'0^0'
'0^0'
'0^0'
'897B6A54CF0608^0'
'-D7ED49369E2058^0'
'64B1519A7FC82^-2'
'-32D5B371B6A46C^-1'
'0^0'
'0^0'
'0^0'
'6808713DE^9'
'68087146^9'
'6808714B^9'
'68087169^9'
'68087173^9'
'6808717D^9'
'68087187^9'
'680871897^9'
'6808713DE^9'
'1^1'
'8^1'
END_ARRAY 2 67
TOTAL_ARRAYS 2
 ~NAIF/SPC BEGIN COMMENTS~
This CK is for testing with the image: /Users/acpaquette/repos/ale/gllssi2isisAle1.cub

This CK was generated using the following command: {}
 ~NAIF/SPC END COMMENTS~
+76 −0
Original line number Diff line number Diff line
Object = IsisCube
  Object = Core
    StartByte   = 65537
    Format      = Tile
    TileSamples = 128
    TileLines   = 128

    Group = Dimensions
      Samples = 800
      Lines   = 800
      Bands   = 1
    End_Group

    Group = Pixels
      Type       = UnsignedByte
      ByteOrder  = Lsb
      Base       = 0.0
      Multiplier = 1.0
    End_Group
  End_Object

  Group = Instrument
    SpacecraftName            = "Galileo Orbiter"
    InstrumentId              = "SOLID STATE IMAGING SYSTEM"
    TargetName                = IO
    SpacecraftClockStartCount = 03836008.26
    StartTime                 = 1997-02-19T21:07:27.314
    ExposureDuration          = 0.19583 <seconds>
    GainModeId                = 100000
    TelemetryFormat           = IM8
    LightFloodStateFlag       = ON
    InvertedClockStateFlag    = "NOT INVERTED"
    BlemishProtectionFlag     = OFF
    ExposureType              = NORMAL
    ReadoutMode               = Contiguous
    FrameDuration             = 8.667 <seconds>
    Summing                   = 1
    FrameModeId               = FULL
  End_Group

  Group = Archive
    DataSetId     = GO-J/JSA-SSI-2-REDR-V1.0
    ProductId     = E6I0032
    ObservationId = E6ISSRFMON01
    DataType      = RADIANCE
    CalTargetCode = E6
  End_Group

  Group = BandBin
    FilterName   = VIOLET
    FilterNumber = 3
    Center       = 0.404 <micrometers>
    Width        = .05 <micrometers>
  End_Group

  Group = Kernels
    NaifFrameCode = -77001
  End_Group
End_Object

Object = Label
  Bytes = 65536
End_Object

Object = History
  Name      = IsisCube
  StartByte = 868353
  Bytes     = 515
End_Object

Object = OriginalLabel
  Name      = IsisCube
  StartByte = 868868
  Bytes     = 7967
End_Object
End
Loading