在本实验中,我们使用GAOFEN-6_43484号卫星,选取喀什作为地面站,选取的观测时间为2023年9月15日4:00至2023年9月15日8:00,完成卫星事件处理任务。下面是orekit附带的教程给出的具体的执行步骤:
注意,在使用Orekit库之前,我们需要读取Orekit文件,详细的读取步骤请移步下面的文章观看:
(1)定义观测的开始日期、引力系数、坐标系类型、卫星的初始状态。
// Initial state definition : date, orbit
final AbsoluteDate initialDate = new AbsoluteDate(2023, 9, 15, 4, 0, 00.000, TimeScalesFactory.getUTC());
final double mu = 3.986004415e+14; // gravitation coefficient
final Frame inertialFrame = FramesFactory.getEME2000(); // inertial frame for orbit definition
final Vector3D position = new Vector3D(2797914.567, -2288195.171, 6012468.374);
final Vector3D velocity = new Vector3D(-6089.132, 2403.774, 3732.121);
final PVCoordinates pvCoordinates = new PVCoordinates(position, velocity);
final Orbit initialOrbit = new KeplerianOrbit(pvCoordinates, inertialFrame, initialDate, mu);
(2)定义propagator类型(备注:orekit将propagation分为:Analytical propagation、Numerical propagation、Semianalytical propagation、Field propagation四个大类,每一类propagation中又有多种具体的propagator类型)。
// Propagator : consider a simple Keplerian motion (could be more elaborate)
final Propagator kepler = new KeplerianPropagator(initialOrbit);
(3)定义地球框架
// Earth and frame
final Frame earthFrame = FramesFactory.getITRF(IERSConventions.IERS_2010, true);
final BodyShape earth = new OneAxisEllipsoid(Constants.WGS84_EARTH_EQUATORIAL_RADIUS,
Constants.WGS84_EARTH_FLATTENING, earthFrame);
(4)定义地面站的经度、纬度、高度
// Station
final double longitude = FastMath.toRadians(75.9797);
final double latitude = FastMath.toRadians(39.4547);
final double altitude = 0.;
final GeodeticPoint station1 = new GeodeticPoint(latitude, longitude, altitude);
final TopocentricFrame sta1Frame = new TopocentricFrame(earth, station1, "喀什");
(5)定义事件处理器并进行事件处理
final EventDetector sta1Visi =
new ElevationDetector(maxcheck, threshold, sta1Frame).withConstantElevation(elevation).withHandler((s, detector, increasing) -> {
System.out.println(" Visibility on " + detector.getTopocentricFrame().getName() +(increasing ? " begins at " : " ends at ") +s.getDate());
return increasing ? Action.CONTINUE : Action.STOP;
});
// Add event to be detected
kepler.addEventDetector(sta1Visi);
(6)定义事件处理的持续时间
// Propagate from the initial date to the first raising or for the fixed duration
final SpacecraftState finalState = kepler.propagate(initialDate.shiftedBy(14400.));
(7)打印输出观测结果
System.out.println(" Final state : " + finalState.getDate().durationFrom(initialDate));
输出结果:
(8)输出多测观测结果
但是,我们将orekit观测结果与STK所给的观测结果进行对比时,发现在上述时间和卫星状态下,卫星有三段时间可以观测到喀什地面站,但是orekit输出的结果只有一个,这里我们需要修改orekit教程中给出的事件处理代码,从而将所有的可见时间段进行输出。
// Event definition
final double maxcheck = 60.0;
final double threshold = 0.001;
final double elevation = FastMath.toRadians(5.0);
final EventDetector sta1Visi = new ElevationDetector(maxcheck, threshold, sta1Frame).withConstantElevation(elevation).withHandler((s, detector, increasing) -> {
if (increasing) {
System.out.println("Visibility begins on " + detector.getTopocentricFrame().getName() + " at " + s.getDate());
} else {
System.out.println("Visibility ends on " + detector.getTopocentricFrame().getName() + " at " + s.getDate());
}
return Action.CONTINUE; // Continue processing the event
});
// Add event to be detected
kepler.addEventDetector(sta1Visi);
输出结果:
这样我们就完成了卫星对地面目标的多次观测。