Set an maker on a point in orbit

Post requests, images, descriptions and reports about work in progress here.
Topic author
www2
Posts: 3
Joined: 28.12.2016
With us: 7 years 11 months

Set an maker on a point in orbit

Post #1by www2 » 09.05.2017, 22:50

Hi i want to know how i can set an marker on a point of a planet orbit.
e.g. i want to have a marker were was earth in his orbit on may 25 2011 at 12:30 PM

Avatar
selden
Developer
Posts: 10192
Joined: 04.09.2002
With us: 22 years 3 months
Location: NY, USA

Post #2by selden » 10.05.2017, 10:30

Celestia doesn't explicitly include that particular functionality, but there are various ways to accomplish something similar.

For example, you ccould write Lua code to produce that result. Unfortunately, I don't think anybody has done it and published the procedure.

Here's an outline of one way it could be done:

One of Celestia's Lua functions is "getposition", which returns the coordinates of an object at a specific simulation time. See https://en.wikibooks.org/wiki/Celestia/Celx_Scrip ... ethods/Celx_object#getposition

An SSC object can be positioned using a Lua function as a ScriptedOrbit. See https://en.wikibooks.org/wiki/Celestia/Trajectories#ScriptedOrbit and https://en.wikibooks.org/wiki/Celestia/SSC_File#ScriptedOrbit_.7B_parameters_.7D

An SSC object can be defined to act as the marker. Its SSC definition would have to include a ScriptedOrbit definition which calls the getposition function to place the "marker" object at the appropriate position.

There probably are easier ways to accomplish whatever it is that you actually want to do.

Some examples:

1. write a Cel or CelX script which alternates Celestia's simulation date between two (or more) values.
2. have two copies of Celestia open, one set at the current date and one set at the other date.
3. define multiple SSC "Earths", each at a different location (perhaps by specifying different MeanAnomaly values) along its orbit. You'd have to define them using an EllipticalOrbit specification which approximates the Earth's orbit instead of using the built-in CustomOrbit.

I'm sure there are others I haven't thought of.
Selden

Janus
Posts: 537
Joined: 13.08.2016
With us: 8 years 3 months

Post #3by Janus » 10.05.2017, 16:59

If all you are after is seeing where the earth was at that time, that is easy.
Freeze the time in the menu, then set it.

If on the other hand, you want to see a marker across time.
Then here is a tweak/hack for you.
It is an abuse of the database system, but it works.

I didn't do the math, it is beyond me at this time.
I merely lined things up and approximated.

www2 date.png


In nearstars.stc I added the following to the end.

# Janus for CelestiaProject forum request from www2
"www2"
{
RA 241.52
Dec -20.86
Distance 0.0000159325
SpectralType "M5.0V" # Copied from Proxima Centauri
AppMag 1
}

It is a star with no defined drift, so it is stationary.

When you run celestia, hit enter and type www2 to select it.
Ctrl-P then marks it, while C & F will center and follow it, or G can take you to it.

If you zoom in on the marker for www2, you will see it does not quite match the orbit of earth.
It is off by a few lunar orbit diameters.
The position of the earth is also a little off.

However, this provides everything you need to get it as precise as you would like.
The arc can be computed using day of year to degree conversions.
The exact distance can be computed as the length of the chord cutting across the arc of the earth orbit.
That is then redefined from light seconds or miles into light years.

If you are after a line, then define a number of these marked as www2-1, www2-2, etc.
Use distances like 1,2,5,10,20,50 so it keeps the same basic profile as you zoom out.
If want a proper line, simply add them to asterisms.dat using the same format as the others.
You can then turn constellations on and see it labelled as you like.

Hope this helps.

Janus.

Edit: Screen layout differences are because I used my personal version of celestia.
I rearranged things some, and provided border offsets for presentation purposes.
For stars it does such things as give RA:Dec:Dist on screen.
The above being separate from the observer distance.

Topic author
www2
Posts: 3
Joined: 28.12.2016
With us: 7 years 11 months

Post #4by www2 » 14.05.2017, 16:06

Thanks Janus that did the trick.

For info: you can a custom stc file and you don't need edit nearstars.stc.

Janus
Posts: 537
Joined: 13.08.2016
With us: 8 years 3 months

Post #5by Janus » 14.05.2017, 18:47

I am glad it worked for you.

I am still learning to navigate the depths of Celestia.
My knowledge has some serious holes in it.
Knowing I can add a custom file fills one, thanks.

Janus.


Return to “Add-on development”