Commit cf393a64 authored by Curtis Rose's avatar Curtis Rose
Browse files

Added features to campt so that it outputs the look direction of the...

Added features to campt so that it outputs the look direction of the spacecraft in J2000, camera, and body fixed coordinate systems. Fixes #2403.

git-svn-id: http://subversion.wr.usgs.gov/repos/prog/isis3/trunk@6922 41f8697f-d340-4b68-9986-7bafba869bb8
parent faec2846
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -108,6 +108,14 @@ Group = GroundPoint
  LocalSolarTime             = 17.089704420784 <hour>
  <def link="Solar Longitude">SolarLongitude</def>             = 201.83159041209 &lt;degrees&gt;
  Error                      = NULL
  
  # Look Direction Unit Vectors in Body Fixed, J2000, and Camera Coordinate Systems.
  LookDirectionBodyFixed     = (0.95457395414683, 0.074906840825054,
                                -0.28840515124058) &lt;degrees&gt;
  LookDirectionJ2000         = (0.5482662642052, -0.25280984110143,
                                -0.797177074292) &lt;degrees&gt;
  LookDirectionCamera        = (0.0040987946596217, -0.6021663586021,
                                0.79836011702128) &lt;degrees&gt;
End_Group
    </pre>
    
+23 −0
Original line number Diff line number Diff line
@@ -271,6 +271,9 @@ namespace Isis {
      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"));
    }

@@ -457,6 +460,26 @@ namespace Isis {
                        m_camera->LocalSolarTime()), "hour");
        gp->findKeyword("SolarLongitude").setValue(toString(
                        m_camera->solarLongitude().degrees()), "degrees");

        std::vector<double>lookB = m_camera->lookDirectionBodyFixed();
        gp->findKeyword("LookDirectionBodyFixed").addValue(toString(lookB[0]), "degrees");
        gp->findKeyword("LookDirectionBodyFixed").addValue(toString(lookB[1]), "degrees");
        gp->findKeyword("LookDirectionBodyFixed").addValue(toString(lookB[2]), "degrees");
        gp->findKeyword("LookDirectionBodyFixed").addComment("Look Direction Unit Vectors in Body Fixed, J2000, and Camera Coordinate Systems.");

        std::vector<double>lookJ = m_camera->lookDirectionJ2000();
        gp->findKeyword("LookDirectionJ2000").addValue(toString(lookJ[0]), "degrees");
        gp->findKeyword("LookDirectionJ2000").addValue(toString(lookJ[1]), "degrees");
        gp->findKeyword("LookDirectionJ2000").addValue(toString(lookJ[2]), "degrees");

        double lookC[3];
        m_camera->LookDirection(lookC);
        gp->findKeyword("LookDirectionCamera").addValue(toString(lookC[0]), "degrees");
        gp->findKeyword("LookDirectionCamera").addValue(toString(lookC[1]), "degrees");
        gp->findKeyword("LookDirectionCamera").addValue(toString(lookC[2]), "degrees");



        if (allowErrors) gp->findKeyword("Error").setValue("NULL");
      }
    }
+16 −0
Original line number Diff line number Diff line
@@ -48,6 +48,14 @@ Group = GroundPoint
  UTC                        = 1994-03-25T19:43:48.0166464
  LocalSolarTime             = 11.622951215761 <hour>
  SolarLongitude             = 129.01790468942 <degrees>

  # Look Direction Unit Vectors in Body Fixed, J2000, and Camera Coordinate Systems.
  LookDirectionBodyFixed     = (-0.083394028492917, -0.027043700663677,
                                0.99614962443708) <degrees>
  LookDirectionJ2000         = (-0.065080625277796, -0.41666190298971,
                                0.90672894009756) <degrees>
  LookDirectionCamera        = (-5.55111512312578e-17, 8.74300631892311e-16,
                                1.0) <degrees>
End_Group
Group = GroundPoint
  Sample                     = 0.90348451909767
@@ -99,4 +107,12 @@ Group = GroundPoint
  UTC                        = 1994-03-25T19:43:48.0166464
  LocalSolarTime             = 11.791629991401 <hour>
  SolarLongitude             = 129.01790468942 <degrees>

  # Look Direction Unit Vectors in Body Fixed, J2000, and Camera Coordinate Systems.
  LookDirectionBodyFixed     = (-0.07608335898211, -0.015181885902405,
                                0.99698587393526) <degrees>
  LookDirectionJ2000         = (-0.055242605204482, -0.4079045962425,
                                0.91135179537568) <degrees>
  LookDirectionCamera        = (-0.0094547052774946, 0.010268734490901,
                                0.99990257607433) <degrees>
End_Group
+27 −5
Original line number Diff line number Diff line
@@ -154,6 +154,7 @@ namespace Isis {
   *
   */
  bool Sensor::SetLookDirection(const double v[3]) {
    //std::cout << "Sensor::SetLookDirection()\n";
    // The look vector must be in the camera coordinate system

    // copy v to LookC
@@ -438,6 +439,7 @@ namespace Isis {
   * @return bool
   */
  bool Sensor::SetGround(const SurfacePoint &surfacePt, bool backCheck) {
    //std::cout << "Sensor::SetGround()\n";
    ShapeModel *shape = target()->shape();
    shape->clearSurfacePoint();

@@ -511,18 +513,38 @@ namespace Isis {
   * @param v[] The look vector.
   */
  void Sensor::LookDirection(double v[3]) const {
    vector<double> lookC = instrumentRotation()->ReferenceVector(lookDirectionJ2000());
    v[0] = lookC[0];
    v[1] = lookC[1];
    v[2] = lookC[2]; 
  }

 /**
   * Returns the look direction in the body fixed coordinate system.
   *
   * @return @b vector<double> Look direction in body fixed coordinate system.
   */
  vector<double> Sensor::lookDirectionBodyFixed() const {
    vector<double> lookB(3);
    lookB[0] = m_lookB[0];
    lookB[1] = m_lookB[1];
    lookB[2] = m_lookB[2];
    vector<double> lookJ = bodyRotation()->J2000Vector(lookB);
    vector<double> lookC = instrumentRotation()->ReferenceVector(lookJ);
    v[0] = lookC[0];
    v[1] = lookC[1];
    v[2] = lookC[2];
    return lookB;
  }
  
  
   /**
   * Returns the look direction in the camera coordinate system.
   *
   * @return @b vector<double> Look direction in J2000 cooridinate system.
   */
  vector<double> Sensor::lookDirectionJ2000() const {
    vector<double> lookJ = bodyRotation()->J2000Vector(lookDirectionBodyFixed());
    return lookJ;
  }



  /**
   * Returns the right ascension angle (sky longitude).
   *
+2 −0
Original line number Diff line number Diff line
@@ -208,6 +208,8 @@ namespace Isis {
      double IncidenceAngle() const;

      void LookDirection(double v[3]) const;
      std::vector<double> lookDirectionJ2000() const;
      std::vector<double> lookDirectionBodyFixed() const;

      double RightAscension();
      double Declination();