Commit 550b5726 authored by Tyler Wilson's avatar Tyler Wilson
Browse files

The CSV/Pvl output for this class was changed because of changes to the Camera...

The CSV/Pvl output for this class was changed because of changes to the Camera class.  References #476

git-svn-id: http://subversion.wr.usgs.gov/repos/prog/isis3/trunk@7065 41f8697f-d340-4b68-9986-7bafba869bb8
parent a347aa99
Loading
Loading
Loading
Loading
+165 −84
Original line number Diff line number Diff line
@@ -55,8 +55,14 @@ namespace Isis {
    m_usedCubes->SetNumOpenCubes(50);
    m_currentCube = NULL;
    m_camera = NULL;
    m_csvOutput = false;
  }

   void CameraPointInfo::SetCSVOutput(bool csvOutput) {

     m_csvOutput = csvOutput;

   }

  /**
   * Destructor, deletes CubeManager object used.
@@ -231,7 +237,62 @@ namespace Isis {
   */
  PvlGroup *CameraPointInfo::GetPointInfo(bool passed, bool allowOutside, bool allowErrors) {
    PvlGroup *gp = new PvlGroup("GroundPoint");

    //Outputting in PVL format
    if(!m_csvOutput)
    {
        gp->addKeyword(PvlKeyword("Filename"));
        gp->addKeyword(PvlKeyword("Sample"));
        gp->addKeyword(PvlKeyword("Line"));
        gp->addKeyword(PvlKeyword("PixelValue"));
        gp->addKeyword(PvlKeyword("RightAscension"));
        gp->addKeyword(PvlKeyword("Declination"));
        gp->addKeyword(PvlKeyword("PlanetocentricLatitude"));
        gp->addKeyword(PvlKeyword("PlanetographicLatitude"));
        gp->addKeyword(PvlKeyword("PositiveEast360Longitude"));
        gp->addKeyword(PvlKeyword("PositiveEast180Longitude"));
        gp->addKeyword(PvlKeyword("PositiveWest360Longitude"));
        gp->addKeyword(PvlKeyword("PositiveWest180Longitude"));
        gp->addKeyword(PvlKeyword("BodyFixedCoordinate"));
        gp->addKeyword(PvlKeyword("LocalRadius"));
        gp->addKeyword(PvlKeyword("SampleResolution"));
        gp->addKeyword(PvlKeyword("LineResolution"));
        gp->addKeyword(PvlKeyword("ObliqueDetectorResolution"));
        gp->addKeyword(PvlKeyword("ObliquePixelResolution"));
        gp->addKeyword(PvlKeyword("ObliqueLineResolution"));
        gp->addKeyword(PvlKeyword("ObliqueSampleResolution"));
        gp->addKeyword(PvlKeyword("SpacecraftPosition"));
        gp->addKeyword(PvlKeyword("SpacecraftAzimuth"));
        gp->addKeyword(PvlKeyword("SlantDistance"));
        gp->addKeyword(PvlKeyword("TargetCenterDistance"));
        gp->addKeyword(PvlKeyword("SubSpacecraftLatitude"));
        gp->addKeyword(PvlKeyword("SubSpacecraftLongitude"));
        gp->addKeyword(PvlKeyword("SpacecraftAltitude"));
        gp->addKeyword(PvlKeyword("OffNadirAngle"));
        gp->addKeyword(PvlKeyword("SubSpacecraftGroundAzimuth"));
        gp->addKeyword(PvlKeyword("SunPosition"));
        gp->addKeyword(PvlKeyword("SubSolarAzimuth"));
        gp->addKeyword(PvlKeyword("SolarDistance"));
        gp->addKeyword(PvlKeyword("SubSolarLatitude"));
        gp->addKeyword(PvlKeyword("SubSolarLongitude"));
        gp->addKeyword(PvlKeyword("SubSolarGroundAzimuth"));
        gp->addKeyword(PvlKeyword("Phase"));
        gp->addKeyword(PvlKeyword("Incidence"));
        gp->addKeyword(PvlKeyword("Emission"));
        gp->addKeyword(PvlKeyword("NorthAzimuth"));
        gp->addKeyword(PvlKeyword("EphemerisTime"));
        gp->addKeyword(PvlKeyword("UTC"));
        gp->addKeyword(PvlKeyword("LocalSolarTime"));
        gp->addKeyword(PvlKeyword("SolarLongitude"));
        gp->addKeyword(PvlKeyword("LookDirectionBodyFixed"));
        gp->addKeyword(PvlKeyword("LookDirectionJ2000"));
        gp->addKeyword(PvlKeyword("LookDirectionCamera"));

        if (allowErrors) gp->addKeyword(PvlKeyword("Error"));
    }

    else {

        gp->addKeyword(PvlKeyword("Filename"));
        gp->addKeyword(PvlKeyword("Sample"));
        gp->addKeyword(PvlKeyword("Line"));
@@ -274,9 +335,19 @@ namespace Isis {
        gp->addKeyword(PvlKeyword("LookDirectionBodyFixed"));
        gp->addKeyword(PvlKeyword("LookDirectionJ2000"));
        gp->addKeyword(PvlKeyword("LookDirectionCamera"));
        gp->addKeyword(PvlKeyword("ObliqueDetectorResolution"));
        gp->addKeyword(PvlKeyword("ObliquePixelResolution"));
        gp->addKeyword(PvlKeyword("ObliqueLineResolution"));
        gp->addKeyword(PvlKeyword("ObliqueSampleResolution"));
        if (allowErrors) gp->addKeyword(PvlKeyword("Error"));




  }



    bool noErrors = passed;
    QString error = "";
    if (!m_camera->HasSurfaceIntersection()) {
@@ -373,12 +444,21 @@ namespace Isis {

        gp->findKeyword("LocalRadius").setValue(toString(
                        m_camera->LocalRadius().meters()), "meters");

        gp->findKeyword("SampleResolution").setValue(toString(
                        m_camera->SampleResolution()), "meters/pixel");
        gp->findKeyword("LineResolution").setValue(toString(
                        m_camera->LineResolution()), "meters/pixel");

        gp->findKeyword("ObliqueDetectorResolution").setValue(
                    toString(m_camera->ObliqueDetectorResolution()),"meters");
        gp->findKeyword("ObliqueLineResolution").setValue(
                    toString(m_camera->ObliqueLineResolution()),"meters");
        gp->findKeyword("ObliqueSampleResolution").setValue(
                    toString(m_camera->ObliqueSampleResolution()),"meters");
        gp->findKeyword("ObliquePixelResolution").setValue(
                    toString(m_camera->ObliquePixelResolution()), "meters/pix");


        //body fixed
        m_camera->instrumentPosition(spB);
        gp->findKeyword("SpacecraftPosition").addValue(toString(spB[0]), "km");
@@ -506,3 +586,4 @@ namespace Isis {
    return m_currentCube;
  }
}
+18 −4
Original line number Diff line number Diff line
@@ -77,7 +77,18 @@ namespace Isis {
   *   @history 2015-10-01 Jeannie Backer - Made improvements to documentation and brought code
   *                           closer to ISIS coding standards. References #1438
   *   @history 2016-07-11 Curtis Rose - Added units to a few of the outputs. References #3979.
   */
   *   @history 2016-08-16 Tyler Wilson - Modified the GetPointInfo function to allow
   *                           developers to specify which order CameraPointInfo fields
   *                           are output for different file formats (PVL or CSV).
   *                           This is managed by setting the m_csvOutput flag via
   *                           the public member function SetCSVOutput.  PVL is the
   *                           default output format, as m_csvOuput is set to false in
   *                           the constructor.  The reason for this is to not to break any
   *                           scripts processors might be running when outputting files in
   *                           csv format.  Column order is important in this case.
   *                           References #476,#4100.
   *
   **/
  class CameraPointInfo {

    public:
@@ -85,6 +96,7 @@ namespace Isis {
      virtual ~CameraPointInfo();

      void SetCube(const QString &cubeFileName);
      void SetCSVOutput(bool csvOutput);
      PvlGroup *SetImage(const double sample, const double line,
                         const bool outside = false, const bool error = false);
      PvlGroup *SetCenter(const bool outside = false, const bool error = false);
@@ -105,7 +117,9 @@ namespace Isis {
      CubeManager *m_usedCubes;
      Cube *m_currentCube;
      Camera *m_camera;
      bool m_csvOutput;
  };
};

#endif
+8 −0
Original line number Diff line number Diff line
@@ -15,6 +15,10 @@ Group = GroundPoint
  LocalRadius                = 1737400.0 <meters>
  SampleResolution           = 187.48511798825 <meters/pixel>
  LineResolution             = 187.48511798825 <meters/pixel>
  ObliqueDetectorResolution  = 187.48933248321 <meters>
  ObliquePixelResolution     = 187.48933248321 <meters/pix>
  ObliqueLineResolution      = 187.48933248321 <meters>
  ObliqueSampleResolution    = 187.48933248321 <meters>

  # Spacecraft Information
  SpacecraftPosition         = (216.76438021037, 54.256829538645,
@@ -73,6 +77,10 @@ Group = GroundPoint
  LocalRadius                = 1737400.0 <meters>
  SampleResolution           = 187.50339379912 <meters/pixel>
  LineResolution             = 187.50339379912 <meters/pixel>
  ObliqueDetectorResolution  = 187.52061363579 <meters>
  ObliquePixelResolution     = 187.52061363579 <meters/pix>
  ObliqueLineResolution      = 187.52061363579 <meters>
  ObliqueSampleResolution    = 187.52061363579 <meters>

  # Spacecraft Information
  SpacecraftPosition         = (216.76438021037, 54.256829538645,