Commit aa03f636 authored by Kim Oyama's avatar Kim Oyama
Browse files

In mapmos, removed the requirement that all four lat/lon extents be entered by...

In mapmos, removed the requirement that all four lat/lon extents be entered by the user. The user can now enter either min/max lat or min/max lon. The other pair will come from the input cube. If the input cube is missing the pair, an error will be thrown telling the user that they have to enter them. Fixes #1550.

git-svn-id: http://subversion.wr.usgs.gov/repos/prog/isis3/trunk@5765 41f8697f-d340-4b68-9986-7bafba869bb8
parent 214ad229
Loading
Loading
Loading
Loading
+22 −5
Original line number Diff line number Diff line
@@ -54,13 +54,30 @@ void IsisMain() {
    PvlGroup mapGroup = inCube.label()->findGroup("Mapping", Pvl::Traverse);
    inCube.close();
    
    mapGroup.addKeyword(PvlKeyword("MinimumLatitude",  toString(ui.GetDouble("MINLAT"))), Pvl::Replace);
    mapGroup.addKeyword(PvlKeyword("MaximumLatitude",  toString(ui.GetDouble("MAXLAT"))), Pvl::Replace);
    mapGroup.addKeyword(PvlKeyword("MinimumLongitude", toString(ui.GetDouble("MINLON"))), Pvl::Replace);
    mapGroup.addKeyword(PvlKeyword("MaximumLongitude", toString(ui.GetDouble("MAXLON"))), Pvl::Replace);
    if ( ui.WasEntered("MINLAT") ) { 
      mapGroup.addKeyword(PvlKeyword( "MinimumLatitude",  toString( ui.GetDouble("MINLAT") ) ),
                          Pvl::Replace);
    }
    if ( ui.WasEntered("MAXLAT") ) {
      mapGroup.addKeyword(PvlKeyword( "MaximumLatitude",  toString( ui.GetDouble("MAXLAT") ) ),
                          Pvl::Replace);
    }
    if ( ui.WasEntered("MINLON") ) {
      mapGroup.addKeyword(PvlKeyword( "MinimumLongitude", toString( ui.GetDouble("MINLON") ) ),
                          Pvl::Replace);
    }
    if ( ui.WasEntered("MAXLON") ) {
      mapGroup.addKeyword(PvlKeyword( "MaximumLongitude", toString( ui.GetDouble("MAXLON") ) ),
                          Pvl::Replace);
    }
    //check to make sure they're all there. If not, throw error, need to enter all.
    if (!mapGroup.hasKeyword("MinimumLongitude") || !mapGroup.hasKeyword("MaximumLongitude") ||
        !mapGroup.hasKeyword("MinimumLatitude") || !mapGroup.hasKeyword("MaximumLatitude") ) {
      QString msg = "One of the extents is missing. Please input all extents.";
      throw IException(IException::User, msg, _FILEINFO_);
    }
    
    CubeAttributeOutput oAtt = ui.GetOutputAttribute("MOSAIC");

    m.SetOutputCube(sInputFile, mapGroup, oAtt, ui.GetFileName("MOSAIC"));
  }
  else {
+15 −15
Original line number Diff line number Diff line
@@ -17,8 +17,9 @@
    <p>
      This program allows the user to create a mosaic using map projected cubes.  An individual
      cube can be placed in a pre-existing mosaic. An option exists to create the mosaic by
      allowing the user to specify the latitude/longitude range for the output mosaic.  Note that
      the input cube and mosaic must have the same ProjectionName, PixelResolution,
      allowing the user to specify the latitude/longitude range for the output mosaic.  Only one
      range is needed. You may enter either the longitude range or the latitude range. Note
      that the input cube and mosaic must have the same ProjectionName, PixelResolution,
      EquatorialRadius, PolarRadius, LatitudeType, and LongitudeDirection as well as projection
      specific keywords (e.g., CenterLatitude, CenterLongitude). This application regardless of any
      priority and flags set, will always place an input pixel on a NULL mosaic  pixel. This
@@ -233,7 +234,8 @@
      cause HS, LS and NULL input pixels to be copied to the mosaic regardless 
      of the priorities and criteria. These options are not supported for  "BENEATH" priority.
    </change>
    <change name="Sharmila Prasad" date="2010-10-27">Process Input File 
    <change name="Sharmila Prasad" date="2010-10-27">
      Process Input File 
      Attributes</change>
    <change name="Sharmila Prasad" date="2011-01-19">
      Added "AVERAGE" priority where the mosaic will be average of valid input 
@@ -257,6 +259,12 @@
      PRIORITY=BAND, a blank "TYPE=" was added to the command line string. This no longer
      occurs, there is either no TYPE parameter or it is set to "TYPE=BANDNUMBER". Fixes #1549.
    </change>
    <change name="Kimberly Oyama" date="2014-02-14">
      Removed the requirement that all four lat/lon extents be entered by the user. The user can
      now enter either min/max lat or min/max lon. The other pair will come from the input cube.
      If the input cube is missing the pair, an error will be thrown telling the user that they
      have to enter them. Fixes #1550.
    </change>
  </history>

  <oldName>
@@ -514,9 +522,7 @@
        <description>
            This parameter specifies the minimum latitude to determine the bounding box of the mosaic
        </description>
        <inclusions>
            <item>CREATE</item>
        </inclusions>
        <internalDefault>Use Map Value</internalDefault>
      </parameter>

      <parameter name="MAXLAT">
@@ -529,9 +535,7 @@
        <greaterThan>
            <item>MINLAT</item>
        </greaterThan>
        <inclusions>
            <item>CREATE</item>
        </inclusions>
        <internalDefault>Use Map Value</internalDefault>
      </parameter>

      <parameter name="MINLON">
@@ -540,9 +544,7 @@
        <description>
            This parameter specifies the minimum longitude to determine the bounding box of the mosaic
        </description>
        <inclusions>
            <item>CREATE</item>
        </inclusions>
        <internalDefault>Use Map Value</internalDefault>
      </parameter>

      <parameter name="MAXLON">
@@ -554,9 +556,7 @@
        <greaterThan>
            <item>MINLON</item>
        </greaterThan>
        <inclusions>
            <item>CREATE</item>
        </inclusions>
        <internalDefault>Use Map Value</internalDefault>
      </parameter>
    </group>

+30 −0
Original line number Diff line number Diff line
APPNAME  = mapmos

include $(ISISROOT)/make/isismake.tsts

commands:
	$(APPNAME) from=$(INPUT)/ab102401.lev2.cub \
	  mosaic=$(OUTPUT)/mapmosTruthLats.cub \
	  create=true \
	  minlat=10.765 \
	  maxlat=34.445 \
	  null=true > /dev/null;
	$(APPNAME) from=$(INPUT)/ab102401.lev2.cub \
	  mosaic=$(OUTPUT)/mapmosTruthLons.cub \
	  create=true \
	  minlon=219.720 \
	  maxlon=236.190 \
	  null=true > /dev/null;
	$(APPNAME) from=$(INPUT)/copy_ab102401.lev2.cub \
	  mosaic=$(OUTPUT)/mapmosTruthLons.cub \
	  create=true \
	  minlon=219.720 \
	  maxlon=236.190 \
	  null=true >& $(OUTPUT)/errors.txt || true;
	$(APPNAME) from=$(INPUT)/ab102401.lev2.cub \
	  mosaic=$(OUTPUT)/mapmosTruthLons.cub \
	  create=true \
	  minlon=219.720 \
	  null=true >& $(OUTPUT)/errors_tmp.txt || true;
	  cat $(OUTPUT)/errors_tmp.txt >> $(OUTPUT)/errors.txt;
	  $(RM) $(OUTPUT)/errors_tmp.txt;