Skip to content
Snippets Groups Projects
Commit ea54feac authored by Guylaine Prat's avatar Guylaine Prat
Browse files

Add precision about sensor/pixel position (the same) in javadoc, comment

and method parameters
parent 0085a52c
No related branches found
No related tags found
No related merge requests found
...@@ -241,8 +241,11 @@ public class Rugged { ...@@ -241,8 +241,11 @@ public class Rugged {
final Vector3D spacecraftVelocity = final Vector3D spacecraftVelocity =
scToInert.transformPVCoordinates(PVCoordinates.ZERO).getVelocity(); scToInert.transformPVCoordinates(PVCoordinates.ZERO).getVelocity();
// compute location of each pixel // compute sensor position in inertial frame
// TBN: for simplicity, due to the size of sensor, we consider each pixel to be at sensor position
final Vector3D pInert = scToInert.transformPosition(sensor.getPosition()); final Vector3D pInert = scToInert.transformPosition(sensor.getPosition());
// compute location of each pixel
final GeodeticPoint[] gp = new GeodeticPoint[sensor.getNbPixels()]; final GeodeticPoint[] gp = new GeodeticPoint[sensor.getNbPixels()];
for (int i = 0; i < sensor.getNbPixels(); ++i) { for (int i = 0; i < sensor.getNbPixels(); ++i) {
...@@ -271,6 +274,8 @@ public class Rugged { ...@@ -271,6 +274,8 @@ public class Rugged {
if (lightTimeCorrection) { if (lightTimeCorrection) {
// compute DEM intersection with light time correction // compute DEM intersection with light time correction
// TBN: for simplicity, due to the size of sensor, we consider each pixel to be at sensor position
final Vector3D sP = approximate.transformPosition(sensor.getPosition()); final Vector3D sP = approximate.transformPosition(sensor.getPosition());
final Vector3D sL = approximate.transformVector(sensor.getLOS(date, i)); final Vector3D sL = approximate.transformVector(sensor.getLOS(date, i));
final Vector3D eP1 = ellipsoid.transform(ellipsoid.pointOnGround(sP, sL, 0.0)); final Vector3D eP1 = ellipsoid.transform(ellipsoid.pointOnGround(sP, sL, 0.0));
...@@ -312,16 +317,17 @@ public class Rugged { ...@@ -312,16 +317,17 @@ public class Rugged {
} }
/** Direct location of a single line-of-sight. /** Direct location of a single line-of-sight.
* TBN: for simplicity, due to the size of sensor, we consider each pixel to be at sensor position
* @param date date of the location * @param date date of the location
* @param position pixel position in spacecraft frame * @param sensorPosition sensor position in spacecraft frame
* @param los normalized line-of-sight in spacecraft frame * @param los normalized line-of-sight in spacecraft frame
* @return ground position of intersection point between specified los and ground * @return ground position of intersection point between specified los and ground
* @exception RuggedException if line cannot be localized, or sensor is unknown * @exception RuggedException if line cannot be localized, or sensor is unknown
*/ */
public GeodeticPoint directLocation(final AbsoluteDate date, final Vector3D position, final Vector3D los) public GeodeticPoint directLocation(final AbsoluteDate date, final Vector3D sensorPosition, final Vector3D los)
throws RuggedException { throws RuggedException {
DumpManager.dumpDirectLocation(date, position, los, lightTimeCorrection, aberrationOfLightCorrection, DumpManager.dumpDirectLocation(date, sensorPosition, los, lightTimeCorrection, aberrationOfLightCorrection,
atmosphericRefraction != null); atmosphericRefraction != null);
// compute the approximate transform between spacecraft and observed body // compute the approximate transform between spacecraft and observed body
...@@ -332,9 +338,11 @@ public class Rugged { ...@@ -332,9 +338,11 @@ public class Rugged {
final Vector3D spacecraftVelocity = final Vector3D spacecraftVelocity =
scToInert.transformPVCoordinates(PVCoordinates.ZERO).getVelocity(); scToInert.transformPVCoordinates(PVCoordinates.ZERO).getVelocity();
// compute location of specified pixel // compute sensor position in inertial frame
final Vector3D pInert = scToInert.transformPosition(position); // TBN: for simplicity, due to the size of sensor, we consider each pixel to be at sensor position
final Vector3D pInert = scToInert.transformPosition(sensorPosition);
// compute location of specified pixel
final Vector3D obsLInert = scToInert.transformVector(los); final Vector3D obsLInert = scToInert.transformVector(los);
final Vector3D lInert; final Vector3D lInert;
if (aberrationOfLightCorrection) { if (aberrationOfLightCorrection) {
...@@ -358,7 +366,8 @@ public class Rugged { ...@@ -358,7 +366,8 @@ public class Rugged {
final NormalizedGeodeticPoint gp; final NormalizedGeodeticPoint gp;
if (lightTimeCorrection) { if (lightTimeCorrection) {
// compute DEM intersection with light time correction // compute DEM intersection with light time correction
final Vector3D sP = approximate.transformPosition(position); // TBN: for simplicity, due to the size of sensor, we consider each pixel to be at sensor position
final Vector3D sP = approximate.transformPosition(sensorPosition);
final Vector3D sL = approximate.transformVector(los); final Vector3D sL = approximate.transformVector(los);
final Vector3D eP1 = ellipsoid.transform(ellipsoid.pointOnGround(sP, sL, 0.0)); final Vector3D eP1 = ellipsoid.transform(ellipsoid.pointOnGround(sP, sL, 0.0));
final double deltaT1 = eP1.distance(sP) / Constants.SPEED_OF_LIGHT; final double deltaT1 = eP1.distance(sP) / Constants.SPEED_OF_LIGHT;
...@@ -389,6 +398,7 @@ public class Rugged { ...@@ -389,6 +398,7 @@ public class Rugged {
final Vector3D pBody = inertToBody.transformPosition(pInert); final Vector3D pBody = inertToBody.transformPosition(pInert);
final Vector3D lBody = inertToBody.transformVector(lInert); final Vector3D lBody = inertToBody.transformVector(lInert);
result = atmosphericRefraction.applyCorrection(pBody, lBody, gp, algorithm); result = atmosphericRefraction.applyCorrection(pBody, lBody, gp, algorithm);
} else { } else {
// don't apply atmospheric refraction correction // don't apply atmospheric refraction correction
result = gp; result = gp;
......
...@@ -145,21 +145,21 @@ class Dump { ...@@ -145,21 +145,21 @@ class Dump {
/** Dump a direct location computation. /** Dump a direct location computation.
* @param date date of the location * @param date date of the location
* @param position pixel position in spacecraft frame * @param sensorPosition sensor position in spacecraft frame
* @param los normalized line-of-sight in spacecraft frame * @param los normalized line-of-sight in spacecraft frame
* @param lightTimeCorrection flag for light time correction * @param lightTimeCorrection flag for light time correction
* @param aberrationOfLightCorrection flag for aberration of light correction * @param aberrationOfLightCorrection flag for aberration of light correction
* @param refractionCorrection flag for refraction correction * @param refractionCorrection flag for refraction correction
* @exception RuggedException if date cannot be converted to UTC * @exception RuggedException if date cannot be converted to UTC
*/ */
public void dumpDirectLocation(final AbsoluteDate date, final Vector3D position, final Vector3D los, public void dumpDirectLocation(final AbsoluteDate date, final Vector3D sensorPosition, final Vector3D los,
final boolean lightTimeCorrection, final boolean aberrationOfLightCorrection, final boolean lightTimeCorrection, final boolean aberrationOfLightCorrection,
final boolean refractionCorrection) final boolean refractionCorrection)
throws RuggedException { throws RuggedException {
writer.format(Locale.US, writer.format(Locale.US,
"direct location: date %s position %22.15e %22.15e %22.15e los %22.15e %22.15e %22.15e lightTime %b aberration %b refraction %b %n", "direct location: date %s position %22.15e %22.15e %22.15e los %22.15e %22.15e %22.15e lightTime %b aberration %b refraction %b %n",
convertDate(date), convertDate(date),
position.getX(), position.getY(), position.getZ(), sensorPosition.getX(), sensorPosition.getY(), sensorPosition.getZ(),
los.getX(), los.getY(), los.getZ(), los.getX(), los.getY(), los.getZ(),
lightTimeCorrection, aberrationOfLightCorrection, refractionCorrection); lightTimeCorrection, aberrationOfLightCorrection, refractionCorrection);
} }
......
...@@ -135,19 +135,19 @@ public class DumpManager { ...@@ -135,19 +135,19 @@ public class DumpManager {
/** Dump a direct location computation. /** Dump a direct location computation.
* @param date date of the location * @param date date of the location
* @param position pixel position in spacecraft frame * @param sensorPosition sensor position in spacecraft frame
* @param los normalized line-of-sight in spacecraft frame * @param los normalized line-of-sight in spacecraft frame
* @param lightTimeCorrection flag for light time correction * @param lightTimeCorrection flag for light time correction
* @param aberrationOfLightCorrection flag for aberration of light correction * @param aberrationOfLightCorrection flag for aberration of light correction
* @param refractionCorrection flag for refraction correction * @param refractionCorrection flag for refraction correction
* @exception RuggedException if date cannot be converted to UTC * @exception RuggedException if date cannot be converted to UTC
*/ */
public static void dumpDirectLocation(final AbsoluteDate date, final Vector3D position, final Vector3D los, public static void dumpDirectLocation(final AbsoluteDate date, final Vector3D sensorPosition, final Vector3D los,
final boolean lightTimeCorrection, final boolean aberrationOfLightCorrection, final boolean lightTimeCorrection, final boolean aberrationOfLightCorrection,
final boolean refractionCorrection) final boolean refractionCorrection)
throws RuggedException { throws RuggedException {
if (isActive()) { if (isActive()) {
DUMP.get().dumpDirectLocation(date, position, los, lightTimeCorrection, aberrationOfLightCorrection, DUMP.get().dumpDirectLocation(date, sensorPosition, los, lightTimeCorrection, aberrationOfLightCorrection,
refractionCorrection); refractionCorrection);
} }
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment