Skip to content

Commit

Permalink
Driver Update and Re-enable (#381)
Browse files Browse the repository at this point in the history
* Removed generic divide by 64 on image lines

* Update a chunk of drivers to test with the ale formatter instead of the ISIS formatter

* Updated formatter test names to start with something other than test

* Moved some isds out of the test file and into the isd directory

* Readded cassis driver import

* Made variable names consistent throughout tests and removed commented out xfail decorators

* Added themis vis and ir isds

* Disabled drivers again

* Added xfails back to disabled drivers
  • Loading branch information
acpaquette authored and jessemapel committed May 30, 2022
1 parent c3dbfd4 commit 93c0743
Show file tree
Hide file tree
Showing 19 changed files with 1,322 additions and 1,018 deletions.
2 changes: 1 addition & 1 deletion ale/base/type_sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ def ephemeris_time(self):
: ndarray
ephemeris times split based on image lines
"""
return np.linspace(self.ephemeris_start_time, self.ephemeris_stop_time, max(2, int(self.image_lines / 64)))
return np.linspace(self.ephemeris_start_time, self.ephemeris_stop_time, max(2, int(self.image_lines/64)))

@property
def ephemeris_stop_time(self):
Expand Down
3 changes: 2 additions & 1 deletion ale/drivers/hayabusa2_drivers.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,10 @@
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 NoDistortion
from ale.base.base import Driver

class Hayabusa2ONCIsisLabelNaifSpiceDriver(Framer, IsisLabel, NaifSpice, Driver):
class Hayabusa2ONCIsisLabelNaifSpiceDriver(Framer, IsisLabel, NaifSpice, NoDistortion, Driver):

@property
def instrument_id(self):
Expand Down
3 changes: 2 additions & 1 deletion ale/drivers/juno_drivers.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,10 @@
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 NoDistortion
from ale.base.base import Driver

class JunoJunoCamIsisLabelNaifSpiceDriver(Framer, IsisLabel, NaifSpice, Driver):
class JunoJunoCamIsisLabelNaifSpiceDriver(Framer, IsisLabel, NaifSpice, NoDistortion, Driver):
"""
Driver for reading Juno ISIS labels.
"""
Expand Down
17 changes: 15 additions & 2 deletions ale/drivers/nh_drivers.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,12 @@
import numpy as np

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

class NewHorizonsLorriIsisLabelNaifSpiceDriver(Framer, IsisLabel, NaifSpice, Driver):
class NewHorizonsLorriIsisLabelNaifSpiceDriver(Framer, IsisLabel, NaifSpice, NoDistortion, Driver):
"""
Driver for reading New Horizons LORRI ISIS3 Labels. These are Labels that have been
ingested into ISIS from PDS EDR images but have not been spiceinit'd yet.
Expand All @@ -22,7 +23,7 @@ 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.
Returns
-------
: str
Expand Down Expand Up @@ -52,3 +53,15 @@ def ikid(self):
Naif Integer ID code for the instrument
"""
return self.label['IsisCube']['Kernels']['NaifFrameCode']

@property
def detector_center_line(self):
return float(spice.gdpool('INS{}_BORESIGHT'.format(self.ikid), 0, 3)[0])

@property
def detector_center_sample(self):
return float(spice.gdpool('INS{}_BORESIGHT'.format(self.ikid), 0, 3)[1])

@property
def sensor_name(self):
return self.label['IsisCube']['Instrument']['SpacecraftName']
39 changes: 36 additions & 3 deletions ale/drivers/ody_drivers.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
import spiceypy as spice

import ale
from ale.base.base import Driver
from ale.base.type_distortion import NoDistortion
from ale.base.data_naif import NaifSpice
from ale.base.label_isis import IsisLabel
from ale.base.type_sensor import LineScanner
from ale.base.base import Driver

import pvl

class OdyThemisIrIsisLabelNaifSpiceDriver(LineScanner, IsisLabel, NaifSpice, Driver):
class OdyThemisIrIsisLabelNaifSpiceDriver(LineScanner, IsisLabel, NaifSpice, NoDistortion, Driver):
"""
Driver for Themis IR ISIS cube
"""
Expand Down Expand Up @@ -59,8 +60,24 @@ def ephemeris_start_time(self):

return og_start_time + offset

@property
def focal_length(self):
return 202.059

@property
def detector_center_line(self):
return 0

@property
def detector_center_sample(self):
return 0

@property
def sensor_name(self):
return self.label['IsisCube']['Instrument']['SpacecraftName']


class OdyThemisVisIsisLabelNaifSpiceDriver(LineScanner, IsisLabel, NaifSpice, Driver):
class OdyThemisVisIsisLabelNaifSpiceDriver(LineScanner, IsisLabel, NaifSpice, NoDistortion, Driver):
""""
Driver for Themis VIS ISIS cube
"""
Expand Down Expand Up @@ -136,3 +153,19 @@ def line_exposure_duration(self):
# if no units are available, assume the exposure duration is given in milliseconds
line_exposure_duration = line_exposure_duration * 0.001
return line_exposure_duration

@property
def focal_length(self):
return 202.059

@property
def detector_center_line(self):
return 0

@property
def detector_center_sample(self):
return 0

@property
def sensor_name(self):
return self.label['IsisCube']['Instrument']['SpacecraftName']
7 changes: 6 additions & 1 deletion ale/drivers/tgo_drivers.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,9 @@
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 NoDistortion

class TGOCassisIsisLabelNaifSpiceDriver(Framer, IsisLabel, NaifSpice, Driver):
class TGOCassisIsisLabelNaifSpiceDriver(Framer, IsisLabel, NaifSpice, NoDistortion, Driver):
"""
Driver for reading TGO Cassis ISIS3 Labels. These are Labels that have been ingested
into ISIS from PDS EDR images but have not been spiceinit'd yet.
Expand Down Expand Up @@ -64,3 +65,7 @@ def sensor_model_version(self):
ISIS sensor model version
"""
return 1

@property
def sensor_name(self):
return self.label['IsisCube']['Instrument']['SpacecraftName']
Loading

0 comments on commit 93c0743

Please sign in to comment.