SDK Question Simulating astronomical events, two questions

This_is_me

New member
Joined
Sep 4, 2015
Messages
4
Reaction score
0
Points
0
I'm writing some code to interface with Orbiter to get times of astronomical events (e.g, conjunctions, sunrise/sunset, etc). I've got two questions:

First, what is the difference, if any, between propagation methods used when oapiSimSetMJD() (see p. 102 of API Reference Manual) is called versus when Orbiter is run "normally" (started at some MJD=X and allowed to progress from there through the date of interest)? For example, suppose I needed the position of some celestial body at MJD X? I could do that in several different ways, e.g.,

1) Start Orbiter at MJD X, get the position immediately.
2) Start Orbiter at some other MJD, use oapiSimSetMJD() to set the simulation to MJD X, then get the position.
3) Start Orbiter at some MJD prior to X, then run it forward and get the position when the simulation reaches MJD X.

I assume that Orbiter sets its own time on startup using the oapiSimSetMJD() function, so #1 and #2 are probably identical, but I may as well ask. Mainly, though, I'm wondering what the difference in propagation methods is between #2 and #3?

For what it's worth, I've already done some checks on Orbiter-generated data using method #2 versus data from other sources, and so far the results all look good. And since this is for amateur naked eye stargazing anyway, I'm not going to worry about small errors; I'd just like to know what those difference are, if any.

Second question ... I've looked all over the API Reference but I can't seem to find the right function(s) to do this. Given the longitude and latitude of some point on the Earth's surface, and a specific time, how do I get the vector from the Earth's center to that surface location? Right now, I'm accomplishing this by using a scenario with a DG parked on the Earth's surface at the desired location then reading its position, but that's a pretty clumsy way to do it; I have to edit and change the scenario file whenever I want to examine a different surface location.

Thanks.
 
First, what is the difference, if any, between propagation methods used when oapiSimSetMJD() (see p. 102 of API Reference Manual) is called versus when Orbiter is run "normally" (started at some MJD=X and allowed to progress from there through the date of interest)?

For celestial bodies, there shouldn't be any difference, as their trajectory is calculated based on either an ephemeris or a standard keplerian model. Real-time calculation of gravity effects do only affect vessels.

Given the longitude and latitude of some point on the Earth's surface, and a specific time, how do I get the vector from the Earth's center to that surface location?

You get it by doing math, I'm afraid ;)
 
Unfortunately, there are multiple projections for latitude and longitude and I don't know which one Orbiter uses, especially given the spherical rendering of planets. The small difference between projections might not matter, but it's something to think about.
 
Unfortunately, there are multiple projections for latitude and longitude and I don't know which one Orbiter uses, especially given the spherical rendering of planets. The small difference between projections might not matter, but it's something to think about.

If you mean "spherical Earth" versus "ellipsoid Earth" versus who-knows-what-else, that's not going to make any difference for this question. I'm modeling the Earth as an ellipsoid, and so the data I'm getting from Orbiter gets converted to that model anyway. I should have been clearer; I don't really care about the magnitude of the radius vector from the Earth's center to some point on the surface, since I'm setting the radius anyway; all I really care about is the direction of that vector. But that difference in models does make a difference in the final results. I've done a few runs comparing my program's output to USNO's data, and when I changed the model from sphere to ellipsoid the difference in results on some variables dropped from about a third of a degree to a few thousandths of a degree. Some variables, but not all; I'm still trying to figure out why.

Anyway, I looked again, and finally found something. Turns out oapiEquToGlobal() will do the trick. The nice thing about the API reference is there's 600 pages of stuff available to use; the bad thing about it is you've gotta look through 600 pages to find what you need ... :)
 
Back
Top