Aiming at the problem that there are errors in defining the ground rectangular area and the sensor field of view range using the orekit library, calculating the time window for the sensor to cover the entire ground area, and the STK simulation results
The following are my own code using orekit and screenshots of the STK simulation results. Does anyone know what causes this error? Thank you for your guidance!
code:
@Test
public void test1(){
final File home = new File(System.getProperty("user.home"));
final File orekitData = new File(home, "orekit-data");
if (!orekitData.exists()) {
System.err.format(Locale.US, "Failed to find %s folder%n",
orekitData.getAbsolutePath());
System.err.format(Locale.US, "You need to download %s from %s, unzip it in %s and rename it 'orekit-data' for this tutorial to work%n",
"orekit-data-master.zip", "https://gitlab.orekit.org/orekit/orekit-data/-/archive/master/orekit-data-master.zip",
home.getAbsolutePath());
System.exit(1);
}
final DataProvidersManager manager = DataContext.getDefault().getDataProvidersManager();
manager.addProvider(new DirectoryCrawler(orekitData));
String line1 = "1 33314U 08040C 18325.13536407 .00000020 00000-0 93127-5 0 9993";
String line2 = "2 33314 97.7735 35.5590 0025404 105.4992 254.9034 14.79911945552555";
double halfApparture = 70;
final AbsoluteDate startDate = new AbsoluteDate(2018, 11, 20, 3, 0, 0, TimeScalesFactory.getUTC());
final AbsoluteDate endDate = new AbsoluteDate(2018, 11, 24, 3, 0, 0, TimeScalesFactory.getUTC());
final FactoryManagedFrame ecef = FramesFactory.getITRF(IERSConventions.IERS_2010, true);
final OneAxisEllipsoid Earth = new OneAxisEllipsoid(Constants.WGS84_EARTH_EQUATORIAL_RADIUS,
Constants.WGS84_EARTH_FLATTENING, ecef);
final TLE tle = new TLE(line1, line2);
final FactoryManagedFrame inertialFrame = FramesFactory.getTEME();
final org.orekit.attitudes.LofOffset attitudeProvider =
new org.orekit.attitudes.LofOffset(inertialFrame, LOFType.VVLH);
TLEPropagator propagator = TLEPropagator.selectExtrapolator(tle);
propagator.setAttitudeProvider(attitudeProvider);
FieldOfView fov = new CircularFieldOfView(Vector3D.PLUS_K, FastMath.toRadians(halfApparture), 0);
final FieldOfView fov1 = new DoubleDihedraFieldOfView(Vector3D.PLUS_K, Vector3D.PLUS_I, FastMath.toRadians(halfApparture / 2), Vector3D.PLUS_J, FastMath.toRadians(halfApparture / 2), 0);
GeodeticPoint[] geoPoints = new GeodeticPoint[4];
geoPoints[0] = new GeodeticPoint(
FastMath.toRadians(39.7058), // 北纬40.5°
FastMath.toRadians(-92.0864), // 西经93.0°
0.0
);
geoPoints[1] = new GeodeticPoint(
FastMath.toRadians(40.7058), // 北纬40.5°
FastMath.toRadians(-92.0864), // 西经92.0°
0.0
);
geoPoints[2] = new GeodeticPoint(
FastMath.toRadians(40.7058), // 北纬39.5°
FastMath.toRadians(-93.0864), // 西经92.0°
0.0
);
geoPoints[3] = new GeodeticPoint(
FastMath.toRadians(39.7058), // 北纬39.5°
FastMath.toRadians(-93.0864), // 西经93.0°
0.0
);
S2Point[] sphericalPoints = new S2Point[4];
for (int i = 0; i < 4; i++) {
Vector3D position = Earth.transform(geoPoints[i]);
sphericalPoints[i] = new S2Point(position);
}
SphericalPolygonsSet region = new SphericalPolygonsSet(1e-10, sphericalPoints);
EventDetector overlapDetector = new FootprintOverlapDetector(fov1, Earth, region, 60000.0)
.withMaxCheck(1.0)
.withThreshold(1e-6)
.withHandler((s,detector,increasing)->{
if (increasing) {
System.out.println("LEAVING rectangularRegion at: " + s.getDate());
} else {
System.out.println("ENTERING rectangularRegion at: " + s.getDate());
}
return Action.CONTINUE;
});
propagator.addEventDetector(overlapDetector);
System.out.println("Propagating from " + startDate + " to " + endDate);
SpacecraftState finalState = propagator.propagate(startDate, endDate);
}
The result of my program:
Propagating from 2018-11-20T03:00:00.000Z to 2018-11-24T03:00:00.000Z
ENTERING rectangularRegion at: 2018-11-21T16:50:16.58904907297756Z
LEAVING rectangularRegion at: 2018-11-21T16:52:43.18264202537443Z
ENTERING rectangularRegion at: 2018-11-22T03:45:11.02342344771568Z
LEAVING rectangularRegion at: 2018-11-22T03:47:41.86521550098077Z
ENTERING rectangularRegion at: 2018-11-22T17:10:30.35136460122703Z
LEAVING rectangularRegion at: 2018-11-22T17:12:58.21487623045591Z
ENTERING rectangularRegion at: 2018-11-23T04:05:26.09743507426377Z
LEAVING rectangularRegion at: 2018-11-23T04:07:53.61842028626758Z
The result of STK:
Ractangle-To-Area1
------------------
Access Start Time (UTCG) Stop Time (UTCG) Duration (sec)
------ ------------------------ ------------------------ --------------
1 21 Nov 2018 16:50:13.573 21 Nov 2018 16:52:40.204 146.631
2 22 Nov 2018 03:45:14.012 22 Nov 2018 03:47:44.776 150.764
3 22 Nov 2018 17:10:27.415 22 Nov 2018 17:12:55.237 147.821
4 23 Nov 2018 04:05:29.077 23 Nov 2018 04:07:56.611 147.534