Commit 872a9bbd authored by Kris Becker's avatar Kris Becker
Browse files

Added subimage support for amica2isis so that the AMICA camera model works...

Added subimage support for amica2isis so that the AMICA camera model works properly for these images. Fixes #2056.

git-svn-id: http://subversion.wr.usgs.gov/repos/prog/isis3/trunk@5759 41f8697f-d340-4b68-9986-7bafba869bb8
parent fdcd81aa
Loading
Loading
Loading
Loading
+19 −0
Original line number Diff line number Diff line
@@ -4,6 +4,7 @@
#include <QString>
#include <algorithm>

#include "AlphaCube.h"
#include "Brick.h"
#include "FileName.h"
#include "ImportFits.h"
@@ -144,6 +145,24 @@ void IsisMain ()
  OriginalLabel oldLabel(label);
  outcube->write(oldLabel);

  // Check for subimage and create an AlphaCube that describes thes subarea and
  // update the cube labels. DO NOT adjust for scale.  Camera model will handle
  // that. Coordinates in label are 0-based.
  if ( (1024 != nsamps) || (1024 != nlines) ) {
     PvlGroup inst = outLabel.findGroup("Instrument",Pvl::Traverse);
     int starting_samp = (int) inst["FirstSample"] + 1;
     int starting_line = (int) inst["FirstLine"] + 1;
     int ending_samp = (int) inst["LastSample"] + 1;
     int ending_line = (int) inst["LastLine"] + 1;

     AlphaCube subarea(1024, 1024, 
                       nsamps, nlines, 
                       starting_samp - 0.5, starting_line - 0.5,
                       ending_samp + 0.5,   ending_line + 0.5);

     subarea.UpdateGroup(*outcube);
  }

  //  All done...
   p.EndProcess();
}
+5 −0
Original line number Diff line number Diff line
@@ -199,6 +199,11 @@
    <change name="Kris Becker" date="2013-11-27">
      Original version
    </change>
    <change name="Kris Becker" date="2014-04-03">
      Added support for subimage areas.  This was done by using the AlphaCube 
      (or crop) feature which provides necessary elements for the AMICA camera 
      model to work properly.  Fixes #2056.
    </change>
  </history>

  <category>
+8 −0
Original line number Diff line number Diff line
APPNAME = amica2isis

include $(ISISROOT)/make/isismake.tsts

commands:
	$(APPNAME) from=$(INPUT)/st_2489244561_v.lbl \
	  to=$(OUTPUT)/st_2489244561_v.cub > /dev/null
	catlab from=$(OUTPUT)/st_2489244561_v.cub to=$(OUTPUT)/st_2489244561_v.pvl > /dev/null;