Skip to content

Commit

Permalink
initial UVVIS Driver notebook and code commit
Browse files Browse the repository at this point in the history
removing notebook, accidentally included

notebook changes

Fixes code.json for release

Adds 0.8.7 to main

initial driver tests, these still need working on.

adding test kernels

staging tests

typo in function

debugging

added additonal kernels and more debugging

changed label name
  • Loading branch information
antonhibl committed Aug 24, 2023
1 parent 1775745 commit 2fc820b
Show file tree
Hide file tree
Showing 14 changed files with 6,229 additions and 20 deletions.
24 changes: 15 additions & 9 deletions DISCLAIMER.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,15 @@
This software has been approved for release by the U.S. Geological Survey
(USGS). Although the software has been subjected to rigorous review, the USGS
reserves the right to update the software as needed pursuant to further analysis
and review. No warranty, expressed or implied, is made by the USGS or the U.S.
Government as to the functionality of the software and related material nor
shall the fact of release constitute any such warranty. Furthermore, the
software is released on condition that neither the USGS nor the U.S. Government
shall be held liable for any damages resulting from its authorized or
unauthorized use.
This software is preliminary or provisional and is subject to revision. It is
being provided to meet the need for timely best science. The software has not
received final approval by the U.S. Geological Survey (USGS). No warranty,
expressed or implied, is made by the USGS or the U.S. Government as to the
functionality of the software and related material nor shall the fact of release
constitute any such warranty. The software is provided on the condition that
neither the USGS nor the U.S. Government shall be held liable for any damages
resulting from the authorized or unauthorized use of the software.This software is preliminary or provisional and is subject to revision. It is
being provided to meet the need for timely best science. The software has not
received final approval by the U.S. Geological Survey (USGS). No warranty,
expressed or implied, is made by the USGS or the U.S. Government as to the
functionality of the software and related material nor shall the fact of release
constitute any such warranty. The software is provided on the condition that
neither the USGS nor the U.S. Government shall be held liable for any damages
resulting from the authorized or unauthorized use of the software.
111 changes: 111 additions & 0 deletions ale/drivers/uvvis_drivers.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,111 @@
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


class UvvisIsisLabelNaifSpiceDriver(Framer, IsisLabel, NaifSpice, NoDistortion, Driver):
"""
Driver for reading Ultra-violet Invisible Spectrum ISIS3 Labels
"""

@property
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. Therefor they are the same ID that Spice expects in bods2c
calls. Expect instrument_id to be defined in the IsisLabel mixin.
This should be a string of the form NEAR EARTH ASTEROID RENDEZVOUS
Returns
-------
: str
instrument id
"""
lookup_table = {
"UVVIS": "ULTRAVIOLET/VISIBLE CAMERA"
}
return lookup_table[super().instrument_id]

@property
def sensor_name(self):
"""
Returns the name of the instrument
Returns
-------
: str
instrument name
"""
filter = self.label["IsisCube"]['BandBin']['FilterName']
return "CLEM_" + super().instrument_id + "_" + filter

@property
def spacecraft_name(self):
"""
Returns the name of the spacecraft
Returns
-------
: str
spacecraft name
"""
return super().spacecraft_name.replace(" ", "_")

@property
def sensor_model_version(self):
"""
Returns ISIS sensor model version
Returns
-------
: int
ISIS sensor model version
"""
return 1

@property
def ephemeris_start_time(self):
return spice.utc2et(self.utc_start_time.strftime("%Y-%m-%d %H:%M:%S.%f"))

@property
def ephemeris_stop_time(self):
"""
Returns the sum of the starting ephemeris time and the exposure duration.
Expects ephemeris start time and exposure duration to be defined. These
should be double precision numbers containing the ephemeris start and
exposure duration of the image.
Returns
-------
: double
Ephemeris stop time for an image
"""
return self.ephemeris_start_time + self.exposure_duration

@property
def ikid(self):
"""
Overridden to grab the ikid from the Isis Cube since there is no way to
obtain this value with a spice bods2c call. Isis sets this value during
ingestion, based on the original fits file.
Returns
-------
: int
Naif ID used to for identifying the instrument in Spice kernels
"""
return self.label["IsisCube"]["Kernels"]["NaifFrameCode"]
66 changes: 56 additions & 10 deletions code.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,26 +3,72 @@
"name": "ale",
"organization": "U.S. Geological Survey",
"description": "GitLab repository for the Abstraction Layer for Ephemerides package",
"version": "0.8.8",
"version": "main",
"status": "Development",

"permissions": {
"usageType": "openSource",
"licenses": [
{
"name": "Public Domain, CC0-1.0",
"URL": "https://code.usgs.gov/astrogeology/ale/-/raw/main/LICENSE.md"
}
]
},

"homepageURL": "https://code.usgs.gov/astrogeology/ale/",
"downloadURL": "https://code.usgs.gov/astrogeology/ale/-/archive/main/ale-main.zip",
"disclaimerURL": "https://code.usgs.gov/astrogeology/ale/-/raw/main/DISCLAIMER.md",
"repositoryURL": "https://code.usgs.gov/astrogeology/ale.git",
"vcs": "git",

"laborHours": 480,

"tags": [
"Planetary",
"Remote Sensing",
"Data Processing",
"Ephemerides",
"Community Sensor Model"
],

"languages": [
"C++",
"Python"
],

"contact": {
"name": "Jason Laura",
"email": "jlaura@usgs.gov"
},

"date": {
"metadataLastUpdated": "2023-02-23"
}
},{
"name": "ale",
"organization": "U.S. Geological Survey",
"description": "GitLab repository for the Abstraction Layer for Ephemerides package",
"version": "0.8.7",
"status": "Production",

"permissions": {
"usageType": "openSource",
"licenses": [
{
"name": "Public Domain, CC0-1.0",
"URL": "https://code.usgs.gov/astrogeology/ale/-/blob/master/LICENSE.md"
"URL": "https://code.usgs.gov/astrogeology/ale/-/raw/0.8.7/LICENSE.md"
}
]
},

"homepageURL": "https://code.usgs.gov/astrogeology/ale/-/releases/0.8.8",
"downloadURL": "https://code.usgs.gov/astrogeology/ale/-/archive/0.8.8/ale-0.8.8.zip",
"disclaimerURL": "https://code.usgs.gov/astrogeology/ale/-/blob/master/DISCLAIMER.md",
"repositoryURL": "https://code.usgs.gov/astrogeology/ale",
"homepageURL": "https://code.usgs.gov/astrogeology/ale/-/tree/0.8.7",
"downloadURL": "https://code.usgs.gov/astrogeology/ale/-/archive/0.8.7/ale-0.8.7.zip",
"disclaimerURL": "https://code.usgs.gov/astrogeology/ale/-/raw/0.8.7/DISCLAIMER.md",
"repositoryURL": "https://code.usgs.gov/astrogeology/ale.git",
"vcs": "git",

"laborHours": 40,
"laborHours": 480,

"tags": [
"Planetary",
Expand All @@ -38,12 +84,12 @@
],

"contact": {
"name": "Jesse Mapel",
"email": "jmapel@usgs.gov"
"name": "Jason Laura",
"email": "jlaura@usgs.gov"
},

"date": {
"metadataLastUpdated": "2022-06-03"
"metadataLastUpdated": "2023-02-23"
}
}
]
2 changes: 1 addition & 1 deletion notebooks/write_MsiIsisLabelNaifSpiceDriver.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -1411,7 +1411,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.10.6"
"version": "3.9.16"
}
},
"nbformat": 4,
Expand Down
Loading

0 comments on commit 2fc820b

Please sign in to comment.