Skip to content

Commit

Permalink
Merge branch 'DOI-USGS:main' into uvvis-driver
Browse files Browse the repository at this point in the history
  • Loading branch information
antonhibl authored Jul 28, 2023
2 parents 687f120 + 5965330 commit 3c4cf43
Show file tree
Hide file tree
Showing 19 changed files with 5,794 additions and 5 deletions.
40 changes: 37 additions & 3 deletions .github/workflows/ci_testing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ on:
- main

jobs:
Build-and-Test:
Build-and-Test-LinuxOsx:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
Expand All @@ -20,10 +20,10 @@ jobs:
run:
shell: bash -l {0}
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9
with:
submodules: true
- uses: conda-incubator/setup-miniconda@v2
- uses: conda-incubator/setup-miniconda@3b0f2504dd76ef23b6d31f291f4913fb60ab5ff3
with:
miniconda-version: "latest"
activate-environment: ale
Expand Down Expand Up @@ -57,3 +57,37 @@ jobs:
fail_ci_if_error: true
verbose: true
if: matrix.os == 'ubuntu-latest' && matrix.python-version == '3.9'

Build-and-Test-Win:
runs-on: windows-2019
strategy:
matrix:
python-version: ["3.8", "3.9", "3.10", "3.11"]
steps:
- uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9
with:
submodules: recursive
- uses: conda-incubator/setup-miniconda@3b0f2504dd76ef23b6d31f291f4913fb60ab5ff3
with:
miniconda-version: "latest"
activate-environment: ale
environment-file: environment.yml
auto-activate-base: false
auto-update-conda: true
python-version: ${{ matrix.python-version }}
- name: Check build environment
run: |
conda list
- name: Build Package
run: |
mkdir -p build
cd build
cmake -DCMAKE_BUILD_TYPE=RELEASE -DCMAKE_WINDOWS_EXPORT_ALL_SYMBOLS=ON -G "Visual Studio 16 2019" -A x64 -DALE_BUILD_TESTS=OFF ..
cmake --build . --target ALL_BUILD --config Release
ls D:\a\ale\ale\build\Release
- uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce
with:
name: ale
path: |
D:\a\ale\ale\build\Release\ale.dll
D:\a\ale\ale\build\Release\ale.lib
5 changes: 4 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,9 @@ release.

## [Unreleased]

### Added
- Mariner10 IsisLabelNaifSpice driver, tests, and test data [#547](https://github.com/DOI-USGS/ale/pull/547)

## [0.9.1] - 2023-06-05

### Changed
Expand Down Expand Up @@ -62,4 +65,4 @@ release.
- MGS MOC WAC IsisLabelNaifSpice driver, tests, and test data [#516](https://github.com/DOI-USGS/ale/pull/516)
- Chandrayaan1_mrffr IsisLabelNaifSpice driver, tests and test data [#519](https://github.com/DOI-USGS/ale/pull/519)
- MGS MOC Narrow Angle IsisLabelNaifSpice driver, tests, and test data [#517](https://github.com/DOI-USGS/ale/pull/517)
- Hayabusa NIRS IsisLabelNaifSpice driver, tests and test data [#532](https://github.com/DOI-USGS/ale/pull/532)
- Hayabusa NIRS IsisLabelNaifSpice driver, tests and test data [#532](https://github.com/DOI-USGS/ale/pull/532)
100 changes: 100 additions & 0 deletions ale/drivers/mariner_drivers.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
import spiceypy as spice
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 Mariner10IsisLabelNaifSpiceDriver(Framer, IsisLabel, NaifSpice, NoDistortion, Driver):

@property
def instrument_id(self):
"""
Returns the ID of the instrument
Returns
-------
: str
Name of the instrument
"""
inst_id_lookup = {
"M10_VIDICON_A": "M10_SPACECRAFT",
"M10_VIDICON_B": "M10_SPACECRAFT"
}
return inst_id_lookup[super().instrument_id]

@property
def sensor_model_version(self):
"""
The ISIS Sensor model number for HiRise in ISIS. This is likely just 1.
Returns
-------
: int
ISIS sensor model version
"""
return 1

@property
def sensor_name(self):
"""
Returns the name of the instrument
Returns
-------
: str
Name of the sensor
"""
return super().instrument_id

@property
def sensor_frame_id(self):
"""
Hard coded sensor_frame_id based on the Isis Mariner10 camera model.
Returns
-------
: int
The sensor frame id
"""
return -76000

@property
def ikid(self):
"""
Returns the ikid/frame code from the ISIS label.
Returns
-------
: int
Naif ID used to for identifying the instrument in Spice kernels
"""
return self.label['IsisCube']['Kernels']['NaifFrameCode']

@property
def ephemeris_start_time(self):
"""
Returns the start ephemeris time for the image.
Returns
-------
: float
start time
"""
return spice.str2et(self.utc_start_time.strftime("%Y-%m-%d %H:%M:%S.%f")) - (self.exposure_duration / 2.0)

@property
def light_time_correction(self):
"""
Returns the type of light time correction and abberation correction to
use in NAIF calls.
Returns
-------
: str
The light time and abberation correction string for use in NAIF calls.
See https://naif.jpl.nasa.gov/pub/naif/toolkit_docs/C/req/abcorr.html
for the different options available.
"""
return 'NONE'

2 changes: 1 addition & 1 deletion environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ dependencies:
- pytz
- python
- python-dateutil
- scipy>=1.4.0
- scipy>=1.4.0,<1.11
- spiceypy>=5.1.0
- pyyaml
- pytest
Expand Down
Loading

0 comments on commit 3c4cf43

Please sign in to comment.