Skip to content
Snippets Groups Projects
Commit bf88b625 authored by Kelvin Rodriguez's avatar Kelvin Rodriguez
Browse files

moved enter/exit metakernel logic to the Spice driver

parent f52db682
No related branches found
No related tags found
No related merge requests found
......@@ -11,23 +11,6 @@ class Driver():
def __init__(self, file):
self._file = file
def __enter__(self):
"""
Called when the context is created. This is used
to get the kernels furnished.
"""
if self.metakernel:
spice.furnsh(self.metakernel)
return self
def __exit__(self, exc_type, exc_val, exc_tb):
"""
Called when the context goes out of scope. Once
this is done, the object is out of scope and the
kernels can be unloaded.
"""
spice.unload(self.metakernel)
def __str__(self):
return str(self.to_dict())
......@@ -236,6 +219,23 @@ class Spice():
def metakernel(self):
pass
def __enter__(self):
"""
Called when the context is created. This is used
to get the kernels furnished.
"""
if self.metakernel:
spice.furnsh(self.metakernel)
return self
def __exit__(self, exc_type, exc_val, exc_tb):
"""
Called when the context goes out of scope. Once
this is done, the object is out of scope and the
kernels can be unloaded.
"""
spice.unload(self.metakernel)
@property
def odtx(self):
return spice.gdpool('INS{}_OD_T_X'.format(self.ikid),0, 10)
......
......@@ -37,10 +37,13 @@ base = {
'sun_velocity',
'target_name',
'number_of_ephemerides',
'fikid',
'number_of_ephemerides'
}
filter = {
'fikid'
}
transverse_distortion = {
'odtk',
'odtx'
......
......@@ -18,7 +18,7 @@ class MdisSpice(Spice, Framer):
'MERCURY DUAL IMAGING SYSTEM WIDE ANGLE CAMERA':'MSGR_MDIS_WAC'
}
required_keys = keys.base | keys.framer | keys.transverse_distortion
required_keys = keys.base | keys.framer | keys.filter | keys.transverse_distortion
@property
def metakernel(self):
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment