Skip to content

Commit

Permalink
Adding Support for OSIRIS-REx TagCams Instruments (#5427)
Browse files Browse the repository at this point in the history
* Add new IrregularBodyCameraGroundMap class

* Update documentation and app/unit tests

* Initial version of tagcams2isis

Signed-off-by: Kris 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: Kris 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: Kris 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: Kris 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: Kris 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: Kris J. Becker <kbecker@orex.lpl.arizona.edu>

* Removed unused variables to suppress warnings

Signed-off-by: Kris 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: Kris J. Becker <kbecker@orex.lpl.arizona.edu>

* Removed apostrophe that causes problems on Linux

Signed-off-by: Kris 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: Kris 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: Kris 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: Kris 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: Kris J. Becker <kbecker@orex.lpl.arizona.edu>

* Added LT and target/observer swap parameters

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

* Properly initialize distorted/undistorted parms

OsirisRexTagcamsDistortionMap
* Properly initialize distorted/undistorted parameters

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

* tagams2isis.xml fix already happened

* Fixed merge issue

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

* Correct typo

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

* Minor documentation change

Signed-off-by: Kris 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: Kris J. Becker <kbecker@orex.lpl.arizona.edu>
Co-authored-by: Kris J. Becker <kbecker@orex.lpl.arizona.edu>
Co-authored-by: Kelvin Rodriguez <krodriguez@usgs.gov>
  • Loading branch information
3 people authored Apr 4, 2024
1 parent 35b21fc commit d9e91ff
Show file tree
Hide file tree
Showing 44 changed files with 24,873 additions and 140 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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
Expand Down
30 changes: 30 additions & 0 deletions isis/appdata/serialnumbers/OsirisRexTagCamsSerialNumber.trn
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# 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 changes: 4 additions & 0 deletions isis/appdata/translations/Instruments.trn
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
5 changes: 4 additions & 1 deletion isis/src/base/objs/CameraGroundMap/CameraGroundMap.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#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
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
/** 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);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
#ifndef IrregularBodyCameraGroundMap_h
#define IrregularBodyCameraGroundMap_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
find files of those names at the top level of this repository. **/

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

#include "Camera.h"
#include "CameraGroundMap.h"
#include "SurfacePoint.h"

namespace Isis {
/**
* Convert between undistorted focal plane and ground coordinates
*
* This class is derived from CameraGroundMap to support the special case of
* irregular bodies. Particularly, only the GetXY() method is reimplemented
* here to never perform the "emission angle" (in places called "back-of-the-
* planet") test. This is because the test uses the ellipsoid to validate
* ground point visibility along the look vector to the surface. This is not
* adequate for most irregular bodies.
*
* @ingroup Camera
*
* @see CameraGroundMap
*
* @author 2018-07-26 UA/OSIRIS-REx IPWG Team
*
* @internal
* @history 2018-07-26 UA/OSIRIS-REx IPWG Team - Developed to support control
* of irregular bodies
* @history 2024-03-10 Ken Edmundson - Modified per Kris Becker such that the
* emission angle (or back-of-the-planet) test is never
* performed in the GetXY method (see class description
* above).
*/
class IrregularBodyCameraGroundMap : public CameraGroundMap {
public:
IrregularBodyCameraGroundMap(Camera *parent, const bool clip_emission_angles = false);

//! Destructor
virtual ~IrregularBodyCameraGroundMap() {};

virtual bool GetXY(const SurfacePoint &spoint, double *cudx, double *cudy);

protected:
bool m_clip_emission; /**! Test for emission angles? */

};
};
#endif
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
This class will be tested by the applications and the individual Camera models.
7 changes: 7 additions & 0 deletions isis/src/base/objs/IrregularBodyCameraGroundMap/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
ifeq ($(ISISROOT), $(BLANK))
.SILENT:
error:
echo "Please set ISISROOT";
else
include $(ISISROOT)/make/isismake.objs
endif
7 changes: 7 additions & 0 deletions isis/src/osirisrex/apps/tagcams2isis/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
ifeq ($(ISISROOT), $(BLANK))
.SILENT:
error:
echo "Please set ISISROOT";
else
include $(ISISROOT)/make/isismake.apps
endif
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
#
# This translation file is used to produce the ISIS Archive label group
# for the Osiris-REx Tagcams cameras (NAVCam, StowCam, NFTCam).
#
# Translation = (left,right) convert the input "right" to "left"
#
# history 2019-01-10 Kris Becker - Original version added to UofA codebase.
#
Group = ProducerId
Auto
Optional
InputKey = ORIGIN
InputPosition = FITSLABELS
OutputName = ProducerId
OutputPosition = (Object, IsisCube, Group, Archive)
Translation = (*, *)
End_Group

Group = CheckSumStatus
Auto
Optional
InputKey = CKPASS
InputPosition = FITSLABELS
OutputName = CheckSumStatus
OutputPosition = (Object, IsisCube, Group, Archive)
Translation = (*, *)
End_Group

Group = MetaKernel
Auto
Optional
InputKey = META_KER
InputPosition = FITSLABELS
OutputName = MetaKernel
OutputPosition = (Object, IsisCube, Group, Archive)
Translation = (*, *)
End_Group

Group = TAGCAMSCommandedSequenceId
Auto
Optional
InputKey = TCSEQID
InputPosition = FITSLABELS
OutputName = TagcamsCommandedSequenceId
OutputPosition = (Object, IsisCube, Group, Archive)
Translation = (*, *)
End_Group

Group = TAGCAMSCommandedImageId
Auto
Optional
InputKey = TCIMGID
InputPosition = FITSLABELS
OutputName = TagcamsCommandedImageId
OutputPosition = (Object, IsisCube, Group, Archive)
Translation = (*, *)
End_Group

Group = RawCameraHeadTemperature
Auto
Optional
InputKey = TCCHTEMP
InputPosition = FITSLABELS
InputDefault = 0
OutputName = RawCameraHeadTemperature
OutputPosition = (Object, IsisCube, Group, Archive)
Translation = (*, *)
End_Group

Group = RAAtReferencePixel
Auto
Optional
InputKey = CRVAL1
InputPosition = FITSLABELS
InputDefault = 0
OutputName = RAAtReferencePixel
OutputPosition = (Object, IsisCube, Group, Archive)
Translation = (*, *)
End_Group

Group = DecAtReferencePixel
Auto
Optional
InputKey = CRVAL2
InputPosition = FITSLABELS
InputDefault = 0
OutputName = DecAtReferencePixel
OutputPosition = (Object, IsisCube, Group, Archive)
Translation = (*, *)
End_Group

End
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
#
# This translation file is used to produce the ISIS BandBin label group
# for the OSIRIS-REx Tagcams cameras (NAVCam, StowCam, NFTCam).
# Translation = (left,right) convert the input "right" to "left"
#
# history 2019-01-19 Kris Becker - Original version added to UofA codebase.

Group = FilterName
Auto
InputKey = FILTNAME
InputPosition = FITSLABELS
InputDefault = Monochrome
OutputName = FilterName
OutputPosition = (Object, IsisCube, Group, BandBin)
InputDefault = Unknown
Translation = (*, *)
End_Group

Group = Name
Auto
InputKey = INSTRUME
InputPosition = FITSLABELS
InputDefault = TagCams
OutputName = Name
OutputPosition = (Object, IsisCube, Group, BandBin)
InputDefault = Unknown
Translation = (NAVCam, NCM)
Translation = (NFTCam, NFT)
Translation = (StowCam, STO)
Translation = (TagCams, *)
End_Group

Group = FilterNumber
Auto
InputKey = FILTNUMB
InputPosition = FITSLABELS
InputDefault = 1
OutputName = Number
OutputPosition = (Object, IsisCube, Group, BandBin)
InputDefault = Unknown
Translation = (*, *)
End_Group

Group = FilterCenter
Auto
InputKey = INSTRUME
InputPosition = FITSLABELS
OutputName = Center
OutputPosition = (Object, IsisCube, Group, BandBin)
Translation = (550 <nm>, N/A)
Translation = (550 <nm>, NCM)
Translation = (550 <nm>, NFT)
Translation = (550 <nm>, STO)
Translation = (*, *)
End_Group

End
Loading

0 comments on commit d9e91ff

Please sign in to comment.