Skip to content
Snippets Groups Projects
Commit e03708cb authored by Jesse Mapel's avatar Jesse Mapel Committed by GitHub
Browse files

Fixed Viking and Cassini ISIS label ISIS SPICE drivers (#392)

* Added instrument check to cassini and viking drivers

* Added more logic to viking and cassini iss drivers

* Moved CO lookups to module

* Added Cassini ISS isis label isis spice test
parent 9d57995b
No related branches found
No related tags found
No related merge requests found
...@@ -17,16 +17,16 @@ from ale.rotation import ConstantRotation ...@@ -17,16 +17,16 @@ from ale.rotation import ConstantRotation
from ale.transformation import FrameChain from ale.transformation import FrameChain
from scipy.spatial.transform import Rotation from scipy.spatial.transform import Rotation
class CassiniIssPds3LabelNaifSpiceDriver(Framer, Pds3Label, NaifSpice, RadialDistortion, Driver):
"""
Cassini mixin class for defining Spice calls.
"""
id_lookup = { id_lookup = {
"ISSNA" : "CASSINI_ISS_NAC", "ISSNA" : "CASSINI_ISS_NAC",
"ISSWA" : "CASSINI_ISS_WAC" "ISSWA" : "CASSINI_ISS_WAC"
} }
name_lookup = {
"ISSNA" : "Imaging Science Subsystem Narrow Angle Camera",
"ISSWA" : "Imaging Science Subsystem Wide Angle Camera"
}
nac_filter_to_focal_length = { nac_filter_to_focal_length = {
("P0","BL2"):2002.19, ("P0","BL2"):2002.19,
("P0","CB1"):2002.30, ("P0","CB1"):2002.30,
...@@ -110,6 +110,12 @@ class CassiniIssPds3LabelNaifSpiceDriver(Framer, Pds3Label, NaifSpice, RadialDis ...@@ -110,6 +110,12 @@ class CassiniIssPds3LabelNaifSpiceDriver(Framer, Pds3Label, NaifSpice, RadialDis
("T3","IRP90"):201.07 ("T3","IRP90"):201.07
} }
class CassiniIssPds3LabelNaifSpiceDriver(Framer, Pds3Label, NaifSpice, RadialDistortion, Driver):
"""
Cassini mixin class for defining Spice calls.
"""
@property @property
def instrument_id(self): def instrument_id(self):
""" """
...@@ -124,7 +130,7 @@ class CassiniIssPds3LabelNaifSpiceDriver(Framer, Pds3Label, NaifSpice, RadialDis ...@@ -124,7 +130,7 @@ class CassiniIssPds3LabelNaifSpiceDriver(Framer, Pds3Label, NaifSpice, RadialDis
: str : str
instrument id instrument id
""" """
return self.id_lookup[super().instrument_id] return id_lookup[super().instrument_id]
@property @property
def focal_epsilon(self): def focal_epsilon(self):
...@@ -259,10 +265,10 @@ class CassiniIssPds3LabelNaifSpiceDriver(Framer, Pds3Label, NaifSpice, RadialDis ...@@ -259,10 +265,10 @@ class CassiniIssPds3LabelNaifSpiceDriver(Framer, Pds3Label, NaifSpice, RadialDis
filters = tuple(self.label['FILTER_NAME']) filters = tuple(self.label['FILTER_NAME'])
if self.instrument_id == "CASSINI_ISS_NAC": if self.instrument_id == "CASSINI_ISS_NAC":
return self.nac_filter_to_focal_length.get(filters, default_focal_len) return nac_filter_to_focal_length.get(filters, default_focal_len)
elif self.instrument_id == "CASSINI_ISS_WAC": elif self.instrument_id == "CASSINI_ISS_WAC":
return self.wac_filter_to_focal_length.get(filters, default_focal_len) return wac_filter_to_focal_length.get(filters, default_focal_len)
@property @property
def _original_naif_sensor_frame_id(self): def _original_naif_sensor_frame_id(self):
...@@ -329,6 +335,19 @@ class CassiniIssPds3LabelNaifSpiceDriver(Framer, Pds3Label, NaifSpice, RadialDis ...@@ -329,6 +335,19 @@ class CassiniIssPds3LabelNaifSpiceDriver(Framer, Pds3Label, NaifSpice, RadialDis
return self._frame_chain return self._frame_chain
class CassiniIssIsisLabelIsisSpiceDriver(Framer, IsisLabel, IsisSpice, NoDistortion, Driver): class CassiniIssIsisLabelIsisSpiceDriver(Framer, IsisLabel, IsisSpice, NoDistortion, Driver):
@property
def instrument_id(self):
"""
Returns the ID of the instrument
Returns
-------
: str
ID of the sensor
"""
return id_lookup[super().instrument_id]
@property @property
def sensor_name(self): def sensor_name(self):
""" """
...@@ -339,4 +358,19 @@ class CassiniIssIsisLabelIsisSpiceDriver(Framer, IsisLabel, IsisSpice, NoDistort ...@@ -339,4 +358,19 @@ class CassiniIssIsisLabelIsisSpiceDriver(Framer, IsisLabel, IsisSpice, NoDistort
: str : str
Name of the sensor Name of the sensor
""" """
return self.label['IsisCube']['Instrument']['SpacecraftName'] return name_lookup[super().instrument_id]
@property
def center_ephemeris_time(self):
"""
Returns the middle exposure time for the image in ephemeris seconds.
This is overriden because the ISIS ISSNAC and ISSWAC sensor models use the
label utc times so the converted times are not available in the
NaifKeywords. Instead we get it from the tables.
Returns
-------
: float
"""
return self.inst_position_table['SpkTableStartTime']
...@@ -8,8 +8,54 @@ from ale.base.type_sensor import Framer ...@@ -8,8 +8,54 @@ from ale.base.type_sensor import Framer
from ale.base.type_distortion import NoDistortion from ale.base.type_distortion import NoDistortion
from ale.base.base import Driver from ale.base.base import Driver
sensor_name_lookup = {
"VISUAL_IMAGING_SUBSYSTEM_CAMERA_A" : "Visual Imaging Subsystem Camera A",
"VISUAL_IMAGING_SUBSYSTEM_CAMERA_B" : "Visual Imaging Subsystem Camera B"
}
spacecraft_name_lookup = {
'VIKING_ORBITER_1': 'VIKING ORBITER 1',
'VIKING_ORBITER_2': 'VIKING ORBITER 2'
}
alt_id_lookup = {
'VIKING ORBITER 1': -27999,
'VIKING ORBITER 2':-30999
}
class VikingIsisLabelNaifSpiceDriver(Framer, IsisLabel, NaifSpice, Driver): class VikingIsisLabelNaifSpiceDriver(Framer, IsisLabel, NaifSpice, Driver):
@property
def instrument_id(self):
"""
Overriden to check that the instrument ID is correct
Returns
-------
: str
The name of the sensor
"""
instrument_id = super().instrument_id
if(instrument_id not in sensor_name_lookup):
raise Exception (f'Instrument ID [{instrument_id}] is wrong.')
return instrument_id
@property
def sensor_name(self):
"""
Returns the name of the instrument
Returns
-------
: str
Name of the sensor
"""
return sensor_name_lookup[super().instrument_id]
@property @property
def spacecraft_name(self): def spacecraft_name(self):
""" """
...@@ -20,12 +66,7 @@ class VikingIsisLabelNaifSpiceDriver(Framer, IsisLabel, NaifSpice, Driver): ...@@ -20,12 +66,7 @@ class VikingIsisLabelNaifSpiceDriver(Framer, IsisLabel, NaifSpice, Driver):
: str : str
Name of the spacecraft. Name of the spacecraft.
""" """
name_lookup = { return spacecraft_name_lookup[super().spacecraft_name]
'VIKING_ORBITER_1': 'VIKING ORBITER 1',
'VIKING_ORBITER_2': 'VIKING ORBITER 2'
}
return name_lookup[super().spacecraft_name]
@property @property
def alt_ikid(self): def alt_ikid(self):
...@@ -41,11 +82,6 @@ class VikingIsisLabelNaifSpiceDriver(Framer, IsisLabel, NaifSpice, Driver): ...@@ -41,11 +82,6 @@ class VikingIsisLabelNaifSpiceDriver(Framer, IsisLabel, NaifSpice, Driver):
Alternate Naif Integer ID code for the instrument Alternate Naif Integer ID code for the instrument
""" """
alt_id_lookup = {
'VIKING ORBITER 1': -27999,
'VIKING ORBITER 2':-30999
}
return alt_id_lookup[self.spacecraft_name] return alt_id_lookup[self.spacecraft_name]
@property @property
...@@ -84,6 +120,24 @@ class VikingIsisLabelNaifSpiceDriver(Framer, IsisLabel, NaifSpice, Driver): ...@@ -84,6 +120,24 @@ class VikingIsisLabelNaifSpiceDriver(Framer, IsisLabel, NaifSpice, Driver):
return ephemeris_start_time + offset1 + offset2 return ephemeris_start_time + offset1 + offset2
class VikingIsisLabelIsisSpiceDriver(Framer, IsisLabel, IsisSpice, NoDistortion, Driver): class VikingIsisLabelIsisSpiceDriver(Framer, IsisLabel, IsisSpice, NoDistortion, Driver):
@property
def instrument_id(self):
"""
Overriden to check that the instrument ID is correct
Returns
-------
: str
The name of the sensor
"""
instrument_id = super().instrument_id
if(instrument_id not in sensor_name_lookup):
raise Exception (f'Instrument ID [{instrument_id}] is wrong.')
return instrument_id
@property @property
def sensor_name(self): def sensor_name(self):
""" """
...@@ -94,4 +148,16 @@ class VikingIsisLabelIsisSpiceDriver(Framer, IsisLabel, IsisSpice, NoDistortion, ...@@ -94,4 +148,16 @@ class VikingIsisLabelIsisSpiceDriver(Framer, IsisLabel, IsisSpice, NoDistortion,
: str : str
Name of the sensor Name of the sensor
""" """
return self.label['IsisCube']['Instrument']['SpacecraftName'] return sensor_name_lookup[super().instrument_id]
@property
def spacecraft_name(self):
"""
Overridden to work with spice calls.
Returns
-------
: str
Name of the spacecraft.
"""
return spacecraft_name_lookup[super().spacecraft_name]
...@@ -4,9 +4,12 @@ import re ...@@ -4,9 +4,12 @@ import re
import warnings import warnings
import numpy as np import numpy as np
import json import json
import pvl
import ale import ale
from ale.base.data_isis import read_table_data
from glob import glob from glob import glob
class SimpleSpice(): class SimpleSpice():
...@@ -95,6 +98,21 @@ def get_image_label(image, label_type='pds3'): ...@@ -95,6 +98,21 @@ def get_image_label(image, label_type='pds3'):
return label_file[0] return label_file[0]
def get_table_data(image, table_name):
if not isinstance(image, str):
try:
image = str(image)
except:
raise KeyError('Cannot coerce requested image name to string')
table_file = glob(os.path.join(data_root, '*',f'{image}_{table_name}.tbl'))
if not table_file:
raise Exception(f'Could not find {table_name} table file for {image}')
table_label = pvl.load(table_file[0])
return read_table_data(table_label["Table"], table_file[0])
def get_isd(instrument): def get_isd(instrument):
if not isinstance(instrument, str): if not isinstance(instrument, str):
raise KeyError('instrument name is not a string') raise KeyError('instrument name is not a string')
......
File added
File added
File added
File added
Object = IsisCube
Object = Core
StartByte = 65537
Format = Tile
TileSamples = 1024
TileLines = 1024
Group = Dimensions
Samples = 1024
Lines = 1024
Bands = 1
End_Group
Group = Pixels
Type = SignedWord
ByteOrder = Lsb
Base = 0.0
Multiplier = 1.0
End_Group
End_Object
Group = Instrument
SpacecraftName = Cassini-Huygens
InstrumentId = ISSNA
TargetName = Enceladus
StartTime = 2011-346T05:02:19.773
StopTime = 2011-346T05:02:24.373
ExposureDuration = 4600.0 <Milliseconds>
AntibloomingStateFlag = Off
# BiasStripMean value converted back to 12 bit.
BiasStripMean = 21.550879
CompressionRatio = 2.203063
CompressionType = Lossless
DataConversionType = Table
DelayedReadoutFlag = No
FlightSoftwareVersionId = 1.4
GainModeId = 29 <ElectronsPerDN>
GainState = 2
ImageTime = 2011-346T05:02:24.373
InstrumentDataRate = 182.783997 <KilobitsPerSecond>
OpticsTemperature = (0.627499, 1.905708 <DegreesCelcius>)
ReadoutCycleIndex = 6
ShutterModeId = NacOnly
ShutterStateId = Enabled
SummingMode = 1
InstrumentModeId = Full
SpacecraftClockCount = 1/1702360365.220
ReadoutOrder = 0
End_Group
Group = Archive
DataSetId = CO-S-ISSNA/ISSWA-2-EDR-V1.0
ImageNumber = 1702360370
ObservationId = ISS_158EN_ENCEL001_PRIME
ProductId = 1_N1702360370.120
End_Group
Group = BandBin
FilterName = CL1/UV3
OriginalBand = 1
Center = 342.868
Width = 68.904
End_Group
Group = Kernels
NaifFrameCode = -82360
LeapSecond = $base/kernels/lsk/naif0012.tls
TargetAttitudeShape = ($base/kernels/pck/pck00009.tpc,
$cassini/kernels/pck/cpck15Dec2017.tpc)
TargetPosition = (Table, $base/kernels/spk/de430.bsp,
$base/kernels/spk/sat425.bsp)
InstrumentPointing = (Table, $cassini/kernels/ck/11344_11349ra.bc,
$cassini/kernels/fk/cas_v40.tf)
Instrument = Null
SpacecraftClock = $cassini/kernels/sclk/cas00172.tsc
InstrumentPosition = (Table,
$cassini/kernels/spk/200128RU_SCPSE_11337_113-
57.bsp)
InstrumentAddendum = $cassini/kernels/iak/IssNAAddendum004.ti
ShapeModel = Null
InstrumentPositionQuality = Reconstructed
InstrumentPointingQuality = Reconstructed
CameraVersion = 1
Source = isis
End_Group
End_Object
Object = Label
Bytes = 65536
End_Object
Object = Table
Name = "ISS Prefix Pixels"
StartByte = 2163131
Bytes = 24576
Records = 1024
ByteOrder = Lsb
Association = Lines
Group = Field
Name = OverclockPixels
Type = Double
Size = 3
End_Group
End_Object
Object = Table
Name = InstrumentPointing
StartByte = 2192270
Bytes = 64
Records = 1
ByteOrder = Lsb
TimeDependentFrames = (-82000, 1)
ConstantFrames = (14082360, -82360, -82000)
ConstantRotation = (-0.0014870197280319, -1.71828725624524e-04,
0.99999887962298, -0.99999872852119,
-5.75703736655754e-04, -0.0014871184258906,
5.75958621314492e-04, -0.99999981952003,
-1.70972424334032e-04)
CkTableStartTime = 376938208.25635
CkTableEndTime = 376938208.25635
CkTableOriginalSize = 1
FrameTypeCode = 3
Description = "Created by spiceinit"
Kernels = ($cassini/kernels/ck/11344_11349ra.bc,
$cassini/kernels/fk/cas_v40.tf)
Group = Field
Name = J2000Q0
Type = Double
Size = 1
End_Group
Group = Field
Name = J2000Q1
Type = Double
Size = 1
End_Group
Group = Field
Name = J2000Q2
Type = Double
Size = 1
End_Group
Group = Field
Name = J2000Q3
Type = Double
Size = 1
End_Group
Group = Field
Name = AV1
Type = Double
Size = 1
End_Group
Group = Field
Name = AV2
Type = Double
Size = 1
End_Group
Group = Field
Name = AV3
Type = Double
Size = 1
End_Group
Group = Field
Name = ET
Type = Double
Size = 1
End_Group
End_Object
Object = Table
Name = InstrumentPosition
StartByte = 2192334
Bytes = 56
Records = 1
ByteOrder = Lsb
CacheType = Linear
SpkTableStartTime = 376938208.25635
SpkTableEndTime = 376938208.25635
SpkTableOriginalSize = 1.0
Description = "Created by spiceinit"
Kernels = $cassini/kernels/spk/200128RU_SCPSE_11337_11357.bsp
Group = Field
Name = J2000X
Type = Double
Size = 1
End_Group
Group = Field
Name = J2000Y
Type = Double
Size = 1
End_Group
Group = Field
Name = J2000Z
Type = Double
Size = 1
End_Group
Group = Field
Name = J2000XV
Type = Double
Size = 1
End_Group
Group = Field
Name = J2000YV
Type = Double
Size = 1
End_Group
Group = Field
Name = J2000ZV
Type = Double
Size = 1
End_Group
Group = Field
Name = ET
Type = Double
Size = 1
End_Group
End_Object
Object = Table
Name = BodyRotation
StartByte = 2192390
Bytes = 64
Records = 1
ByteOrder = Lsb
TimeDependentFrames = (10040, 1)
CkTableStartTime = 376938208.25635
CkTableEndTime = 376938208.25635
CkTableOriginalSize = 1
FrameTypeCode = 2
PoleRa = (40.66, -0.036, 0.0)
PoleDec = (83.52, -0.004, 0.0)
PrimeMeridian = (6.32, 262.7318996, 0.0)
Description = "Created by spiceinit"
Kernels = ($base/kernels/spk/de430.bsp,
$base/kernels/spk/sat425.bsp,
$base/kernels/pck/pck00009.tpc,
$cassini/kernels/pck/cpck15Dec2017.tpc)
SolarLongitude = 18.419628138988
Group = Field
Name = J2000Q0
Type = Double
Size = 1
End_Group
Group = Field
Name = J2000Q1
Type = Double
Size = 1
End_Group
Group = Field
Name = J2000Q2
Type = Double
Size = 1
End_Group
Group = Field
Name = J2000Q3
Type = Double
Size = 1
End_Group
Group = Field
Name = AV1
Type = Double
Size = 1
End_Group
Group = Field
Name = AV2
Type = Double
Size = 1
End_Group
Group = Field
Name = AV3
Type = Double
Size = 1
End_Group
Group = Field
Name = ET
Type = Double
Size = 1
End_Group
End_Object
Object = Table
Name = SunPosition
StartByte = 2192454
Bytes = 56
Records = 1
ByteOrder = Lsb
CacheType = Linear
SpkTableStartTime = 376938208.25635
SpkTableEndTime = 376938208.25635
SpkTableOriginalSize = 1.0
Description = "Created by spiceinit"
Kernels = ($base/kernels/spk/de430.bsp,
$base/kernels/spk/sat425.bsp)
Group = Field
Name = J2000X
Type = Double
Size = 1
End_Group
Group = Field
Name = J2000Y
Type = Double
Size = 1
End_Group
Group = Field
Name = J2000Z
Type = Double
Size = 1
End_Group
Group = Field
Name = J2000XV
Type = Double
Size = 1
End_Group
Group = Field
Name = J2000YV
Type = Double
Size = 1
End_Group
Group = Field
Name = J2000ZV
Type = Double
Size = 1
End_Group
Group = Field
Name = ET
Type = Double
Size = 1
End_Group
End_Object
Object = History
Name = IsisCube
StartByte = 2192510
Bytes = 1334
End_Object
Object = OriginalLabel
Name = IsisCube
StartByte = 2187707
Bytes = 4563
End_Object
Object = NaifKeywords
BODY_CODE = 602
BODY602_RADII = (256.6, 251.4, 248.3)
BODY_FRAME_CODE = 10040
INS-82360_CL1_UV3_FOCAL_LENGTH = 2003.09
INS-82360_PIXEL_PITCH = 0.012
INS_-82360_FRAME_ID = 14082360
INS-82360_TRANSX = (0.0, 0.012, 0.0)
INS-82360_TRANSY = (0.0, 0.0, 0.012)
INS-82360_ITRANSS = (0.0, 83.333333333333, 0.0)
INS-82360_ITRANSL = (0.0, 0.0, 83.333333333333)
INS-82360_BORESIGHT_LINE = 512.5
INS-82360_BORESIGHT_SAMPLE = 512.5
INS-82360_K1 = 8.0e-06
End_Object
End
{
"isis_camera_version": 1,
"image_lines": 1024,
"image_samples": 1024,
"name_platform": "Cassini-Huygens",
"name_sensor": "Imaging Science Subsystem Narrow Angle Camera",
"reference_height": {
"maxheight": 1000,
"minheight": -1000,
"unit": "m"
},
"name_model": "USGS_ASTRO_FRAME_SENSOR_MODEL",
"center_ephemeris_time": 376938208.25635,
"radii": {
"semimajor": 256.6,
"semiminor": 248.3,
"unit": "km"
},
"body_rotation": {
"time_dependent_frames": [
10040,
1
],
"ck_table_start_time": 376938208.25635386,
"ck_table_end_time": 376938208.25635386,
"ck_table_original_size": 1,
"ephemeris_times": [
376938208.25635386
],
"quaternions": [
[
0.4972617451295224,
-0.018842274857752542,
-0.05328962355712633,
-0.8657574380448987
]
],
"angular_velocities": [
[
4.544323197605576e-06,
3.902625629848406e-06,
5.2734222166983134e-05
]
],
"reference_frame": 1
},
"instrument_pointing": {
"time_dependent_frames": [
-82000,
1
],
"ck_table_start_time": 376938208.25635386,
"ck_table_end_time": 376938208.25635386,
"ck_table_original_size": 1,
"ephemeris_times": [
376938208.25635386
],
"quaternions": [
[
0.7145950771077332,
-0.21489011402790192,
-0.4418416741274442,
0.4979478383030953
]
],
"angular_velocities": [
[
-0.000757278786092557,
-0.0003503954137480032,
-0.000106338121706134
]
],
"reference_frame": 1,
"constant_frames": [
14082360,
-82000
],
"constant_rotation": [
-0.0014870197280309472,
-0.00017182872562249152,
0.9999988796229811,
-0.9999987285211891,
-0.0005757037366557749,
-0.0014871184258896664,
0.0005759586213145429,
-0.999999819520032,
-0.00017097242433200543
]
},
"naif_keywords": {
"BODY_CODE": 602,
"BODY602_RADII": [
256.6,
251.4,
248.3
],
"BODY_FRAME_CODE": 10040,
"INS-82360_CL1_UV3_FOCAL_LENGTH": 2003.09,
"INS-82360_PIXEL_PITCH": 0.012,
"INS_-82360_FRAME_ID": 14082360,
"INS-82360_TRANSX": [
0.0,
0.012,
0.0
],
"INS-82360_TRANSY": [
0.0,
0.0,
0.012
],
"INS-82360_ITRANSS": [
0.0,
83.333333333333,
0.0
],
"INS-82360_ITRANSL": [
0.0,
0.0,
83.333333333333
],
"INS-82360_BORESIGHT_LINE": 512.5,
"INS-82360_BORESIGHT_SAMPLE": 512.5,
"INS-82360_K1": 8e-06
},
"detector_sample_summing": 1,
"detector_line_summing": 1,
"focal_length_model": {
"focal_length": null
},
"detector_center": {
"line": 512.5,
"sample": 512.5
},
"starting_detector_line": 0,
"starting_detector_sample": 0,
"focal2pixel_lines": [
0.0,
0.0,
83.333333333333
],
"focal2pixel_samples": [
0.0,
83.333333333333,
0.0
],
"optical_distortion": {
"radial": {
"coefficients": [
0.0,
0.0,
0.0
]
}
},
"instrument_position": {
"spk_table_start_time": 376938208.25635386,
"spk_table_end_time": 376938208.25635386,
"spk_table_original_size": 1,
"ephemeris_times": [
376938208.25635386
],
"positions": [
[
21962.31325652874,
10152.071521618314,
-3286.8494024992624
]
],
"velocities": [
[
5.4555677148391,
-3.302818436967495,
-0.20369613220714297
]
],
"reference_frame": 1
},
"sun_position": {
"spk_table_start_time": 376938208.25635386,
"spk_table_end_time": 376938208.25635386,
"spk_table_original_size": 1,
"ephemeris_times": [
376938208.25635386
],
"positions": [
[
1342712164.8315928,
521645737.4508392,
157522069.42042258
]
],
"velocities": [
[
-15.573465467758476,
5.743806619852782,
4.859438874986023
]
],
"reference_frame": 1
}
}
\ No newline at end of file
import pytest import pytest
import ale import ale
import os import os
import pvl
import numpy as np import numpy as np
from ale.drivers import co_drivers from ale.drivers import co_drivers
import unittest import unittest
from unittest.mock import PropertyMock, patch from unittest.mock import PropertyMock, patch
import json import json
from conftest import get_image_label, get_image_kernels, get_isd, convert_kernels, compare_dicts from conftest import get_image_label, get_image_kernels, get_isd, convert_kernels, compare_dicts, get_table_data
from ale.drivers.co_drivers import CassiniIssPds3LabelNaifSpiceDriver from ale.drivers.co_drivers import CassiniIssPds3LabelNaifSpiceDriver
from conftest import get_image_kernels, convert_kernels, get_image_label
@pytest.fixture() @pytest.fixture()
def test_kernels(scope="module", autouse=True): def test_kernels(scope="module", autouse=True):
...@@ -20,7 +20,7 @@ def test_kernels(scope="module", autouse=True): ...@@ -20,7 +20,7 @@ def test_kernels(scope="module", autouse=True):
for kern in binary_kernels: for kern in binary_kernels:
os.remove(kern) os.remove(kern)
def test_load(test_kernels): def test_load_pds(test_kernels):
label_file = get_image_label("N1702360370_1") label_file = get_image_label("N1702360370_1")
compare_dict = get_isd("cassiniiss") compare_dict = get_isd("cassiniiss")
...@@ -29,6 +29,19 @@ def test_load(test_kernels): ...@@ -29,6 +29,19 @@ def test_load(test_kernels):
print(json.dumps(isd_obj, indent=2)) print(json.dumps(isd_obj, indent=2))
assert compare_dicts(isd_obj, compare_dict) == [] assert compare_dicts(isd_obj, compare_dict) == []
def test_load_isis():
label_file = get_image_label("N1702360370_1", label_type="isis3")
compare_dict = get_isd("cassiniiss_isis")
def read_detatched_table(table_label, cube):
return get_table_data("N1702360370_1", table_label["Name"])
with patch('ale.base.data_isis.read_table_data', side_effect=read_detatched_table):
isd_str = ale.loads(label_file)
isd_obj = json.loads(isd_str)
print(json.dumps(isd_obj, indent=2))
assert compare_dicts(isd_obj, compare_dict) == []
# ========= Test cassini pds3label and naifspice driver ========= # ========= Test cassini pds3label and naifspice driver =========
class test_cassini_pds3_naif(unittest.TestCase): class test_cassini_pds3_naif(unittest.TestCase):
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment