Unverified Commit d9e91ffc authored by kledmundson's avatar kledmundson Committed by GitHub
Browse files

Adding Support for OSIRIS-REx TagCams Instruments (#5427)



* Add new IrregularBodyCameraGroundMap class

* Update documentation and app/unit tests

* Initial version of tagcams2isis

Signed-off-by: default avatarKris J. Becker <kbecker@orex.lpl.arizona.edu>

* Initial version of OREX TAGCAMS Camera Model

Provides initial version of OREX TAGCAMS camera model for NAVCam (Navcam 1), NFTCam (Navcam 2) and STOWCam instruments

Signed-off-by: default avatarKris J. Becker <kbecker@orex.lpl.arizona.edu>

* Improved import of TAGCAMS image data

tagcams2isis
* Added more keywords to import/translate
* Added option REMOVECALPIXELS to allow user to control how the boundary pixels are treated
* Implemented summing and scaling based upon expected conditions
* Add SourceProductId
* Compute CameraHeadTemperature (Celsius) from TCCHTEMP FITS label keyword for camera distortion model
* Compute and add YearDoy keyword

Signed-off-by: default avatarKris J. Becker <kbecker@orex.lpl.arizona.edu>

* Add complete version of OpenCV distortion model

* Added full implementation of the OpenCV 10 parameter distortion model for the TAGCAMS camera
* Allow selection of several models including OpenCV, OCAMS or none
* Added TOLERANCE parameter to determine convergence tolerance
* Added DEBUG_MODEL parameter to turn on print statements to debug the camera distortion model
* Added modified kernel DB file to support TAGCAMS along with OCAMS
* Updated TAGCAMS camera addendum file

Signed-off-by: default avatarKris J. Becker <kbecker@orex.lpl.arizona.edu>

* Modified OpenCV distortion model

OsirisRexTagcamsDistortionMap
* Renamed OpenCV parameters in the IAK kernel to better conform and associate with the OpenCV parameter names
* Added k4-k6 parameters to fully implement the OpenCV model

Signed-off-by: default avatarKris J. Becker <kbecker@orex.lpl.arizona.edu>

* Update TAGCAMS OpenCV distortion model parameters

orx_tagcams_addendum_v04.ti
* Version 4 of the TAGCAMS IAK kernel was created for new OpenCV distortion model parameters for Navcam 1 & 2

Signed-off-by: default avatarKris J. Becker <kbecker@orex.lpl.arizona.edu>

* Removed unused variables to suppress warnings

Signed-off-by: default avatarKris J. Becker <kbecker@orex.lpl.arizona.edu>

* Typo in iTime.h include

tagcams2isis
* Mistyped iTime.h with capital I - works on Macs, not Linux systems

Signed-off-by: default avatarKris J. Becker <kbecker@orex.lpl.arizona.edu>

* Removed apostrophe that causes problems on Linux

Signed-off-by: default avatarKris J. Becker <kbecker@orex.lpl.arizona.edu>

* Update tagcams2isis temperature computation

tagcams2isis
* Update b parameter used to convert raw DNs of camera head temperature to Celsius as provided by the NAV team in update to camera model

Signed-off-by: default avatarKris J. Becker <kbecker@orex.lpl.arizona.edu>

* Update TAGCAMS camera model

TAGCAMS Camera Model
* Now use the CCD center as specified in the IK as the focal plane detector map system origin
* Update camera model parameters provided by the NAV team
* Renamed conversion methods to more meaningful names
* Fixes pointing issues

Signed-off-by: default avatarKris J. Becker <kbecker@orex.lpl.arizona.edu>

* New version of TAGCAMS camera model parameters

orex_tagcams_addendum_v05.ti
* Updated with all new TAGCAMS parameters as provided by the NAV/Kinetx team
* Added distortion model reference

Signed-off-by: default avatarKris J. Becker <kbecker@orex.lpl.arizona.edu>

* Updates to TAGCAMS IAK

orex_tagcams_addendum_v06.ti
* Added light time/stellar, abberation correction and target/observer swap parameters for each instrument
* Updated documentation

Signed-off-by: default avatarKris J. Becker <kbecker@orex.lpl.arizona.edu>

* Added LT and target/observer swap parameters

Signed-off-by: default avatarKris J. Becker <kbecker@orex.lpl.arizona.edu>

* Properly initialize distorted/undistorted parms

OsirisRexTagcamsDistortionMap
* Properly initialize distorted/undistorted parameters

Signed-off-by: default avatarKris J. Becker <kbecker@orex.lpl.arizona.edu>

* tagams2isis.xml fix already happened

* Fixed merge issue

Signed-off-by: default avatarKris J. Becker <kbecker@orex.lpl.arizona.edu>

* Correct typo

Signed-off-by: default avatarKris J. Becker <kbecker@orex.lpl.arizona.edu>

* Minor documentation change

Signed-off-by: default avatarKris J. Becker <kbecker@orex.lpl.arizona.edu>

* Modified for easy development of derived classes

Moved all private variables and methods to protected scope

* Added translations for OSIRIS-REx TagCams instruments NFTCam, NAVCam, and StowCam into Instruments.trn file. Originally added to University of Arizona codebase by Kris Becker on January 10, 2019. Addresses #5424.

* Committing test data for OsirisREx TagCams support. Addresses #5424.

* Initial commit of Osiris-REx Tagcams ingestion program tagcams2isis and supporting files. Addresses #5424.

* Adding support for intersections with irregular bodies, in particular to support Osiris-REx instruments. Addresses #5424.

* Unit test and truth data for OsirisREx tagcams instruments. Addresses #5424.

* Support for OsirisREx tagcams instruments. Addresses #5424.

* CHANGELOG entry for Osiris-REx tagcams instrument support. Addresses #5424.

* Per review comments 2024-03-18: 1) fixed typo in IrregularBodyGroundMap.h; 2) removed IrregularBodyGroundMap unit test; 3) replaced OsirisRexTagcamsCamera unit test with gtest version. Addresses #5424.

