9#include "OsirisRexOcamsCamera.h"
14#include "CameraDetectorMap.h"
15#include "CameraFocalPlaneMap.h"
16#include "CameraGroundMap.h"
17#include "CameraSkyMap.h"
18#include "IrregularBodyCameraGroundMap.h"
21#include "NaifStatus.h"
22#include "OsirisRexDistortionMap.h"
47 if (frameCode == -64361) {
51 else if (frameCode == -64362) {
55 else if ((frameCode == -64360) || (frameCode >= -64616 && frameCode <= -64500)) {
60 QString msg =
"Unable to construct OSIRIS-REx camera model. "
61 "Unrecognized NaifFrameCode [" +
toString(frameCode) +
"].";
62 throw IException(IException::User, msg, _FILEINFO_);
65 Pvl &lab = *cube.
label();
66 PvlGroup inst = lab.findGroup(
"Instrument", Pvl::Traverse);
67 QString ikCode =
toString(frameCode);
68 int focusIkCode(frameCode);
71 if (inst.hasKeyword(
"PolyCamFocusPositionNaifId")) {
72 if (QString::compare(
"NONE", inst[
"PolyCamFocusPositionNaifId"], Qt::CaseInsensitive) != 0) {
73 focusIkCode = toInt(inst[
"PolyCamFocusPositionNaifId"][0]);
78 PvlGroup bandBin = lab.findGroup(
"BandBin", Pvl::Traverse);
79 QString filterName = bandBin[
"FilterName"];
82 QString dcode(
toString(distortCode));
84 QString focalLength =
"INS" + dcode +
"_FOCAL_LENGTH";
88 QString pitch =
"INS" + dcode +
"_PIXEL_SIZE";
93 QString clockCount = inst[
"SpacecraftClockStartCount"];
118 dmodel =
getString(
"INS" + ikCode +
"_DISTORTION_MODEL").toUpper();
119 }
catch (IException &ie) {
126 if (
"OPENCV" == dmodel) {
132 double camHeadTemp(0.0);
134 if ( inst.hasKeyword(camkey) ) {
135 camHeadTemp = (double) inst[camkey];
139 else if (
"OCAMS" == dmodel ) {
142 if ( !distortionMap->
SetDistortion(distortCode, filterName) ) {
241 const int polyfocusCode,
242 const QString &filter)
const {
246 QString fname = filter.toUpper();
248 if (
"PAN" == fname )
return ( -64364 );
249 if (
"B" == fname )
return ( -64365 );
250 if (
"V" == fname )
return ( -64366 );
251 if (
"W" == fname )
return ( -64367 );
252 if (
"X" == fname )
return ( -64368 );
257 return ( polyfocusCode );
Unless noted otherwise, the portions of Isis written by the USGS are public domain.
Convert between parent image coordinates and detector coordinates.
Distort/undistort focal plane coordinates.
Convert between distorted focal plane and detector coordinates.
void SetDetectorOrigin(const double sample, const double line)
Set the detector origin.
QString m_spacecraftNameLong
Full spacecraft name.
virtual double exposureDuration() const
Return the exposure duration for the pixel that the camera is set to.
void SetFocalLength()
Reads the focal length from the instrument kernel.
void SetPixelPitch()
Reads the Pixel Pitch from the instrument kernel.
void LoadCache()
This loads the spice cache big enough for this image.
QString m_instrumentNameShort
Shortened instrument name.
QString m_spacecraftNameShort
Shortened spacecraft name.
QString m_instrumentNameLong
Full instrument name.
Convert between undistorted focal plane and ra/dec coordinates.
IO Handler for Isis Cubes.
Pvl * label() const
Returns a pointer to the IsisLabel object associated with the cube.
FramingCamera(Cube &cube)
Constructs the FramingCamera object.
virtual std::pair< iTime, iTime > ShutterOpenCloseTimes(double time, double exposureDuration)=0
Returns the shutter open and close times.
Convert between undistorted focal plane and ground coordinates.
static void CheckErrors(bool resetNaif=true)
This method looks for any naif errors that might have occurred.
Distort/undistort focal plane coordinates for OSIRIS REx's cameras.
virtual bool SetDistortion(int naifIkCode, QString filter="UNKNOWN")
Load distortion coefficients and center-of-distortion for OCAMS.
This class models the behavior and attributes of the OSIRIS-REx Cameras: Mapping Camera,...
OsirisRexOcamsCamera(Cube &cube)
Constructs an OSIRIS-REx Camera Model using the image labels.
virtual std::pair< iTime, iTime > ShutterOpenCloseTimes(double time, double exposureDuration)
Returns the shutter open and close times.
~OsirisRexOcamsCamera()
Destroys the MapCamera object.
virtual int CkFrameId() const
The frame ID for the spacecraft (or instrument) used by the Camera-matrix Kernel.
virtual int CkReferenceId() const
The frame ID for the reference coordinate system used by the Camera-matrix Kernel.
int getFunctionalIkCode(const int naifIkCode, const int polyfocusCode, const QString &filter) const
Determine best functional IK code for distortion models.
virtual int SpkReferenceId() const
The reference frame ID for the Spacecraft Kernel is 1, representing J2000.
OsirisRexOcamsOpenCVDistortionMap camera distortion model for TAGCAMS.
void SetCameraTemperature(const double temp)
Set camera head temperature for the model.
void setTime(const iTime &time)
By setting the time you essential set the position of the spacecraft and body as indicated in the cla...
QString getString(const QString &key, int index=0)
This returns a value from the NAIF text pool.
virtual iTime getClockTime(QString clockValue, int sclkCode=-1, bool clockTicks=false)
This converts the spacecraft clock ticks value (clockValue) to an iTime.
virtual iTime time() const
Returns the ephemeris time in seconds which was used to obtain the spacecraft and sun positions.
SpiceInt naifIkCode() const
This returns the NAIF IK code to use when reading from instrument kernels.
SpiceDouble getDouble(const QString &key, int index=0)
This returns a value from the NAIF text pool.
Parse and return pieces of a time string.
double Et() const
Returns the ephemeris time (TDB) representation of the time as a double.
This is free and unencumbered software released into the public domain.
QString toString(const LinearAlgebra::Vector &vector, int precision)
A global function to format LinearAlgebra::Vector as a QString with the given precision.
Namespace for the standard library.