Unverified Commit b59f3b24 authored by acpaquette's avatar acpaquette Committed by GitHub
Browse files

Fixes ddd2isis to support updated uvflat files (#3719)

* Fixes ddd2isis to support updated uvflat files

* Added history comment
parent 3eec82d1
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -41,6 +41,10 @@
      bands. Removed the internal default of the output parameter set to None so
      that an output file is now requried. Fixes #703.
    </change>
    <change name="Adam Paquette" date="2020-02-28">
      Updated the dataTypes QMap with a new mapping (32, 4) to handle ingesting
      the updated uvflat files from malin. Fixes #3715.
    </change>
  </history>

  <category>
+7 −0
Original line number Diff line number Diff line
@@ -100,6 +100,7 @@ void IsisMain() {
  dataTypes.insert(1450903360, 8);
  dataTypes.insert(8, 1);
  dataTypes.insert(16, 2);
  dataTypes.insert(32, 4);
  dataTypes.insert(48, 2);

  // Read bytes 16-19 to get the bit type
@@ -130,6 +131,12 @@ void IsisMain() {
     nOffset = 1024;
  }

  if (dataTypeBytes == 0) {
    string msg = "The value totalBandBits [" + to_string(totalBandBits) + "] does not map " +
                  "to any byte size in the dataTypes table.";
    throw IException(IException::Programmer, msg, _FILEINFO_);
  }

  fin.close();

  PvlGroup results("FileInfo");
+24 −0
Original line number Diff line number Diff line
APPNAME = ddd2isis

include $(ISISROOT)/make/isismake.tsts

commands:
	# TEST: Throws an error when trying to open the file
	if [ `$(APPNAME) \
                FROM=$(INPUT)/bad_flat.ddd \
                TO=$(OUTPUT)/bad_flat.cub \
                2> $(OUTPUT)/temp.txt > /dev/null` ]; \
                then true; \
                fi;
	
	# TEST: Throws an error when trying to read from a cub instead of ddd
	if [ `$(APPNAME) \
                FROM=$(INPUT)/bad_flat.cub \
                TO=$(OUTPUT)/bad_flat.cub \
                2>> $(OUTPUT)/temp.txt > /dev/null` ]; \
                then true; \
                fi;

        # Removes input file path up until input
	$(SED) 's+\[.*/input+[input+' $(OUTPUT)/temp.txt > $(OUTPUT)/errorTruth.txt;
	$(RM) $(OUTPUT)/temp.txt