File failed to load: https://isis.astrogeology.usgs.gov/6.0.0/Object/assets/jax/output/NativeMML/config.js
Isis 3 Programmer Reference
NewHorizonsMvicTdiCamera.cpp
1 
7 /* SPDX-License-Identifier: CC0-1.0 */
8 
9 #include "NewHorizonsMvicTdiCamera.h"
10 
11 #include <QDebug>
12 #include <QString>
13 
14 #include "NewHorizonsMvicTdiCameraDistortionMap.h"
15 #include "CameraFocalPlaneMap.h"
16 #include "IException.h"
17 #include "iTime.h"
18 #include "LineScanCameraDetectorMap.h"
19 #include "LineScanCameraGroundMap.h"
20 #include "LineScanCameraSkyMap.h"
21 #include "NaifStatus.h"
22 
23 using namespace std;
24 namespace Isis {
32  NewHorizonsMvicTdiCamera::NewHorizonsMvicTdiCamera(Cube &cube) : LineScanCamera(cube) {
33  m_instrumentNameLong = "Multispectral Visible Imaging TDI Camera";
34  m_instrumentNameShort = "MVIC TDI";
35  m_spacecraftNameLong = "New Horizons";
36  m_spacecraftNameShort = "NewHorizons";
37 
39 
40  // Set the pixel pitch, focal length and row offset from Mvic frame transfer array
41  SetPixelPitch();
43 
44  Pvl &lab = *cube.label();
45  PvlGroup &inst = lab.findGroup("Instrument", Pvl::Traverse);
46  QString stime = inst["SpacecraftClockStartCount"];
47 
48  m_etStart = getClockTime(stime).Et();
49  m_lineRate = 1.0 / (double)inst["TdiRate"];
50 
51  // The detector map tells us how to convert from image coordinates to
52  // detector coordinates. In our case, a (sample,line) to a (sample,time)
53  new LineScanCameraDetectorMap(this, m_etStart, m_lineRate);
54 
55  // The focal plane map tells us how to go from detector position
56  // to focal plane x/y (distorted). That is, (sample,time) to (x,y).
57  CameraFocalPlaneMap *focalMap = new CameraFocalPlaneMap(this, naifIkCode());
58 
59  // This origin does not use 5024/2 because we strip off the leading and trailing 12 pixels
60  focalMap->SetDetectorOrigin(2500.5, -16.5);
61 
62  // Read legendre polynomial distortion coefficients and boresight offsets from the instrument
63  // kernels. Then construct the distortion map.
64 
65  // read legendre polynomial distortion coefs from the NAIF Kernels
66  QString naifXKey = "INS-98900_DISTORTION_COEF_X";
67  QString naifYKey = "INS-98900_DISTORTION_COEF_Y";
68  QString naifppKey = "INS-98900_PP_OFFSET";
69  vector<double> distCoefX;
70  vector<double> distCoefY;
71  vector<double> residualColumnDistCoefs;
72  vector<double> residualRowDistCoefs;
73 
74  for (int i=0; i < 20; i++) {
75  distCoefX.push_back(getDouble(naifXKey,i));
76  distCoefY.push_back(getDouble(naifYKey,i));
77  }
78 
79  // read residual polynomial distortion coefs from the NAIF Kernels
80  int code = naifIkCode();
81  QString naifCOLKey = "INS" + toString(code) + "_RESIDUAL_COL_DIST_COEF";
82  QString naifROWKey = "INS" + toString(code) + "_RESIDUAL_ROW_DIST_COEF";
83 
84  for (int i=0; i < 6; i++) {
85  residualColumnDistCoefs.push_back(getDouble(naifCOLKey,i));
86  residualRowDistCoefs.push_back(getDouble(naifROWKey,i));
87  }
88 
89  new NewHorizonsMvicTdiCameraDistortionMap(this, distCoefX, distCoefY, residualColumnDistCoefs,
90  residualRowDistCoefs);
91 
92  // Setup the ground and sky map
93  new LineScanCameraGroundMap(this);
94  new LineScanCameraSkyMap(this);
95 
96  LoadCache();
98  }
99 }
100 
101 
102 // Plugin
112 extern "C" Isis::Camera *NewHorizonsMvicTdiCameraPlugin(Isis::Cube &cube) {
113  return new Isis::NewHorizonsMvicTdiCamera(cube);
114 }
Isis::LineScanCameraSkyMap
Convert between undistorted focal plane and ra/dec coordinates.
Definition: LineScanCameraSkyMap.h:34
Isis::CameraFocalPlaneMap::SetDetectorOrigin
void SetDetectorOrigin(const double sample, const double line)
Set the detector origin.
Definition: CameraFocalPlaneMap.cpp:293
Isis::PvlObject::findGroup
PvlGroupIterator findGroup(const QString &name, PvlGroupIterator beg, PvlGroupIterator end)
Find a group with the specified name, within these indexes.
Definition: PvlObject.h:129
Isis::Spice::naifIkCode
SpiceInt naifIkCode() const
This returns the NAIF IK code to use when reading from instrument kernels.
Definition: Spice.cpp:968
Isis::NewHorizonsMvicTdiCamera
New Horizons Mvic Camera, Tdi mode.
Definition: NewHorizonsMvicTdiCamera.h:39
Isis::Camera::m_instrumentNameLong
QString m_instrumentNameLong
Full instrument name.
Definition: Camera.h:496
Isis::Spice::getClockTime
virtual iTime getClockTime(QString clockValue, int sclkCode=-1, bool clockTicks=false)
This converts the spacecraft clock ticks value (clockValue) to an iTime.
Definition: Spice.cpp:1053
Isis::Pvl
Container for cube-like labels.
Definition: Pvl.h:119
Isis::NaifStatus::CheckErrors
static void CheckErrors(bool resetNaif=true)
This method looks for any naif errors that might have occurred.
Definition: NaifStatus.cpp:28
Isis::Camera
Definition: Camera.h:236
Isis::toString
QString toString(bool boolToConvert)
Global function to convert a boolean to a string.
Definition: IString.cpp:211
Isis::PvlObject::Traverse
@ Traverse
Search child objects.
Definition: PvlObject.h:158
Isis::iTime::Et
double Et() const
Returns the ephemeris time (TDB) representation of the time as a double.
Definition: iTime.h:126
Isis::Camera::SetPixelPitch
void SetPixelPitch()
Reads the Pixel Pitch from the instrument kernel.
Definition: Camera.cpp:1418
Isis::PvlGroup
Contains multiple PvlContainers.
Definition: PvlGroup.h:41
Isis::LineScanCamera
Generic class for Line Scan Cameras.
Definition: LineScanCamera.h:36
Isis::LineScanCameraGroundMap
Convert between undistorted focal plane and ground coordinates.
Definition: LineScanCameraGroundMap.h:49
Isis::Cube
IO Handler for Isis Cubes.
Definition: Cube.h:167
Isis::Camera::m_spacecraftNameLong
QString m_spacecraftNameLong
Full spacecraft name.
Definition: Camera.h:498
std
Namespace for the standard library.
Isis::Camera::LoadCache
void LoadCache()
This loads the spice cache big enough for this image.
Definition: Camera.cpp:2420
Isis::Camera::m_instrumentNameShort
QString m_instrumentNameShort
Shortened instrument name.
Definition: Camera.h:497
Isis::CameraFocalPlaneMap
Convert between distorted focal plane and detector coordinates.
Definition: CameraFocalPlaneMap.h:85
Isis::Cube::label
Pvl * label() const
Returns a pointer to the IsisLabel object associated with the cube.
Definition: Cube.cpp:1701
Isis::Spice::getDouble
SpiceDouble getDouble(const QString &key, int index=0)
This returns a value from the NAIF text pool.
Definition: Spice.cpp:1039
Isis::NewHorizonsMvicTdiCameraDistortionMap
Distort/undistort focal plane coordinates for New Horizons/MVIC.
Definition: NewHorizonsMvicTdiCameraDistortionMap.h:34
Isis::Camera::m_spacecraftNameShort
QString m_spacecraftNameShort
Shortened spacecraft name.
Definition: Camera.h:499
Isis::Camera::SetFocalLength
void SetFocalLength()
Reads the focal length from the instrument kernel.
Definition: Camera.cpp:1411
Isis
This is free and unencumbered software released into the public domain.
Definition: Apollo.h:16
Isis::LineScanCameraDetectorMap
Convert between parent image coordinates and detector coordinates.
Definition: LineScanCameraDetectorMap.h:37

U.S. Department of the Interior | U.S. Geological Survey
ISIS | Privacy & Disclaimers | Astrogeology Research Program
To contact us, please post comments and questions on the USGS Astrogeology Discussion Board
To report a bug, or suggest a feature go to: ISIS Github
File Modified: 07/13/2023 15:16:56