Announcement of Intent to checkin code

The place to discuss creating, porting and modifying Celestia's source code.
Topic author
BluMunky
Posts: 8
Joined: 13.09.2002
With us: 22 years 2 months

Announcement of Intent to checkin code

Post #1by BluMunky » 22.09.2002, 06:25

Since I'm new to this development effort, I wanted to solicit any bits of advice before I checked in some code.

The code I'd like to checkin adds a new menu item titled "Start Logging" which is a toggleable menu item. This menu item will trigger code that begins logging some info to a file celeslog.log in the following format:

<Date and Time Stamp><tab><Currently selected object><tab><Distance to object><carriage return>

Basically this grew out of my desire to follow halley's commet around, and get a file of the distance to Earth. Then I could sort that file in Excel to find out in what year will Halley come closest to Earth.

I'd like to evolve the code into a full logging subsystem so that the user can enter a format string like:

&date&tab&sel&tab&dist&cr

into a config screen box and have celestia output the requested information to a file. Possible format codes could be:

&date - Date and time string
&sel - Current selection name
&dist - Distance to currently selected object
&tab - Insert a tab
&cr - Insert a carriage return
&vel - Velocity
&dayl - Day length of currently selected object

This way, as the simulation blazes by at 1000000x speed, we can get a record of what went on.

Any comments on this attempt would be appreciated

blu

abiogenesis
Posts: 104
Joined: 07.06.2002
With us: 22 years 5 months
Location: Redmond, WA

Post #2by abiogenesis » 22.09.2002, 06:47

If you run the simulation at 1000000x, won't your sample rate be too low? You can only output to the log once a frame and, at that time scale, you won't get continuous data. Halley will likely fly right past the closest point, perhaps multiple times, without a single log.

As far as I know, Celestia doesn't actually model orbits with velocity, but rather the Keplerian formula that is parameterized by time. That is, something to the effect of:

Position = KeplerianOrbit( JulianDate )

A more practical solution to the problem might be to just mathematically solve for the shortest distance between the two objects, using the formulas for their respective orbits. I don't know how difficult or easy this would be, but it seems like it could be done.

- a b i o g e n e s i s -

erostosthenes
Posts: 62
Joined: 16.09.2002
With us: 22 years 2 months
Location: Phoenix, Arizona

Post #3by erostosthenes » 22.09.2002, 07:03

that wouldn't be too difficult with some calculus. simply fashion a formula for the distance between the two, taking into account their relative motions and minimize the function.

also, running celestia very fast is bad idea. you end up with very strange orbits that curl back on themselves :?

Topic author
BluMunky
Posts: 8
Joined: 13.09.2002
With us: 22 years 2 months

Makes sense.

Post #4by BluMunky » 22.09.2002, 15:34

That makes sense, and would indeed be more accurate wouldn't it. :-) I wonder if this approach would work for custom orbits eventually.

Anyhoo. Anyone have suggestions for other uses for an logging system for celestia?

blu


Return to “Development”