File failed to load: https://isis.astrogeology.usgs.gov/6.0.0/Object/assets/jax/output/NativeMML/config.js
Isis 3 Programmer Reference
HayabusaNirsCamera.cpp
1 
7 /* SPDX-License-Identifier: CC0-1.0 */
8 
9 #include "HayabusaNirsCamera.h"
10 
11 #include <QString>
12 
13 #include "CameraDistortionMap.h"
14 #include "CameraFocalPlaneMap.h"
15 #include "CameraGroundMap.h"
16 #include "CameraSkyMap.h"
17 #include "IString.h"
18 #include "iTime.h"
19 #include "NaifStatus.h"
20 #include "NirsDetectorMap.h"
21 
22 using namespace std;
23 
24 namespace Isis {
32  HayabusaNirsCamera::HayabusaNirsCamera(Cube &cube) : FramingCamera(cube) {
33  m_instrumentNameLong = "Near InfraRed Spectrometer";
34  m_instrumentNameShort = "NIRS";
35  m_spacecraftNameLong = "Hayabusa";
36  m_spacecraftNameShort = "Hayabusa";
37 
39  Pvl &lab = *cube.label();
40 
41  // Get focal length and pixel pitch from IAK
43  SetFocalLength(FocalLength() * 1000.0); // Convert from meters to mm
44  SetPixelPitch();
45 
46  // Get the start time in et
47  PvlGroup &inst = lab.findGroup("Instrument", Pvl::Traverse);
48 
49  // get the start and stop times
50  QString startTime = inst["SpacecraftClockStartCount"];
51  QString stopTime = inst["SpacecraftClockStopCount"];
52  iTime etStart = getClockTime(startTime);
53  iTime etStop = getClockTime(stopTime);
54 
55  double exposureDuration = etStop - etStart;
56  iTime centerTime = etStart + (exposureDuration / 2.0);
57 
58  // Setup focal plane map
59  CameraFocalPlaneMap *focalMap = new CameraFocalPlaneMap(this, naifIkCode());
60 
61  // lines and samples added to the pvl in the order you
62  // call getDouble()
63  double bLines = Spice::getDouble("INS" + toString(naifIkCode()) + "_BORESIGHT_LINE");
64  double bSamples = Spice::getDouble("INS" + toString(naifIkCode()) + "_BORESIGHT_SAMPLE");
65 
66  focalMap->SetDetectorOrigin(bSamples, bLines);
67 
68  // Setup detector map
70  detMap->SetStartingDetectorSample(0);
71  detMap->SetStartingDetectorLine(0);
72 
73  // Setup distortion map
74  new CameraDistortionMap(this);
75 
76  // Setup the ground and sky map
77  new CameraGroundMap(this);
78  new CameraSkyMap(this);
79 
80  setTime(centerTime);
81  LoadCache();
83  }
84 
85 
90 
91  }
92 
93 
116  pair<iTime, iTime> HayabusaNirsCamera::ShutterOpenCloseTimes(double time,
117  double exposureDuration) {
119  }
120 
121 
133 
134  QList<QPointF> offsets;
135 
136  // Create 8 pts on each edge of pixel
137  int npts = 8;
138 
139  // Top edge of pixel
140  for (double x = -PixelPitch() / 2.0; x <= PixelPitch() / 2.0; x += PixelPitch() / (npts-1)) {
141  offsets.append(QPointF(x, -PixelPitch() / 2.0));
142  }
143  // Right edge of pixel
144  for (double y = -PixelPitch() / 2.0; y <= PixelPitch() / 2.0; y += PixelPitch() / (npts-1)) {
145  offsets.append(QPointF(PixelPitch() / 2.0, y));
146  }
147  // Bottom edge of pixel
148  for (double x = PixelPitch() / 2.0; x >= -PixelPitch() / 2.0; x -= PixelPitch() / (npts-1)) {
149  offsets.append(QPointF(x, PixelPitch() / 2.0));
150  }
151  // Left edge of pixel
152  for (double y = PixelPitch() / 2.0; y >= -PixelPitch() / 2.0; y -= PixelPitch() / (npts-1)) {
153  offsets.append(QPointF(-PixelPitch() / 2.0, y));
154  }
155 
156  return offsets;
157  }
158 }
159 
160 
171 extern "C" Isis::Camera *HayabusaNirsCameraPlugin(Isis::Cube &cube) {
172  return new Isis::HayabusaNirsCamera(cube);
173 }
Isis::CameraFocalPlaneMap::SetDetectorOrigin
void SetDetectorOrigin(const double sample, const double line)
Set the detector origin.
Definition: CameraFocalPlaneMap.cpp:293
Isis::Camera::exposureDuration
virtual double exposureDuration() const
Return the exposure duration for the pixel that the camera is set to.
Definition: Camera.cpp:3063
Isis::NirsDetectorMap
The detector map class for the Hayabusa NIRS camera.
Definition: NirsDetectorMap.h:29
Isis::Spice::time
iTime time() const
Returns the ephemeris time in seconds which was used to obtain the spacecraft and sun positions.
Definition: Spice.cpp:884
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::CameraDetectorMap
Convert between parent image coordinates and detector coordinates.
Definition: CameraDetectorMap.h:47
Isis::HayabusaNirsCamera
This is the camera model for the Hayabusa NIRS camera.
Definition: HayabusaNirsCamera.h:27
QList< QPointF >
Isis::Spice::naifIkCode
SpiceInt naifIkCode() const
This returns the NAIF IK code to use when reading from instrument kernels.
Definition: Spice.cpp:968
Isis::iTime
Parse and return pieces of a time string.
Definition: iTime.h:65
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::HayabusaNirsCamera::~HayabusaNirsCamera
~HayabusaNirsCamera()
Destroys a HayabusaNirsCamera object.
Definition: HayabusaNirsCamera.cpp:89
Isis::Pvl
Container for cube-like labels.
Definition: Pvl.h:119
Isis::FramingCamera::ShutterOpenCloseTimes
virtual std::pair< iTime, iTime > ShutterOpenCloseTimes(double time, double exposureDuration)=0
Returns the shutter open and close times.
Definition: FramingCamera.cpp:42
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::FramingCamera
Generic class for Framing Cameras.
Definition: FramingCamera.h:32
Isis::toString
QString toString(bool boolToConvert)
Global function to convert a boolean to a string.
Definition: IString.cpp:211
Isis::CameraGroundMap
Convert between undistorted focal plane and ground coordinates.
Definition: CameraGroundMap.h:73
Isis::CameraDetectorMap::SetStartingDetectorLine
void SetStartingDetectorLine(const double line)
Set the starting detector line.
Definition: CameraDetectorMap.h:93
Isis::PvlObject::Traverse
@ Traverse
Search child objects.
Definition: PvlObject.h:158
Isis::Sensor::setTime
void setTime(const iTime &time)
By setting the time you essential set the position of the spacecraft and body as indicated in the cla...
Definition: Sensor.cpp:97
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::HayabusaNirsCamera::ShutterOpenCloseTimes
virtual std::pair< iTime, iTime > ShutterOpenCloseTimes(double time, double exposureDuration)
Returns the shutter open and close times.
Definition: HayabusaNirsCamera.cpp:116
Isis::CameraDistortionMap
Distort/undistort focal plane coordinates.
Definition: CameraDistortionMap.h:41
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
Isis::CameraDetectorMap::SetStartingDetectorSample
void SetStartingDetectorSample(const double sample)
Set the starting detector sample.
Definition: CameraDetectorMap.h:79
Isis::Camera::FocalLength
double FocalLength() const
Returns the focal length.
Definition: Camera.cpp:2732
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::Camera::PixelPitch
double PixelPitch() const
Returns the pixel pitch.
Definition: Camera.cpp:2742
Isis::Cube::label
Pvl * label() const
Returns a pointer to the IsisLabel object associated with the cube.
Definition: Cube.cpp:1701
Isis::HayabusaNirsCamera::PixelIfovOffsets
virtual QList< QPointF > PixelIfovOffsets()
Returns the pixel ifov offsets from center of pixel.
Definition: HayabusaNirsCamera.cpp:132
Isis::CameraSkyMap
Convert between undistorted focal plane and ra/dec coordinates.
Definition: CameraSkyMap.h:31
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::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

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:33