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

Add method directLocation with PixelLOS (for atmospheric refraction

optimization) WIP
parent ea54feac
No related branches found
No related tags found
No related merge requests found
...@@ -34,6 +34,7 @@ import org.orekit.rugged.linesensor.LineSensor; ...@@ -34,6 +34,7 @@ import org.orekit.rugged.linesensor.LineSensor;
import org.orekit.rugged.linesensor.SensorMeanPlaneCrossing; import org.orekit.rugged.linesensor.SensorMeanPlaneCrossing;
import org.orekit.rugged.linesensor.SensorPixel; import org.orekit.rugged.linesensor.SensorPixel;
import org.orekit.rugged.linesensor.SensorPixelCrossing; import org.orekit.rugged.linesensor.SensorPixelCrossing;
import org.orekit.rugged.los.PixelLOS;
import org.orekit.rugged.refraction.AtmosphericRefraction; import org.orekit.rugged.refraction.AtmosphericRefraction;
import org.orekit.rugged.utils.DSGenerator; import org.orekit.rugged.utils.DSGenerator;
import org.orekit.rugged.utils.ExtendedEllipsoid; import org.orekit.rugged.utils.ExtendedEllipsoid;
...@@ -302,24 +303,36 @@ public class Rugged { ...@@ -302,24 +303,36 @@ public class Rugged {
} }
if (atmosphericRefraction != null) { if (atmosphericRefraction != null) {
// apply atmospheric refraction correction // compute atmospheric refraction
final Vector3D pBody = inertToBody.transformPosition(pInert);
final Vector3D lBody = inertToBody.transformVector(lInert); // Test if optimization is not required
gp[i] = atmosphericRefraction.applyCorrection(pBody, lBody, (NormalizedGeodeticPoint) gp[i], algorithm); if (! atmosphericRefraction.isOptimized()) {
// apply atmospheric refraction correction
final Vector3D pBody = inertToBody.transformPosition(pInert);
final Vector3D lBody = inertToBody.transformVector(lInert);
gp[i] = atmosphericRefraction.applyCorrection(pBody, lBody, (NormalizedGeodeticPoint) gp[i], algorithm);
} else { // Optimization is required
// TODO algo with optimization
}
} }
DumpManager.dumpDirectLocationResult(gp[i]); DumpManager.dumpDirectLocationResult(gp[i]);
} }
return gp; return gp;
} }
/** 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 * <br>
* NB: if (the optionnal) atmospheric refraction must be computed with the optimization algorithm,
* see {@link #directLocation(AbsoluteDate, Vector3D, PixelLOS)})
* @param date date of the location * @param date date of the location
* @param sensorPosition sensor position in spacecraft frame * @param sensorPosition sensor position in spacecraft frame. For simplicity, due to the size of sensor,
* we consider each pixel to be at sensor position
* @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
...@@ -327,6 +340,24 @@ public class Rugged { ...@@ -327,6 +340,24 @@ public class Rugged {
public GeodeticPoint directLocation(final AbsoluteDate date, final Vector3D sensorPosition, final Vector3D los) public GeodeticPoint directLocation(final AbsoluteDate date, final Vector3D sensorPosition, final Vector3D los)
throws RuggedException { throws RuggedException {
// Set the pixel to null in order not to compute atmosphere with optimization
final PixelLOS pixelLOS = new PixelLOS(null, los);
return directLocation(date, sensorPosition, pixelLOS);
}
/** Direct location of a single line-of-sight.
* @param date date of the location
* @param sensorPosition sensor position in spacecraft frame. For simplicity, due to the size of sensor,
* we consider each pixel to be at sensor position
* @param pixelLOS pixel definition with normalized line-of-sight in spacecraft frame
* @return ground position of intersection point between specified los and ground
* @exception RuggedException if line cannot be localized, or sensor is unknown
*/
public GeodeticPoint directLocation(final AbsoluteDate date, final Vector3D sensorPosition, final PixelLOS pixelLOS) throws RuggedException {
final Vector3D los = pixelLOS.getLOS();
DumpManager.dumpDirectLocation(date, sensorPosition, los, lightTimeCorrection, aberrationOfLightCorrection, DumpManager.dumpDirectLocation(date, sensorPosition, los, lightTimeCorrection, aberrationOfLightCorrection,
atmosphericRefraction != null); atmosphericRefraction != null);
...@@ -342,9 +373,10 @@ public class Rugged { ...@@ -342,9 +373,10 @@ public class Rugged {
// TBN: for simplicity, due to the size of sensor, we consider each pixel to be at sensor 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); final Vector3D pInert = scToInert.transformPosition(sensorPosition);
// compute location of specified pixel // compute line of sight in inertial frame
final Vector3D obsLInert = scToInert.transformVector(los); final Vector3D obsLInert = scToInert.transformVector(los);
final Vector3D lInert; final Vector3D lInert;
if (aberrationOfLightCorrection) { if (aberrationOfLightCorrection) {
// apply aberration of light correction // apply aberration of light correction
// as the spacecraft velocity is small with respect to speed of light, // as the spacecraft velocity is small with respect to speed of light,
...@@ -363,7 +395,9 @@ public class Rugged { ...@@ -363,7 +395,9 @@ public class Rugged {
lInert = obsLInert; lInert = obsLInert;
} }
// compute ground location of specified pixel
final NormalizedGeodeticPoint gp; final NormalizedGeodeticPoint gp;
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 // TBN: for simplicity, due to the size of sensor, we consider each pixel to be at sensor position
...@@ -392,21 +426,28 @@ public class Rugged { ...@@ -392,21 +426,28 @@ public class Rugged {
algorithm.intersection(ellipsoid, pBody, lBody)); algorithm.intersection(ellipsoid, pBody, lBody));
} }
final NormalizedGeodeticPoint result; // compute the ground location with atmospheric correction if asked for
NormalizedGeodeticPoint result = gp;
if (atmosphericRefraction != null) { if (atmosphericRefraction != null) {
// apply atmospheric refraction correction // compute atmospheric refraction
final Vector3D pBody = inertToBody.transformPosition(pInert);
final Vector3D lBody = inertToBody.transformVector(lInert);
result = atmosphericRefraction.applyCorrection(pBody, lBody, gp, algorithm);
} else { // Test if optimization is not required or if sensor pixel is not defined
// don't apply atmospheric refraction correction if (! atmosphericRefraction.isOptimized() || pixelLOS.getSensorPixel() == null) {
result = gp;
// apply atmospheric refraction correction
final Vector3D pBody = inertToBody.transformPosition(pInert);
final Vector3D lBody = inertToBody.transformVector(lInert);
result = atmosphericRefraction.applyCorrection(pBody, lBody, gp, algorithm);
} else { // Optimization is required and sensor pixel is defined
// TODO algo with optimization
}
} }
DumpManager.dumpDirectLocationResult(result); DumpManager.dumpDirectLocationResult(result);
return result; return result;
} }
/** Find the date at which sensor sees a ground point. /** Find the date at which sensor sees a ground point.
......
package org.orekit.rugged.los;
import java.io.Serializable;
import org.hipparchus.geometry.euclidean.threed.Vector3D;
import org.orekit.rugged.linesensor.SensorPixel;
/** Container for pixel line-of-sight.
* <p>
* Instances of this class are guaranteed to be immutable.
* </p>
* @author Guylaine Prat
* @since 3.0
*/
public class PixelLOS implements Serializable {
/** Serializable UID. */
private static final long serialVersionUID = -6674056279573271367L;
/** Sensor pixel. */
private final SensorPixel sensorPixel;
/** Pixel line-of-sight in spacecraft frame. */
private final Vector3D los;
/**
* Build a new instance.
* @param sensorPixel the sensor pixel cell
* @param los the pixel line-of-sight in spacecraft frame
*/
public PixelLOS(final SensorPixel sensorPixel, final Vector3D los) {
this.sensorPixel = sensorPixel;
this.los = los;
}
/**
* @return the sensorPixel
*/
public SensorPixel getSensorPixel() {
return sensorPixel;
}
/**
* @return the lOS in spacecraft frame
*/
public Vector3D getLOS() {
return los;
}
@Override
public String toString() {
return "{Sensor pixel: " + sensorPixel.toString() +
", LOS: " + los.toString() + "}";
}
}
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