Skip to content

Commit

Permalink
adding stereo quality report (#21)
Browse files Browse the repository at this point in the history
* adding stereo quality report from https://github.com/rbeyer/scriptorium, keeping licenses, eventually need to refactor things a bit to a lot for cleaner more granular access/ability to do some checks with moody metadata
* added stereo report to workflow test
  • Loading branch information
AndrewAnnex committed Dec 24, 2020
1 parent dc91021 commit 16eb3e4
Show file tree
Hide file tree
Showing 5 changed files with 546 additions and 0 deletions.
6 changes: 6 additions & 0 deletions .github/workflows/ci-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,12 @@ jobs:
timeout-minutes: 1
shell: bash -l {0}
run: asap ctx step-two
- name: asap stereo quality report
shell: bash -l {0}
run: |
ls
asap common get_stereo_quality_report ./B03_010644_1889_XN_08N001W.lev1eo.cub ./P02_001902_1889_XI_08N001W.lev1eo.cub
ls
- name: asap 4 & rescale images for test
shell: bash -l {0}
run: |
Expand Down
51 changes: 51 additions & 0 deletions asap_stereo/asap.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,34 @@
# BSD 3-Clause License
#
# Copyright (c) 2020, Andrew Michael Annex
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# 1. Redistributions of source code must retain the above copyright notice, this
# list of conditions and the following disclaimer.
#
# 2. Redistributions in binary form must reproduce the above copyright notice,
# this list of conditions and the following disclaimer in the documentation
# and/or other materials provided with the distribution.
#
# 3. Neither the name of the copyright holder nor the names of its
# contributors may be used to endorse or promote products derived from
# this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.


import fire
import sh
from sh import Command
Expand Down Expand Up @@ -242,6 +273,26 @@ def __init__(self):
finally:
self.ba = self.ba.bake('--threads', cores, _out=sys.stdout, _err=sys.stderr)

@staticmethod
def get_stereo_quality_report(cub1, cub2) -> str:
"""
Get the stereo quality report for two cub files
The cub files must be Level1 images (Spiceinit'ed but not map-projected).
The quality values reported by this program are based on the
recommendations and limitations in Becker et al. (2015). They have
a value of one for an ideal value, between zero and one for a value
within the acceptable limits, and less than zero (the more negative,
the worse) if the value is beyond the acceptable limit.
# TODO refactor into more granular bits
:param cub1: path
:param cub2: path
:return:
"""
from .stereo_quality import get_report
report = get_report(cub1, cub2)
return report

@staticmethod
def get_cam_info(img) -> Dict:
"""
Expand Down

0 comments on commit 16eb3e4

Please sign in to comment.