Skip to content
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
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ ctest FunctionalTestJigsawApollo to validate this output. [#5710](https://github
- Added std:: namespace for isinf, fixes build errors for some versions of c++
- Adds PROJ into ISIS, and exposes the capability with a new class called IProj. [#5317](https://github.com/DOI-USGS/ISIS3/pull/5317)
- Added `MATCHBANDBIN` option to himos and hicolormos. [#5859](https://github.com/DOI-USGS/ISIS3/issues/5859) and [#5860](https://github.com/DOI-USGS/ISIS3/issues/5860)
- Added serial number translation for ideal camera [#5662](https://github.com/DOI-USGS/ISIS3/issues/5662)

### Changed
- Removed Arm dependency on xalan-c, as it does not build for now on conda-forge. This requires turning off doc building on Arm. Also changed some variables to avoid name clashes on Arm with clang 16. [#5802](https://github.com/DOI-USGS/ISIS3/pull/5802)
Expand Down
46 changes: 46 additions & 0 deletions isis/appdata/serialnumbers/IdealIdealSerialNumber.trn
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
Group = Keyword1
Auto = 1
InputKey = SpacecraftName
InputGroup = "IsisCube,Instrument"
InputPosition = (IsisCube, Instrument)
OutputName = Keyword1
OutputPosition = (Group, SerialNumberKeywords)
Translation = (*, *)
End_Group

Group = Keyword2
Auto = 1
InputKey = InstrumentId
InputGroup = "IsisCube,Instrument"
InputPosition = (IsisCube, Instrument)
OutputName = Keyword2
OutputPosition = (Group, SerialNumberKeywords)
Translation = (*, *)
End_Group

Group = Keyword3
Auto = 1
InputKey = EphemerisTime
InputGroup = "IsisCube,Instrument"
InputPosition = (IsisCube, Instrument)
OutputName = Keyword3
OutputPosition = (Group, SerialNumberKeywords)
Translation = (*, *)
End_Group

/* This keyword is an optional keyword that is to be used to */
/* create unique serial numbers for images derived from the */
/* original. When processing multiple CCDs from the same */
/* observation, CcdId ensures each CCD has a unique serial */
/* number. It has no effect if the keyword does not exist. */
Group = Keyword4
Auto = 1
Optional = 1
InputKey = CcdId
InputGroup = "IsisCube,Instrument"
InputPosition = (IsisCube, Instrument)
OutputName = Keyword4
OutputPosition = (Group, SerialNumberKeywords)
Translation = (*, *)
End_Group
End
6 changes: 6 additions & 0 deletions isis/src/base/apps/noproj/noproj.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -311,6 +311,12 @@ namespace Isis {
key.setValue(startTime);
inst.addKeyword(key);

// Preserve CcdId from original instrument if present
// These are needed for unique serial numbers when processing multiple CCDs
if (fromInst.hasKeyword("CcdId")) {
inst.addKeyword(fromInst["CcdId"]);
}

if(stopTime != "") {
key.setName("StopTime");
key.setValue(stopTime);
Expand Down
31 changes: 31 additions & 0 deletions isis/tests/FunctionalTestsNoproj.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,11 @@
#include "CameraFixtures.h"
#include "Histogram.h"
#include "LineManager.h"
#include "Pvl.h"
#include "PvlGroup.h"
#include "TestUtilities.h"
#include "skypt.h"
#include "getsn.h"

#include "gmock/gmock.h"

Expand Down Expand Up @@ -852,3 +854,32 @@ TEST_F(DefaultCube, FunctionalTestNoprojOffBodyTrueOffBodyTrimTrue) {

}

TEST_F(DefaultCube, FunctionalTestNoprojSn) {
QString cubeFileName = tempDir.path() + "/output.cub";
QVector<QString> args = {"to=" + cubeFileName};
UserInterface options(APP_XML, args);

noproj(testCube, NULL, options);

Cube oCube(cubeFileName);
Pvl *isisLabel = oCube.label();
PvlGroup instGroup = isisLabel->findGroup("Instrument", Pvl::Traverse);
EXPECT_PRED_FORMAT2(AssertQStringsEqual, instGroup.findKeyword("SpacecraftName"), "IdealSpacecraft");
EXPECT_PRED_FORMAT2(AssertQStringsEqual, instGroup.findKeyword("InstrumentId"), "IdealCamera");
EXPECT_DOUBLE_EQ((double)instGroup.findKeyword("EphemerisTime"), -709401200.26114);

// Get SN
QString APP_XML_SN = FileName("$ISISROOT/bin/xml/getsn.xml").expanded();
QVector<QString> sn_args = {"from=" + cubeFileName,
"file=true",
"observation=true"};
UserInterface sn_options(APP_XML_SN, sn_args);
Pvl appLog;
getsn(sn_options, &appLog);

PvlGroup results = appLog.findGroup("Results");
EXPECT_PRED_FORMAT2(AssertQStringsEqual, results.findKeyword("Filename"), cubeFileName);
EXPECT_PRED_FORMAT2(AssertQStringsEqual, results.findKeyword("SerialNumber"), "IdealSpacecraft/IdealCamera/-709401200.26114");
EXPECT_PRED_FORMAT2(AssertQStringsEqual, results.findKeyword("ObservationNumber"), "IdealSpacecraft/IdealCamera/-709401200.26114");

}