Skip to content

Commit

Permalink
Disable HRSC from spice server (#5270)
Browse files Browse the repository at this point in the history
* Disable HRSC from spice server

* added docs

* Added test

* added changelog
  • Loading branch information
amystamile-usgs authored Nov 28, 2023
1 parent 6c42917 commit 50d5d98
Show file tree
Hide file tree
Showing 4 changed files with 97 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ release.
- Modified tgocassisstitch to optionally allow either a outputprefix or an
outputsuffix, both, or neither for naming convention purposes. [#5162](https://github.com/DOI-USGS/ISIS3/pull/5162)
- Changed the default PCK load behavior to try and load mission specific PCKs, if that fails we default to the base PCKs [#5335](https://github.com/DOI-USGS/ISIS3/pull/5335)
- Disabled option to use web=true when running spiceinit with HRSC images. [#5223](https://github.com/DOI-USGS/ISIS3/issues/5223)

### Added
- Added rclone to run dependencies in meta.yaml [#5183](https://github.com/DOI-USGS/ISIS3/issues/5183)
Expand Down
5 changes: 5 additions & 0 deletions isis/src/base/apps/spiceinit/spiceinit.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -614,6 +614,11 @@ namespace Isis {
QString instrumentId =
labels.findGroup("Instrument", Pvl::Traverse)["InstrumentId"][0];

if (instrumentId == "HRSC"){
QString msg = "Spice Server does not support MEX HRSC images. Please rerun spiceinit with local MEX data.";
throw IException(IException::User, msg, _FILEINFO_);
}

QString url = ui.GetString("URL") + "?mission=" + missionName +
"&instrument=" + instrumentId;
int port = ui.GetInteger("PORT");
Expand Down
9 changes: 9 additions & 0 deletions isis/src/base/apps/spiceinit/spiceinit.xml
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,15 @@
"NADIR" options typically have less accuracy than reconstructed and smithed
kernels which is why they are disabled by default.
</p>
<p><b>Issues running HRSC using ISIS SPICE Web Service:</b>
Currently HRSC images cannot be spiceinit'd using ISIS SPICE web services.
This is due to the HRSC camera model relying on cube data to process
line scan times. When using the SPICE server, only the label is returned
causing the camera model to fail initialization. In order to run spiceinit on
HRSC images, download the MEX data locally. See download instructions at
https://github.com/DOI-USGS/ISIS3/blob/dev/README.md#mission-specific-data-downloads.
</p>

</description>

<category>
Expand Down
82 changes: 82 additions & 0 deletions isis/tests/FunctionalTestsSpiceinit.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ using json = nlohmann::json;
#include "gmock/gmock.h"

using namespace Isis;
using ::testing::HasSubstr;

static QString APP_XML = FileName("$ISISROOT/bin/xml/spiceinit.xml").expanded();

Expand Down Expand Up @@ -710,3 +711,84 @@ TEST_F(SmallCube, FunctionalTestSpiceinitCsminitRestorationOnFail) {
EXPECT_PRED_FORMAT2(AssertPvlGroupEqual, csmInfoGroup, outputCube.group("CsmInfo"));
}


TEST(Spiceinit, TestSpiceinitHrscWebError) {

std::istringstream labelStrm(R"(
Object = IsisCube
Object = Core
StartByte = 65537
Format = Tile
TileSamples = 323
TileLines = 409
Group = Dimensions
Samples = 2584
Lines = 19632
Bands = 1
End_Group
Group = Pixels
Type = Real
ByteOrder = Lsb
Base = 0.0
Multiplier = 1.0
End_Group
End_Object
Group = Instrument
SpacecraftName = "MARS EXPRESS"
InstrumentId = HRSC
StartTime = 2019-01-16T13:11:27.926
StopTime = 2019-01-16T13:13:37.796
SpacecraftClockStartCount = 1/0495724211.25691
SpacecraftClockStopCount = 1/0495724397.63935
MissionPhaseName = ME_Phase_40
TargetName = Mars
Summing = 2
FocalPlaneTemperature = 8.9911 <degC>
LensTemperature = 9.6028 <degC>
InstrumentTemperature = 11.8457 <degC>
End_Group
Group = Archive
DataSetId = MEX-M-HRSC-3-RDR-V3.0
DetectorId = MEX_HRSC_P1
EventType = MARS-REGIONAL-MAPPING-Im-Gl-Pf
OrbitNumber = 19029
ProductId = HJ029_0000_P12.IMG
End_Group
Group = BandBin
Width = 174.0 <nm>
Center = 675.0 <nm>
End_Group
Group = Kernels
NaifIkCode = -41217
End_Group
End_Object
End
)");

Pvl label;
labelStrm >> label;

QTemporaryFile tempFile;
tempFile.open();
Cube testCube;

testCube.fromLabel(tempFile.fileName() + ".cub", label, "rw");

QVector<QString> args = {"web=true"};
UserInterface options(APP_XML, args);


try {
spiceinit(&testCube, options);
FAIL() << "Should throw an exception" << std::endl;
}
catch (IException &e) {
EXPECT_THAT(e.what(), HasSubstr("Spice Server does not support MEX HRSC images. Please rerun spiceinit with local MEX data."));
}
}

0 comments on commit 50d5d98

Please sign in to comment.