You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am using Stellarium to extract data in a "batch" fashion, if you know what I mean. So I am changing location, and then grabbinhg some attributes for the Sun/Moon, and then changing location again.
For example:
core.setObserverLocation("Sydney, Australia", 0)
var thisMoonAlt = core.getObjectInfo("Moon")["altitude"]
core.setObserverLocation("Perth, Australia", 0)
var thatMoonAlt = core.getObjectInfo("Moon")["altitude"]
What I'm seeing a lot is thisMoonAlt == thatMoonAlt. It's like Stellarium hasn't yet processed the move of the observer, and is giving me the old value. I've seen a lot of code online that says I need to add core.wait() to give it time to catch up, but I guess I was hoping that there was some way to force it to block until the location has been processed .. ?
The text was updated successfully, but these errors were encountered:
No, that lot of code online and in our own documentation does what we recommend for such cases. Add a core.wait(0.1) or so to give it time to catch up, i.e., allow one frame drawing cycle, else you are updating the location without actually computing anything. If there was an alternative, it would have been documented.
You mean, adding core.wait(SignalName) instead of just waiting a short time? Maybe. This might be helpful to minimize the waiting delay. Such signal could be emitted after all computations are done and drawing begins. However, some computations are done during drawing, so maybe rather add and connect to a signal 'nextFrameComplete' (hard to foresee intermixed frame counters?) or use a counter initialized with 2 and counting down, to compute&draw 2 frames before returning the numbers. The core.wait(smallDelay) is a solution that at least works now and has worked since 2012 or so. Feel free to optimize! I think some command to be given manually to yield processing to the main loop is unavoidable.
I am using Stellarium to extract data in a "batch" fashion, if you know what I mean. So I am changing location, and then grabbinhg some attributes for the Sun/Moon, and then changing location again.
For example:
What I'm seeing a lot is thisMoonAlt == thatMoonAlt. It's like Stellarium hasn't yet processed the move of the observer, and is giving me the old value. I've seen a lot of code online that says I need to add core.wait() to give it time to catch up, but I guess I was hoping that there was some way to force it to block until the location has been processed .. ?
The text was updated successfully, but these errors were encountered: