-
Notifications
You must be signed in to change notification settings - Fork 173
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
Mosrange Error Handling Improved to Not Abort on Bad Images #5292
Merged
Kelvinrr
merged 8 commits into
DOI-USGS:dev
from
kledmundson:feature/mosrange-newParameters1
Sep 29, 2023
Merged
Mosrange Error Handling Improved to Not Abort on Bad Images #5292
Kelvinrr
merged 8 commits into
DOI-USGS:dev
from
kledmundson:feature/mosrange-newParameters1
Sep 29, 2023
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
*ONERROR, ERRORLOG, and ERRORLIST parameters added for error handling. *ONERROR dictates whether mosrange will abort or continue when an error occurs. *If ONERROR=FAIL (default behavior), mosrange aborts upon error without generating a map file. *If ONERROR=CONTINUE, mosrange produces an output map file with data collected from all successfully processed images. *A detailed list of files that fail and their associated errors are written to ERRORLOG if provided. *A simple list of failed files is written to ERRORLIST if provided.
*Add test for ONERROR=CONTINUE. *Add test for ONERROR=FAIL.
…re/mosrange-newParameters
…p; added gtests; removed old makefile tests
Kelvinrr
reviewed
Sep 28, 2023
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall looks good, new test looks good, changes to the app all make sense, doesn't seem like new parameters are API breaking.
only one suggestion in line.
… Pvl mosrange(FileList &cubeFileList, UserInterface &ui) on PR review suggestion.
Kelvinrr
approved these changes
Sep 29, 2023
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
Occasionally, mosrange would fail on one or more images which aborts the application. We improved mosrange to trap failing calculations for each image, log the image and remove it from the list. mosrange continues to completion, processing as many image cubes as possible.
We found that this issue could occur rather frequently and randomly due to issues with SPICE data and shape models. Producing lists of failing images allows one to investigate the underlying issues.
Three new parameters were added: ERRORLOG, ERRRORLIST and ONERROR.
ERRORLOG allows the user to provide the name of a file where the error is reported.
ERRORLIST allows the user to provide the name of a file where the name of failed images are written.
ONERROR can be used by the user to choose how these file errors are handled when they occur. ONERROR=FAIL preserves pre-existing behavior and will result in a program error.
Example
[113]: mosrange -h
FROMLIST = Null
MAP = Null
TO = Null
LOG = Null
ERRORLOG = Null
ERRORLIST = Null
PROJECTION = None
LATTYPE = (*PLANETOCENTRIC, PLANETOGRAPHIC)
LONDIR = (*POSITIVEEAST, POSITIVEWEST)
LONDOM = (*360, 180)
PRECISION = 12
ONERROR = (CONTINUE, *FAIL)
Further, mosrange has been converted to a callable application; documentation has been updated; old-style ISIS Makefile tests have been removed and replaced with google tests; and necessary test data has been moved to the /isis/tests/data/mosrange/ folder.
Related Issue
Addresses #3606.
How Has This Been Validated?
ISIS make file tests have been replaced with the following gtests.
Results of ctest suite...
ctest -R Mosrange --output-on-failure
Test project /Users/kledmundson/ISISDev/mosrange/Jul132023/ISIS3/build
Start 2038: Mosrange.MosrangeDefault
1/3 Test #2038: Mosrange.MosrangeDefault ........... Passed 0.76 sec
Start 2039: Mosrange.MosrangeOnErrorContinue
2/3 Test #2039: Mosrange.MosrangeOnErrorContinue ... Passed 0.70 sec
Start 2040: Mosrange.MosrangeOnErrorFail
3/3 Test #2040: Mosrange.MosrangeOnErrorFail ....... Passed 0.70 sec
100% tests passed, 0 tests failed out of 3
Total Test time (real) = 2.35 sec
Types of changes
Checklist:
Licensing
This project is mostly composed of free and unencumbered software released into the public domain, and we are unlikely to accept contributions that are not also released into the public domain. Somewhere near the top of each file should have these words: