|
Isis 3.0 Object Programmers' Reference |
Home |
00001 00021 #include "UvvisCamera.h" 00022 00023 #include "CameraDetectorMap.h" 00024 #include "CameraDistortionMap.h" 00025 #include "CameraFocalPlaneMap.h" 00026 #include "CameraGroundMap.h" 00027 #include "CameraSkyMap.h" 00028 #include "IString.h" 00029 #include "iTime.h" 00030 #include "NaifStatus.h" 00031 00032 using namespace std; 00033 00034 namespace Isis { 00044 UvvisCamera::UvvisCamera(Pvl &lab) : FramingCamera(lab) { 00045 NaifStatus::CheckErrors(); 00046 // Get the camera characteristics 00047 SetFocalLength(); 00048 SetPixelPitch(); 00049 00050 // Get the start time in et 00051 PvlGroup inst = lab.FindGroup("Instrument", Pvl::Traverse); 00052 00053 // set variables startTime and exposureDuration 00054 double time = iTime((QString)inst["StartTime"]).Et(); 00055 00056 // divide exposure duration keyword value by 1000 to convert to seconds 00057 double exposureDuration = ((double) inst["ExposureDuration"]) / 1000.0; 00058 pair<iTime, iTime> shuttertimes = ShutterOpenCloseTimes(time, exposureDuration); 00059 // Add half exposure duration to get time at center of image 00060 iTime centerTime = shuttertimes.first.Et() + exposureDuration / 2.0; 00061 00062 // Setup detector map 00063 new CameraDetectorMap(this); 00064 00065 // Setup focal plane map 00066 CameraFocalPlaneMap *focalMap = new CameraFocalPlaneMap(this, naifIkCode()); 00067 00068 focalMap->SetDetectorOrigin( 00069 Spice::getDouble("INS" + toString(naifIkCode()) + 00070 "_BORESIGHT_SAMPLE"), 00071 Spice::getDouble("INS" + toString(naifIkCode()) + 00072 "_BORESIGHT_LINE")); 00073 00074 // Setup distortion map 00075 new CameraDistortionMap(this); 00076 00077 // Setup the ground and sky map 00078 new CameraGroundMap(this); 00079 new CameraSkyMap(this); 00080 00081 setTime(centerTime); 00082 LoadCache(); 00083 NaifStatus::CheckErrors(); 00084 } 00085 00108 pair<iTime, iTime> UvvisCamera::ShutterOpenCloseTimes(double time, 00109 double exposureDuration) { 00110 return FramingCamera::ShutterOpenCloseTimes(time, exposureDuration); 00111 } 00112 } 00113 00114 00126 extern "C" Isis::Camera *UvvisCameraPlugin(Isis::Pvl &lab) { 00127 return new Isis::UvvisCamera(lab); 00128 }