Unverified Commit 9484abae authored by Kristin's avatar Kristin Committed by GitHub
Browse files

Merge pull request #180 from kdl222/rdrgenProductId

Updated tgocassisrdrgen to check if a cube has a Mosaic group
parents 85153a2e 93eb506b
Loading
Loading
Loading
Loading
+11 −2
Original line number Diff line number Diff line
@@ -32,7 +32,17 @@ void IsisMain() {
  Cube *icube = process.SetInputCube("FROM");

  PvlObject *label= icube->label();
  PvlKeyword &instrument = label->findObject("IsisCube").findGroup("Instrument").findKeyword("InstrumentId");

  bool isMosaic;
  PvlKeyword instrument;
  if ( label->findObject("IsisCube").hasGroup("Instrument") ) {
    instrument = label->findObject("IsisCube").findGroup("Instrument").findKeyword("InstrumentId");
    isMosaic = false;
  }
  else if ( label->findObject("IsisCube").hasGroup("Mosaic") ) {
    instrument = label->findObject("IsisCube").findGroup("Mosaic").findKeyword("InstrumentId");
    isMosaic = true;
  }

  // Check if the cube is able to be translated into a CaSSIS xml file
  // This could very well be unnecessary
@@ -52,7 +62,6 @@ void IsisMain() {
  if ( ui.WasEntered("PRODUCTID") ) {
    productId.setValue( ui.GetString("PRODUCTID") );
    instrumentGroup.addKeyword(productId);

  }
  else {
    QString observationId = instrumentGroup.findKeyword("ObservationId")[0];
+27 −17
Original line number Diff line number Diff line
# Verify that we can export a non-projected and non-mosaiked cube as a TGO CaSSIS image.
# Test that we can override the product id with the PRODUCTID parameter.
#
# history 2018-05-18 Kaitlyn Lee - Changed input cube with an one that has the
# 				ObservationId. Added the removal of the modification_date and ISIS version.
# 				Added testing for PRODUCTID parameter.

APPNAME = tgocassisrdrgen

include $(ISISROOT)/make/isismake.tsts
@@ -7,16 +14,13 @@ commands:
	           to=$(OUTPUT)/CAS-MCO-2016-11-22T15.45.50.984-BLU-03000-B1.img \
		   > /dev/null;
			 
	# Reingest the PDS4 data
	tgocassis2isis from=$(OUTPUT)/CAS-MCO-2016-11-22T15.45.50.984-BLU-03000-B1.xml \
	# Reingest output and make sure the cubes are the same
	raw2isis from=$(OUTPUT)/CAS-MCO-2016-11-22T15.45.50.984-BLU-03000-B1.img \
					 to=$(OUTPUT)/CAS-MCO-2016-11-22T15.45.50.984-BLU-03000-B1.cub \
		 > /dev/null;

	# Compare the output cube from raw2isis to the original input cube to
	# ensure that they are identical
	cubediff from=$(INPUT)/CAS-MCO-2016-11-22T15.45.50.984-BLU-03000-B1.cub \
	         from2=$(OUTPUT)/CAS-MCO-2016-11-22T15.45.50.984-BLU-03000-B1.cub \
	         to=$(OUTPUT)/cubediffresults.txt \
					 SAMPLES=2048 \
					 LINES=252 \
					 BITTYPE=REAL \
					 BYTEORDER=LSB \
		 > /dev/null;

	$(SED) 's+\Product_Observational.*>+\Product_Observational>+' \
@@ -28,15 +32,18 @@ commands:
	$(SED) 's+\PEHK_HEADER.*>+\PEHK_HEADER>+' \
	       $(OUTPUT)/templabel2.txt \
	       > $(OUTPUT)/templabel3.txt;
	$(SED) 's+\Modification_Detail.*>+\Modification_Detail>+' \
	$(SED) 's+\modification_date.*>+\modification_date>+' \
	       $(OUTPUT)/templabel3.txt \
	       > $(OUTPUT)/templabel4.txt
	$(SED) 's+\ISIS version.*<+\ISIS version.<+' \
	       $(OUTPUT)/templabel4.txt \
	       > $(OUTPUT)/CAS-MCO-2016-11-22T15.45.50.984-BLU-03000-B1.xmlLabel.txt;


	$(RM) $(OUTPUT)/CAS-MCO-2016-11-22T15.45.50.984-BLU-03000-B1.xml \
	      $(OUTPUT)/templabel1.txt \
	      $(OUTPUT)/templabel2.txt \
	      $(OUTPUT)/templabel3.txt;
	      $(OUTPUT)/templabel3.txt \
				$(OUTPUT)/templabel4.txt;

	# Test PRODUCTID parameter with same input
	$(APPNAME) from=$(INPUT)/CAS-MCO-2016-11-22T15.45.50.984-BLU-03000-B1.cub \
@@ -53,12 +60,15 @@ commands:
	$(SED) 's+\PEHK_HEADER.*>+\PEHK_HEADER>+' \
	       $(OUTPUT)/templabel2.txt \
	       > $(OUTPUT)/templabel3.txt;
	$(SED) 's+\Modification_Detail.*>+\Modification_Detail>+' \
	$(SED) 's+\modification_date.*>+\modification_date>+' \
	       $(OUTPUT)/templabel3.txt \
	       > $(OUTPUT)/templabel4.txt
	$(SED) 's+\ISIS version.*<+\ISIS version.<+' \
	       $(OUTPUT)/templabel4.txt \
	       > $(OUTPUT)/CAS-MCO-2016-11-22T15.45.50.984-BLU-03000-B1_modifiedId.xmlLabel.txt;


	$(RM) $(OUTPUT)/CAS-MCO-2016-11-22T15.45.50.984-BLU-03000-B1_modifiedId.xml \
	      $(OUTPUT)/templabel1.txt \
	      $(OUTPUT)/templabel2.txt \
	      $(OUTPUT)/templabel3.txt;
	      $(OUTPUT)/templabel3.txt \
				$(OUTPUT)/templabel4.txt;