Unverified Commit fefd6993 authored by AustinSanders's avatar AustinSanders Committed by GitHub
Browse files

leisa2isis gtests (#4062)



* Initial leisa tests

* Converted leisa tests to gtest

* Added raw fits file

* fixed names

Co-authored-by: default avatarKelvin <kelvinrr@icloud.com>
parent a927eabf
Loading
Loading
Loading
Loading
+17 −6
Original line number Diff line number Diff line
@@ -40,6 +40,7 @@
#include "Pvl.h"
#include "PvlTokenizer.h"
#include "SpecialPixel.h"
#include "UserInterface.h"

#define EXPONENT_MASK ((char) 0x7F)

@@ -1263,7 +1264,7 @@ namespace Isis {


  /**
   * Create the output file. Note that all the appropiate calls to at least
   * Create the output file. Note that all the appropriate 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.
@@ -1282,6 +1283,16 @@ namespace Isis {
  }


  /**
   * Create the output file.
   *
  */
  Isis::Cube *ProcessImport::SetOutputCube(const QString &parameter, UserInterface &ui){
    CubeAttributeOutput &att = ui.GetOutputAttribute(parameter);
    SetAttributes(att);
    return Isis::Process::SetOutputCube(ui.GetFileName(parameter), att, p_ns, p_nl, p_nb);
  }

  /**
   * Create the output file. Note that all the appropiate calls to at least
   * SetDimensions should be invoked prior to calling this method.
+2 −0
Original line number Diff line number Diff line
@@ -32,6 +32,7 @@
#include "Process.h"
#include "PvlToPvlTranslationManager.h"
#include "SpecialPixel.h"
#include "UserInterface.h"

namespace Isis {
  /**
@@ -199,6 +200,7 @@ namespace Isis {

      using Isis::Process::SetOutputCube;  // make parent functions visable
      Isis::Cube *SetOutputCube(const QString &parameter);
      Isis::Cube *SetOutputCube(const QString &parameter, UserInterface &ui);
      virtual Isis::Cube *SetOutputCube(const QString &fname,
                                Isis::CubeAttributeOutput &att);

+2 −2
Original line number Diff line number Diff line
@@ -250,7 +250,7 @@ namespace Isis {
      PvlGroup extensionLabel = importFits.fitsImageLabel(5);
      importFits.SetOrganization(ProcessImport::BIL);
      importFits.setProcessFileStructure(5);
      Cube *output = importFits.SetOutputCube("ERRORMAP");
      Cube *output = importFits.SetOutputCube("ERRORMAP", ui);

      // Save the input FITS label in the Cube original labels
      Pvl origLabel;
@@ -269,7 +269,7 @@ namespace Isis {
      PvlGroup extensionLabel = importFits.fitsImageLabel(6);
      importFits.SetOrganization(ProcessImport::BIL);
      importFits.setProcessFileStructure(6);
      Cube *output = importFits.SetOutputCube("QUALITY");
      Cube *output = importFits.SetOutputCube("QUALITY", ui);

      // Save the input FITS label in the Cube original labels
      Pvl origLabel;
+0 −52
Original line number Diff line number Diff line
APPNAME = leisa2isis

include $(ISISROOT)/make/isismake.tsts

commands:
	# Test for existance of the MISSION keyword in the main FITS image label
	LC_CTYPE=C && LANG=C && $(SED) 's+MISSION = '"'"'New Horizons+MISSIOx = '"'"'New Horizons+' \
	    $(INPUT)/lsb_0034933739_0x53c_sci_1.fit > $(OUTPUT)/temp.fit
	if [ `$(APPNAME) \
	  from=$(OUTPUT)/temp.fit \
	  to=$(OUTPUT)/junk.cub \
	  >& $(OUTPUT)/temp.txt` ]; then \
	  true; \
	fi;
	$(SED) 's/\[.*\/\(temp.fit\)\]/[\1]/' < $(OUTPUT)/temp.txt > $(OUTPUT)/error_mission-key.txt;
	$(RM) $(OUTPUT)/temp.txt $(OUTPUT)/temp.fit;
	# Test for the value of the MISSION keyword in the main FITS image label
	LC_CTYPE=C && LANG=C && $(SED) 's+MISSION = '"'"'New Horizons+MISSION = '"'"'NewXHorizons+' \
	    $(INPUT)/lsb_0034933739_0x53c_sci_1.fit > $(OUTPUT)/temp.fit
	if [ `$(APPNAME) \
	  from=$(OUTPUT)/temp.fit \
	  to=$(OUTPUT)/junk.cub \
	  >& $(OUTPUT)/temp.txt` ]; then \
	  true; \
	fi;
	$(SED) 's/\[.*\/\(temp.fit\)\]/[\1]/' < $(OUTPUT)/temp.txt > $(OUTPUT)/error_mission-value.txt;
	$(RM) $(OUTPUT)/temp.txt $(OUTPUT)/temp.fit;
	# Test for the existance of the INSTR keyword in the main FITS image label
	LC_CTYPE=C && LANG=C && $(SED) 's+INSTRU  = '"'"'lei+INSTRz  = '"'"'lei+' \
	    $(INPUT)/lsb_0034933739_0x53c_sci_1.fit > $(OUTPUT)/temp.fit
	if [ `$(APPNAME) \
	  from=$(OUTPUT)/temp.fit \
	  to=$(OUTPUT)/junk.cub \
	  >& $(OUTPUT)/temp.txt` ]; then \
	  true; \
	fi;
	$(SED) 's/\[.*\/\(temp.fit\)\]/[\1]/' < $(OUTPUT)/temp.txt > $(OUTPUT)/error_instru-key.txt;
	$(RM) $(OUTPUT)/temp.txt $(OUTPUT)/temp.fit;
	# Test for the value of the INSTRU keyword in the main FITS image label
	LC_CTYPE=C && LANG=C && $(SED) 's+INSTRU  = '"'"'lei+INSTRU  = '"'"'leY+' \
	    $(INPUT)/lsb_0034933739_0x53c_sci_1.fit > $(OUTPUT)/temp.fit
	if [ `$(APPNAME) \
	  from=$(OUTPUT)/temp.fit \
	  to=$(OUTPUT)/junk.cub \
	  >& $(OUTPUT)/temp.txt` ]; then \
	  true; \
	fi;
	$(SED) 's/\[.*\/\(temp.fit\)\]/[\1]/' < $(OUTPUT)/temp.txt > $(OUTPUT)/error_instru-value.txt;
	$(RM) $(OUTPUT)/temp.txt $(OUTPUT)/temp.fit;


+0 −22
Original line number Diff line number Diff line
APPNAME = leisa2isis

include $(ISISROOT)/make/isismake.tsts

commands:
	$(APPNAME) from=$(INPUT)/lsb_0034933739_0x53c_sci_1.fit \
          to=$(OUTPUT)/lsb_0034933739_0x53c_sci_1_Truth.cub \
          > /dev/null;
	catlab from=$(OUTPUT)/lsb_0034933739_0x53c_sci_1_Truth.cub > \
	  $(OUTPUT)/lsb_0034933739_0x53c_sci_1_Truth.pvl;
	$(APPNAME) from=$(INPUT)/lsb_0034933739_0x53c_sci_1.fit \
	  to=$(OUTPUT)/lsb_0034933739_0x53c_sci_1_Truth.cub \
	  error=$(OUTPUT)/lsb_0034933739_0x53c_sci_1_Error.cub \
	  > /dev/null;
	catlab from=$(OUTPUT)/lsb_0034933739_0x53c_sci_1_Error.cub > \
	  $(OUTPUT)/lsb_0034933739_0x53c_sci_1_Error.pvl;
	$(APPNAME) from=$(INPUT)/lsb_0034933739_0x53c_sci_1.fit \
	  to=$(OUTPUT)/lsb_0034933739_0x53c_sci_1_Truth.cub \
	  quality=$(OUTPUT)/lsb_0034933739_0x53c_sci_1_Quality.cub\
	  > /dev/null;
	catlab from=$(OUTPUT)/lsb_0034933739_0x53c_sci_1_Quality.cub > \
	  $(OUTPUT)/lsb_0034933739_0x53c_sci_1_Quality.pvl;
 No newline at end of file
Loading