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

Added error checking around spicelib furnsh call. Closes #4038 #4115

Merged
merged 2 commits into from
Nov 13, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,9 @@ update the Unreleased link so that it compares against the latest release tag.

## [Unreleased]


- Fixed so required files are reported instead of continuing without them. [#4038](https://github.com/USGS-Astrogeology/ISIS3/issues/4038)

## [4.3.0] - 2020-10-02

### Changed
Expand All @@ -48,7 +51,7 @@ update the Unreleased link so that it compares against the latest release tag.

- mro/hideal2pds app now writes the correct SAMPLE_BIT_MASK values to the output label. [#3978](https://github.com/USGS-Astrogeology/ISIS3/issues/3978)

- For Histograms in ISIS, updated the math for calculating what bin data should be placed in and the min/max values of each bin to be more intuitive. In addition, the output of hist and cnethist were changed to display the min/max values of each bin instead of the middle pixel's DN. [#3882](https://github.com/USGS-Astrogeology/ISIS3/issues/3882)
- For Histograms in ISIS, updated the math for calculating what bin data should be placed in and the min/max values of each bin to be more intuitive. In addition, the output of hist and cnethist were changed to display the min/max values of each bin instead of the middle pixel's DN. [#3882](https://github.com/USGS-Astrogeology/ISIS3/issues/3882)

### Added

Expand Down
8 changes: 8 additions & 0 deletions isis/src/lro/apps/lrowaccal/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
#include "CubeAttribute.h"
#include "iTime.h"
#include "Message.h"
#include "NaifStatus.h"
#include "Preference.h"
#include "ProcessByBrick.h"
#include "PvlGroup.h"
Expand Down Expand Up @@ -206,14 +207,21 @@ void IsisMain () {
// Astronomical Units (AU)
QString bspKernel1 = p.MissionData("lro", "/kernels/tspk/moon_pa_de421_1900-2050.bpc", false);
QString bspKernel2 = p.MissionData("lro", "/kernels/tspk/de421.bsp", false);
NaifStatus::CheckErrors();
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does there exist a naif call that could error that this would catch before the furnsh calls?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The furnsh calls are what are failing, due to the file not existing. The naifstatus calls wrap the internal spicelib error handling, so that we get an error thrown instead of the blind continue that was there before.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Guess, I failed to mention that. Yes, the error was not there after inserting the status calls, and if I remove the needed files, it issues an error with the name of the missing file.

furnsh_c(bspKernel1.toLatin1().data());
NaifStatus::CheckErrors();
furnsh_c(bspKernel2.toLatin1().data());
NaifStatus::CheckErrors();
QString pckKernel1 = p.MissionData("base", "/kernels/pck/pck?????.tpc", true);
QString pckKernel2 = p.MissionData("lro", "/kernels/pck/moon_080317.tf", false);
QString pckKernel3 = p.MissionData("lro", "/kernels/pck/moon_assoc_me.tf", false);
NaifStatus::CheckErrors();
furnsh_c(pckKernel1.toLatin1().data());
NaifStatus::CheckErrors();
furnsh_c(pckKernel2.toLatin1().data());
NaifStatus::CheckErrors();
furnsh_c(pckKernel3.toLatin1().data());
NaifStatus::CheckErrors();
double sunpos[6], lt;
spkezr_c("sun", etStart, "MOON_ME", "LT+S", "MOON", sunpos, &lt);
g_solarDistance = vnorm_c(sunpos) / KM_PER_AU;
Expand Down