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

Mosrange Error Handling Improved to Not Abort on Bad Images #5292

Merged
merged 8 commits into from
Sep 29, 2023

Conversation

kledmundson
Copy link
Contributor

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.

  1. Default
  2. OnErrorContinue
  3. OnErrorFail

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

  • Bug fix (non-breaking change which fixes an issue)
  • [x ] New feature (non-breaking change which adds functionality)
  • Documentation change (update to the documentation; no code change)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Infrastructure change (changes to things like CI or the build system that do not impact users)

Checklist:

  • [x ] I have read and agree to abide by the Code of Conduct
  • [ x] I have read the CONTRIBUTING document.
  • [x ] My change requires a change to the documentation and I have updated the documentation accordingly.
  • [x ] I have added tests to cover my changes.
  • [x ] I have added myself to the .zenodo.json document.
  • [x ] I have added any user impacting changes to the CHANGELOG.md document.

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:

This work is free and unencumbered software released into the public domain. In jurisdictions that recognize copyright laws, the author or authors of this software dedicate any and all copyright interest in the software to the public domain.

  • [x ] I dedicate any and all copyright interest in this software to the public domain. I make this dedication for the benefit of the public at large and to the detriment of my heirs and successors. I intend this dedication to be an overt act of relinquishment in perpetuity of all present and future rights to this software under copyright law.

*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.
Copy link
Collaborator

@Kelvinrr Kelvinrr left a 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.

@Kelvinrr Kelvinrr merged commit 1a9b9cd into DOI-USGS:dev Sep 29, 2023
@github-actions github-actions bot added enhancement New feature or request Missions Issues which are a priority for missions labels Sep 29, 2023
@kledmundson kledmundson deleted the feature/mosrange-newParameters1 branch October 8, 2023 17:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request Missions Issues which are a priority for missions
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants