Project

General

Profile

Bug #5261

Improve error message in ProcessImportPds

Added by Makayla Shepherd 4 months ago. Updated 4 months ago.

Status:
Acknowledged
Priority:
Normal
Assignee:
-
Category:
API
Target version:
-
Impact:
Software Version:
Test Reviewer:

Description

If you are trying to import a .lbl and you try to set the output cube before you set up the pds file:

Example of code to produce the failure:
ProcessImportPds p;
Pvl mainLabel;
UserInterface &ui = Application::GetUserInterface();

QString mainImage = ui.GetFileName("FROM");
QString imageFile("");

Cube *ocube = p.SetOutputCube("TO");
p.SetPdsFile(mainImage, imageFile, mainLabel);

p.StartProcess();
p.EndProcess();

This produces:
Object = eisnac2isis
IsisVersion = "3.5.2.0 beta | 2017-11-04"
ProgramVersion = 2017-07-07
ProgramPath = /scratch/isis3_private/isis/src/clipper/apps/eisnac2isis
ExecutionDateTime = 2017-12-18T14:07:32
HostName = dugong
UserName = mshepherd
Description = "Import New Horizons LORRI files into ISIS format"

Group = UserParameters
FROM = eisnactest1.lbl
FROM2 = eisnactest1.img
TO = DELETEME
End_Group

Group = Error
Program = ./eisnac2isis
Class = "PROGRAMMER ERROR"
Code = 3
Message = "Unsupported pixel type [None]"
File = ProcessImport.cpp
Line = 1244
End_Group
End_Object
End

The problem with the code above is that: Cube *ocube = p.SetOutputCube("TO"); comes before p.SetPdsFile(mainImage, imageFile, mainLabel);

SetPdsFile does a lot of initialization and therefore has to come before SetOutputCube. The error message needs to be more descriptive.

History

#1 Updated by Tammy Becker 4 months ago

  • Status changed from New to Acknowledged

Also available in: Atom PDF