Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding Support for OSIRIS-REx TagCams Instruments #5427

Merged
merged 37 commits into from
Apr 4, 2024
Merged
Show file tree
Hide file tree
Changes from 23 commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
48e4de1
Add new IrregularBodyCameraGroundMap class
KrisBecker Jul 26, 2018
41e4141
Update documentation and app/unit tests
KrisBecker Sep 19, 2018
cc1ebcc
Merge branch 'ocams_support' of http://orgit:7990/scm/isis/enhancemen…
KrisBecker Dec 2, 2018
a93659d
Initial version of tagcams2isis
KrisBecker Jan 11, 2019
8e0c8c2
Initial version of OREX TAGCAMS Camera Model
KrisBecker Jan 23, 2019
e7c0400
Improved import of TAGCAMS image data
KrisBecker Jan 23, 2019
fd27ef1
Add complete version of OpenCV distortion model
KrisBecker Jan 23, 2019
b6c96f1
Modified OpenCV distortion model
KrisBecker Jan 23, 2019
161070d
Update TAGCAMS OpenCV distortion model parameters
KrisBecker Jan 24, 2019
67a2225
Removed unused variables to suppress warnings
KrisBecker Jan 24, 2019
39398a9
Typo in iTime.h include
KrisBecker Jan 24, 2019
1e0dacb
Removed apostrophe that causes problems on Linux
KrisBecker Jan 24, 2019
f84d6f9
Update tagcams2isis temperature computation
KrisBecker Jan 28, 2019
0fbbbb8
Update TAGCAMS camera model
KrisBecker Jan 28, 2019
dc67506
New version of TAGCAMS camera model parameters
KrisBecker Jan 28, 2019
7869994
Updates to TAGCAMS IAK
KrisBecker Feb 4, 2019
2ff7fe0
Added LT and target/observer swap parameters
KrisBecker Feb 4, 2019
de20570
Properly initialize distorted/undistorted parms
KrisBecker Feb 4, 2019
db79996
tagams2isis.xml fix already happened
KrisBecker Jan 24, 2019
791c59b
Fixed merge issue
KrisBecker Mar 7, 2019
97bdc17
Correct typo
KrisBecker Mar 29, 2019
d867bb4
Minor documentation change
KrisBecker Feb 10, 2020
79ae1bb
Merge UofA branch 'main' into USGS ISIS repo for 1) isis/src/osirisre…
kledmundson Feb 6, 2024
91e111e
Merge branch 'dev' of https://github.com/kledmundson/ISIS3 into dev
kledmundson Feb 19, 2024
233c2c6
Modified for easy development of derived classes
KrisBecker Jul 26, 2018
f6074cb
Added translations for OSIRIS-REx TagCams instruments NFTCam, NAVCam,…
kledmundson Feb 28, 2024
2626786
Committing test data for OsirisREx TagCams support. Addresses #5424.
kledmundson Mar 10, 2024
5e7751c
Initial commit of Osiris-REx Tagcams ingestion program tagcams2isis a…
kledmundson Mar 10, 2024
f5dd8c0
Adding support for intersections with irregular bodies, in particular…
kledmundson Mar 10, 2024
ec8ef50
Unit test and truth data for OsirisREx tagcams instruments. Addresses…
kledmundson Mar 10, 2024
9ec9fa0
Support for OsirisREx tagcams instruments. Addresses #5424.
kledmundson Mar 10, 2024
26f13c9
CHANGELOG entry for Osiris-REx tagcams instrument support. Addresses …
kledmundson Mar 10, 2024
acac69f
Merge branch 'DOI-USGS:dev' into enhancement/orexTagcamsSupport
kledmundson Mar 15, 2024
80fd22f
Merge branch 'DOI-USGS:dev' into enhancement/orexTagcamsSupport
kledmundson Mar 19, 2024
39a4ca0
Per review comments 2024-03-18: 1) fixed typo in IrregularBodyGroundM…
kledmundson Mar 19, 2024
ea82895
Per Adam's suggestion 2024-03-19, modified second tagcams2isis method…
kledmundson Mar 19, 2024
7d8e904
Merge branch 'dev' into enhancement/orexTagcamsSupport
Kelvinrr Apr 4, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,127 @@
/**
* @file
* $Revision: 1.7 $
* $Date: 2010/03/27 06:36:41 $
*
* Unless noted otherwise, the portions of Isis written by the USGS are
* public domain. See individual third-party library and package descriptions
* for intellectual property information, user agreements, and related
* information.
*
* Although Isis has been used by the USGS, no warranty, expressed or
* implied, is made by the USGS as to the accuracy and functioning of such
* software and related material nor shall the fact of distribution
* constitute any such warranty, and no responsibility is assumed by the
* USGS in connection therewith.
*
* For additional information, launch
* $ISISROOT/doc//documents/Disclaimers/Disclaimers.html
* in a browser or see the Privacy & Disclaimers page on the Isis website,
* http://isis.astrogeology.usgs.gov, and the USGS privacy and disclaimers on
* http://www.usgs.gov/privacy.html.
*/
#include "IrregularBodyCameraGroundMap.h"

