Commit 5f874774 authored by Tracie Sucharski's avatar Tracie Sucharski
Browse files

Merge branch 'dev' of github.com:USGS-Astrogeology/ISIS3 into ipce

parents cf6fc37f b850feb2
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -27,6 +27,7 @@ object_script.*.Debug
*_plugin_import.cpp
*.moc
ui_*.h
*.html

# ignore all files created by squish coco
*csmes
+40 −17
Original line number Diff line number Diff line
#include "EquatorialCylindricalShape.h"

#include <QDebug>
#include <QVector>

#include <algorithm>
#include <cfloat>
@@ -20,6 +21,8 @@
// #include "LinearAlgebra.h"
#include "Longitude.h"
#include "NaifStatus.h"
#include "Spice.h"
#include "ShapeModel.h"
#include "SpecialPixel.h"
#include "SurfacePoint.h"
#include "Table.h"
@@ -28,7 +31,10 @@ using namespace std;

#define MAX(x,y) (((x) > (y)) ? (x) : (y))


namespace Isis {


  /**
   * Initialize the Isis3 Equatorial Cylindrical shape model.
   *
@@ -216,7 +222,7 @@ namespace Isis {
      // Set dalpha to be half the grid spacing for nyquist sampling
      //double dalpha = (PI/180.0)/(2.0*p_demScale);
      double cmin = cos((90.0 - 1.0 / (2.0 * demScale())) * DEG2RAD);
      double dalpha = MAX(cos(g1lat * DEG2RAD), cmin) / (2.0 * demScale() * DEG2RAD);
      double dalpha = MAX(cos(g1lat * DEG2RAD), cmin) / (2.0 * demScale() * RAD2DEG);

      // Previous Sensor version used local version of this method with lat and lon doubles.  Steven said
      // it didn't make a significant difference in speed.
@@ -384,7 +390,7 @@ namespace Isis {
        // put in a test (above) for dd being smaller than the pixel
        // convergence tolerance.  If so the loop exits without an
        // intersection
        dalpha = MAX(cos(g2lat * DEG2RAD), cmin) / (2.0 * demScale() * DEG2RAD);
        dalpha = MAX(cos(g2lat * DEG2RAD), cmin) / (2.0 * demScale() * RAD2DEG);
      } // end while

      SpiceDouble intersectionPoint[3];
@@ -407,9 +413,26 @@ namespace Isis {

    }

    // Do nothing since the DEM intersection was already successful
    setHasIntersection(true);
    return hasIntersection();
  }
  // Do nothing since the DEM intersection was already successful


  /**
   * Override of virtual function for intersectEllipsoid
   *
   * @return QVector holding three SpiceDoubles: SpiceDouble a, SpiceDouble b, SpiceDouble c
   */
  QVector<SpiceDouble> EquatorialCylindricalShape::setTargetRadii() {
    QVector<SpiceDouble> spiceVector(3);
    SpiceDouble a = m_maxRadius->kilometers();
    SpiceDouble b = m_maxRadius->kilometers();
    SpiceDouble c = m_maxRadius->kilometers();
    spiceVector.insert(0, a);
    spiceVector.insert(1, b);
    spiceVector.insert(2, c);
    return spiceVector;
  }

}
+17 −3
Original line number Diff line number Diff line
@@ -24,6 +24,9 @@

#include "DemShape.h"

#include <QVector>

#include "Spice.h"
namespace Isis {
  class Pvl;

@@ -47,6 +50,14 @@ namespace Isis {
   *                           intersection in intersectSurface() method to prevent early return
   *                           and attempt the iterative method even when the ellipsoid is not
   *                           intersected. Fixes #1438
   *   @history 2018-01-05 Cole Neubauer - Fixed units conversion in intersectSurface so that the
   *                           loop is stepping by radians per pixel, as recommended by Jeff
   *                           Anderson (LROC team). Fixes #5245
   *   @history 2018-02-05 Cole Neubauer - Added the setTargetRadii virtual method so that the
   *                           intersectEllipsoid method can use the MaximumRadius found in the
   *                           ShapeModelStatistics group of the labels (often written during a run of
   *                           demprep) as a starting radius for the ellipsoid as opposed to the
   *                           default radius of the target. Fixes #5242
   */
  class EquatorialCylindricalShape : public DemShape {
    public:
@@ -60,6 +71,10 @@ namespace Isis {
      bool intersectSurface(std::vector<double> observerPos,
                            std::vector<double> lookDirection);

    protected:
      virtual QVector<SpiceDouble> setTargetRadii(); // returns a QVector of SpiceDouble


    private:
      Distance *m_minRadius;  //!< Minimum radius value in DEM file
      Distance *m_maxRadius;  //!< Maximum radius value in DEM file
@@ -67,4 +82,3 @@ namespace Isis {
};

#endif
+13 −3
Original line number Diff line number Diff line
@@ -469,7 +469,7 @@ namespace Isis {
   * This method write out the labels and image data to the specified output file.
   * Creates an IMG and XML file.
   * 
   * @param outFile QString of the name of the output file. Will create an XML 
   * @param outFile QString of the name of the output image file. Will create an XML 
   *        and an IMG file with the output file name.
   *
   */
@@ -477,10 +477,20 @@ namespace Isis {
    
    FileName outputFile(outFile);

    // Name for output label
    QString path(outputFile.originalPath());
    QString name(outputFile.baseName());
    QString labelName = path + "/" + name + ".xml";

    // Name for output image
    QString imageName = outputFile.expanded();

    // If input file ends in .xml, the user entered a label name for the output file, not an
    // image name with a unique file extension. 
    if (QString::compare(outputFile.extension(), "xml", Qt::CaseInsensitive) == 0) {
      imageName = path + "/" + name + ".img";
    }

    QDomElement rootElement = m_domDoc->documentElement();
    QDomElement fileAreaObservationalElement =
                    rootElement.firstChildElement("File_Area_Observational");
@@ -501,7 +511,7 @@ namespace Isis {
    OutputLabel(oLabel);
    oLabel.close();
    
    ofstream oCube(outputFile.expanded().toLatin1().data());
    ofstream oCube(imageName.toLatin1().data());
    StartProcess(oCube);
    oCube.close();

+4 −1
Original line number Diff line number Diff line
@@ -68,6 +68,9 @@ namespace Isis {
   *                           Array_3D_Image values properly.
   *   @history 2017-11-21 Kristin Berry - Updated the constructor to add the xml version and 
   *                           encoding to the beginning of the XML file.
   *   @history 2018-02-05 Kristin Berry - Updated WritePds4 to remove the .xml and add a .img
   *                           if the user inputs something of the form filename.xml as the image
   *                           output name. 
   */

  class ProcessExportPds4: public Isis::ProcessExport {
Loading