9 #include "MocWideAngleDetectorMap.h"
18 bool MocWideAngleDetectorMap::SetDetector(
const double sample,
20 if(!LineScanCameraDetectorMap::SetDetector(sample, line))
return false;
22 if((p_moclab->CrosstrackSumming() == 13) ||
23 (p_moclab->CrosstrackSumming() == 27)) {
24 int detector = (int) sample;
25 if(detector < 1) detector = 1;
26 if(detector >= p_moclab->Detectors()) detector = p_moclab->Detectors() - 1;
27 double samp1 = p_moclab->Sample(detector - 1);
28 double samp2 = p_moclab->Sample(detector);
29 if(samp1 < 0.0)
return false;
30 if(samp2 < 0.0)
return false;
32 double m = (samp2 - samp1);
33 p_parentSample = m * (sample - detector) + samp2;
46 bool MocWideAngleDetectorMap::SetParent(
const double sample,
48 if(!LineScanCameraDetectorMap::SetParent(sample, line))
return false;
51 if((p_moclab->CrosstrackSumming() == 13) ||
52 (p_moclab->CrosstrackSumming() == 27)) {
53 int isamp = (int) sample;
55 p_detectorSample = p_moclab->StartDetector(1);
56 p_detectorSample += sample - 1.0;
58 else if(isamp > p_camera->Samples()) {
59 p_detectorSample = p_moclab->StartDetector(p_camera->Samples());
60 p_detectorSample += sample - p_camera->Samples();
63 int ss = p_moclab->StartDetector(isamp - 1);
64 int es = p_moclab->EndDetector(isamp - 1);
65 double samp1 = (ss + es) / 2.0;
67 ss = p_moclab->StartDetector(isamp);
68 es = p_moclab->EndDetector(isamp);
69 double samp2 = (ss + es) / 2.0;
71 double m = (samp2 - samp1);
72 p_detectorSample = m * (sample - isamp) + samp1;