#include <iostream>

#include <QDebug>

#include <SpiceUsr.h>

#include "IException.h"
#include "Latitude.h"
#include "Longitude.h"
#include "NaifStatus.h"
#include "SurfacePoint.h"
#include "Target.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 isIrregular) :
CameraGroundMap(parent), m_isBodyIrregular(isIrregular) {
}


/**
* Compute undistorted focal plane coordinate from ground position using current Spice
* from SetImage call
*
* This method will compute the undistorted focal plane coordinate 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 for m_pB and m_lookJ are set by this method.
*
* @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) {

// Check to determine if the body is irregular. If not, go ahead and
// use CameraGroundMap implementation
if ( !m_isBodyIrregular ) {
return ( CameraGroundMap::GetXY(point, cudx, cudy) );
}


// Do everything CameraGroundMap::GetXY does but the emission angle check.

vector<double> pB(3);
pB[0] = point.GetX().kilometers();
pB[1] = point.GetY().kilometers();
pB[2] = point.GetZ().kilometers();

// Check for Sky images
if (p_camera->target()->isSky()) {
return false;
}

// Should a check be added to make sure SetImage has been called???

// Get spacecraft vector in j2000 coordinates
SpiceRotation *bodyRot = p_camera->bodyRotation();
SpiceRotation *instRot = p_camera->instrumentRotation();
vector<double> pJ = bodyRot->J2000Vector(pB);
vector<double> sJ = p_camera->instrumentPosition()->Coordinate();

// Calculate lookJ
vector<double> lookJ(3);
for (int ic = 0; ic < 3; ic++) {
lookJ[ic] = pJ[ic] - sJ[ic];
}

// Save pB for target body partial derivative calculations NEW *** DAC 8-14-2015
m_pB = pB;

// Ok, this is where the emission angle check would be but we will assume
// it is always visible until a better solution can be identified. This
// method is primarily use in BundleAdjust and returning false will cause
// an abort. This must be fixed!


// Get the look vector in the camera frame and the instrument rotation
m_lookJ.resize(3);
m_lookJ = lookJ;
vector<double> lookC(3);
lookC = instRot->ReferenceVector(m_lookJ);

// Get focal length with direction for scaling coordinates
double fl = p_camera->DistortionMap()->UndistortedFocalPlaneZ();

*cudx = lookC[0] * fl / lookC[2];
*cudy = lookC[1] * fl / lookC[2];
return true;
}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
/**
* @file
* $Revision: 1.7 $
* $Date: 2010/03/27 06:36:41 $
*
* Unless noted otherwise, the portions of Isis written by the USGS are
* public domain. See individual third-party library and package descriptions
* for intellectual property information, user agreements, and related
* information.
*
* Although Isis has been used by the USGS, no warranty, expressed or
* implied, is made by the USGS as to the accuracy and functioning of such
* software and related material nor shall the fact of distribution
* constitute any such warranty, and no responsibility is assumed by the
* USGS in connection therewith.
*
* For additional information, launch
* $ISISROOT/doc//documents/Disclaimers/Disclaimers.html
* in a browser or see the Privacy &amp; Disclaimers page on the Isis website,
* http://isis.astrogeology.usgs.gov, and the USGS privacy and disclaimers on
* http://www.usgs.gov/privacy.html.
*/

#ifndef IrregularBodyCameraGroundMap_h
#define IrregularBodyCameraGroundMap_h

#include "Camera.h"
#include "CameraDistortionMap.h"
#include "CameraGroundMap.h"
#include "SpicePosition.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
* because it uses the ellipsiod 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
*/
class IrregularBodyCameraGroundMap : public CameraGroundMap {
public:
IrregularBodyCameraGroundMap(Camera *parent, const bool isIrregular = true);

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

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

protected:
bool m_isBodyIrregular; /**! Is the body irregular */

};
};
#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
8 changes: 8 additions & 0 deletions isis/src/base/objs/IrregularBodyCameraGroundMap/unitTest.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#include <iostream>
#include "Preference.h"

using namespace std;
int main() {
Isis::Preference::Preferences(true);
cout << "This class will be tested by the applications and the individual Camera models." << endl;
}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why even include it then? We really rather have more Makefile based tests.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed.

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
Loading