I want to achieve ground station visibility to the satellite, and then I have the following program. My orbital input file is TLE, and I use TLE for orbital propagation. However, I want to output the time of event occurrence using EventDetector, and also output the azimuth and elevation changes when the ground station sees the satellite. Is there a callable method or any reference example in the Event Processor for this?
public void satToFacility(String line1, String line2, Date startDate, Date endDate, String facilityName,
Double longitude, Double latitude, Double altitude, Double minElevation){
//加载固定数据
Dataloading dataloading = new Dataloading();
dataloading.dataLoade();
// Initial state definition : date, orbit
//计算时间段由北京时间转为UTC时间
TimeScale utc = TimeScalesFactory.getUTC();
AbsoluteDate start = new AbsoluteDate(startDate, utc);
AbsoluteDate end = new AbsoluteDate(endDate, utc);
final double mu = 3.986004415e+14; // gravitation coefficient
final Frame inertialFrame = FramesFactory.getEME2000(); // inertial frame for orbit definition
TLE tle = new TLE(line1, line2);
TLEPropagator tlePropagator = TLEPropagator.selectExtrapolator(tle);
// 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);
final GeodeticPoint facility = new GeodeticPoint(latitude, longitude, altitude);
final TopocentricFrame sta1Frame = new TopocentricFrame(earth, facility, facilityName);
//定义事件处理器,用于处理事件
final double maxcheck = 60.0;
final double threshold = 0.01;
final EventDetector sta1Visi =
new ElevationDetector(maxcheck, threshold, sta1Frame)
.withConstantElevation(minElevation)
.withHandler((s, detector, increasing) → {
if (increasing) {
System.out.println(“Ground Station Name: “+((ElevationDetector) detector).getTopocentricFrame().getName()
+” Tracking Start Time: " + s.getDate()
+” Azimuth: “+((ElevationDetector) detector).getTopocentricFrame().getAzimuth());
} else {
System.out.println(” Tracking End Time: " + s.getDate());
}
return Action.CONTINUE; // Continue processing the event
});
// Add event to be detected
tlePropagator.addEventDetector(sta1Visi);
// Propagate from the initial date to the first raising or for the fixed duration
final SpacecraftState finalState = tlePropagator.propagate(start, end);
}
您好,
很抱歉,恐怕奥雷基特社区里会说普通话的人不多。您能用英语重新表述一下您的信息吗?
非常感谢,
Sébastien
1 Like
I want to achieve ground station visibility to the satellite, and then I have the following program. My orbital input file is TLE, and I use TLE for orbital propagation. However, I want to output the time of event occurrence using EventDetector, and also output the azimuth and elevation changes when the ground station sees the satellite. Is there a callable method or any reference example in the Event Processor for this?
Thank you for your reply. I have solved this problem.