Commit 3785a649 authored by Ian Humphrey's avatar Ian Humphrey
Browse files

pixel2map will now allow band selection on FROM cube and FROMLIST cubes. Added...

pixel2map will now allow band selection on FROM cube and FROMLIST cubes. Added bandSelect test. Modified multpleInputCubes test. Fixes #4520.

git-svn-id: http://subversion.wr.usgs.gov/repos/prog/isis3/branches/ipce@7254 41f8697f-d340-4b68-9986-7bafba869bb8
parent 0a8a5852
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -55,7 +55,8 @@ void IsisMain() {

  FileList list;
  if (ui.GetString("FROMTYPE") == "FROM") {
    list.push_back(FileName(ui.GetFileName("FROM")));
    // GetAsString will capture the entire string, including attributes
    list.push_back(FileName(ui.GetAsString("FROM")));
  }
  else {
    list.read(ui.GetFileName("FROMLIST"));
@@ -301,7 +302,8 @@ void IsisMain() {
    ProcessByBrick processBrick;
    processBrick.Progress()->SetText("Working on file:  " + list[f].toString());
    processBrick.SetBrickSize(1, 1, bands);
    CubeAttributeInput atts0(list[f].toString());
    // Recall list[f] is a FileName, which stores the attributes
    CubeAttributeInput atts0(list[f]);
    icube = processBrick.SetInputCube(list[f].toString(), atts0, 0);
    g_incam = icube->camera();

+4 −0
Original line number Diff line number Diff line
@@ -227,6 +227,10 @@
      Added feature to allow user to use full exposure duration to get polygons corresponding to
      real FOV. Improved coding standards. Fixes #4476.
    </change>
    <change name="Ian Humphrey" date="2016-11-18">
      Previous pixel2map was ignoring cube attributes when storing the FROM parameter internally.
      Running pixel2map now allows band selection on the FROM cube and FROMLIST cubes. Fixes #4520.
    </change>
  </history>

  <groups>
+13 −0
Original line number Diff line number Diff line
# This tests that the band selection work properly for pixel2map.
# In this test, we will select band 1.
#
# @history 2016-11-18 Ian Humphrey - Original version. Adapated from #4520 user test plan.
#                         References #4520.
APPNAME = pixel2map

include $(ISISROOT)/make/isismake.tsts

commands:
	$(APPNAME) from=$(INPUT)/CM_1540484927_1_001.ir.cub+1 \
	  to=$(OUTPUT)/band1.cub \
  	  > /dev/null;
+17 −0
Original line number Diff line number Diff line
# This tests the fromlist capabilities of pixel2map.
# The first test ensures that the proper output mosaic is created.
# The send test ensures that band selection works within a fromlist, and that it creates the
#   expected output (output identical to band 2 of the first test's output).
#
# @history 2016-11-18 Ian Humphrey - Added documentation to Makefile. Added TEST 2.
#                         References #4520.
APPNAME = pixel2map

include $(ISISROOT)/make/isismake.tsts

commands:
	# TEST 1
	$(LS) $(INPUT)/*.cub > $(OUTPUT)/files.lis;
	$(APPNAME) fromtype=fromlist \
	           fromlist=$(OUTPUT)/files.lis \
	           to=$(OUTPUT)/combinedCubes.sinu.cub \
	           > /dev/null;
	$(RM) $(OUTPUT)/files.lis;
	# TEST 2
	# Test the fromlist with band selection (band 2).
	# Note the command below is adding +2 to each of the input cube listings, then redirecting. 
	$(LS) $(INPUT)/*.cub | xargs -i echo "{}+2" > $(OUTPUT)/files.lis;
	$(APPNAME) fromtype=fromlist \
	           fromlist=$(OUTPUT)/files.lis \
	           to=$(OUTPUT)/combinedCubesBand2.sinu.cub \
	           > /dev/null;
	$(RM) $(OUTPUT)/files.lis;