Orekit使用心得(五)——卫星星历计算

星历是指在GPS测量中,天体运行随时间而变的精确位置或轨迹表,它是时间的函数。Orekit提供的教程中提供了计算星历的方法。

注意,在使用Orekit库之前,我们需要读取Orekit文件,详细的读取步骤请移步下面的文章观看:

Orekit使用心得(一)——读取orekit数据icon-default.png?t=N7T8https://blog.csdn.net/whq002/article/details/135258646?spm=1001.2014.3001.5501

下面是使用Orekit进行卫星星历计算的具体步骤:

(1)定义卫星的轨道六根数

// Initial orbit parameters

final double a = 24396159; // semi major axis in meters

final double e = 0.72831215; // eccentricity

final double i = FastMath.toRadians(7); // inclination

final double omega = FastMath.toRadians(180); // perigee argument

final double raan = FastMath.toRadians(261); // right ascension of ascending node

final double lM = 0; // mean anomaly

(2)定义坐标系类型

// Inertial frame

final Frame inertialFrame = FramesFactory.getEME2000();

(3)定义初始时间

卫星星历的时间按世界标准时间(UTC)计算。

// Initial date in UTC time scale

final TimeScale utc = TimeScalesFactory.getUTC();

final AbsoluteDate initialDate = new AbsoluteDate(2004, 01, 01, 23, 30, 00.000, utc);

(4)定义地球引力系数

// gravitation coefficient

final double mu = 3.986004415e+14;

(5)定义卫星轨道类型

// Orbit construction as Keplerian

final Orbit initialOrbit = new KeplerianOrbit(a, e, i, omega, raan, lM, PositionAngle.MEAN,inertialFrame, initialDate, mu);

(6)定义卫星的初始状态

// Initialize state

final SpacecraftState initialState = new SpacecraftState(initialOrbit);

(7)定义propagator并插入到卫星上

final double stepSize = 10;

final AbstractIntegrator integrator = new ClassicalRungeKuttaIntegrator(stepSize);

final NumericalPropagator propagator = new NumericalPropagator(integrator);



// Set the propagator to ephemeris mode

final EphemerisGenerator generator = propagator.getEphemerisGenerator();



// Initialize propagation

propagator.setInitialState(initialState);

(8)计算并输出星历

// Propagation with storage of the results in an integrated ephemeris

final SpacecraftState finalState = propagator.propagate(initialDate.shiftedBy(6000));



System.out.format(Locale.US, "Numerical propagation:%n  Final date: %s%n  %s%n",finalState.getDate(), finalState.getOrbit());



// Getting the integrated ephemeris

final BoundedPropagator ephemeris = generator.getGeneratedEphemeris();



System.out.format(Locale.US, "%nEphemeris defined from %s to %s%n",ephemeris.getMinDate(),ephemeris.getMaxDate());



System.out.format(Locale.US, "%nEphemeris propagation:%n");

final String format = "  %s  %s%n";

AbsoluteDate intermediateDate = initialDate.shiftedBy(3000);

SpacecraftState intermediateState = ephemeris.propagate(intermediateDate);

System.out.format(Locale.US, format, intermediateState.getDate(), intermediateState.getOrbit());



intermediateDate = finalState.getDate();

intermediateState = ephemeris.propagate(intermediateDate);

System.out.format(Locale.US, format, intermediateState.getDate(), intermediateState.getOrbit());



intermediateDate = initialDate.shiftedBy(-1000);

System.out.format(Locale.US, "%nAttempting to propagate to date %s which is OUT OF RANGE%n",intermediateDate);

System.out.println("This propagation attempt should fail, " +"so an error message shoud appear below, " +"this is expected and shows that errors are handled correctly");

intermediateState = ephemeris.propagate(intermediateDate);



// these two print should never happen as an exception should have been triggered

System.out.println("  date :  " + intermediateState.getDate());

System.out.println("  " + intermediateState.getOrbit());

输出结果:

  • 15
    点赞
  • 5
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 2
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

上善若水阳阳

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值