From d4153718596dc3b42b41c235e01211da124d5856 Mon Sep 17 00:00:00 2001 From: Adam Paquette Date: Thu, 28 Mar 2019 14:36:00 -0700 Subject: [PATCH 01/11] Allowed writting of residuals when value is zero to controlnet pvl --- .../objs/ControlNetVersioner/ControlNetVersioner.cpp | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/isis/src/control/objs/ControlNetVersioner/ControlNetVersioner.cpp b/isis/src/control/objs/ControlNetVersioner/ControlNetVersioner.cpp index 5ff748fcff..b71b779954 100644 --- a/isis/src/control/objs/ControlNetVersioner/ControlNetVersioner.cpp +++ b/isis/src/control/objs/ControlNetVersioner/ControlNetVersioner.cpp @@ -501,15 +501,13 @@ namespace Isis { "pixels"); } - if ( controlMeasure.GetSampleResidual() != Isis::Null - && controlMeasure.GetSampleResidual() != 0. ) { + if ( controlMeasure.GetSampleResidual() != Isis::Null ) { pvlMeasure += PvlKeyword("SampleResidual", toString(controlMeasure.GetSampleResidual()), "pixels"); } - if ( controlMeasure.GetLineResidual() != Isis::Null - && controlMeasure.GetLineResidual() != 0. ) { + if ( controlMeasure.GetLineResidual() != Isis::Null ) { pvlMeasure += PvlKeyword("LineResidual", toString(controlMeasure.GetLineResidual()), "pixels"); } @@ -1675,7 +1673,7 @@ namespace Isis { pointByteTotal += writeFirstPoint(&output); } - // // Insert header at the beginning of the file once writing is done. + // Insert header at the beginning of the file once writing is done. ControlNetFileHeaderV0005 protobufHeader; protobufHeader.set_networkid(m_header.networkID.toLatin1().data()); From 3a6975fb00e885525729d446ee1bb666fef64572 Mon Sep 17 00:00:00 2001 From: Adam Paquette Date: Thu, 28 Mar 2019 16:10:38 -0700 Subject: [PATCH 02/11] Updated ControlNetVersioner unit test --- .../ControlNetVersioner.truth | 72 +++++++++++-------- 1 file changed, 41 insertions(+), 31 deletions(-) diff --git a/isis/src/control/objs/ControlNetVersioner/ControlNetVersioner.truth b/isis/src/control/objs/ControlNetVersioner/ControlNetVersioner.truth index 6c6270e6fe..c62f45de02 100644 --- a/isis/src/control/objs/ControlNetVersioner/ControlNetVersioner.truth +++ b/isis/src/control/objs/ControlNetVersioner/ControlNetVersioner.truth @@ -36,21 +36,25 @@ Object = ControlNetwork End_Group Group = ControlMeasure - SerialNumber = M1 - MeasureType = Candidate - ChooserName = Unknown - DateTime = 2018-01-09 - Sample = 1.0 - Line = 1.0 + SerialNumber = M1 + MeasureType = Candidate + ChooserName = Unknown + DateTime = 2018-01-09 + Sample = 1.0 + Line = 1.0 + SampleResidual = 0.0 + LineResidual = 0.0 End_Group Group = ControlMeasure - SerialNumber = M2 - MeasureType = Candidate - ChooserName = Unknown - DateTime = 2018-01-09 - Sample = 1.0 - Line = 1.0 + SerialNumber = M2 + MeasureType = Candidate + ChooserName = Unknown + DateTime = 2018-01-09 + Sample = 1.0 + Line = 1.0 + SampleResidual = 0.0 + LineResidual = 0.0 End_Group End_Object End_Object @@ -80,31 +84,37 @@ Object = ControlNetwork DateTime = 2018-01-19 Group = ControlMeasure - SerialNumber = Cassini-Huygens/ISSNA/1/1467436709.122 - MeasureType = RegisteredPixel - ChooserName = Unknown - DateTime = 2018-01-19 - Sample = 893.0 - Line = 616.0 + SerialNumber = Cassini-Huygens/ISSNA/1/1467436709.122 + MeasureType = RegisteredPixel + ChooserName = Unknown + DateTime = 2018-01-19 + Sample = 893.0 + Line = 616.0 + SampleResidual = 0.0 + LineResidual = 0.0 End_Group Group = ControlMeasure - SerialNumber = Cassini-Huygens/ISSNA/1/1467443189.122 - MeasureType = RegisteredPixel - ChooserName = Unknown - DateTime = 2018-01-19 - Sample = 799.25 - Line = 701.21 - Reference = True + SerialNumber = Cassini-Huygens/ISSNA/1/1467443189.122 + MeasureType = RegisteredPixel + ChooserName = Unknown + DateTime = 2018-01-19 + Sample = 799.25 + Line = 701.21 + SampleResidual = 0.0 + LineResidual = 0.0 + Reference = True End_Group Group = ControlMeasure - SerialNumber = Cassini-Huygens/ISSNA/1/1467454012.125 - MeasureType = RegisteredPixel - ChooserName = Unknown - DateTime = 2018-01-19 - Sample = 569.01 - Line = 807.23 + SerialNumber = Cassini-Huygens/ISSNA/1/1467454012.125 + MeasureType = RegisteredPixel + ChooserName = Unknown + DateTime = 2018-01-19 + Sample = 569.01 + Line = 807.23 + SampleResidual = 0.0 + LineResidual = 0.0 End_Group End_Object End_Object From da361fcd796d1afaecf9d98d1c40fbe0b0c2ccf4 Mon Sep 17 00:00:00 2001 From: Adam Paquette Date: Fri, 12 Apr 2019 16:44:45 -0700 Subject: [PATCH 03/11] Fixed pvl labels original pvl labels not being written to the resulting cube. --- .../base/objs/ProcessImport/ProcessImport.cpp | 27 ++++++++++++++----- .../base/objs/ProcessImport/ProcessImport.h | 1 + isis/src/galileo/apps/gllssi2isis/main.cpp | 17 ++++-------- 3 files changed, 26 insertions(+), 19 deletions(-) diff --git a/isis/src/base/objs/ProcessImport/ProcessImport.cpp b/isis/src/base/objs/ProcessImport/ProcessImport.cpp index b1bf815fb5..5684c460b9 100644 --- a/isis/src/base/objs/ProcessImport/ProcessImport.cpp +++ b/isis/src/base/objs/ProcessImport/ProcessImport.cpp @@ -1199,7 +1199,6 @@ namespace Isis { } } - /** * Create the output file. Note that all the appropiate calls to at least * SetDimensions and SetPixelType should be made prior to calling this method. @@ -1210,10 +1209,7 @@ namespace Isis { * * @throws Isis::iException::Message "Unsupported pixel type." */ - Isis::Cube *ProcessImport::SetOutputCube(const QString ¶meter) { - CubeAttributeOutput &att = - Application::GetUserInterface().GetOutputAttribute(parameter); - + Isis::Cube *ProcessImport::SetOutputCube(const QString ¶meter, CubeAttributeOutput &att, const int ns, const int nl, const int nb) { if (att.propagateMinimumMaximum()) { double min, max; if ((p_pixelType == Isis::Double) || @@ -1264,7 +1260,24 @@ namespace Isis { } } - return Process::SetOutputCube(Application::GetUserInterface().GetFileName(parameter), att, p_ns, p_nl, p_nb); + return Process::SetOutputCube(Application::GetUserInterface().GetFileName(parameter), att, ns, nl, nb); + } + + + /** + * Create the output file. Note that all the appropiate calls to at least + * SetDimensions and SetPixelType should be made prior to calling this method. + * + * @param parameter The parameter name that holds the output file name. + * + * @return @b Isis::Cube Output cube. + * + * @throws Isis::iException::Message "Unsupported pixel type." + */ + Isis::Cube *ProcessImport::SetOutputCube(const QString ¶meter) { + CubeAttributeOutput &att = + Application::GetUserInterface().GetOutputAttribute(parameter); + return ProcessImport::SetOutputCube(parameter, att, p_ns, p_nl, p_nb); } @@ -1977,7 +1990,7 @@ namespace Isis { break; case Isis::SignedInteger: (*out)[samp] = (double)swapper.Int(&in[bufferIndex]); - break; + break; case Isis::UnsignedInteger: (*out)[samp] = (double)swapper.Uint32_t(&in[bufferIndex]); break; diff --git a/isis/src/base/objs/ProcessImport/ProcessImport.h b/isis/src/base/objs/ProcessImport/ProcessImport.h index ca9c9d8b86..ef1c1647e6 100644 --- a/isis/src/base/objs/ProcessImport/ProcessImport.h +++ b/isis/src/base/objs/ProcessImport/ProcessImport.h @@ -199,6 +199,7 @@ namespace Isis { using Isis::Process::SetOutputCube; // make parent functions visable Isis::Cube *SetOutputCube(const QString ¶meter); + Isis::Cube *SetOutputCube(const QString ¶meter, CubeAttributeOutput &att, const int ns, const int nl, const int nb); virtual Isis::Cube *SetOutputCube(const QString &fname, Isis::CubeAttributeOutput &att); diff --git a/isis/src/galileo/apps/gllssi2isis/main.cpp b/isis/src/galileo/apps/gllssi2isis/main.cpp index a0dfea9f5a..15b815790a 100644 --- a/isis/src/galileo/apps/gllssi2isis/main.cpp +++ b/isis/src/galileo/apps/gllssi2isis/main.cpp @@ -28,7 +28,6 @@ void translateLabels(Pvl &pdsLabel, Cube *ocube); void fixPvl(QString fileName); void IsisMain() { - //initialize globals summed = false; summedOutput = NULL; @@ -110,22 +109,16 @@ void IsisMain() { p.StartProcess(); } else { - summedOutput = new Cube(); - summedOutput->setDimensions(p.Samples() / 2, p.Lines() / 2, p.Bands()); - summedOutput->setPixelType(p.PixelType()); - summedOutput->create(ui.GetFileName("TO")); - p.StartProcess(translateData); + Isis::CubeAttributeOutput &att = Application::GetUserInterface().GetOutputAttribute("TO"); + att.setPixelType(p.PixelType()); + summedOutput = p.SetOutputCube("TO", att, p.Samples() / 2, p.Lines() / 2, p.Bands()); ocube = summedOutput; + p.StartProcess(translateData); } translateLabels(pdsLabel, ocube); p.EndProcess(); - if (summed) { - summedOutput->close(); - delete summedOutput; - } - return; } @@ -182,7 +175,7 @@ void fixPvl(QString fileName){ -void translateData(Buffer &inData) { +void translateData(Isis::Buffer &inData) { summedOutput->write(inData); } From fd7ab5388e6c3625f10a851f13ba7f236e4e74e1 Mon Sep 17 00:00:00 2001 From: Adam Paquette Date: Mon, 15 Apr 2019 11:16:59 -0700 Subject: [PATCH 04/11] Updated docstrings and history for updated methods --- .../base/objs/ProcessImport/ProcessImport.cpp | 17 +++++++++++++---- .../src/base/objs/ProcessImport/ProcessImport.h | 6 ++++-- 2 files changed, 17 insertions(+), 6 deletions(-) diff --git a/isis/src/base/objs/ProcessImport/ProcessImport.cpp b/isis/src/base/objs/ProcessImport/ProcessImport.cpp index 5684c460b9..07adff91eb 100644 --- a/isis/src/base/objs/ProcessImport/ProcessImport.cpp +++ b/isis/src/base/objs/ProcessImport/ProcessImport.cpp @@ -1200,11 +1200,20 @@ namespace Isis { } /** - * Create the output file. Note that all the appropiate calls to at least - * SetDimensions and SetPixelType should be made prior to calling this method. + * Create the output file. This method will use the cube attribute object + * passed in to populate the pixel type and pass the desired samples, lines, + * and band numbers into the process setOutputCube method. * * @param parameter The parameter name that holds the output file name. * + * @param att The CubeAttributeOutput object with defined attributes + * + * @param ns The number of samples in the output cube + * + * @param nl The number of lines in the output cube + * + * @param nb The number of bands in the output cube + * * @return @b Isis::Cube Output cube. * * @throws Isis::iException::Message "Unsupported pixel type." @@ -1271,8 +1280,6 @@ namespace Isis { * @param parameter The parameter name that holds the output file name. * * @return @b Isis::Cube Output cube. - * - * @throws Isis::iException::Message "Unsupported pixel type." */ Isis::Cube *ProcessImport::SetOutputCube(const QString ¶meter) { CubeAttributeOutput &att = @@ -1291,6 +1298,7 @@ namespace Isis { * output cube. * * @return @b Isis::Cube Output cube. + * * @throws Isis::iException::Message "File is not in a supported * organization." */ @@ -1328,6 +1336,7 @@ namespace Isis { * @param funct Method that accepts Isis::Buffer as an input * parameter, processes the image, and has no * return value. + * * @throws Isis::iException::Message "File is not a supported * organization." */ diff --git a/isis/src/base/objs/ProcessImport/ProcessImport.h b/isis/src/base/objs/ProcessImport/ProcessImport.h index ef1c1647e6..9810aa4310 100644 --- a/isis/src/base/objs/ProcessImport/ProcessImport.h +++ b/isis/src/base/objs/ProcessImport/ProcessImport.h @@ -163,9 +163,11 @@ namespace Isis { * was made to accomodate Rosetta VIRTIS-m calibrated data files and * has no impact on other supported BIP files. * Fixes #5398. - * @history 208-07-19 Tyler Wilson - Added support for 4-byte UnsignedInteger special pixel + * @history 2018-07-19 Tyler Wilson - Added support for 4-byte UnsignedInteger special pixel * values. - * + * @history 2019-04-15 Adam Paquette - Exposed the ns, nl, nb (number of samples, lines, and bands) + * for the setOutputCube function. Updated existing setOutputCube methods + * accordingly. */ class ProcessImport : public Isis::Process { public: From cc1ba4d2f1ed168db75cd5f1f4390169c8d65430 Mon Sep 17 00:00:00 2001 From: Adam Paquette Date: Mon, 15 Apr 2019 15:01:39 -0700 Subject: [PATCH 05/11] Removed the need to set the output cube pixel type --- isis/src/base/objs/ProcessImport/ProcessImport.cpp | 13 ++++++------- isis/src/base/objs/ProcessImport/ProcessImport.h | 2 +- isis/src/galileo/apps/gllssi2isis/main.cpp | 7 +++---- 3 files changed, 10 insertions(+), 12 deletions(-) diff --git a/isis/src/base/objs/ProcessImport/ProcessImport.cpp b/isis/src/base/objs/ProcessImport/ProcessImport.cpp index 07adff91eb..a3feb8aefe 100644 --- a/isis/src/base/objs/ProcessImport/ProcessImport.cpp +++ b/isis/src/base/objs/ProcessImport/ProcessImport.cpp @@ -1206,8 +1206,6 @@ namespace Isis { * * @param parameter The parameter name that holds the output file name. * - * @param att The CubeAttributeOutput object with defined attributes - * * @param ns The number of samples in the output cube * * @param nl The number of lines in the output cube @@ -1218,7 +1216,10 @@ namespace Isis { * * @throws Isis::iException::Message "Unsupported pixel type." */ - Isis::Cube *ProcessImport::SetOutputCube(const QString ¶meter, CubeAttributeOutput &att, const int ns, const int nl, const int nb) { + Isis::Cube *ProcessImport::SetOutputCube(const QString ¶meter, const int ns, const int nl, const int nb) { + FileName fname = Application::GetUserInterface().GetFileName(parameter); + CubeAttributeOutput att = + Application::GetUserInterface().GetOutputAttribute(parameter); if (att.propagateMinimumMaximum()) { double min, max; if ((p_pixelType == Isis::Double) || @@ -1269,7 +1270,7 @@ namespace Isis { } } - return Process::SetOutputCube(Application::GetUserInterface().GetFileName(parameter), att, ns, nl, nb); + return Process::SetOutputCube(fname.expanded(), att, ns, nl, nb); } @@ -1282,9 +1283,7 @@ namespace Isis { * @return @b Isis::Cube Output cube. */ Isis::Cube *ProcessImport::SetOutputCube(const QString ¶meter) { - CubeAttributeOutput &att = - Application::GetUserInterface().GetOutputAttribute(parameter); - return ProcessImport::SetOutputCube(parameter, att, p_ns, p_nl, p_nb); + return ProcessImport::SetOutputCube(parameter, p_ns, p_nl, p_nb); } diff --git a/isis/src/base/objs/ProcessImport/ProcessImport.h b/isis/src/base/objs/ProcessImport/ProcessImport.h index 9810aa4310..f04083a268 100644 --- a/isis/src/base/objs/ProcessImport/ProcessImport.h +++ b/isis/src/base/objs/ProcessImport/ProcessImport.h @@ -201,7 +201,7 @@ namespace Isis { using Isis::Process::SetOutputCube; // make parent functions visable Isis::Cube *SetOutputCube(const QString ¶meter); - Isis::Cube *SetOutputCube(const QString ¶meter, CubeAttributeOutput &att, const int ns, const int nl, const int nb); + Isis::Cube *SetOutputCube(const QString ¶meter, const int ns, const int nl, const int nb); virtual Isis::Cube *SetOutputCube(const QString &fname, Isis::CubeAttributeOutput &att); diff --git a/isis/src/galileo/apps/gllssi2isis/main.cpp b/isis/src/galileo/apps/gllssi2isis/main.cpp index 15b815790a..a565121932 100644 --- a/isis/src/galileo/apps/gllssi2isis/main.cpp +++ b/isis/src/galileo/apps/gllssi2isis/main.cpp @@ -35,7 +35,7 @@ void IsisMain() { ProcessImportPds p; UserInterface &ui = Application::GetUserInterface(); FileName inFile = ui.GetFileName("FROM"); - FileName out = ui.GetFileName("TO"); + FileName outFile = ui.GetFileName("TO"); @@ -109,9 +109,8 @@ void IsisMain() { p.StartProcess(); } else { - Isis::CubeAttributeOutput &att = Application::GetUserInterface().GetOutputAttribute("TO"); - att.setPixelType(p.PixelType()); - summedOutput = p.SetOutputCube("TO", att, p.Samples() / 2, p.Lines() / 2, p.Bands()); + // CubeAttributeOutput att = ui.GetOutputAttribute("TO"); + summedOutput = p.SetOutputCube("TO", p.Samples() / 2, p.Lines() / 2, p.Bands()); ocube = summedOutput; p.StartProcess(translateData); } From a265340c161b8375e408b406d4721ac810022180 Mon Sep 17 00:00:00 2001 From: Adam Paquette Date: Mon, 15 Apr 2019 15:13:44 -0700 Subject: [PATCH 06/11] Reverted proceeimport changes --- .../base/objs/ProcessImport/ProcessImport.cpp | 37 ++++--------------- .../base/objs/ProcessImport/ProcessImport.h | 7 +--- 2 files changed, 10 insertions(+), 34 deletions(-) diff --git a/isis/src/base/objs/ProcessImport/ProcessImport.cpp b/isis/src/base/objs/ProcessImport/ProcessImport.cpp index a3feb8aefe..b1bf815fb5 100644 --- a/isis/src/base/objs/ProcessImport/ProcessImport.cpp +++ b/isis/src/base/objs/ProcessImport/ProcessImport.cpp @@ -1199,27 +1199,21 @@ namespace Isis { } } + /** - * Create the output file. This method will use the cube attribute object - * passed in to populate the pixel type and pass the desired samples, lines, - * and band numbers into the process setOutputCube method. + * Create the output file. Note that all the appropiate calls to at least + * SetDimensions and SetPixelType should be made prior to calling this method. * * @param parameter The parameter name that holds the output file name. * - * @param ns The number of samples in the output cube - * - * @param nl The number of lines in the output cube - * - * @param nb The number of bands in the output cube - * * @return @b Isis::Cube Output cube. * * @throws Isis::iException::Message "Unsupported pixel type." */ - Isis::Cube *ProcessImport::SetOutputCube(const QString ¶meter, const int ns, const int nl, const int nb) { - FileName fname = Application::GetUserInterface().GetFileName(parameter); - CubeAttributeOutput att = + Isis::Cube *ProcessImport::SetOutputCube(const QString ¶meter) { + CubeAttributeOutput &att = Application::GetUserInterface().GetOutputAttribute(parameter); + if (att.propagateMinimumMaximum()) { double min, max; if ((p_pixelType == Isis::Double) || @@ -1270,20 +1264,7 @@ namespace Isis { } } - return Process::SetOutputCube(fname.expanded(), att, ns, nl, nb); - } - - - /** - * Create the output file. Note that all the appropiate calls to at least - * SetDimensions and SetPixelType should be made prior to calling this method. - * - * @param parameter The parameter name that holds the output file name. - * - * @return @b Isis::Cube Output cube. - */ - Isis::Cube *ProcessImport::SetOutputCube(const QString ¶meter) { - return ProcessImport::SetOutputCube(parameter, p_ns, p_nl, p_nb); + return Process::SetOutputCube(Application::GetUserInterface().GetFileName(parameter), att, p_ns, p_nl, p_nb); } @@ -1297,7 +1278,6 @@ namespace Isis { * output cube. * * @return @b Isis::Cube Output cube. - * * @throws Isis::iException::Message "File is not in a supported * organization." */ @@ -1335,7 +1315,6 @@ namespace Isis { * @param funct Method that accepts Isis::Buffer as an input * parameter, processes the image, and has no * return value. - * * @throws Isis::iException::Message "File is not a supported * organization." */ @@ -1998,7 +1977,7 @@ namespace Isis { break; case Isis::SignedInteger: (*out)[samp] = (double)swapper.Int(&in[bufferIndex]); - break; + break; case Isis::UnsignedInteger: (*out)[samp] = (double)swapper.Uint32_t(&in[bufferIndex]); break; diff --git a/isis/src/base/objs/ProcessImport/ProcessImport.h b/isis/src/base/objs/ProcessImport/ProcessImport.h index f04083a268..ca9c9d8b86 100644 --- a/isis/src/base/objs/ProcessImport/ProcessImport.h +++ b/isis/src/base/objs/ProcessImport/ProcessImport.h @@ -163,11 +163,9 @@ namespace Isis { * was made to accomodate Rosetta VIRTIS-m calibrated data files and * has no impact on other supported BIP files. * Fixes #5398. - * @history 2018-07-19 Tyler Wilson - Added support for 4-byte UnsignedInteger special pixel + * @history 208-07-19 Tyler Wilson - Added support for 4-byte UnsignedInteger special pixel * values. - * @history 2019-04-15 Adam Paquette - Exposed the ns, nl, nb (number of samples, lines, and bands) - * for the setOutputCube function. Updated existing setOutputCube methods - * accordingly. + * */ class ProcessImport : public Isis::Process { public: @@ -201,7 +199,6 @@ namespace Isis { using Isis::Process::SetOutputCube; // make parent functions visable Isis::Cube *SetOutputCube(const QString ¶meter); - Isis::Cube *SetOutputCube(const QString ¶meter, const int ns, const int nl, const int nb); virtual Isis::Cube *SetOutputCube(const QString &fname, Isis::CubeAttributeOutput &att); From 415e661a35cb085fa494d28cc7cfa9cc380327ea Mon Sep 17 00:00:00 2001 From: Adam Paquette Date: Mon, 15 Apr 2019 15:14:05 -0700 Subject: [PATCH 07/11] Set the dimensions in the process before processing --- isis/src/galileo/apps/gllssi2isis/main.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/isis/src/galileo/apps/gllssi2isis/main.cpp b/isis/src/galileo/apps/gllssi2isis/main.cpp index a565121932..b2b21eb078 100644 --- a/isis/src/galileo/apps/gllssi2isis/main.cpp +++ b/isis/src/galileo/apps/gllssi2isis/main.cpp @@ -109,8 +109,8 @@ void IsisMain() { p.StartProcess(); } else { - // CubeAttributeOutput att = ui.GetOutputAttribute("TO"); - summedOutput = p.SetOutputCube("TO", p.Samples() / 2, p.Lines() / 2, p.Bands()); + p.SetDimensions(p.Samples() / 2, p.Lines() / 2, p.Bands()); + summedOutput = p.SetOutputCube("TO"); ocube = summedOutput; p.StartProcess(translateData); } From 3be607366ad61c7b99dd4d858ecf96c6509c20c6 Mon Sep 17 00:00:00 2001 From: Adam Paquette Date: Mon, 15 Apr 2019 15:24:08 -0700 Subject: [PATCH 08/11] Added missing 1 in a history record --- isis/src/base/objs/ProcessImport/ProcessImport.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/isis/src/base/objs/ProcessImport/ProcessImport.h b/isis/src/base/objs/ProcessImport/ProcessImport.h index ca9c9d8b86..f3f3558220 100644 --- a/isis/src/base/objs/ProcessImport/ProcessImport.h +++ b/isis/src/base/objs/ProcessImport/ProcessImport.h @@ -163,7 +163,7 @@ namespace Isis { * was made to accomodate Rosetta VIRTIS-m calibrated data files and * has no impact on other supported BIP files. * Fixes #5398. - * @history 208-07-19 Tyler Wilson - Added support for 4-byte UnsignedInteger special pixel + * @history 2018-07-19 Tyler Wilson - Added support for 4-byte UnsignedInteger special pixel * values. * */ From d64811363a538748c9cd8d375bd7bedbf91529b5 Mon Sep 17 00:00:00 2001 From: Adam Paquette Date: Mon, 15 Apr 2019 18:20:35 -0700 Subject: [PATCH 09/11] Reverted and applied a more appropriate fix --- isis/src/galileo/apps/gllssi2isis/main.cpp | 54 +++++++++------------- 1 file changed, 21 insertions(+), 33 deletions(-) diff --git a/isis/src/galileo/apps/gllssi2isis/main.cpp b/isis/src/galileo/apps/gllssi2isis/main.cpp index b2b21eb078..6377f39945 100644 --- a/isis/src/galileo/apps/gllssi2isis/main.cpp +++ b/isis/src/galileo/apps/gllssi2isis/main.cpp @@ -5,6 +5,7 @@ #include "IException.h" #include "iTime.h" #include "ProcessImportPds.h" +#include "OriginalLabel.h" #include "UserInterface.h" #include @@ -14,9 +15,6 @@ #include - - - using namespace std; using namespace Isis; bool summed; @@ -37,15 +35,10 @@ void IsisMain() { FileName inFile = ui.GetFileName("FROM"); FileName outFile = ui.GetFileName("TO"); - - + // Apply a fix to the gallileo pds labels so they can be read fixPvl(inFile.toString()); - - - // Make sure it is a Galileo SSI image - Pvl lab(inFile.expanded()); //Checks if in file is rdr @@ -101,28 +94,34 @@ void IsisMain() { Pvl pdsLabel; p.SetPdsFile(inFile.expanded(), "", pdsLabel); - //Set up the output file - Cube *ocube; - + // If summed handle the image similarly to pds2isis + // with an extra translation step if (!summed) { - ocube = p.SetOutputCube("TO"); + Cube *ocube = p.SetOutputCube("TO"); p.StartProcess(); + translateLabels(pdsLabel, ocube); + p.EndProcess(); } else { - p.SetDimensions(p.Samples() / 2, p.Lines() / 2, p.Bands()); - summedOutput = p.SetOutputCube("TO"); - ocube = summedOutput; - p.StartProcess(translateData); - } + // Otherwise the dimensions of the cube need to be cut in half before + // processsing. Since we didn't set the output cube we need to take care + // of writting the original label ourselves + summedOutput = new Cube(); + summedOutput->setDimensions(p.Samples() / 2, p.Lines() / 2, p.Bands()); + summedOutput->setPixelType(p.PixelType()); + summedOutput->create(ui.GetFileName("TO")); - translateLabels(pdsLabel, ocube); - p.EndProcess(); + p.StartProcess(translateData); + translateLabels(pdsLabel, summedOutput); + OriginalLabel ol(Pvl(inFile.expanded())); + summedOutput->write(ol); + summedOutput->close(); + delete summedOutput; + } return; } - - /** * This fixes a problem with some of the Pvl files where a comment * was left open. If the file has this error, the comment is closed @@ -133,9 +132,6 @@ void IsisMain() { * being checked * */ - - - void fixPvl(QString fileName){ QFile pvlFile; @@ -166,14 +162,6 @@ void fixPvl(QString fileName){ } - - - - - - - - void translateData(Isis::Buffer &inData) { summedOutput->write(inData); } From 7c7a93f90a8d6995025036a01214b4bfe9e73752 Mon Sep 17 00:00:00 2001 From: Adam Paquette Date: Tue, 16 Apr 2019 10:53:57 -0700 Subject: [PATCH 10/11] Used outfile obtained at the beginning of the program --- isis/src/galileo/apps/gllssi2isis/main.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/isis/src/galileo/apps/gllssi2isis/main.cpp b/isis/src/galileo/apps/gllssi2isis/main.cpp index 6377f39945..a812d041e8 100644 --- a/isis/src/galileo/apps/gllssi2isis/main.cpp +++ b/isis/src/galileo/apps/gllssi2isis/main.cpp @@ -109,7 +109,7 @@ void IsisMain() { summedOutput = new Cube(); summedOutput->setDimensions(p.Samples() / 2, p.Lines() / 2, p.Bands()); summedOutput->setPixelType(p.PixelType()); - summedOutput->create(ui.GetFileName("TO")); + summedOutput->create(outFile.expanded()); p.StartProcess(translateData); translateLabels(pdsLabel, summedOutput); From a6ea2c502c81c546108e477ffeab6e153463919e Mon Sep 17 00:00:00 2001 From: Adam Paquette Date: Tue, 16 Apr 2019 11:25:37 -0700 Subject: [PATCH 11/11] Added history comment to app xml --- .../galileo/apps/gllssi2isis/gllssi2isis.xml | 50 ++++++++++--------- 1 file changed, 27 insertions(+), 23 deletions(-) diff --git a/isis/src/galileo/apps/gllssi2isis/gllssi2isis.xml b/isis/src/galileo/apps/gllssi2isis/gllssi2isis.xml index 6fcebf37c2..1870e30690 100644 --- a/isis/src/galileo/apps/gllssi2isis/gllssi2isis.xml +++ b/isis/src/galileo/apps/gllssi2isis/gllssi2isis.xml @@ -8,19 +8,19 @@ Converts a PDS formatted Galileo solid state imager (SSI) image EDR - into an Isis Cube. The required instrument labels will be propagated - into the instrument group. The user must choose an input image label, - output cube name, and frame mode, or summing mode. Galileo SSI images have - a summing mode of FULL (800 x 800 pixels) or SUMMED (400 x 400 pixels). + into an Isis Cube. The required instrument labels will be propagated + into the instrument group. The user must choose an input image label, + output cube name, and frame mode, or summing mode. Galileo SSI images have + a summing mode of FULL (800 x 800 pixels) or SUMMED (400 x 400 pixels).

- Note: For the I24 encounter (found in volume go_0022), - many Galileo SSI images of Io were originally "garbled". These images - were reconstructed and released with the filename ####s where ####r is the - name of the original garbled file and #### is the last four digits of the - SPACECRAFT_CLOCK_START_COUNT. These images will have Most of the original - images were 400 x 400 (i.e. SUMMED). However, the reconstructed files are - 800 x 800 and must be imported as FULL to get the entire image. If the - user imports a reconstructed image with FRAMEMODE = AUTO, it will be + Note: For the I24 encounter (found in volume go_0022), + many Galileo SSI images of Io were originally "garbled". These images + were reconstructed and released with the filename ####s where ####r is the + name of the original garbled file and #### is the last four digits of the + SPACECRAFT_CLOCK_START_COUNT. These images will have Most of the original + images were 400 x 400 (i.e. SUMMED). However, the reconstructed files are + 800 x 800 and must be imported as FULL to get the entire image. If the + user imports a reconstructed image with FRAMEMODE = AUTO, it will be treated as a FULL image, even if the original was SUMMED.

@@ -33,15 +33,15 @@ Converted to Isis 3.0 - Added Summing Keyword. Moved most hardcoded translations into a - translation table. Modified tests to check the lables. Removed ImageID + Added Summing Keyword. Moved most hardcoded translations into a + translation table. Modified tests to check the lables. Removed ImageID keyword. Removed the hard coded Instrument Mode ID keyword translation. - Added summing options. Output summed images will now only be a quarter of + Added summing options. Output summed images will now only be a quarter of the size for calibration (the upper-left data in the input is preserved). @@ -52,7 +52,7 @@ Added valid DATA_SET_ID value for reconstructed images (i.e. value - contains "SSI-4-REDR-V1.0"). Modified code to set as FULL summing + contains "SSI-4-REDR-V1.0"). Modified code to set as FULL summing mode if FRAMEMODE=AUTO and the image is reconstructed. @@ -64,6 +64,10 @@ Changed documentation to have the correct link to the Planetary Science Data Dictionary Document. Fixes #3867 + + Fixed original label not being written to cubes ingested using the summed + option. Fixes #3207 + @@ -129,7 +133,7 @@ string Summing mode of the input image - Summing mode of the input image. The user + Summing mode of the input image. The user may specify the summing mode or choose to allow the program to determine this. @@ -138,15 +142,15 @@ @@ -182,8 +186,8 @@ Example GUI - Screenshot of GUI with parameters filled in to perform the - gllssi2isis application. Input label and output cubes are always + Screenshot of GUI with parameters filled in to perform the + gllssi2isis application. Input label and output cubes are always required. The FRAMEMODE radio button AUTO is chosen as default. @@ -214,7 +218,7 @@ TO - +