* Per Adam's suggestion 2024-03-19, modified second tagcams2isis method to take FileName object as an argument instead of a ProcessImportFits object. Addresses #5424.

---------

Signed-off-by: default avatarKris J. Becker <kbecker@orex.lpl.arizona.edu>
Co-authored-by: default avatarKris J. Becker <kbecker@orex.lpl.arizona.edu>
Co-authored-by: default avatarKelvin Rodriguez <krodriguez@usgs.gov>
parent 35b21fc9
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -39,7 +39,6 @@ release.
- Changed the default spiceinit url to https://astrogeology.usgs.gov/apis/ale/v0.9.1/spiceserver/ and added deprecation warning for use of https://services.isis.astrogeology.usgs.gov/cgi-bin/spiceinit.cgi url. [#5327](https://github.com/USGS-Astrogeology/ISIS3/issues/5327)
- Skypt has been refactored to be callable; old Makefile tests have been removed and replaced by gtests. Issue: [#5443](https://github.com/USGS-Astrogeology/ISIS3/issues/5443)


### Fixed
- Fixed a bug in which the histogram tool used the entire image to calculate bin size, which caused an issue with high dynamic range images. [#5371](https://github.com/DOI-USGS/ISIS3/issues/5371)
- Fixed a bug in which 'version' file was compiled as source and prevented subsequent ISIS recompilation [#5374](https://github.com/DOI-USGS/ISIS3/issues/5374)
@@ -56,6 +55,7 @@ release.
- Added new option in `ctxcal` to use monthly computed flatfield files for "Frown" removal in CTX images. [#5338](https://github.com/DOI-USGS/ISIS3/pull/5338)
- CSMCamera can now read and use the body rotation from ALE produced ISDs [#5072](https://github.com/DOI-USGS/ISIS3/pull/5072)
- CSMSkyMap added to CSMCamera for use with local rover projections in ISIS [#5072](https://github.com/DOI-USGS/ISIS3/pull/5072)
- OSIRIS-REx Tagcams instrument support, tests, and test data added [#5424](https://github.com/DOI-USGS/ISIS3/issues/5424)


## [8.1.0] - 2024-01-08
+30 −0
Original line number Diff line number Diff line
# history 2019-01-19 Kris Becker - Original version added to UofA codebase.

Group = Keyword1
  Auto
  InputKey = SpacecraftName
  InputGroup = "IsisCube,Instrument"
  InputPosition  = (IsisCube, Instrument)
  OutputName = Keyword1
  OutputPosition = ("Group","SerialNumberKeywords")
  Translation = ("OsirisRex", "OSIRIS-REx")
  Translation = (*,*)
EndGroup
Group = Keyword2
  Auto
  InputKey = InstrumentId
  InputGroup = "IsisCube,Instrument"
  InputPosition  = (IsisCube, Instrument)
  OutputName = Keyword2
  OutputPosition = ("Group","SerialNumberKeywords")
  Translation = (*,*)
EndGroup
Group = Keyword3
  Auto
  InputKey = SpacecraftClockStartCount
  InputGroup = "IsisCube,Instrument"
  InputPosition  = (IsisCube, Instrument)
  OutputName = Keyword3
  OutputPosition = ("Group","SerialNumberKeywords")
  Translation = (*,*)
EndGroup
+4 −0
Original line number Diff line number Diff line
@@ -142,6 +142,10 @@ Group = InstrumentName
  Translation   = (OCams, SamCam)
  Translation   = (OCams, PolyCam)

  Translation   = (TagCams, NAVCam)
  Translation   = (TagCams, NFTCam)
  Translation   = (TagCams, StowCam)

  # Rosetta
  Translation   = (Osiris, OSINAC)
  Translation   = (Osiris, OSIWAC)
+4 −1
Original line number Diff line number Diff line
#ifndef CameraGroundMap_h
#define CameraGroundMap_h

/** This is free and unencumbered software released into the public domain.
The authors of ISIS do not claim copyright on the contents of this file.
For more details about the LICENSE terms and the AUTHORS, you will
@@ -69,6 +70,9 @@ namespace Isis {
   *                          allow the bundle adjustment to skip the back of planet test during iterations. 
   *                          Also changed the name of the angle variable to cosangle to be more 
   *                          descriptive. References #2591.
   *  @history 2018-07-26 Kris Becker - Move all local variables  and methods to
   *                         protected scope so derived objects can be developed
   *                         properly
   */
  class CameraGroundMap {
    public:
@@ -135,7 +139,6 @@ namespace Isis {
      double p_focalPlaneX; //!< Camera's x focal plane coordinate
      double p_focalPlaneY; //!< Camera's y focal plane coordinate

    private:
      void LookCtoFocalPlaneXY();  //!< Calculate focalplane x/y from lookvector in camera
      /** Surface point calculated from ground coordinates in GetXY and used for partials*/
      std::vector<double> m_pB;
+47 −0
Original line number Diff line number Diff line
/** This is free and unencumbered software released into the public domain.
The authors of ISIS do not claim copyright on the contents of this file.
For more details about the LICENSE terms and the AUTHORS, you will
find files of those names at the top level of this repository. **/

/* SPDX-License-Identifier: CC0-1.0 */

#include "IrregularBodyCameraGroundMap.h"

#include "SurfacePoint.h"

using namespace std;

namespace Isis {

  /** 
   * Constructor
   *
   * @param parent Pointer to camera to be used for mapping with ground
   */
  IrregularBodyCameraGroundMap::IrregularBodyCameraGroundMap(Camera *parent,
      const bool clip_emission_angles) : CameraGroundMap(parent),
      m_clip_emission(clip_emission_angles) {
  }

  /** 
   * This method computes the undistorted focal plane coordinates for a ground
   * position, using the current Spice settings (time and kernels) without
   * resetting the current point values for lat/lon/radius/x/y. The class value
   * value for m_pB and m_lookJ are set by this method.
   * 
   * This method has been reimplemented from the CameraGroundMap class to never
   * perform the emission angle check. This is because it uses the ellipsoid for
   * the check which is in general not adequate for irregular bodies.
   *
   * @param point Surface point (ground position) 
   * @param cudx [out] Pointer to computed undistored x focal plane coordinate
   * @param cudy [out] Pointer to computed undistored y focal plane coordinate
   *
   * @return @b bool If conversion was successful
   */
  bool IrregularBodyCameraGroundMap::GetXY(const SurfacePoint &point, 
                                           double *cudx, double *cudy) {

      return CameraGroundMap::GetXY(point, cudx, cudy, m_clip_emission);
  }      
}
Loading