Skip to content
Snippets Groups Projects
Commit 32cb4697 authored by Kristin's avatar Kristin Committed by GitHub
Browse files

Cassini ALE driver. (#110)

* Add getPosition with coefficients

* Add some exceptions and associated test

* remove debug statements and change test name

* Updated to use gsl for polynomial evaluation and separated out into a helper function. Swapped order of coeffs, other changes in response to review comments

* Added a couple of suggested tests and updated documentation

* Inital work toward ALE cassini driver

* Updated comments in base.py and removed notebook from this PR

* Update mk location to be accessible beyond my computer

* remove newlines

* Update name of Cassini ISS Ale driver

* Update comment based on feedback
parent a792479f
No related branches found
No related tags found
No related merge requests found
......@@ -4,8 +4,9 @@ Config File
# Directory with metakernals
spice_root = "/data/spice/"
cassini = '/data/big/spice/co-s_j_e_v-spice-6-v1.0/cosp_1000/extras/mk'
cassini = '/usgs/cpkgs/isis3/data/cassini/kernels/mk/' # Cassini ISS
mdis = '/data/spice/mess-e_v_h-spice-6-v1.0/messsp_1000/extras/mk' # Messenger
mro = '/data/spice/mro-m-spice-6-v1.0/mrosp_1000/extras/mk' # Mars Reconnaissance Orbiter
kaguya = '/data/spice/SELENE/kernels/mk/'
dawn = '/data/spice/dawn-m_a-spice-6-v1.0/dawnsp_1000/extras/mk'
......@@ -577,7 +577,11 @@ class Pds3Label():
@property
def _exposure_duration(self):
# The EXPOSURE_DURATION may either be stored as a (value, unit) or just a value
try:
return self.label['EXPOSURE_DURATION'].value * 0.001
except:
return self.label['EXPOSURE_DURATION'] * 0.001
class NaifSpice():
......
......@@ -6,11 +6,11 @@ import spiceypy as spice
import numpy as np
from ale import config
from ale.drivers.base import Framer, RadialDistortion, Driver, Pds3, NaifSpice
from ale.drivers.base import Framer, RadialDistortion, Driver, Pds3Label, NaifSpice
class CassiniIssPds3NaifSpiceDriver(Driver, Pds3, NaifSpice, Framer, RadialDistortion):
class CassiniIssPds3LabelNaifSpiceDriver(Driver, Pds3Label, NaifSpice, Framer, RadialDistortion):
"""
Cassini mixin class for defining Spice calls.
"""
id_lookup = {
"ISSNA" : "CASSINI_ISS_NAC",
......@@ -28,6 +28,7 @@ class CassiniIssPds3NaifSpiceDriver(Driver, Pds3, NaifSpice, Framer, RadialDisto
Path to latest metakernel file
"""
metakernel_dir = config.cassini
mks = sorted(glob(os.path.join(metakernel_dir,'*.tm')))
if not hasattr(self, '_metakernel'):
for mk in mks:
......@@ -39,8 +40,8 @@ class CassiniIssPds3NaifSpiceDriver(Driver, Pds3, NaifSpice, Framer, RadialDisto
def instrument_id(self):
"""
Returns an instrument id for unquely 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.
also used to be piped into Spice Kernels to acquire instrument kernel (IK) NAIF IDs.
Therefore they use the same NAIF ID asin bods2c calls.
Returns
-------
......@@ -73,12 +74,7 @@ class CassiniIssPds3NaifSpiceDriver(Driver, Pds3, NaifSpice, Framer, RadialDisto
return [0.0, 0.0, 1/pixel_size]
@property
def _exposure_duration(self):
# labels do not specify a unit explicitly
return self.label['EXPOSURE_DURATION'] * 0.001 # Scale to seconds
@property
def odtk(self):
def _odtk(self):
"""
The radial distortion coeffs are not defined in the ik kernels, instead
they are defined in the ISS Data User Guide (Knowles). Therefore, we
......@@ -90,3 +86,15 @@ class CassiniIssPds3NaifSpiceDriver(Driver, Pds3, NaifSpice, Framer, RadialDisto
elif self.instrument_id == 'CASSINI_ISS_NAC':
# NAC
return [float('-8e-6'), 0, 0]
@property
# FOV_CENTER_PIXEL doesn't specify which coordinate is sample or line, but they are the same
# number, so the order doesn't matter
def _detector_center_line(self):
return float(spice.gdpool('INS{}_FOV_CENTER_PIXEL'.format(self.ikid), 0, 2)[1])
@property
# FOV_CENTER_PIXEL doesn't specify which coordinate is sample or line, but they are the same
# number, so the order doesn't matter
def _detector_center_sample(self):
return float(spice.gdpool('INS{}_FOV_CENTER_PIXEL'.format(self.ikid), 0, 2)[0])
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment