7#include "ProcessImportPds.h"
10#include <QRegularExpression>
16#include "IException.h"
17#include "ImportPdsTable.h"
19#include "LineManager.h"
20#include "OriginalLabel.h"
22#include "Preference.h"
23#include "Projection.h"
24#include "TProjection.h"
26#include "PvlKeyword.h"
29#include "PvlToPvlTranslationManager.h"
30#include "SpecialPixel.h"
32#include "UserInterface.h"
52 ProcessImportPds::~ProcessImportPds() {
96 QString message =
"No projection name in labels";
97 throw IException(IException::Unknown, message, _FILEINFO_);
101 p_targetName = pdsXlater.
Translate(
"TargetName");
104 QString message =
"No target name in labels";
105 throw IException(IException::Unknown, message, _FILEINFO_);
109 str = pdsXlater.
Translate(
"EquatorialRadius");
113 QString message =
"No equatorial radius name in labels";
114 throw IException(IException::User, message, _FILEINFO_);
118 str = pdsXlater.
Translate(
"PolarRadius");
122 QString message =
"No polar radius in labels";
123 throw IException(IException::User, message, _FILEINFO_);
144 str = pdsXlater.
Translate(
"MinimumLatitude");
148 catch(IException &e) {
157 str = pdsXlater.
Translate(
"MaximumLatitude");
161 catch(IException &e) {
171 bool positiveWest =
false;
173 str = pdsXlater.
Translate(
"MinimumLongitude");
178 catch(IException &e) {
183 str = pdsXlater.
Translate(
"MinimumLongitude2");
187 catch(IException &e) {
196 str = pdsXlater.
Translate(
"MaximumLongitude");
201 catch(IException &e) {
206 str = pdsXlater.
Translate(
"MaximumLongitude2");
210 catch(IException &e) {
218 str = pdsXlater.
Translate(
"LongitudeDomain");
257 str = pdsXlater.
Translate(
"PixelResolution");
259 str = pdsXlater.
InputKeyword(
"PixelResolution").unit().toUpper();
261 if ((str !=
"METERS/PIXEL") && (str !=
"M/PIXEL") && (str !=
"M/PIX")) {
272 catch(IException &) {
278 double xoff, yoff, xmult, ymult;
282 str = pdsXlater.
Translate(
"LineProjectionOffset");
285 str = pdsXlater.
Translate(
"LineProjectionOffset2");
287 p_lineProjectionOffset = toDouble(str);
291 str = pdsXlater.
Translate(
"SampleProjectionOffset");
294 str = pdsXlater.
Translate(
"SampleProjectionOffset2");
296 p_sampleProjectionOffset = toDouble(str);
315 for (
unsigned int i = 0; i <
OutputCubes.size(); i++) {
352 double &xmult,
double &ymult) {
360 Isis::Pvl p(
p_transDir +
"/" +
"translations/pdsProjectionLineSampToXY.def");
362 Isis::PvlObject &projDef = p.findObject(
"ProjectionOffsetMults",
365 for(
int g = 0; g < projDef.groups(); g++) {
366 QString key = projDef.group(g)[
"Keyword"];
369 QString pattern = projDef.group(g)[
"Pattern"];
372 if (value.contains(pattern)) {
373 xmult = projDef.group(g)[
"xMult"];
374 ymult = projDef.group(g)[
"yMult"];
375 xoff = projDef.group(g)[
"xOff"];
376 yoff = projDef.group(g)[
"yOff"];
395 stringstream trnsStrm;
396 trnsStrm <<
"Group = PdsFile" << endl;
397 trnsStrm <<
" InputPosition = ROOT" << endl;
398 trnsStrm <<
" InputKey = PDS_VERSION_ID" << endl;
399 trnsStrm <<
"EndGroup" << endl;
400 trnsStrm <<
"Group = Isis2File" << endl;
401 trnsStrm <<
" InputPosition = ROOT" << endl;
402 trnsStrm <<
" InputKey = CCSD3ZF0000100000001NJPL3IF0PDS200000001" << endl;
403 trnsStrm <<
"EndGroup" << endl;
435 int found = isisTableName.lastIndexOf(
"Table");
436 if (found == isisTableName.length() - 5) {
437 isisTableName.remove(found, 5);
440 Table isisTable = pdsTable.
importTable(isisTableName);
457 if (p_source == ISIS2) {
484 const bool & calcOffsetOnly) {
486 const PvlKeyword & dataFilePointer = pdsXlater.
InputKeyword(
"DataFilePointer");
488 QString dataFileName;
496 if (dataFilePointer.size() == 1) {
498 str = pdsXlater.
Translate(
"DataFilePointer");
500 units = dataFilePointer.unit();
505 catch(IException &e) {
515 else if (dataFilePointer.size() == 2) {
516 dataFileName = pdsXlater.
Translate(
"DataFilePointer", 0);
517 offset = IString(pdsXlater.
Translate(
"DataFilePointer", 1)).ToInteger();
518 units = dataFilePointer.unit(1);
521 else if (dataFilePointer.size() == 0) {
522 QString msg =
"Data file pointer ^IMAGE or ^QUBE has no value, must"
523 "have either file name or offset or both, in [" +
525 throw IException(IException::Unknown, msg, _FILEINFO_);
529 QString msg =
"Improperly formatted data file pointer keyword ^IMAGE or "
530 "^QUBE, in [" +
p_labelFile +
"], must contain filename "
531 " or offset or both";
532 throw IException(IException::Unknown, msg, _FILEINFO_);
537 if (!calcOffsetOnly) {
541 Isis::FileName dataFile;
542 if (dataFileName.size() != 0 && dataFileName.at(0) ==
'/')
543 dataFile = FileName(dataFileName);
546 dataFile = FileName(labelFile.path() +
"/" + dataFileName);
549 if (dataFile.fileExists()) {
554 QString tmp = dataFile.expanded();
555 dataFileName = dataFileName.toLower();
556 dataFile = FileName(labelFile.path() +
"/" + dataFileName);
557 if (dataFile.fileExists()) {
561 QString msg =
"Unable to find input file [" + tmp +
"] or [" +
562 dataFile.expanded() +
"]";
563 throw IException(IException::Io, msg, _FILEINFO_);
569 units = units.trimmed();
570 if (units ==
"BYTES" || units ==
"B") {
574 QString recSize = pdsXlater.
Translate(
"DataFileRecordBytes");
598 stringstream trnsStrm;
599 trnsStrm <<
"Group = PdsTypeImage" << endl;
600 trnsStrm <<
" InputPosition = ROOT" << endl;
601 trnsStrm <<
" InputPosition = FILE" << endl;
602 trnsStrm <<
" InputPosition = UNCOMPRESSED_FILE" << endl;
603 trnsStrm <<
" InputKey = ^IMAGE" << endl;
604 trnsStrm <<
"EndGroup" << endl;
605 trnsStrm <<
"Group = PdsCombinedSpectrum" << endl;
606 trnsStrm <<
" InputPosition = ROOT" << endl;
607 trnsStrm <<
" InputPosition = FILE" << endl;
608 trnsStrm <<
" InputPosition = UNCOMPRESSED_FILE" << endl;
609 trnsStrm <<
" InputKey = ^COMBINED_SPECTRUM" << endl;
610 trnsStrm <<
"EndGroup" << endl;
611 trnsStrm <<
"Group = PdsTypeL0" << endl;
612 trnsStrm <<
" InputPosition = L0_FILE" << endl;
613 trnsStrm <<
" InputKey = ^L0_IMAGE" << endl;
614 trnsStrm <<
"EndGroup" << endl;
615 trnsStrm <<
"Group = PdsTypeRdn" << endl;
616 trnsStrm <<
" InputPosition = RDN_FILE" << endl;
617 trnsStrm <<
" InputKey = ^RDN_IMAGE" << endl;
618 trnsStrm <<
"EndGroup" << endl;
619 trnsStrm <<
"Group = PdsTypeLoc" << endl;
620 trnsStrm <<
" InputPosition = LOC_FILE" << endl;
621 trnsStrm <<
" InputKey = ^LOC_IMAGE" << endl;
622 trnsStrm <<
"EndGroup" << endl;
623 trnsStrm <<
"Group = PdsTypeObs" << endl;
624 trnsStrm <<
" InputPosition = OBS_FILE" << endl;
625 trnsStrm <<
" InputKey = ^OBS_IMAGE" << endl;
626 trnsStrm <<
"EndGroup" << endl;
627 trnsStrm <<
"Group = PdsTypeQube" << endl;
628 trnsStrm <<
" InputKey = ^QUBE" << endl;
629 trnsStrm <<
"EndGroup" << endl;
630 trnsStrm <<
"Group = PdsTypeSpectralQube" << endl;
631 trnsStrm <<
" InputKey = ^SPECTRAL_QUBE" << endl;
632 trnsStrm <<
"EndGroup" << endl;
633 trnsStrm <<
"Group = PdsEncodingType" << endl;
634 trnsStrm <<
" InputPosition = COMPRESSED_FILE" << endl;
635 trnsStrm <<
" InputKey = ENCODING_TYPE" << endl;
636 trnsStrm <<
" Translation = (*,*)" << endl;
637 trnsStrm <<
"EndGroup" << endl;
638 trnsStrm <<
"Group = PdsCompressedFile" << endl;
639 trnsStrm <<
" InputPosition = COMPRESSED_FILE" << endl;
640 trnsStrm <<
" InputKey = FILE_NAME" << endl;
641 trnsStrm <<
" Translation = (*,*)" << endl;
642 trnsStrm <<
"EndGroup" << endl;
651 PvlObject obj =
p_pdsLabel.findObject(
"QUBE");
652 PvlKeyword coreKey = obj.findKeyword(
"CORE_ITEM_TYPE");
653 PvlKeyword suffixKey = obj.findKeyword(
"BAND_SUFFIX_ITEM_TYPE");
656 if (coreKey[0] ==
"VAX_REAL") {
660 catch (IException &e) {
668 str = pdsXlater.
Translate(
"PdsEncodingType");
671 str = pdsXlater.
Translate(
"PdsCompressedFile");
672 if (pdsDataFile.isEmpty()) {
674 Isis::FileName ifile(lfile.path() +
"/" + str);
675 if (ifile.fileExists()) {
679 QString tmp = ifile.expanded();
681 ifile = lfile.path() +
"/" + str;
682 if (ifile.fileExists()) {
686 QString msg =
"Unable to find input file [" + tmp +
"] or [" +
687 ifile.expanded() +
"]";
688 throw IException(IException::Io, msg, _FILEINFO_);
694 QString msg =
"Unsupported encoding type in [" +
p_labelFile +
"]";
695 throw IException(IException::Io, msg, _FILEINFO_);
701 if ((allowedTypes & Image) == Image && pdsXlater.
InputHasKeyword(
"PdsTypeImage")) {
705 else if ((allowedTypes & Qube) == Qube && pdsXlater.
InputHasKeyword(
"PdsTypeQube")) {
709 else if ((allowedTypes & SpectralQube) == SpectralQube &&
714 else if ((allowedTypes & L0) == L0 && pdsXlater.
InputHasKeyword(
"PdsTypeL0")) {
718 else if ((allowedTypes & Rdn) == Rdn && pdsXlater.
InputHasKeyword(
"PdsTypeRdn")) {
722 else if ((allowedTypes & Loc) == Loc && pdsXlater.
InputHasKeyword(
"PdsTypeLoc")) {
726 else if ((allowedTypes & Obs) == Obs && pdsXlater.
InputHasKeyword(
"PdsTypeObs")) {
730 else if ((allowedTypes & CombinedSpectrum) == CombinedSpectrum &&
736 QString msg =
"Unknown label type in [" +
p_labelFile +
"]. It is possible the label file "
737+
"does not describe an image product (IMAGE, CUBE, or SPECTRALCUBE).";
738 throw IException(IException::Io, msg, _FILEINFO_);
762 Isis::FileName transFile(
p_transDir +
"/translations/pdsCombinedSpectrum.trn");
767 str = pdsXlater.
Translate(
"CoreLinePrefixBytes");
770 str = pdsXlater.
Translate(
"CoreLineSuffixBytes");
775 str = pdsXlater.
Translate(
"CoreByteOrder");
778 str = pdsXlater.
Translate(
"CoreSamples");
793 if (pdsDataFile.length() > 0) {
814 str = pdsXlater.
Translate(
"CoreMultiplier");
818 str = pdsXlater.
Translate(
"CoreOrganization");
823 else if (str ==
"BSQ") {
826 else if (str ==
"BIP") {
829 else if (str ==
"BIL") {
833 QString msg =
"Unsupported axis order [" + str +
"]";
834 throw IException(IException::Programmer, msg, _FILEINFO_);
856 const QString &transFile) {
859 Isis::FileName tFile(
p_transDir +
"/translations/" + transFile);
871 int val = pdsXlater.
InputKeyword(
"CoreOrganization").size();
873 for(
int i = 0; i < val; i++) {
874 str = pdsXlater.
Translate(
"CoreOrganization", i);
876 if (str ==
"SAMPLE") {
879 else if (str ==
"LINE") {
882 else if (str ==
"BAND") {
886 QString message =
"Unknown file axis name [" + str +
"]";
887 throw IException(IException::User, message, _FILEINFO_);
894 else if (tmp ==
"SAMPLELINEBAND") {
897 else if (tmp ==
"BANDSAMPLELINE") {
900 else if (tmp ==
"SAMPLEBANDLINE") {
904 PvlKeyword pdsCoreOrg =
p_pdsLabel.findKeyword(pdsXlater.
905 InputKeywordName(
"CoreOrganization"), Pvl::Traverse);
907 stringstream pdsCoreOrgStream;
908 pdsCoreOrgStream << pdsCoreOrg;
910 QString msg =
"Unsupported axis order [" + QString(pdsCoreOrgStream.str().c_str()) +
"]";
911 throw IException(IException::Programmer, msg, _FILEINFO_);
920 str = pdsXlater.
Translate(
"SuffixItemSize");
921 int suffix = toInt(str);
922 str = pdsXlater.
Translate(
"AxisSuffixCount", 0);
923 suffix *= toInt(str);
926 str = pdsXlater.
Translate(
"SuffixItemSize");
930 int trailer = toInt(str);
931 str = pdsXlater.
Translate(
"AxisSuffixCount", 1);
932 trailer *= toInt(str);
933 str = pdsXlater.
Translate(
"CoreSamples", samplePos);
934 trailer *= toInt(str);
949 str = pdsXlater.
Translate(
"CoreByteOrder");
963 str = pdsXlater.
Translate(
"CoreSamples", samplePos);
965 str = pdsXlater.
Translate(
"CoreLines", linePos);
967 str = pdsXlater.
Translate(
"CoreBands", bandPos);
981 if (pdsDataFile.length() > 0) {
1003 vector<double> bases;
1004 vector<double> mults;
1005 for(
int i = 0; i < pdsXlater.
InputKeyword(
"BandBase").size(); i++) {
1006 str = pdsXlater.
Translate(
"BandBase", i);
1007 bases.push_back(toDouble(str));
1008 str = pdsXlater.
Translate(
"BandMultiplier", i);
1009 mults.push_back(toDouble(str));
1017 str = pdsXlater.
Translate(
"CoreMultiplier");
1035 Isis::FileName transFile(
p_transDir +
"/translations/pdsImage.trn");
1040 str = pdsXlater.
Translate(
"CoreLinePrefixBytes");
1043 str = pdsXlater.
Translate(
"CoreLineSuffixBytes");
1048 str = pdsXlater.
Translate(
"CoreByteOrder");
1051 str = pdsXlater.
Translate(
"CoreSamples");
1052 int ns = toInt(str);
1054 int nl = toInt(str);
1056 int nb = toInt(str);
1069 if (pdsDataFile.length() > 0) {
1091 str = pdsXlater.
Translate(
"CoreMultiplier");
1095 str = pdsXlater.
Translate(
"CoreOrganization");
1100 else if (str ==
"BSQ") {
1103 else if (str ==
"BIP") {
1106 else if (str ==
"BIL") {
1110 QString msg =
"Unsupported axis order [" + str +
"]";
1111 throw IException(IException::Programmer, msg, _FILEINFO_);
1122 str = pdsXlater.
Translate(
"CoreBitsPerPixel");
1123 int bitsPerPixel = toInt(str);
1124 str = pdsXlater.
Translate(
"CorePixelType");
1126 if ((str ==
"Real") && (bitsPerPixel == 64)) {
1130 else if ((str ==
"Real") && (bitsPerPixel == 32)) {
1133 else if ((str ==
"Integer") && (bitsPerPixel == 8)) {
1136 else if ((str ==
"Integer") && (bitsPerPixel == 16)) {
1139 else if ((str ==
"Integer") && (bitsPerPixel == 32)) {
1142 else if ((str ==
"Natural") && (bitsPerPixel == 8)) {
1145 else if ((str ==
"Natural") && (bitsPerPixel == 16)) {
1148 else if ((str ==
"Natural") && (bitsPerPixel == 16)) {
1151 else if ((str ==
"Natural") && (bitsPerPixel == 32)) {
1156 QString msg =
"Invalid PixelType and BitsPerPixel combination [" + str +
1157 ", " +
toString(bitsPerPixel) +
"]";
1158 throw IException(IException::Io, msg, _FILEINFO_);
1175 Isis::FileName transFile;
1176 if (fileType == L0) {
1177 transFile =
p_transDir +
"/translations/pdsL0.trn";
1179 else if (fileType == Rdn) {
1180 transFile =
p_transDir +
"/translations/pdsRdn.trn";
1182 else if (fileType == Loc) {
1183 transFile =
p_transDir +
"/translations/pdsLoc.trn";
1185 else if (fileType == Obs) {
1186 transFile =
p_transDir +
"/translations/pdsObs.trn";
1189 throw IException(IException::Programmer,
"ProcessImportPds::ProcessPdsM3Label can only be "
1190 "called with file type of L0, Rdn, Loc or Obs.", _FILEINFO_);
1198 str = pdsXlater.
Translate(
"CoreLinePrefixBytes");
1201 str = pdsXlater.
Translate(
"CoreLineSuffixBytes");
1206 str = pdsXlater.
Translate(
"CoreByteOrder");
1209 str = pdsXlater.
Translate(
"CoreSamples");
1210 int ns = toInt(str);
1212 int nl = toInt(str);
1214 int nb = toInt(str);
1226 if (pdsDataFile.length() > 0) {
1248 str = pdsXlater.
Translate(
"CoreMultiplier");
1252 str = pdsXlater.
Translate(
"CoreOrganization");
1257 else if (str ==
"BSQ") {
1260 else if (str ==
"BIP") {
1263 else if (str ==
"BIL") {
1267 QString msg =
"Unsupported axis order [" + str +
"]";
1268 throw IException(IException::Programmer, msg, _FILEINFO_);
1279 double pdsNull = Isis::NULL8;
1282 if (str !=
"NULL") {
1283 pdsNull = toDouble(str);
1288 if (str !=
"NULL") {
1289 pdsNull = toDouble(str);
1293 double pdsLrs = Isis::Lrs;
1296 if (str !=
"NULL") {
1297 pdsLrs = toDouble(str);
1302 if (str !=
"NULL") {
1303 pdsLrs = toDouble(str);
1307 double pdsLis = Isis::Lis;
1310 if (str !=
"NULL") {
1311 pdsLis = toDouble(str);
1316 if (str !=
"NULL") {
1317 pdsLis = toDouble(str);
1321 double pdsHrs = Isis::Hrs;
1324 if (str !=
"NULL") {
1325 pdsHrs = toDouble(str);
1330 if (str !=
"NULL") {
1331 pdsHrs = toDouble(str);
1335 double pdsHis = Isis::His;
1338 if (str !=
"NULL") {
1339 pdsHis = toDouble(str);
1344 if (str !=
"NULL") {
1345 pdsHis = toDouble(str);
1368 const QString &pdsDataFile,
1369 PdsFileType allowedTypes) {
1396 const QString &pdsDataFile,
1397 Isis::Pvl &pdsLabel,
1398 PdsFileType allowedTypes) {
1402 pdsLabel.read(pdsLabelFile);
1404 catch (IException &e) {
1405 throw IException(e, IException::User,
1406 QObject::tr(
"This image does not contain a pds label. You will need an "
1407 "image with a PDS label or a detached PDS label for this "
1408 "image."), _FILEINFO_);
1423 for (
unsigned int i = 0; i <
p_tables.size(); i++) {
1455 QString transDir =
"$ISISROOT/appdata";
1457 Isis::FileName transFile(transDir +
"/" +
"translations/isis2bandbin.trn");
1461 isis2Xlater.
Auto(lab);
1473 QString transDir =
"$ISISROOT/appdata";
1475 Isis::FileName transFile(transDir +
"/" +
"translations/isis2instrument.trn");
1479 isis2Xlater.
Auto(lab);
1482 Isis::PvlGroup &inst = lab.findGroup(
"Instrument");
1484 if (inst.hasKeyword(
"StartTime")) {
1485 Isis::PvlKeyword &stkey = inst[
"StartTime"];
1486 QString stime = stkey[0];
1487 stime = stime.remove(QRegularExpression(
"[Zz]$"));
1514 Isis::FileName transFile(
p_transDir +
"/" +
"translations/pdsImageArchive.trn");
1518 isis2Xlater.
Auto(lab);
1530 Isis::FileName transFile(
p_transDir +
"/" +
"translations/pdsImageBandBin.trn");
1534 isis2Xlater.
Auto(lab);
1566 stringstream trnsStrm;
1567 trnsStrm <<
"Group = PdsProjectionTypeImage" << endl;
1568 trnsStrm <<
" InputPosition = IMAGE_MAP_PROJECTION" << endl;
1569 trnsStrm <<
" InputPosition = IMAGE_MAP_PROJECTION_CATALOG" << endl;
1570 trnsStrm <<
" InputKey = MAP_PROJECTION_TYPE" << endl;
1571 trnsStrm <<
"EndGroup" << endl;
1572 trnsStrm <<
"Group = PdsProjectionTypeQube" << endl;
1573 trnsStrm <<
" InputPosition = (QUBE,IMAGE_MAP_PROJECTION)" << endl;
1574 trnsStrm <<
" InputKey = MAP_PROJECTION_TYPE" << endl;
1575 trnsStrm <<
"EndGroup" << endl;
1576 trnsStrm <<
"Group = PdsProjectionTypeSpectralQube" << endl;
1577 trnsStrm <<
" InputPosition = (SPECTRAL_QUBE,IMAGE_MAP_PROJECTION)" << endl;
1578 trnsStrm <<
" InputKey = MAP_PROJECTION_TYPE" << endl;
1579 trnsStrm <<
"EndGroup" << endl;
1585 QString transDir =
"$ISISROOT/appdata";
1587 Isis::FileName transFile;
1589 transFile = transDir +
"/" +
"translations/pdsImageProjection.trn";
1592 transFile = transDir +
"/" +
"translations/pdsQubeProjection.trn";
1595 transFile = transDir +
"/" +
"translations/pdsSpectralQubeProjection.trn";
1605 Isis::PvlGroup mapGroup(
"Mapping");
1606 mapGroup += Isis::PvlKeyword(
"ProjectionName",
p_projection);
1607 mapGroup += Isis::PvlKeyword(
"TargetName", p_targetName);
1630 mapGroup[
"MinimumLongitude"] =
toString(-180);
1631 mapGroup[
"MaximumLongitude"] =
toString(180);
1634 mapGroup[
"MinimumLongitude"] =
toString(0);
1635 mapGroup[
"MaximumLongitude"] =
toString(360);
1642 mapGroup += Isis::PvlKeyword(
"UpperLeftCornerX",
toString(p_upperLeftX),
"meters");
1643 mapGroup += Isis::PvlKeyword(
"UpperLeftCornerY",
toString(p_upperLeftY),
"meters");
1653 QString projSpecificFileName =
"$ISISROOT/appdata/translations/pdsImport";
1657 lab.addGroup(mapGroup);
1658 specificXlater.
Auto(lab);
1660 if (lab.findGroup(
"Mapping").hasKeyword(
"CenterLongitude")) {
1661 PvlKeyword ¢erLon = lab.findGroup(
"Mapping")[
"CenterLongitude"];
1668 if (lab.findGroup(
"Mapping").hasKeyword(
"PoleLongitude")) {
1669 PvlKeyword &poleLon = lab.findGroup(
"Mapping")[
"PoleLongitude"];
1676 OutputCubes[0]->putGroup(lab.findGroup(
"Mapping"));
Buffer for reading and writing cube data.
Import a PDS table file with a label description.
QString getFormattedName(const QString &colname) const
Converts a column name to a camel-case after it has been cleansed.
Table importTable(const QString &isisTableName)
Populate a Table object with the PDS table and return it.
Read and store original labels.
std::vector< Isis::Cube * > OutputCubes
A vector of pointers to allocated Cube objects.
virtual void Finalize()
Cleans up by closing cubes and freeing memory for owned cubes.
void SetVAXConvert(const bool vax_convert)
Sets the VAX flag of the input cube.
virtual void StartProcess()
Process the input file and write it to the output.
void SetPixelType(const Isis::PixelType type)
Sets the pixel type of the input file.
void SetFileHeaderBytes(const int bytes)
This method sets the number of bytes in the header of a file.
void SaveDataTrailer()
This method marks the data block trailers to be saved.
void SetOrganization(const ProcessImport::Interleave org)
Sets the organization of the input cube.
void SetDataPrefixBytes(const int bytes)
This method sets the number of bytes at the beginning of each data record of a file.
int DataTrailerBytes() const
This method returns the number of data trailer bytes.
void SetSpecialValues(const double null, const double lrs, const double lis, const double hrs, const double his)
Sets a mapping of input pixel values to output special pixel values.
void SetInputFile(const QString &file)
Sets the name of the input file to be read in the import StartProcess method and verifies its existan...
void SetMultiplier(const double mult)
Sets the core multiplier of the input cube.
void SetDataHeaderBytes(const int bytes)
This method sets the number of bytes in the header of each datablock of a file.
void SetDataTrailerBytes(const int bytes)
This method sets the number of bytes in the trailer of each datablock of a file.
void SetByteOrder(const Isis::ByteOrder order)
Sets the byte order of the input file.
@ BIL
Band Interleaved By Line Format (i.e.
@ BIP
Band Interleaved By Pixel Format (i.e.
@ JP2
Jpeg 2000 Format (always band sequential).
@ BSQ
Band Sequential Format (i.e.
void SetDataSuffixBytes(const int bytes)
This method sets the number of bytes at the end of each data record of a file.
void SetBase(const double base)
Sets the core base of the input cube.
void SetDimensions(const int ns, const int nl, const int nb)
Sets the physical size of the input cube.
EncodingType p_encodingType
The encoding type of the image data.
QString p_labelFile
The filename where the PDS label came from.
void GetProjectionOffsetMults(double &xoff, double &yoff, double &xmult, double &ymult)
Read mults and offsets from a def file in order to calculate the upper left x/y.
void TranslatePdsBandBin(Pvl &lab)
Fill as many of the Isis BandBin labels as possible.
double p_scaleFactor
The scale factor found in the PDS projection labels.
double p_minimumLongitude
Minimum longitude found in the PDS projection labels.
bool p_keepOriginalLabel
determines whether or not to keep the OriginalLabel blob.
void TranslateIsis2Labels(Pvl &lab)
Translate as many of the ISIS2 labels as possible.
void IdentifySource(Pvl &lab)
Identify the source of this file PDS or ISIS2.
std::vector< Table > p_tables
Vector of Isis Table objects that were imported from PDS and need to be added to the imported cube fi...
double p_minimumLatitude
Minimum latitude found in the PDS projection labels.
QString p_jp2File
The name of the file containing the encoded JP2 data.
QString p_transDir
Base data directory.
void SetPdsFile(const QString &pdsLabelFile, const QString &pdsDataFile, Pvl &pdsLabel, PdsFileType allowedTypes=All)
Set the input label file, data file and initialize a Pvl with the PDS labels.
QString p_longitudeDirection
Longitude direction found in the PDS projection labels.
double p_maximumLatitude
Maximum latitude found in the PDS projection labels.
double p_equatorialRadius
Equatorial radius found in the PDS projection labels.
ProcessImportPds()
Constructor.
void StartProcess()
This method will write the cube and table data to the output cube.
void OmitOriginalLabel()
Prevents the Original Label blob from being written out to the end of the cube.
void TranslateIsis2BandBin(Pvl &lab)
Fill as many of the Isis BandBin labels as possible.
Pvl p_pdsLabel
Internalized PDS label.
void ProcessDataFilePointer(PvlToPvlTranslationManager &pdsXlater, const bool &calcOffsetOnly)
Handles the DataFilePointer keyword, aka ^QUBE or ^IMAGE.
void TranslatePdsProjection(Pvl &lab)
Fills the passed in label with the projection information from the PDS label file.
void ProcessPixelBitandType(PvlToPvlTranslationManager &pdsXlater)
Handles PixelType and BitsPerPixel Calls SetPixelType with the correct values.
void ExtractPdsProjection(PvlToPvlTranslationManager &pdsXlater)
Extract all possible PDS projection parameters from the PDS label.
bool p_projectionOffsetChange
Whether the projection offsets were updated upon loading.
void TranslatePdsArchive(Pvl &lab)
Fill as many of the Isis BandBin labels as possible.
void ProcessSpecialPixels(PvlToPvlTranslationManager &pdsXlater, const bool &isQube)
Handles all special pixel setting, ultimately, calls SetSpecialValues.
double p_maximumLongitude
Maximum longitude found in the PDS projection labels.
bool GetProjectionOffsetChange()
Return whether the projection offsets have changed.
void ProcessPdsQubeLabel(const QString &pdsDataFile, const QString &transFile)
Process the PDS label of type QUBE or SPECTRALQUBE.
bool IsIsis2()
Return true if ISIS2 cube, else return false.
double p_polarRadius
The polar radius found in the PDS projection labels.
void ProcessPdsCombinedSpectrumLabel(const QString &pdsDataFile)
Process the PDS label of type CombinedSpectrum.
Table & ImportTable(QString pdsTableName)
This method will import the PDS table with the given name into an Isis Table object.
int p_longitudeDomain
Longitude domain found in the PDS projection labels.
void ProcessPdsImageLabel(const QString &pdsDataFile)
Process the PDS label of type IMAGE.
void TranslatePdsLabels(Pvl &lab)
Translate as many of the PDS labels as possible.
PvlGroup GetProjectionOffsetGroup()
Return the projection offsets.
void ProcessPdsM3Label(const QString &pdsDataFile, PdsFileType fileType)
Process Chandrayaan M3 PDS label.
QString p_projection
The name of the projection found in the PDS projection labels.
double p_rotation
The rotation found in the PDS labels.
void ProcessLabel(const QString &pdsDataFile, PdsFileType allowedTypes)
Load the PDS labels after determining what type of data file was provided.
PvlGroup p_projectionOffsetGroup
Log information for projection offsets.
double p_pixelResolution
Pixel resolution found in the PDS projection labels.
void TranslateIsis2Instrument(Pvl &lab)
Fill as many of the Isis instrument labels as possible.
void Finalize()
End the processing sequence and cleans up by closing cubes, freeing memory, etc.
QString p_latitudeType
The latitude type found in the PDS projection labels.
Allows applications to translate simple text files.
virtual const PvlKeyword & InputKeyword(const QString translationGroupName) const
Returns the ith input value associated with the output name argument.
virtual QString Translate(QString translationGroupName, int findex=0)
Returns a translated value.
virtual bool InputHasKeyword(const QString translationGroupName)
Indicates if the input keyword corresponding to the output name exists in the label.
void Auto(Pvl &outputLabel)
Automatically translate all the output names found in the translation table If a output name does not...
static double To180Domain(const double lon)
This method converts a longitude into the -180 to 180 domain.
static double To360Domain(const double lon)
This method converts a longitude into the 0 to 360 domain.
This is free and unencumbered software released into the public domain.
QString toString(const LinearAlgebra::Vector &vector, int precision)
A global function to format LinearAlgebra::Vector as a QString with the given precision.
Namespace for the standard library.