51 int startFramelet = 1;
57 bool minimizedSpacecraftDist =
false;
59 for (
int j = 0; j < 30 && !minimizedSpacecraftDist;j++) {
60 int deltaX = abs(startFramelet - endFramelet) / 2;
69 double biasFactor = startDist / endDist;
71 if (biasFactor < 1.0) {
72 biasFactor = -1.0 / biasFactor;
73 biasFactor = -(biasFactor + 1) / biasFactor;
76 biasFactor = std::min(biasFactor + 0.50, 0.0);
79 biasFactor = (biasFactor - 1) / biasFactor;
82 biasFactor = std::max(biasFactor - 0.50, 0.0);
85 int middleFramelet = startFramelet + (int)(deltaX + biasFactor * deltaX);
88 if (startDist > endDist) {
90 if (startFramelet == middleFramelet) middleFramelet++;
91 startFramelet = middleFramelet;
92 startDist = middleDist;
95 endFramelet = middleFramelet;
99 if (startFramelet == endFramelet) {
100 minimizedSpacecraftDist =
true;
104 if (!minimizedSpacecraftDist) {
108 int realFramelet = startFramelet;
109 bool frameletEven = (realFramelet % 2 == 0);
120 double realDist =
FindDistance(realFramelet, surfacePoint);
121 int guessFramelet = realFramelet + direction;
122 double guessDist =
FindDistance(guessFramelet, surfacePoint);
124 if (guessDist > realDist) {
125 direction = -1 * direction;
126 guessFramelet = realFramelet + direction;
130 for (
int j = 0; (realDist >= guessDist) && (j < 30);j++) {
131 realFramelet = guessFramelet;
132 realDist = guessDist;
134 guessFramelet = realFramelet + direction;
137 if (realFramelet <= 0 || realFramelet > detectorMap->
TotalFramelets()) {
169 if(!
p_camera->Sensor::SetGround(surfacePoint,
false))
return DBL_MAX;
172 p_camera->Sensor::LookDirection(lookC);
187 double frameletDeltaY = detectorMap->
frameletLine() - (actualFrameletHeight / 2.0);
189 return frameletDeltaY * frameletDeltaY;
207 if(!
p_camera->Sensor::SetGround(surfacePoint,
false))
return DBL_MAX;
This class defines a body-fixed surface point.
bool p_evenFramelets
True if the file contains even framelets.
double frameletLine() const
This returns the calculated framelet line.
CameraDetectorMap * DetectorMap()
Returns a pointer to the CameraDetectorMap object.
CameraDistortionMap * DistortionMap()
Returns a pointer to the CameraDistortionMap object.
double SlantDistance() const
Return the distance between the spacecraft and surface point in kmv.
virtual bool SetFocalPlane(const double dx, const double dy)
Compute detector position (sample,line) from focal plane coordinates.
virtual double LineScaleFactor() const
Return scaling factor for computing line resolution.
void SetFramelet(int framelet, const double deltaT=0)
This method changes the current framelet.
This class is designed to encapsulate the concept of a Latitude.
int frameletHeight() const
This returns how many lines are considered a single framelet.
Unless noted otherwise, the portions of Isis written by the USGS are public domain.
double FocalLength() const
Returns the focal length.
virtual bool SetDetector(const double sample, const double line)
Compute parent position from a detector coordinate.
Longitude GetLongitude() const
Return the body-fixed longitude for the surface point.
double DetectorLine() const
Return detector line.
double DetectorSample() const
Return detector sample.
This class is designed to encapsulate the concept of a Longitude.
virtual bool SetGround(const Latitude &lat, const Longitude &lon)
Compute undistorted focal plane coordinate from ground position.
double FindSpacecraftDistance(int framelet, const SurfacePoint &surfacePoint)
This method finds the distance from the point on the ground to the spacecraft at the time the specifi...
double FindDistance(int framelet, const SurfacePoint &surfacePoint)
This method finds the distance from the center of the framelet to the lat,lon.
Convert between distorted focal plane and detector coordinates.
Latitude GetLatitude() const
Return the body-fixed latitude for the surface point.
virtual bool SetUndistortedFocalPlane(double ux, double uy)
Compute distorted focal plane x/y.
Convert between parent image coordinates and detector coordinates.
int TotalFramelets() const
Return the total number of framelets including padding.
Distort/undistort focal plane coordinates.
virtual bool SetGround(const Latitude &lat, const Longitude &lon)
Compute undistorted focal plane coordinate from ground position.
CameraFocalPlaneMap * FocalPlaneMap()
Returns a pointer to the CameraFocalPlaneMap object.
Unless noted otherwise, the portions of Isis written by the USGS are public domain.
Distance LocalRadius() const
Returns the local radius at the intersection point.
double FocalPlaneY() const
Return distorted focal plane y.
bool timeAscendingFramelets()
Returns if the framelets are reversed from top-to-bottom.
double FocalPlaneX() const
Return distorted focal plane x.
Unless noted otherwise, the portions of Isis written by the USGS are public domain.