Commit 55c61461 authored by Kristin Berry's avatar Kristin Berry
Browse files

Changed isis2pds to assume that radii without units in the input Isis cube are...

Changed isis2pds to assume that radii without units in the input Isis cube are in meters. Fixes #1784

git-svn-id: http://subversion.wr.usgs.gov/repos/prog/isis3/trunk@5874 41f8697f-d340-4b68-9986-7bafba869bb8
parent 46834e63
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -21,6 +21,9 @@
    <change name="Christopher Austin" date="2008-08-07">
      Added the Label Type capability (param)
    </change>
    <change name="Kristin Berry" date="2014-06-06">
      Changed to assume that radii without units in the input Isis cube are in meters, map scales without units are in meters/pixel, and map resolutions without units are in pixels/degree. 
    </change>
    </history>

  <groups>
+16 −0
Original line number Diff line number Diff line
APPNAME = isis2pds

include $(ISISROOT)/make/isismake.tsts

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


+8 −7
Original line number Diff line number Diff line
@@ -705,24 +705,24 @@ namespace Isis {
    // Add the projection name
//    pdsMapObj += PvlKeyword ("MAP_PROJECTION_TYPE", projName.toUpper());

    // Modify the radii to be km
    // Modify the radii to be km. 
    PvlKeyword &aRadius = pdsMapObj["A_AXIS_RADIUS"];
    QString unit = aRadius.unit();
    if(unit.toUpper() == "METERS") {
    if( (unit.toUpper() == "METERS") || (unit == "") ) { //if no units, assume in meters
      double dValue = (double)aRadius;
      dValue /= 1000.0;
      aRadius.setValue(toString(dValue), "KM");
    }
    PvlKeyword &bRadius = pdsMapObj["B_AXIS_RADIUS"];
    unit = bRadius.unit();
    if(unit.toUpper() == "METERS") {
    if( (unit.toUpper() == "METERS") || (unit == "") ) {
      double dValue = (double)bRadius;
      dValue /= 1000.0;
      bRadius.setValue(toString(dValue), "KM");
    }
    PvlKeyword &cRadius = pdsMapObj["C_AXIS_RADIUS"];
    unit = cRadius.unit();
    if(unit.toUpper() == "METERS") {
    if( (unit.toUpper() == "METERS") || (unit == "") ) {
      double dValue = (double)cRadius;
      dValue /= 1000.0;
      cRadius.setValue(toString(dValue), "KM");
@@ -731,7 +731,8 @@ namespace Isis {
    // Modify the units on MAP_SCALE and MAP_RESOLUTION
    PvlKeyword &mapScale = pdsMapObj["MAP_SCALE"];
    unit = mapScale.unit();
    if((unit.toUpper() == "METERS/PIX") || (unit.toUpper() == "METERS/PIXEL")) {
    //if no units, assume in meters/pixel
    if( (unit.toUpper() == "METERS/PIX") || (unit.toUpper() == "METERS/PIXEL") || (unit == "") ) {
      if(m_exportResolution == Kilometer) {
        double dValue = (double)mapScale;
        dValue /= 1000.0;
@@ -743,11 +744,11 @@ namespace Isis {
    }
    PvlKeyword &mapRes = pdsMapObj["MAP_RESOLUTION"];
    unit = mapRes.unit();
    if(unit.toUpper() == "PIXELS/DEGREE") {
    //if no units, asume in pixels/degree
    if( (unit.toUpper() == "PIXELS/DEGREE") || (unit == "") ) {
      mapRes.setValue((QString)mapRes, "PIX/DEG");
    }


    // Add the EASTERNMOST AND WESTERNMOST LONGITUDE keywords
    PvlKeyword &isisLonDir = inputMapping.findKeyword("LongitudeDirection");
    QString lonDir = isisLonDir[0];
+6 −0
Original line number Diff line number Diff line
@@ -71,7 +71,13 @@ namespace Isis {
   *                           altered in the export program unless
   *                           functionality is added to deal with the new start
   *                           byte values. References #678.
   *   @history 2014-06-06 Kristin Berry - Added default units to assume if there
   *                           are no units on certain values in the input Isis cube. 
   *                           Unlabeled radii are assumed to be in meters; map scales 
   *                           to be in meters/pixel, and map resolutions to be in
   *                           pixels/degree.
   */

  class ProcessExportPds : public Isis::ProcessExport {
    public:
      /**