Isis 3 Programmer Reference
MocWideAngleDetectorMap.cpp
Go to the documentation of this file.
1 
21 
22 using namespace std;
23 namespace Isis {
29  bool MocWideAngleDetectorMap::SetDetector(const double sample,
30  const double line) {
31  if(!LineScanCameraDetectorMap::SetDetector(sample, line)) return false;
32 
33  if((p_moclab->CrosstrackSumming() == 13) ||
34  (p_moclab->CrosstrackSumming() == 27)) {
35  int detector = (int) sample;
36  if(detector < 1) detector = 1;
37  if(detector >= p_moclab->Detectors()) detector = p_moclab->Detectors() - 1;
38  double samp1 = p_moclab->Sample(detector - 1);
39  double samp2 = p_moclab->Sample(detector);
40  if(samp1 < 0.0) return false;
41  if(samp2 < 0.0) return false;
42 
43  double m = (samp2 - samp1);
44  p_parentSample = m * (sample - detector) + samp2;
45  }
46 
47  return true;
48  }
49 
50 
57  bool MocWideAngleDetectorMap::SetParent(const double sample,
58  const double line) {
59  if(!LineScanCameraDetectorMap::SetParent(sample, line)) return false;
60 
61  // Handle variable summing if necessary
62  if((p_moclab->CrosstrackSumming() == 13) ||
63  (p_moclab->CrosstrackSumming() == 27)) {
64  int isamp = (int) sample;
65  if(isamp < 2) {
66  p_detectorSample = p_moclab->StartDetector(1);
67  p_detectorSample += sample - 1.0;
68  }
69  else if(isamp > p_camera->Samples()) {
70  p_detectorSample = p_moclab->StartDetector(p_camera->Samples());
71  p_detectorSample += sample - p_camera->Samples();
72  }
73  else {
74  int ss = p_moclab->StartDetector(isamp - 1);
75  int es = p_moclab->EndDetector(isamp - 1);
76  double samp1 = (ss + es) / 2.0;
77 
78  ss = p_moclab->StartDetector(isamp);
79  es = p_moclab->EndDetector(isamp);
80  double samp2 = (ss + es) / 2.0;
81 
82  double m = (samp2 - samp1);
83  p_detectorSample = m * (sample - isamp) + samp1;
84  }
85  }
86  return true;
87  }
88 }
89 
Unless noted otherwise, the portions of Isis written by the USGS are public domain.
Namespace for the standard library.
Namespace for ISIS/Bullet specific routines.
Definition: Apollo.h:31