File failed to load: https://isis.astrogeology.usgs.gov/6.0.0/Object/assets/jax/output/NativeMML/config.js
Isis 3 Programmer Reference
Hyb2OncCamera.cpp
1 
7 /* SPDX-License-Identifier: CC0-1.0 */
8 
9 #include "Hyb2OncCamera.h"
10 
11 #include <QString>
12 #include <QtMath>
13 
14 #include "CameraDetectorMap.h"
15 #include "CameraFocalPlaneMap.h"
16 #include "CameraGroundMap.h"
17 #include "CameraSkyMap.h"
18 #include "Hyb2OncDistortionMap.h"
19 #include "IString.h"
20 #include "iTime.h"
21 #include "NaifStatus.h"
22 
23 using namespace std;
24 
25 namespace Isis {
33  Hyb2OncCamera::Hyb2OncCamera(Cube &cube) : FramingCamera(cube) {
34  m_spacecraftNameLong = "Hayabusa2";
35  m_spacecraftNameShort = "Hayabusa2";
36 
37  // Set the correct instrument name based on NaifFrameCode in kernels group
38 
39  // ONC-T
40  if (naifIkCode() == -37100) {
41  m_instrumentNameLong = "Optical Navigation Camera - Telescopic Camera";
42  m_instrumentNameShort = "ONC-T";
43  }
44  // ONC-W1
45  else if (naifIkCode() == -37110) {
46  m_instrumentNameLong = "Optical Navigation Camera - W1 Camera";
47  m_instrumentNameShort = "ONC-W1";
48  }
49  // ONC-W2
50  else if (naifIkCode() == -37120) {
51  m_instrumentNameLong = "Optical Navigation Camera - W2 Camera";
52  m_instrumentNameShort = "ONC-W2";
53  }
54  else {
55  QString msg = "File does not appear to be a Hayabusa2 image";
56  throw IException(IException::User, msg, _FILEINFO_);
57  }
58 
60 
61  SetFocalLength(); // Retrives from IK stored in units of mm
62  SetPixelPitch(); // Get from IAK
63 
64  // Get the start time in et
65  Pvl &lab = *cube.label();
66  PvlGroup &inst = lab.findGroup("Instrument", Pvl::Traverse);
67 
68  // set variables startTime and exposureDuration
69  QString stime = inst["SpacecraftClockStartCount"];
70  iTime etStart = getClockTime(stime);
71 
72  double exposureDuration = ((double) inst["ExposureDuration"]);
73  iTime centerTime = etStart + (exposureDuration / 2.0);
74 
75  // Setup focal plane map
76  CameraFocalPlaneMap *focalMap = new CameraFocalPlaneMap(this, naifIkCode());
77 
78  // BORESIGHT SAMPLE AND LINE still need to be added to the IAK
79  double bLines = Spice::getDouble("INS" + toString(naifIkCode()) + "_BORESIGHT_LINE");
80  double bSamples = Spice::getDouble("INS" + toString(naifIkCode()) + "_BORESIGHT_SAMPLE");
81 
82  focalMap->SetDetectorOrigin(bSamples, bLines);
83 
84  // Setup detector map (use default for now)
85  CameraDetectorMap *detMap = new CameraDetectorMap(this);
86 
87  // Handle summing
88  int binning = inst["Binning"];
89  detMap->SetDetectorLineSumming(binning);
90  detMap->SetDetectorSampleSumming(binning);
91 
92  // Setup distortion map (use default for now)
93  CameraDistortionMap *distortionMap = new Hyb2OncDistortionMap(this);
94  distortionMap->SetDistortion(naifIkCode());
95 
96  // Setup the ground and sky map
97  new CameraGroundMap(this);
98  new CameraSkyMap(this);
99 
100  setTime(centerTime);
101  LoadCache();
103  }
104 
105 
110  }
111 
112 
131  pair<iTime, iTime> Hyb2OncCamera::ShutterOpenCloseTimes(double time,
132  double exposureDuration) {
134  }
135 
136 
144  return (-37000);
145  }
146 
147 
155  return (1);
156  }
157 
158 
166  return (1);
167  }
168 }
169 
170 
179 extern "C" Isis::Camera *Hyb2OncCameraPlugin(Isis::Cube &cube) {
180  return new Isis::Hyb2OncCamera(cube);
181 }
Isis::Hyb2OncCamera
This is the camera model for the Hayabusa2 ONC camera.
Definition: Hyb2OncCamera.h:27
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::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::CameraDistortionMap::SetDistortion
virtual void SetDistortion(int naifIkCode)
Load distortion coefficients.
Definition: CameraDistortionMap.cpp:58
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::Hyb2OncCamera::ShutterOpenCloseTimes
virtual std::pair< iTime, iTime > ShutterOpenCloseTimes(double time, double exposureDuration)
Returns the shutter open and close times.
Definition: Hyb2OncCamera.cpp:131
Isis::CameraDetectorMap
Convert between parent image coordinates and detector coordinates.
Definition: CameraDetectorMap.h:47
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::Hyb2OncCamera::CkFrameId
virtual int CkFrameId() const
CK frame ID - - Instrument Code from spacit run on CK.
Definition: Hyb2OncCamera.cpp:143
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::CameraDetectorMap::SetDetectorSampleSumming
void SetDetectorSampleSumming(const double summing)
Set sample summing mode.
Definition: CameraDetectorMap.h:108
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::Hyb2OncCamera::CkReferenceId
virtual int CkReferenceId() const
CK Reference ID - J2000.
Definition: Hyb2OncCamera.cpp:154
Isis::CameraGroundMap
Convert between undistorted focal plane and ground coordinates.
Definition: CameraGroundMap.h:73
Isis::CameraDetectorMap::SetDetectorLineSumming
void SetDetectorLineSumming(const double summing)
Set line summing mode.
Definition: CameraDetectorMap.h:123
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::CameraDistortionMap
Distort/undistort focal plane coordinates.
Definition: CameraDistortionMap.h:41
Isis::Cube
IO Handler for Isis Cubes.
Definition: Cube.h:167
Isis::IException
Isis exception class.
Definition: IException.h:91
Isis::Camera::m_spacecraftNameLong
QString m_spacecraftNameLong
Full spacecraft name.
Definition: Camera.h:498
Isis::Hyb2OncCamera::~Hyb2OncCamera
~Hyb2OncCamera()
Default Destructor.
Definition: Hyb2OncCamera.cpp:109
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::CameraSkyMap
Convert between undistorted focal plane and ra/dec coordinates.
Definition: CameraSkyMap.h:31
Isis::Hyb2OncDistortionMap
Distort/undistort focal plane coordinates for Hayabusa 2's ONC cameras.
Definition: Hyb2OncDistortionMap.h:30
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::Hyb2OncCamera::SpkReferenceId
virtual int SpkReferenceId() const
SPK Reference ID - J2000.
Definition: Hyb2OncCamera.cpp:165
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::IException::User
@ User
A type of error that could only have occurred due to a mistake on the user's part (e....
Definition: IException.h:126

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