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

8.0.4 LTS Release Prep (old) #5684

Closed
wants to merge 39 commits into from
Closed
Changes from 1 commit
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
06aa3d7
Bug fix in noproj to remove persistent temporary lbl file (#5578)
chkim-usgs Nov 25, 2024
b2b87a0
Remove restrictive validity check in caminfo (#5553)
AustinSanders Jul 22, 2024
e8c38f4
Qview command line Fix (#5505)
acpaquette Jun 4, 2024
b461cd8
Fixes qmos segfaults (#5556)
amystamile-usgs Jul 25, 2024
38b472c
CsmSerialNumber.trn - typo and PVL compilant fix (#5561)
amystamile-usgs Jul 30, 2024
449fc61
hrsc2isis support for level 3 images (#5560)
amystamile-usgs Jul 30, 2024
a2ba9d6
Fixed gllssi2isis to support V1.1 data (#5570)
amystamile-usgs Jul 31, 2024
23440f5
Removed a debug output statement inadvertently left in noseam.cpp. Ad…
kledmundson Nov 7, 2024
1a94f1a
Bug fixes to address incorrect handling of RADIUS in the jigsaw GUI a…
kledmundson Oct 25, 2024
ab8c81d
Bug fixed in isisminer to properly handle self-intersecting polygon g…
kledmundson Oct 17, 2024
e556c04
Fix detached label support for kaguyasp2ascii (#5607)
murashinln Aug 30, 2024
163b056
Speeds up FunctionalTestCamstatsDefaultParameters (#5647)
amystamile-usgs Oct 30, 2024
8bb7ec5
XmlToJson Namespace fix (#5652)
acpaquette Oct 31, 2024
8d203f0
fixes photomet not accepting backplanes (#5658)
amystamile-usgs Nov 12, 2024
ae52429
Convert dstripe to gtests (#5665)
amystamile-usgs Nov 13, 2024
e52f970
Adds HRSC support in socetlinescankeywords (#5669)
amystamile-usgs Nov 18, 2024
4f1ef70
Converted skypt to a callable app. Converted existing Makefile tests …
artmathgirl Apr 1, 2024
77c8ffb
Noseam has been refactored to be callable. Makefile test has been con…
kledmundson Oct 4, 2024
9171685
The explode application has been refactored to be callable and Makefi…
kledmundson Sep 11, 2024
0d0da90
Isisminer has been refactored to be callable and Makefile tests conve…
kledmundson Sep 11, 2024
d7ffd99
Algebra has been refactored to be callable; old Makefile tests have b…
kledmundson Sep 11, 2024
30fd887
Photrim has been refactored to be callable; old Makefile tests have b…
kledmundson Aug 16, 2024
7ec076d
Bandtrim has been refactored to be callable; old Makefile tests have …
kledmundson Aug 5, 2024
2b4a78c
Updated kaguyasp2ascii to support newer (detached) data (#5568)
AustinSanders Jul 31, 2024
40dddc0
Jigsaw csm error message (#5562)
AustinSanders Jul 26, 2024
1139482
Pin qwt to 6.2.0 or lower (#5503)
chkim-usgs Jun 4, 2024
fd5ccb8
Pinned suitesparse to below 7.7.0 (#5528)
chkim-usgs Jun 24, 2024
e767ffa
release prep
chkim-usgs Nov 26, 2024
b89bab9
Remove comment
chkim-usgs Nov 26, 2024
005951a
Add codebuild workflow
chkim-usgs Nov 26, 2024
740c55b
Add update workflow files
chkim-usgs Nov 26, 2024
e316aac
Trigger build
chkim-usgs Nov 26, 2024
f0bc319
Update python version
chkim-usgs Nov 26, 2024
bdafade
Update ale
chkim-usgs Nov 26, 2024
2c18a55
Update deps
chkim-usgs Nov 26, 2024
10497cf
Update boost and libopencv
chkim-usgs Nov 26, 2024
19de33b
Update pcl
chkim-usgs Nov 26, 2024
3fcb162
Update pcl cmake
chkim-usgs Nov 26, 2024
117119b
Add float.h to embree
chkim-usgs Nov 26, 2024
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
Prev Previous commit
Next Next commit
Converted skypt to a callable app. Converted existing Makefile tests …
…to gtests. Removed existing Makefile tests. (#5444)

* Converted skypt to a callable app. Converted existing makefile tests to gtest format and removed old makefile tests and data. Addresses #5443.

* Updated contributor list to add Sarah S. Sutton. Addresses #5443.

---------

Co-authored-by: Sarah Sutton <ssutton@dhcp-10-142-214-177.uawifi.arizona.edu>
2 people authored and chkim-usgs committed Nov 26, 2024
commit 4f1ef70b0ed67066440ed35d8fa2f8cd661cb53e
4 changes: 4 additions & 0 deletions .zenodo.json
Original file line number Diff line number Diff line change
@@ -441,6 +441,10 @@
{
"name": "Sucharski, Tracie"
},
{
"affiliation": "University of Arizona, Lunar and Planetary Laboratory",
"name": "Sutton, Sarah S."
},
{
"name": "Takir, Driss"
},
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -40,6 +40,7 @@ release.
### Changed
- Disabled option to use web=true when running spiceinit with HRSC images. [#5223](https://github.com/DOI-USGS/ISIS3/issues/5223)
- Changed the default spiceinit url to https://astrogeology.usgs.gov/apis/ale/v0.9.1/spiceserver/ and added deprecation warning for use of https://services.isis.astrogeology.usgs.gov/cgi-bin/spiceinit.cgi url. [#5327](https://github.com/USGS-Astrogeology/ISIS3/issues/5327)
- Skypt has been refactored to be callable; old Makefile tests have been removed and replaced by gtests. Issue: [#5443](https://github.com/USGS-Astrogeology/ISIS3/issues/5443)

### Fixed
- Fixed a bug in which capital E was problematic for OSX / Ubuntu [#5466](https://github.com/DOI-USGS/ISIS3/pull/5466)
135 changes: 15 additions & 120 deletions isis/src/base/apps/skypt/main.cpp
Original file line number Diff line number Diff line change
@@ -1,129 +1,24 @@
/** This is free and unencumbered software released into the public domain.

The authors of ISIS do not claim copyright on the contents of this file.
For more details about the LICENSE terms and the AUTHORS, you will
find files of those names at the top level of this repository. **/

/* SPDX-License-Identifier: CC0-1.0 */

#include "Isis.h"

#include "Brick.h"
#include "Camera.h"
#include "IException.h"
#include "iTime.h"
#include "UserInterface.h"
#include "Application.h"
#include "skypt.h"

using namespace std;
using namespace Isis;


void IsisMain() {
// Get user interface
UserInterface &ui = Application::GetUserInterface();

// Get input cube and get camera model for it
QString channel = ui.GetCubeName("FROM");
Cube cube;
cube.open(channel);
Camera *cam = cube.camera();

// Get the type of conversion that we are doing
QString type = ui.GetString("TYPE");
double samp, line;

// Do conversion from samp/line to ra/dec
if (type == "IMAGE") {
// Get users sample & line values and do a setImage for the camera
samp = ui.GetDouble("SAMPLE");
line = ui.GetDouble("LINE");
cam->SetImage(samp, line);
}
// Do conversion from ra/dec to samp/line
else {
double ra = ui.GetDouble("RA");
double dec = ui.GetDouble("DEC");
if (!cam->SetRightAscensionDeclination(ra, dec)) {
QString msg = "Invalid Ra/Dec coordinate";
throw IException(IException::User, msg, _FILEINFO_);
}
samp = cam->Sample();
line = cam->Line();
}

// Create Brick on samp, line to get the dn value of the pixel
Brick b(3, 3, 1, cube.pixelType());
int intSamp = (int)(samp + 0.5);
int intLine = (int)(line + 0.5);
b.SetBasePosition(intSamp, intLine, 1);
cube.read(b);

double rot = cam->CelestialNorthClockAngle();

// Create group with sky position
PvlGroup sp("SkyPoint");
{
sp += PvlKeyword("Filename", FileName(channel).expanded());
sp += PvlKeyword("Sample", toString(cam->Sample()));
sp += PvlKeyword("Line", toString(cam->Line()));
sp += PvlKeyword("RightAscension", toString(cam->RightAscension()));
sp += PvlKeyword("Declination", toString(cam->Declination()));
sp += PvlKeyword("EphemerisTime", toString(cam->time().Et()));
sp += PvlKeyword("PixelValue", PixelToString(b[0]));
sp += PvlKeyword("CelestialNorthClockAngle", toString(rot), "degrees");
}

//Write the group to the screen
Application::Log(sp);

// Write an output label file if necessary
if (ui.WasEntered("TO")) {
// Get user params from ui
QString outFile = FileName(ui.GetFileName("TO")).expanded();
bool exists = FileName(outFile).fileExists();
bool append = ui.GetBoolean("APPEND");

// Write the pvl group out to the file
if (ui.GetString("FORMAT") == "PVL") {
Pvl temp;
temp.setTerminator("");
temp.addGroup(sp);
if (append) {
temp.append(ui.GetAsString("TO"));
}
else {
temp.write(ui.GetAsString("TO"));
}
}
// Create a flatfile of the same data
// The flatfile is comma delimited and can be imported into Excel
else {
ofstream os;
bool writeHeader = false;
if (append) {
os.open(outFile.toLatin1().data(), ios::app);
if (!exists) {
writeHeader = true;
}
}
else {
os.open(outFile.toLatin1().data(), ios::out);
writeHeader = true;
}

if (writeHeader) {
for(int i = 0; i < sp.keywords(); i++) {
os << sp[i].name();

if (i < sp.keywords() - 1) {
os << ",";
}
}
os << endl;
}

for(int i = 0; i < sp.keywords(); i++) {
os << (QString)sp[i];

if (i < sp.keywords() - 1) {
os << ",";
}
}
os << endl;
}
}
else if (ui.GetString("FORMAT") == "FLAT") {
QString msg = "Flat file must have a name.";
throw IException(IException::User, msg, _FILEINFO_);
}
Pvl appLog;
skypt(ui, &appLog);
}

152 changes: 152 additions & 0 deletions isis/src/base/apps/skypt/skypt.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,152 @@
/** This is free and unencumbered software released into the public domain.

The authors of ISIS do not claim copyright on the contents of this file.
For more details about the LICENSE terms and the AUTHORS, you will
find files of those names at the top level of this repository. **/

/* SPDX-License-Identifier: CC0-1.0 */

#include "skypt.h"

#include <string>
#include <iomanip>

#include "Brick.h"
#include "Camera.h"
#include "IException.h"
#include "iTime.h"
#include "PvlGroup.h"

using namespace std;
using namespace Isis;

namespace Isis{

void skypt(UserInterface &ui, Pvl *log) {
Cube *cube = new Cube(ui.GetCubeName("FROM"));
skypt(cube, ui, log);
}

void skypt(Cube *cube, UserInterface &ui, Pvl *log){
// Get camera model for the input cube.
QString channel = ui.GetCubeName("FROM");
Camera *cam = cube->camera();

// Get the type of conversion that we are doing
QString type = ui.GetString("TYPE");
double samp, line;

// Do conversion from samp/line to ra/dec
if (type == "IMAGE") {
// Get users sample & line values and do a setImage for the camera
samp = ui.GetDouble("SAMPLE");
line = ui.GetDouble("LINE");
cam->SetImage(samp, line);
}

// Do conversion from ra/dec to samp/line
else {
double ra = ui.GetDouble("RA");
double dec = ui.GetDouble("DEC");
if (!cam->SetRightAscensionDeclination(ra, dec)) {
QString msg = "Invalid Ra/Dec coordinate";
throw IException(IException::User, msg, _FILEINFO_);
}
samp = cam->Sample();
line = cam->Line();
}

// Create Brick on samp, line to get the dn value of the pixel
Brick b(3, 3, 1, cube->pixelType());
int intSamp = (int)(samp + 0.5);
int intLine = (int)(line + 0.5);
b.SetBasePosition(intSamp, intLine, 1);
cube->read(b);

double rot = cam->CelestialNorthClockAngle();

// Create group with sky position
PvlGroup sp("SkyPoint");
{
sp += PvlKeyword("Filename", FileName(channel).expanded());
sp += PvlKeyword("Sample", toString(cam->Sample()));
sp += PvlKeyword("Line", toString(cam->Line()));
sp += PvlKeyword("RightAscension", toString(cam->RightAscension()));
sp += PvlKeyword("Declination", toString(cam->Declination()));
sp += PvlKeyword("EphemerisTime", toString(cam->time().Et()));
sp += PvlKeyword("PixelValue", PixelToString(b[0]));
sp += PvlKeyword("CelestialNorthClockAngle", toString(rot), "degrees");
}

//Write the group to the screen
log->addLogGroup(sp);

// Write an output label file if necessary
if (ui.WasEntered("TO")) {
// Get user params from ui
QString outFile = FileName(ui.GetFileName("TO")).expanded();
bool exists = FileName(outFile).fileExists();
bool append = ui.GetBoolean("APPEND");

// Write the pvl group out to the file
if (ui.GetString("FORMAT") == "PVL") {
Pvl temp;
temp.setTerminator("");
temp.addGroup(sp);
if (append) {
temp.append(ui.GetAsString("TO"));
}
else {
temp.write(ui.GetAsString("TO"));
}
}

// Create a flatfile of the same data
// The flatfile is comma delimited and can be imported into Excel
else {
ofstream os;
bool writeHeader = false;
if (append) {
os.open(outFile.toLatin1().data(), ios::app);
if (!exists) {
writeHeader = true;
}
}
else {
os.open(outFile.toLatin1().data(), ios::out);
writeHeader = true;
}

if (writeHeader) {
for(int i = 0; i < sp.keywords(); i++) {
os << sp[i].name();
if (i < sp.keywords() - 1) {
os << ",";
}
}
os << endl;
}

for(int i = 0; i < sp.keywords(); i++) {
os << (QString)sp[i];
if (i < sp.keywords() - 1) {
os << ",";
}
}
os << endl;
}
}
else if (ui.GetString("FORMAT") == "FLAT") {
QString msg = "Flat file must have a name.";
throw IException(IException::User, msg, _FILEINFO_);
}
}

}







20 changes: 20 additions & 0 deletions isis/src/base/apps/skypt/skypt.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
/** This is free and unencumbered software released into the public domain.

The authors of ISIS do not claim copyright on the contents of this file.
For more details about the LICENSE terms and the AUTHORS, you will
find files of those names at the top level of this repository. **/

/* SPDX-License-Identifier: CC0-1.0 */

#ifndef skypt_h
#define skypt_h

#include "Pvl.h"
#include "UserInterface.h"

namespace Isis{
extern void skypt(UserInterface &ui, Pvl *log);
extern void skypt(Cube *cube, UserInterface &ui, Pvl *log);
}

#endif
3 changes: 3 additions & 0 deletions isis/src/base/apps/skypt/skypt.xml
Original file line number Diff line number Diff line change
@@ -50,6 +50,9 @@
<change name="Kelvin Rodriguez" date="2016-06-27">
Added functionality to compute celestial north clock angle, References #2365.
</change>
<change name="Sarah Sutton" date="2024-03-26">
Converted to a callable app. References #5443.
</change>
</history>

<groups>
4 changes: 0 additions & 4 deletions isis/src/base/apps/skypt/tsts/Makefile

This file was deleted.

9 changes: 0 additions & 9 deletions isis/src/base/apps/skypt/tsts/default/Makefile

This file was deleted.

20 changes: 0 additions & 20 deletions isis/src/base/apps/skypt/tsts/flat/Makefile

This file was deleted.

246 changes: 246 additions & 0 deletions isis/tests/FunctionalTestsSkypt.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,246 @@
#include <iostream>
#include <QTextStream>
#include <QStringList>
#include <QFile>

#include "skypt.h"

#include "CameraFixtures.h"
#include "Pvl.h"
#include "PvlGroup.h"
#include "TestUtilities.h"

#include "gtest/gtest.h"

using namespace Isis;

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

/**
* FunctionalTestSkyptDefault
*
* Skypt test of check valid functionality.
*
* Input ...
* 1) Level 1 cube (Default test cube)
* 2) Sample and line numbers (because the default option is "image")
*
* Output ...
* 1) Pvl log file (the default output option is PVL).
*
* Test that the output values in the pvl file are as expected to within a given tolerance.
*/
TEST_F(DefaultCube, FunctionalTestSkyptDefault) {

QVector<QString> args = {"from="+testCube->fileName(),
"sample=10.0",
"line=10.0"};
UserInterface options(APP_XML, args);
Pvl appLog;
skypt(testCube, options, &appLog);
PvlGroup skyPoint = appLog.findGroup("SkyPoint");

EXPECT_DOUBLE_EQ( (double) skyPoint.findKeyword("Sample"), 10.0);
EXPECT_DOUBLE_EQ( (double) skyPoint.findKeyword("Line"), 10.0);
EXPECT_NEAR( (double) skyPoint.findKeyword("RightAscension"), 311.67239851182, 1e-8);
EXPECT_NEAR( (double) skyPoint.findKeyword("Declination"), -46.856497015346, 1e-8);
EXPECT_NEAR( (double) skyPoint.findKeyword("EphemerisTime"), -709401200.26114, 1e-8);
EXPECT_DOUBLE_EQ( (double) skyPoint.findKeyword("PixelValue"), 136);
EXPECT_NEAR( (double) skyPoint.findKeyword("CelestialNorthClockAngle"), 69.384799169319, 1e-8);
}

/**
* FunctionalTestSkyptFlatSampleLine
*
* Skypt test of the flat file output against the applog given the image option and
* sample and line inputs.
*
* Input ...
* 1) Level 1 cube (Default test cube).
* 2) Specify the output format is "flat."
* 3) Provide the flat file name (a temporarily created text file).
* 4) Set append = false.
* 5) Set type = image; expects sample and line.
* 6) Sample number.
* 7) Line number.
*
* Output ...
* 1) A comma-separated file with two lines, the first line being the field names,
* and the second line contains the values for each field.
*
* Check that the field names in the first line match those in the pvl applog.
* Check that the values in the flat file also match those in the pvl applog.
*/
TEST_F(DefaultCube, FunctionalTestSkyptFlatSampleLine) {

QFile flatFile(tempDir.path() + "/testOut.txt");

QVector<QString> args = {"from="+testCube->fileName(),
"format=flat",
"to="+flatFile.fileName(),
"append=false",
"type=image",
"sample=10.0",
"line=10.0"};
UserInterface options(APP_XML, args);
Pvl appLog;
skypt(testCube, options, &appLog);
PvlGroup skyPoint = appLog.findGroup("SkyPoint");

int lineNumber = 0;
QTextStream flatStream(&flatFile);

if (flatFile.open(QIODevice::ReadOnly)) {
while(!flatStream.atEnd()) {
QString line = flatStream.readLine();
QStringList fields = line.split(",");

if(lineNumber == 0) {
EXPECT_PRED_FORMAT2(AssertQStringsEqual, fields.value(0), "Filename");
EXPECT_PRED_FORMAT2(AssertQStringsEqual, fields.value(1), "Sample");
EXPECT_PRED_FORMAT2(AssertQStringsEqual, fields.value(2), "Line");
EXPECT_PRED_FORMAT2(AssertQStringsEqual, fields.value(3), "RightAscension");
EXPECT_PRED_FORMAT2(AssertQStringsEqual, fields.value(4), "Declination");
EXPECT_PRED_FORMAT2(AssertQStringsEqual, fields.value(5), "EphemerisTime");
EXPECT_PRED_FORMAT2(AssertQStringsEqual, fields.value(6), "PixelValue");
EXPECT_PRED_FORMAT2(AssertQStringsEqual, fields.value(7), "CelestialNorthClockAngle");
}
else if(lineNumber == 1) {
EXPECT_PRED_FORMAT2(AssertQStringsEqual, fields.value(0), skyPoint.findKeyword("Filename"));
EXPECT_DOUBLE_EQ(fields.value(1).toDouble(), skyPoint.findKeyword("Sample"));
EXPECT_DOUBLE_EQ(fields.value(2).toDouble(), skyPoint.findKeyword("Line"));
EXPECT_DOUBLE_EQ(fields.value(3).toDouble(), skyPoint.findKeyword("RightAscension"));
EXPECT_DOUBLE_EQ(fields.value(4).toDouble(), skyPoint.findKeyword("Declination"));
EXPECT_DOUBLE_EQ(fields.value(5).toDouble(), skyPoint.findKeyword("EphemerisTime"));
EXPECT_DOUBLE_EQ(fields.value(6).toDouble(), skyPoint.findKeyword("PixelValue"));
EXPECT_DOUBLE_EQ(fields.value(7).toDouble(), skyPoint.findKeyword("CelestialNorthClockAngle"));
}
lineNumber++;
}
}
else {
FAIL() << "FAILED TO OPEN FLATFILE";
}
}

/**
* FunctionalTestSkyptFlatRaDec
*
* Skypt test of the flat file output against the applog given the sky option and
* right ascension and declination inputs.
*
* Input ...
* 1) Level 1 cube (Default test cube).
* 2) Specify the output format is "flat."
* 3) Provide the flat file name (a temporarily created text file).
* 4) Set append = false.
* 5) Set type = sky; expects ra and dec.
* 6) Right ascension value.
* 7) Declination value.
*
* Output ...
* 1) A comma-separated file with two lines, the first line being the field names,
* and the second line contains the values for each field.
*
* Check that the field names in the first line match those in the pvl applog.
* Check that the values in the flat file also match those in the pvl applog.
*/
TEST_F(DefaultCube, FunctionalTestSkyptFlatRaDec) {

QFile flatFile(tempDir.path() + "/testOut2.txt");

QVector<QString> args = {"from="+testCube->fileName(),
"format=flat",
"to="+flatFile.fileName(),
"append=false",
"type=sky",
"ra=311.67239851182",
"dec=-46.856497015346"};

UserInterface options(APP_XML, args);
Pvl appLog;
skypt(testCube, options, &appLog);
PvlGroup skyPoint = appLog.findGroup("SkyPoint");

int lineNumber = 0;
QTextStream flatStream(&flatFile);

if (flatFile.open(QIODevice::ReadOnly)) {
while(!flatStream.atEnd()) {
QString line = flatStream.readLine();
std::cout << std::endl << line.toStdString() << std::endl;
QStringList fields = line.split(",");

if(lineNumber == 0) {
EXPECT_PRED_FORMAT2(AssertQStringsEqual, fields.value(0), "Filename");
EXPECT_PRED_FORMAT2(AssertQStringsEqual, fields.value(1), "Sample");
EXPECT_PRED_FORMAT2(AssertQStringsEqual, fields.value(2), "Line");
EXPECT_PRED_FORMAT2(AssertQStringsEqual, fields.value(3), "RightAscension");
EXPECT_PRED_FORMAT2(AssertQStringsEqual, fields.value(4), "Declination");
EXPECT_PRED_FORMAT2(AssertQStringsEqual, fields.value(5), "EphemerisTime");
EXPECT_PRED_FORMAT2(AssertQStringsEqual, fields.value(6), "PixelValue");
EXPECT_PRED_FORMAT2(AssertQStringsEqual, fields.value(7), "CelestialNorthClockAngle");
}
else if(lineNumber == 1) {
EXPECT_PRED_FORMAT2(AssertQStringsEqual, fields.value(0), skyPoint.findKeyword("Filename"));
EXPECT_DOUBLE_EQ(fields.value(1).toDouble(), skyPoint.findKeyword("Sample"));
EXPECT_DOUBLE_EQ(fields.value(2).toDouble(), skyPoint.findKeyword("Line"));
EXPECT_DOUBLE_EQ(fields.value(3).toDouble(), skyPoint.findKeyword("RightAscension"));
EXPECT_DOUBLE_EQ(fields.value(4).toDouble(), skyPoint.findKeyword("Declination"));
EXPECT_DOUBLE_EQ(fields.value(5).toDouble(), skyPoint.findKeyword("EphemerisTime"));
EXPECT_DOUBLE_EQ(fields.value(6).toDouble(), skyPoint.findKeyword("PixelValue"));
EXPECT_DOUBLE_EQ(fields.value(7).toDouble(), skyPoint.findKeyword("CelestialNorthClockAngle"));
}
lineNumber++;
}
}
else {
FAIL() << "FAILED TO OPEN FLATFILE";
}
}


/**
* FunctionalTestSkyptFlatFileError
*
* Skypt test to fail if flatfile name is not provided.
*
* Input ...
* 1) Level 1 cube (Default test cube).
* 2) Specify the output format is "flat."
* 3) Set append = false.
* 4) Set type = image so sample and line are expected inputs.
* 4) Sample value.
* 5) Line value.
*
* Output ...
* 1) Running without specifying a value for "TO" should throw the exception
* "Flat file must have a name."
*
* Test that the expected error message is thrown.
*/
TEST_F(DefaultCube, FunctionalTestSkyptFlatFileError) {

QVector<QString> args = {"from="+testCube->fileName(),
"format=flat"
"append=false",
"type=image",
"sample=10.0",
"line=10.0"};
UserInterface options(APP_XML, args);
Pvl appLog;

try {
skypt(testCube, options, &appLog);
FAIL() << "Expected an exception to be thrown";
}
catch(Isis::IException &e) {
EXPECT_TRUE(e.toString().toLatin1().contains("Flat file must have a name."))
<< e.toString().toStdString();
}
catch(...) {
FAIL() << "Expected an IException with message: \"Flat file must have a name.\"";
}
}