30 p_camera->Sensor::SetRightAscensionDeclination(ra, dec);
33 p_camera->Sensor::LookDirection(lookC);
38 if(!distortionMap->SetUndistortedFocalPlane(ux, uy))
return false;
40 double dy = distortionMap->FocalPlaneY();
43 if(!focalMap->SetFocalPlane(dx, dy))
return false;
45 focalMap->DetectorLine();
49 p_camera->Sensor::SetRightAscensionDeclination(ra, dec);
51 p_camera->Sensor::LookDirection(lookC);
55 if(!distortionMap->SetUndistortedFocalPlane(ux, uy))
return false;
56 dx = distortionMap->FocalPlaneX();
57 dy = distortionMap->FocalPlaneY();
59 if(!focalMap->SetFocalPlane(dx, dy))
return false;
60 double endOffset = focalMap->DetectorLineOffset() -
61 focalMap->DetectorLine();
64 if((startOffset < 0.0) && (endOffset < 0.0))
return false;
65 if((startOffset > 0.0) && (endOffset > 0.0))
return false;
68 double fl, fh, xl, xh;
69 if(startOffset < endOffset) {
72 xl =
p_camera->Spice::cacheStartTime().Et();
73 xh =
p_camera->Spice::cacheEndTime().Et();
78 xl =
p_camera->Spice::cacheEndTime().Et();
79 xh =
p_camera->Spice::cacheStartTime().Et();
85 double timeTol = detectorMap->
LineRate() / 10.0;
86 for(
int j = 0; j < 30; j++) {
87 double etGuess = xl + (xh - xl) * fl / (fl - fh);
89 p_camera->Sensor::SetRightAscensionDeclination(ra, dec);
90 p_camera->Sensor::LookDirection(lookC);
94 if(!distortionMap->SetUndistortedFocalPlane(ux, uy))
return false;
95 dx = distortionMap->FocalPlaneX();
96 dy = distortionMap->FocalPlaneY();
98 if(!focalMap->SetFocalPlane(dx, dy))
return false;
99 double f = focalMap->DetectorLineOffset() -
100 focalMap->DetectorLine();
104 delTime = xl - etGuess;
109 delTime = xh - etGuess;
116 if(fabs(delTime) < timeTol || f == 0.0) {