7#include "ProcessImportPds.h"
15#include "IException.h"
16#include "ImportPdsTable.h"
18#include "LineManager.h"
19#include "OriginalLabel.h"
21#include "Preference.h"
22#include "Projection.h"
23#include "TProjection.h"
25#include "PvlKeyword.h"
28#include "PvlTokenizer.h"
29#include "PvlToPvlTranslationManager.h"
30#include "SpecialPixel.h"
32#include "UserInterface.h"
52 ProcessImportPds::~ProcessImportPds() {
92 if (pdsXlater.InputHasKeyword(
"ProjectionName")) {
96 QString message =
"No projection name in labels";
100 if (pdsXlater.InputHasKeyword(
"TargetName")) {
101 p_targetName = pdsXlater.Translate(
"TargetName");
104 QString message =
"No target name in labels";
108 if (pdsXlater.InputHasKeyword(
"EquatorialRadius")) {
109 str = pdsXlater.Translate(
"EquatorialRadius");
113 QString message =
"No equatorial radius name in labels";
117 if (pdsXlater.InputHasKeyword(
"PolarRadius")) {
118 str = pdsXlater.Translate(
"PolarRadius");
122 QString message =
"No polar radius in labels";
126 if (pdsXlater.InputHasKeyword(
"LongitudeDirection")) {
136 else if (pdsXlater.InputHasKeyword(
"LatitudeType2")) {
143 if (pdsXlater.InputHasKeyword(
"MinimumLatitude")) {
144 str = pdsXlater.Translate(
"MinimumLatitude");
156 if (pdsXlater.InputHasKeyword(
"MaximumLatitude")) {
157 str = pdsXlater.Translate(
"MaximumLatitude");
171 bool positiveWest =
false;
172 if (pdsXlater.InputHasKeyword(
"MinimumLongitude")) {
173 str = pdsXlater.Translate(
"MinimumLongitude");
182 else if (pdsXlater.InputHasKeyword(
"MinimumLongitude2")) {
183 str = pdsXlater.Translate(
"MinimumLongitude2");
195 if (pdsXlater.InputHasKeyword(
"MaximumLongitude")) {
196 str = pdsXlater.Translate(
"MaximumLongitude");
205 else if (pdsXlater.InputHasKeyword(
"MaximumLongitude2")) {
206 str = pdsXlater.Translate(
"MaximumLongitude2");
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")) {
265 str = pdsXlater.Translate(
"Scale");
269 str = pdsXlater.Translate(
"Rotation");
278 double xoff, yoff, xmult, ymult;
281 if (pdsXlater.InputHasKeyword(
"LineProjectionOffset")) {
282 str = pdsXlater.Translate(
"LineProjectionOffset");
285 str = pdsXlater.Translate(
"LineProjectionOffset2");
287 p_lineProjectionOffset =
toDouble(str);
290 if (pdsXlater.InputHasKeyword(
"SampleProjectionOffset")) {
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) {
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;
408 if (sourceXlater.InputHasKeyword(
"PdsFile")) {
411 else if (sourceXlater.InputHasKeyword(
"Isis2File")) {
434 QString isisTableName = pdsTable.getFormattedName(pdsTableName);
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();
515 else if (dataFilePointer.size() == 2) {
516 dataFileName = pdsXlater.Translate(
"DataFilePointer", 0);
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 [" +
529 QString msg =
"Improperly formatted data file pointer keyword ^IMAGE or "
530 "^QUBE, in [" +
p_labelFile +
"], must contain filename "
531 " or offset or both";
537 if (!calcOffsetOnly) {
542 if (dataFileName.size() != 0 && dataFileName.at(0) ==
'/')
546 dataFile =
FileName(labelFile.path() +
"/" + dataFileName);
555 dataFileName = dataFileName.toLower();
556 dataFile =
FileName(labelFile.path() +
"/" + dataFileName);
561 QString msg =
"Unable to find input file [" + tmp +
"] or [" +
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;
652 PvlKeyword coreKey = obj.findKeyword(
"CORE_ITEM_TYPE");
653 PvlKeyword suffixKey = obj.findKeyword(
"BAND_SUFFIX_ITEM_TYPE");
656 if (coreKey[0] ==
"VAX_REAL") {
667 if (pdsXlater.InputHasKeyword(
"PdsEncodingType")) {
668 str = pdsXlater.Translate(
"PdsEncodingType");
671 str = pdsXlater.Translate(
"PdsCompressedFile");
672 if (pdsDataFile.isEmpty()) {
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() +
"]";
694 QString msg =
"Unsupported encoding type in [" +
p_labelFile +
"]";
701 if ((allowedTypes &
Image) ==
Image && pdsXlater.InputHasKeyword(
"PdsTypeImage")) {
705 else if ((allowedTypes & Qube) == Qube && pdsXlater.InputHasKeyword(
"PdsTypeQube")) {
709 else if ((allowedTypes & SpectralQube) == SpectralQube &&
710 pdsXlater.InputHasKeyword(
"PdsTypeSpectralQube")) {
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 &&
731 pdsXlater.InputHasKeyword(
"PdsCombinedSpectrum")) {
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).";
767 str = pdsXlater.Translate(
"CoreLinePrefixBytes");
770 str = pdsXlater.Translate(
"CoreLineSuffixBytes");
775 str = pdsXlater.Translate(
"CoreByteOrder");
778 str = pdsXlater.Translate(
"CoreSamples");
780 str = pdsXlater.Translate(
"CoreLines");
782 str = pdsXlater.Translate(
"CoreBands");
793 if (pdsDataFile.length() > 0) {
812 str = pdsXlater.Translate(
"CoreBase");
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 +
"]";
856 const QString &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 +
"]";
894 else if (tmp ==
"SAMPLELINEBAND") {
897 else if (tmp ==
"BANDSAMPLELINE") {
900 else if (tmp ==
"SAMPLEBANDLINE") {
907 stringstream pdsCoreOrgStream;
908 pdsCoreOrgStream << pdsCoreOrg;
910 QString msg =
"Unsupported axis order [" + QString(pdsCoreOrgStream.str().c_str()) +
"]";
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) {
1001 if ((pdsXlater.InputHasKeyword(
"BandBase")) &&
1002 (pdsXlater.InputHasKeyword(
"BandMultiplier"))) {
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);
1008 str = pdsXlater.Translate(
"BandMultiplier", i);
1015 str = pdsXlater.Translate(
"CoreBase");
1017 str = pdsXlater.Translate(
"CoreMultiplier");
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);
1053 str = pdsXlater.Translate(
"CoreLines");
1054 int nl =
toInt(str);
1055 str = pdsXlater.Translate(
"CoreBands");
1056 int nb =
toInt(str);
1069 if (pdsDataFile.length() > 0) {
1089 str = pdsXlater.Translate(
"CoreBase");
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 +
"]";
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) +
"]";
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";
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);
1211 str = pdsXlater.Translate(
"CoreLines");
1212 int nl =
toInt(str);
1213 str = pdsXlater.Translate(
"CoreBands");
1214 int nb =
toInt(str);
1226 if (pdsDataFile.length() > 0) {
1246 str = pdsXlater.Translate(
"CoreBase");
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 +
"]";
1279 double pdsNull = Isis::NULL8;
1280 if (pdsXlater.InputHasKeyword(
"CoreNull")) {
1281 str = pdsXlater.Translate(
"CoreNull");
1282 if (str !=
"NULL") {
1286 else if (!isQube && pdsXlater.InputHasKeyword(
"CoreNull2")) {
1287 str = pdsXlater.Translate(
"CoreNull2");
1288 if (str !=
"NULL") {
1294 if (pdsXlater.InputHasKeyword(
"CoreLrs")) {
1295 str = pdsXlater.Translate(
"CoreLrs");
1296 if (str !=
"NULL") {
1300 else if (!isQube && pdsXlater.InputHasKeyword(
"CoreLrs2")) {
1301 str = pdsXlater.Translate(
"CoreLrs2");
1302 if (str !=
"NULL") {
1308 if (pdsXlater.InputHasKeyword(
"CoreLis")) {
1309 str = pdsXlater.Translate(
"CoreLis");
1310 if (str !=
"NULL") {
1314 else if (!isQube && pdsXlater.InputHasKeyword(
"CoreLis2")) {
1315 str = pdsXlater.Translate(
"CoreLis2");
1316 if (str !=
"NULL") {
1322 if (pdsXlater.InputHasKeyword(
"CoreHrs")) {
1323 str = pdsXlater.Translate(
"CoreHrs");
1324 if (str !=
"NULL") {
1328 else if (!isQube && pdsXlater.InputHasKeyword(
"CoreHrs2")) {
1329 str = pdsXlater.Translate(
"CoreHrs2");
1330 if (str !=
"NULL") {
1336 if (pdsXlater.InputHasKeyword(
"CoreHis")) {
1337 str = pdsXlater.Translate(
"CoreHis");
1338 if (str !=
"NULL") {
1342 else if (!isQube && pdsXlater.InputHasKeyword(
"CoreHis2")) {
1343 str = pdsXlater.Translate(
"CoreHis2");
1344 if (str !=
"NULL") {
1368 const QString &pdsDataFile,
1369 PdsFileType allowedTypes) {
1396 const QString &pdsDataFile,
1398 PdsFileType allowedTypes) {
1402 pdsLabel.read(pdsLabelFile);
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);
1484 if (inst.hasKeyword(
"StartTime")) {
1486 QString stime = stkey[0];
1487 stime = stime.remove(QRegExp(
"[Zz]$"));
1518 isis2Xlater.Auto(lab);
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";
1588 if (projType.InputHasKeyword(
"PdsProjectionTypeImage")) {
1589 transFile = transDir +
"/" +
"translations/pdsImageProjection.trn";
1591 else if (projType.InputHasKeyword(
"PdsProjectionTypeQube")) {
1592 transFile = transDir +
"/" +
"translations/pdsQubeProjection.trn";
1594 else if (projType.InputHasKeyword(
"PdsProjectionTypeSpectralQube")) {
1595 transFile = transDir +
"/" +
"translations/pdsSpectralQubeProjection.trn";
1630 mapGroup[
"MinimumLongitude"] =
toString(-180);
1631 mapGroup[
"MaximumLongitude"] =
toString(180);
1634 mapGroup[
"MinimumLongitude"] =
toString(0);
1635 mapGroup[
"MaximumLongitude"] =
toString(360);
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.
File name manipulation and expansion.
bool fileExists() const
Returns true if the file exists; false otherwise.
QString name() const
Returns the name of the file excluding the path and the attributes in the file name.
QString expanded() const
Returns a QString of the full file name including the file path, excluding the attributes.
@ Unknown
A type of error that cannot be classified as any of the other error types.
@ User
A type of error that could only have occurred due to a mistake on the user's part (e....
@ Programmer
This error is for when a programmer made an API call that was illegal.
@ Io
A type of error that occurred when performing an actual I/O operation.
Adds specific functionality to C++ strings.
int ToInteger() const
Returns the object string as an integer.
This represents a cube in a project-based GUI interface.
Import a PDS table file with a label description.
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.
void setName(const QString &name)
Set the name of the container.
void addKeyword(const PvlKeyword &keyword, const InsertMode mode=Append)
Add a keyword to the container.
Contains multiple PvlContainers.
Container for cube-like labels.
A single keyword-value pair.
Contains Pvl Groups and Pvl Objects.
bool hasKeyword(const QString &kname, FindOptions opts) const
See if a keyword is in the current PvlObject, or deeper inside other PvlObjects and Pvlgroups within ...
PvlGroup & group(const int index)
Return the group at the specified index.
PvlObjectIterator findObject(const QString &name, PvlObjectIterator beg, PvlObjectIterator end)
Find the index of object with a specified name, between two indexes.
@ Traverse
Search child objects.
PvlKeyword & findKeyword(const QString &kname, FindOptions opts)
Finds a keyword in the current PvlObject, or deeper inside other PvlObjects and Pvlgroups within this...
Allows applications to translate simple text files.
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.
Class for storing Table blobs information.
This is free and unencumbered software released into the public domain.
const double His
Value for an Isis High Instrument Saturation pixel.
QString toString(bool boolToConvert)
Global function to convert a boolean to a string.
const double Hrs
Value for an Isis High Representation Saturation pixel.
int toInt(const QString &string)
Global function to convert from a string to an integer.
const double Lrs
Value for an Isis Low Representation Saturation pixel.
const double Lis
Value for an Isis Low Instrument Saturation pixel.
double toDouble(const QString &string)
Global function to convert from a string to a double.
Namespace for the standard library.