Skip to content

Commit

Permalink
Merge branch 'dev' into enhancement/bandtrimCallable
Browse files Browse the repository at this point in the history
  • Loading branch information
kledmundson authored Jul 31, 2024
2 parents f466c64 + 778e471 commit 3c0a5ce
Show file tree
Hide file tree
Showing 6 changed files with 54 additions and 30 deletions.
11 changes: 11 additions & 0 deletions .github/workflows/gitlab-codebuild.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,15 @@ jobs:
git commit -a -m "$PR_NUMBER"
git push origin PR_$PR_NUMBER --force
comment-bot:
permissions: write-all
runs-on: [ubuntu-latest]
steps:
- name: Check out code
uses: actions/checkout@v4
- name: Comment PR
uses: thollander/actions-comment-pull-request@v2
with:
message: |
The build and test suite have started for your pull request. View [build logs](https://us-west-2.codebuild.aws.amazon.com/project/eyJlbmNyeXB0ZWREYXRhIjoiNDJNZ2MxbHFKTkwxV1RyQUxJekdJY3FIanNqU29rMHB4Nk1YUzk4REIrZUZDeEtEaW9HQlZ1dTZOSHpML2VUTGVDekYydmVFcU9sUHJKN20wQzd1Q0UzSzJscnB0MElDb1M3Ti9GTlJYR1RuMWJTV3V1SkJTa3NoYmc9PSIsIml2UGFyYW1ldGVyU3BlYyI6IjF3U2NTSGlDcEtCc29YVnEiLCJtYXRlcmlhbFNldFNlcmlhbCI6MX0%3D) for results.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ release.

### Changed
- Bandtrim has been refactored to be callable; old Makefile tests have been removed and replaced by gtests. Issue: [#5571](https://github.com/USGS-Astrogeology/ISIS3/issues/5571)
- Modified kaguyasp2isis to work with new (detached) data [#5436](https://github.com/DOI-USGS/ISIS3/issues/5436)
- Added jigsaw error message for csminit'd images without csm parameters[#5486](https://github.com/DOI-USGS/ISIS3/issues/5486)
- Changed `qwt` dependency version to 6.2.0 or below [#5498](https://github.com/DOI-USGS/ISIS3/issues/5498)
- Pinned `suitesparse` dependency version to maximum not including 7.7.0 [#5496](https://github.com/DOI-USGS/ISIS3/issues/5496)
Expand All @@ -53,6 +54,7 @@ release.
- Fixed CSMSerialNumber.trn typo [#5485](https://github.com/DOI-USGS/ISIS3/issues/5485)
- Fixed CSMSerialNumber.trn to be PVL compliant [#5484](https://github.com/DOI-USGS/ISIS3/issues/5484)
- Fixed hrsc2isis to support level 3 hrsc images [#5497](https://github.com/DOI-USGS/ISIS3/issues/5497)
- Fixed gllssi2isis to support V1.1 data [#5396](https://github.com/DOI-USGS/ISIS3/issues/5396)

### Added
- Added versioned default values to lrowacphomap's PHOALGO and PHOPARCUBE parameters and updated lrowacphomap to handle them properly. [#5452](https://github.com/DOI-USGS/ISIS3/pull/5452)
Expand Down
9 changes: 6 additions & 3 deletions isis/src/base/objs/NaifDskShape/unitTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -158,23 +158,26 @@ int main(int argc, char *argv[]) {
qDebug() << "Try to calculate norms using valid shape model...";
shapeModelFromPvlElevation.setLocalNormalFromIntercept();
qDebug() << "Has intercept normal? " << shapeModelFromPvlElevation.hasLocalNormal();
std::vector<double> normal = shapeModelFromPvlElevation.localNormal();
qDebug() << "Normal set from Intercept: "
<< QVector<double>(shapeModelFromPvlElevation.localNormal().begin(), shapeModelFromPvlElevation.localNormal().end());
<< QVector<double>(normal.begin(), normal.end());
// no need to call calculateSurfaceNormal() or ellipsoidNormal()
// directly. these methods are called by calculateDefaultNormal()
shapeModelFromPvlElevation.calculateDefaultNormal();
qDebug() << "Has default normal? " << shapeModelFromPvlElevation.hasNormal();
normal = shapeModelFromPvlElevation.normal();
qDebug() << "Default normal: "
<< QVector<double>(shapeModelFromPvlElevation.normal().begin(), shapeModelFromPvlElevation.normal().end());
<< QVector<double>(normal.begin(), normal.end());

QVector <double *> cornerNeighborPoints;
double point[3];
point[0] = 1.0; point[1] = 0.0; point[2] = 0.0;
cornerNeighborPoints.push_back(point);
shapeModelFromPvlElevation.calculateLocalNormal(cornerNeighborPoints);
qDebug() << "Has local normal? " << shapeModelFromPvlElevation.hasLocalNormal();
normal = shapeModelFromPvlElevation.localNormal();
qDebug() << "Local normal from neighbor points: "
<< QVector<double>(shapeModelFromPvlElevation.localNormal().begin(), shapeModelFromPvlElevation.localNormal().end());
<< QVector<double>(normal.begin(), normal.end());
qDebug() << "";

qDebug() << "================================= Error Throws ==================================";
Expand Down
21 changes: 8 additions & 13 deletions isis/src/galileo/apps/gllssi2isis/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -56,20 +56,15 @@ void IsisMain() {
throw IException(IException::Io, msg, _FILEINFO_);
}

// data set id value must contain "SSI-2-REDR-V1.0"(valid SSI image)
// or "SSI-4-REDR-V1.0"(reconstructed from garbled SSI image)
// data set id value must contain "SSI-2-REDR-V1.0" or "SSI-2-REDR-V1.1" (valid SSI image)
// or "SSI-4-REDR-V1.0" or "SSI-4-REDR-V1.1"(reconstructed from garbled SSI image)
QString dataSetId;
dataSetId = (QString)lab["DATA_SET_ID"];
try {
if(!dataSetId.contains("SSI-2-REDR-V1.0")
&& !dataSetId.contains("SSI-4-REDR-V1.0") ) {
QString msg = "Invalid DATA_SET_ID [" + dataSetId + "]";
throw IException(IException::Unknown, msg, _FILEINFO_);
}
}
catch(IException &e) {
QString msg = "Unable to read [DATA_SET_ID] from input file [" +
inFile.expanded() + "]";

if(!dataSetId.contains("SSI-2-REDR-V1.0") && !dataSetId.contains("SSI-2-REDR-V1.1")
&& !dataSetId.contains("SSI-4-REDR-V1.0") && !dataSetId.contains("SSI-4-REDR-V1.1") ) {
QString msg = "Invalid DATA_SET_ID [" + dataSetId + "]" +
" from input file [" + inFile.expanded() + "]";
throw IException(IException::Unknown, msg, _FILEINFO_);
}

Expand All @@ -79,7 +74,7 @@ void IsisMain() {
// reconstructed images are 800x800 (i.e. not summed)
// even though they have frame duration of 2.333
// (which ordinarily indicates a summed image)
if(dataSetId.contains("SSI-4-REDR-V1.0")) {
if(dataSetId.contains("SSI-4-REDR-V1.0") || dataSetId.contains("SSI-4-REDR-V1.1")) {
summed = false;
}
else if (frameDuration > 2.0 && frameDuration < 3.0) {
Expand Down
4 changes: 2 additions & 2 deletions isis/src/kaguya/apps/kaguyasp2ascii/kaguyasp2ascii.xml
Original file line number Diff line number Diff line change
Expand Up @@ -80,10 +80,10 @@
Input Kaguya SP file
</brief>
<description>
This is the input Kaguya SP file
This is the input Kaguya SP file. For an attached label, use the .spc file, or for a detached label, use the .lbl file.
</description>
<filter>
*.spc
*.lbl *.spc
</filter>
</parameter>
<parameter name="TO">
Expand Down
37 changes: 25 additions & 12 deletions isis/src/kaguya/apps/kaguyasp2ascii/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,20 @@ void IsisMain() {
ProcessImportPds p;
UserInterface &ui = Application::GetUserInterface();

FileName inFile = ui.GetFileName("FROM");
Pvl lab(inFile.expanded());
QString inFile = ui.GetFileName("FROM");
Pvl lab(inFile);
QString dataFile = lab.findKeyword("FILE_NAME")[0];

// Detached labels use format keyword = "dataFile" value <unit>
int keywordIndex = 1;

if (FileName(inFile).baseName() == FileName(dataFile).baseName()){
// data files usually do not include path information. If input basename matches datafile basename, include path information
// this allows users to specify data that is not in the current directory.
dataFile = inFile;
// Attached labels use format keyword = value <units>
keywordIndex = 0;
}

ofstream os;
QString outFile = FileName(ui.GetFileName("TO")).expanded();
Expand Down Expand Up @@ -59,32 +71,32 @@ void IsisMain() {
int qaptr = 0;

if (lab.hasKeyword("^SP_SPECTRUM_WAV")) {
wavptr = toInt(lab.findKeyword("^SP_SPECTRUM_WAV")[0]) - 1;
wavptr = toInt(lab.findKeyword("^SP_SPECTRUM_WAV")[keywordIndex]) - 1;
}
if (lab.hasKeyword("^SP_SPECTRUM_RAW")) {
rawptr = toInt(lab.findKeyword("^SP_SPECTRUM_RAW")[0]) - 1;
rawptr = toInt(lab.findKeyword("^SP_SPECTRUM_RAW")[keywordIndex]) - 1;
}
if (lab.hasKeyword("^SP_SPECTRUM_RAD")) {
radptr = toInt(lab.findKeyword("^SP_SPECTRUM_RAD")[0]) - 1;
radptr = toInt(lab.findKeyword("^SP_SPECTRUM_RAD")[keywordIndex]) - 1;
}
//older-format file without calibrated NIR2 data
if (lab.hasKeyword("^SP_SPECTRUM_REF")) {
refptr1 = toInt(lab.findKeyword("^SP_SPECTRUM_REF")[0]) - 1;
refptr1 = toInt(lab.findKeyword("^SP_SPECTRUM_REF")[keywordIndex]) - 1;
}
//newer-format file with calibrated NIR2 data and 2 different Reflectances
if (lab.hasKeyword("^SP_SPECTRUM_REF1")) {
refptr1 = toInt(lab.findKeyword("^SP_SPECTRUM_REF1")[0]) - 1;
refptr1 = toInt(lab.findKeyword("^SP_SPECTRUM_REF1")[keywordIndex]) - 1;
}
if (lab.hasKeyword("^SP_SPECTRUM_REF2")) {
refptr2 = toInt(lab.findKeyword("^SP_SPECTRUM_REF2")[0]) - 1;
refptr2 = toInt(lab.findKeyword("^SP_SPECTRUM_REF2")[keywordIndex]) - 1;
}
if (lab.hasKeyword("^SP_SPECTRUM_QA")) {
qaptr = toInt(lab.findKeyword("^SP_SPECTRUM_QA")[0]) - 1;
qaptr = toInt(lab.findKeyword("^SP_SPECTRUM_QA")[keywordIndex]) - 1;
}

FILE *spcptr;
if ((spcptr = fopen(inFile.expanded().toLatin1().data(),"rb")) == 0) {
QString msg = "Error opening input Kaguya SP file [" + inFile.expanded() + "]";
if ((spcptr = fopen(dataFile.toLatin1().data(),"rb")) == 0) {
QString msg = "Error opening input Kaguya SP file [" + dataFile + "]";
throw IException(IException::User, msg, _FILEINFO_);
}

Expand All @@ -101,7 +113,7 @@ void IsisMain() {
if (!lab.hasObject("SP_SPECTRUM_WAV") || !lab.hasObject("SP_SPECTRUM_QA") ||
!lab.hasObject("SP_SPECTRUM_RAD") || !(lab.hasObject("SP_SPECTRUM_REF") ||
(lab.hasObject("SP_SPECTRUM_REF1") && lab.hasObject("SP_SPECTRUM_REF2")))) {
QString msg = "Input file [" + inFile.expanded() + "] is not a valid ";
QString msg = "Input file [" + inFile + "] is not a valid ";
msg += "Kaguya Spectral Profiler file";
throw IException(IException::User, msg, _FILEINFO_);
}
Expand Down Expand Up @@ -261,6 +273,7 @@ void IsisMain() {

PvlObject refobj;
PvlObject refobj2;

if (lab.hasKeyword("^SP_SPECTRUM_REF")) {
refobj = lab.findObject("SP_SPECTRUM_REF");
}
Expand Down

0 comments on commit 3c0a5ce

Please sign in to comment.