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

pds2isis gtest #4144

Merged
merged 6 commits into from
Dec 7, 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
7 changes: 0 additions & 7 deletions isis/src/base/apps/pds2isis/Makefile

This file was deleted.

84 changes: 84 additions & 0 deletions isis/src/base/apps/pds2isis/pds2isis.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
#include "ProcessImportPds.h"

#include "UserInterface.h"
#include "FileName.h"

using namespace std;
namespace Isis {
void pds2isis(UserInterface &ui, Pvl *log) {
ProcessImportPds p;
Pvl label;
QString labelFile = ui.GetFileName("FROM");
QString imageFile("");
if(ui.WasEntered("IMAGE")) {
imageFile = ui.GetFileName("IMAGE");
}

p.SetPdsFile(labelFile, imageFile, label);


CubeAttributeOutput &att = ui.GetOutputAttribute("TO");
Cube *ocube = p.SetOutputCube(ui.GetFileName("TO"), att);

// Get user entered special pixel ranges
if(ui.GetBoolean("SETNULLRANGE")) {
p.SetNull(ui.GetDouble("NULLMIN"), ui.GetDouble("NULLMAX"));
}
if(ui.GetBoolean("SETHRSRANGE")) {
p.SetHRS(ui.GetDouble("HRSMIN"), ui.GetDouble("HRSMAX"));
}
if(ui.GetBoolean("SETHISRANGE")) {
p.SetHIS(ui.GetDouble("HISMIN"), ui.GetDouble("HISMAX"));
}
if(ui.GetBoolean("SETLRSRANGE")) {
p.SetLRS(ui.GetDouble("LRSMIN"), ui.GetDouble("LRSMAX"));
}
if(ui.GetBoolean("SETLISRANGE")) {
p.SetLIS(ui.GetDouble("LISMIN"), ui.GetDouble("LISMAX"));
}

// Export the cube
p.StartProcess();

// Get as many of the other labels as we can
Pvl otherLabels;
p.TranslatePdsProjection(otherLabels);
if(p.IsIsis2()) {
p.TranslateIsis2Labels(otherLabels);
}
else {
p.TranslatePdsLabels(otherLabels);
}

if(otherLabels.hasGroup("Mapping") &&
(otherLabels.findGroup("Mapping").keywords() > 0)) {
ocube->putGroup(otherLabels.findGroup("Mapping"));
}
if(otherLabels.hasGroup("Instrument") &&
(otherLabels.findGroup("Instrument").keywords() > 0)) {
ocube->putGroup(otherLabels.findGroup("Instrument"));
}
if(otherLabels.hasGroup("BandBin") &&
(otherLabels.findGroup("BandBin").keywords() > 0)) {
ocube->putGroup(otherLabels.findGroup("BandBin"));
}
if(otherLabels.hasGroup("Archive") &&
(otherLabels.findGroup("Archive").keywords() > 0)) {
ocube->putGroup(otherLabels.findGroup("Archive"));
}

// Check for and log any change from the default projection offsets and multipliers
if (p.GetProjectionOffsetChange()) {
PvlGroup results = p.GetProjectionOffsetGroup();
results.setName("Results");
results[0].addComment("Projection offsets and multipliers have been changed from");
results[0].addComment("defaults. New values are below.");
log->addGroup(results);
}

p.EndProcess();

return;
}
}

11 changes: 11 additions & 0 deletions isis/src/base/apps/pds2isis/pds2isis.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#ifndef pds2isis_h
#define pds2isis_h

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

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

#endif
4 changes: 0 additions & 4 deletions isis/src/base/apps/pds2isis/tsts/Makefile

This file was deleted.

11 changes: 0 additions & 11 deletions isis/src/base/apps/pds2isis/tsts/bandbin/Makefile

This file was deleted.

10 changes: 0 additions & 10 deletions isis/src/base/apps/pds2isis/tsts/default/Makefile

This file was deleted.

9 changes: 0 additions & 9 deletions isis/src/base/apps/pds2isis/tsts/offsetTest/Makefile

This file was deleted.

15 changes: 0 additions & 15 deletions isis/src/base/apps/pds2isis/tsts/projection/Makefile

This file was deleted.

16 changes: 0 additions & 16 deletions isis/src/base/apps/pds2isis/tsts/specialPixels/Makefile

This file was deleted.

9 changes: 0 additions & 9 deletions isis/src/base/apps/pds2isis/tsts/testBIL/Makefile

This file was deleted.

12 changes: 0 additions & 12 deletions isis/src/base/apps/pds2isis/tsts/testBIP/Makefile

This file was deleted.

8 changes: 0 additions & 8 deletions isis/src/base/apps/pds2isis/tsts/testNIMSQub/Makefile

This file was deleted.

Loading