Unverified Commit e5e20d6e authored by Tim Giroux's avatar Tim Giroux Committed by GitHub
Browse files

ObliqueDetectorResolution uses local emission (#4600)



* ObliqueDetectorResolution uses local emission

* test, changelog, docs, and return null on localemission failure

* Reversed normal test calls due to how the localnormal is calculated

* Made local emission calculation the default behavior

* Adjusted camera point info truth

* Updated change log

* fixed ctets

* Updated function signatures in CSMCamera for proper function overloading

* Removed left over print

Co-authored-by: default avataracpaquette <acp263@nau.edu>
Co-authored-by: default avatarKelvin Rodriguez <krodriguez@usgs.gov>
parent cfd25431
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -44,6 +44,9 @@ release.
synchronized with footprintinit default values of the same parameters.
This corrects inconsistencies of footprint generation failing in caminfo
but passing in footprintinit. [#4651](https://github.com/USGS-Astrogeology/ISIS3/issues/4651).
- Changed the internal logic of ObliqueDataResolution() to use LocalEmission angle rather than Emission angle.
This will cause differences in output; new values will be more accurate because they use DEM rather than
ellipsoid. The cost to compute the local emissoin will increase by approximately x1.5. [#3600](https://github.com/USGS-Astrogeology/ISIS3/issues/3600)

### Added
- Added the USECAMSTATSTBL option to caminfo. This allows caminfo to extract existing
+1 −1
Original line number Diff line number Diff line
@@ -88,7 +88,7 @@ for (lbl in labels) {
                            // Gtests
                            stageStatus = "Running gtests on ${label}"
                            try {
                                loginShell "ctest -R '.' -E '(_app_|_unit_|_module_)' -j${NUM_CORES} --output-on-failure"
                                loginShell "ctest -R '.' -E '(_app_|_unit_|_module_)' -j${NUM_CORES} --output-on-failure --timeout 10000"
                            } catch(e) {
                                errors.add(stageStatus)
                                osFailed = true
+3 −3
Original line number Diff line number Diff line
@@ -391,7 +391,7 @@ namespace Isis {
   *
   * @returns @b double The oblique line resolution in meters per pixel
   */
  double CSMCamera::ObliqueLineResolution() {
  double CSMCamera::ObliqueLineResolution(bool useLocal) {
    // CSM resolution is always the oblique resolution so just return it
    return LineResolution();
  }
@@ -406,7 +406,7 @@ namespace Isis {
   *
   * @returns @b double The oblique sample resolution in meters per pixel
   */
  double CSMCamera::ObliqueSampleResolution() {
  double CSMCamera::ObliqueSampleResolution(bool useLocal) {
    // CSM resolution is always the oblique resolution so just return it
    return SampleResolution();
  }
@@ -421,7 +421,7 @@ namespace Isis {
   *
   * @returns @b double The oblique detector resolution in meters per pixel
   */
  double CSMCamera::ObliqueDetectorResolution() {
  double CSMCamera::ObliqueDetectorResolution(bool useLocal) {
    // CSM resolution is always the oblique resolution so just return it
    return DetectorResolution();
  }
+3 −3
Original line number Diff line number Diff line
@@ -87,9 +87,9 @@ namespace Isis {
      virtual double LineResolution();
      virtual double SampleResolution();
      virtual double DetectorResolution();
      virtual double ObliqueLineResolution();
      virtual double ObliqueSampleResolution();
      virtual double ObliqueDetectorResolution();
      virtual double ObliqueLineResolution(bool useLocal = true);
      virtual double ObliqueSampleResolution(bool useLocal = true);
      virtual double ObliqueDetectorResolution(bool useLocal = true);

      virtual double parentLine() const;
      virtual double parentSample() const;
+36 −18
Original line number Diff line number Diff line
@@ -557,7 +557,7 @@ namespace Isis {
  /**
   * @brief This method returns the Oblique Detector Resolution
   * if the Look Vector intersects the target and if the emission angle is greater than or equal
   * to 0, and less than 90 degrees.   Otherwise, it returns -1.0.  This formula provides an
   * to 0, and less than 90 degrees.   Otherwise, it returns Isis::Null.  This formula provides an
   * improved estimate to the detector resolution for images near the limb:
   *
   *
@@ -577,26 +577,44 @@ namespace Isis {
   *   <b>Reference 2:</b>  Handwritten notes by Orrin Thomas which can be found in the
   *                 Glossary under the entry for Oblique Detector Resolution.
   *
   * @param useLocal If true, emission is fetched from LocalPhotometricAngles.
   *                 Otherwise, emission is fetched from EmissionAngle().
   *                 This is an optional parameter that defaults to true,
   *                 because local emission will give more accurate results.
   *
   * @return @b double
   */
  double Camera::ObliqueDetectorResolution(){
  double Camera::ObliqueDetectorResolution(bool useLocal) {


      if(HasSurfaceIntersection()){
    if(!HasSurfaceIntersection()) {
      return Isis::Null;
    }

    double thetaRad;
          thetaRad = EmissionAngle()*DEG2RAD;
    double emissionDeg;

          if (thetaRad < HALFPI) {
            return DetectorResolution()/cos(thetaRad);
    if(useLocal) {
      Angle phase, emission, incidence;
      bool success;

      LocalPhotometricAngles(phase, incidence, emission, success);
      emissionDeg = (success) ? emission.degrees() : Isis::Null;
    }
    else {
      emissionDeg = EmissionAngle();
    }
          return Isis::Null;

    thetaRad = emissionDeg*DEG2RAD;

    if (thetaRad < HALFPI) {
      return DetectorResolution()/cos(thetaRad);

    }

    return Isis::Null;


  }


@@ -636,8 +654,8 @@ namespace Isis {
   *
   * @return @b double The sample resolution
   */
  double Camera::ObliqueSampleResolution() {
    return ObliqueDetectorResolution() * p_detectorMap->SampleScaleFactor();
  double Camera::ObliqueSampleResolution(bool useLocal) {
    return ObliqueDetectorResolution(useLocal) * p_detectorMap->SampleScaleFactor();
  }


@@ -658,8 +676,8 @@ namespace Isis {
   *
   * @return @b double The line resolution
   */
  double Camera::ObliqueLineResolution() {
    return ObliqueDetectorResolution() * p_detectorMap->LineScaleFactor();
  double Camera::ObliqueLineResolution(bool useLocal) {
    return ObliqueDetectorResolution(useLocal) * p_detectorMap->LineScaleFactor();
  }


@@ -682,9 +700,9 @@ namespace Isis {
   *
   * @return @b double The pixel resolution
   */
  double Camera::ObliquePixelResolution() {
    double lineRes = ObliqueLineResolution();
    double sampRes = ObliqueSampleResolution();
  double Camera::ObliquePixelResolution(bool useLocal) {
    double lineRes = ObliqueLineResolution(useLocal);
    double sampRes = ObliqueSampleResolution(useLocal);
    if (lineRes < 0.0) return Isis::Null;
    if (sampRes < 0.0) return Isis::Null;
    return (lineRes + sampRes) / 2.0;
Loading