Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clementine LWIR, NIR, and HIRES Drivers #565

Merged
merged 3 commits into from
Sep 22, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
49 changes: 34 additions & 15 deletions ale/drivers/clementine_drivers.py
Original file line number Diff line number Diff line change
@@ -1,25 +1,16 @@
import os
import spiceypy as spice
import json
import numpy as np
import pvl

import ale
from ale.base import Driver
from ale.base.label_isis import IsisLabel
from ale.base.data_naif import NaifSpice
from ale.base.type_distortion import RadialDistortion, NoDistortion
from ale.base.type_sensor import Framer, LineScanner
from ale.util import generate_kernels_from_cube
from ale.base.type_sensor import Framer
from ale.base.type_distortion import NoDistortion

from ale import util
from ale.base.type_sensor import Framer


class ClementineUvvisIsisLabelNaifSpiceDriver(Framer, IsisLabel, NaifSpice, NoDistortion, Driver):
class ClementineIsisLabelNaifSpiceDriver(Framer, IsisLabel, NaifSpice, NoDistortion, Driver):
"""
Driver for reading Ultra-violet Invisible Spectrum ISIS3 Labels
Driver for reading UUVIS, HIRES, NIR, and LWIR ISIS3 Labels
"""

@property
Expand All @@ -37,7 +28,10 @@ def instrument_id(self):
instrument id
"""
lookup_table = {
"UVVIS": "ULTRAVIOLET/VISIBLE CAMERA"
"UVVIS": "ULTRAVIOLET/VISIBLE CAMERA",
"NIR": "Near Infrared Camera",
"HIRES": "High Resolution Camera",
"LWIR": "Long Wave Infrared Camera"
}
return lookup_table[super().instrument_id]

Expand All @@ -51,8 +45,7 @@ def sensor_name(self):
: str
instrument name
"""
filter = self.label["IsisCube"]['BandBin']['FilterName']
return "CLEM_" + super().instrument_id + "_" + filter
return super().instrument_id

@property
def spacecraft_name(self):
Expand Down Expand Up @@ -109,3 +102,29 @@ def ikid(self):
Naif ID used to for identifying the instrument in Spice kernels
"""
return self.label["IsisCube"]["Kernels"]["NaifFrameCode"]

@property
def focal_length(self):
"""
NIR manually sets focal length based on filter.

Returns
-------
: float
focal length
"""
if (self.instrument_id == "Near Infrared Camera"):
filter = self.label["IsisCube"]['BandBin']['FilterName']

lookup_table = {
"A": 2548.2642,
"B": 2530.8958,
"C": 2512.6589,
"D": 2509.0536,
"E": 2490.7378,
"F": 2487.8694
}

return lookup_table[filter.upper()] * 0.038

return super().focal_length
Loading
Loading