New Script: Azimuth and Elevation (2nd UPDATE)

All about writing scripts for Celestia in Lua and the .cel system
Topic author
Harry
Posts: 559
Joined: 05.09.2003
With us: 21 years 2 months
Location: Germany

New Script: Azimuth and Elevation (2nd UPDATE)

Post #1by Harry » 29.04.2004, 16:37

Hi,

I just finished a script which displays the azimuth and elevation of the direction the observer is looking. The display is only activated when near the surface of a planet (I don't think the values make much sense when somewhere in space).

You can find the script here:
show-azimuth-elevation_v1.0.celx or here, together with my other scripts.

The results should be correct, but may not be perfectly precise - please report any problems. It would be great if someone can compare the results with a reference ;)

The script only works with recent Celestia 1.3.2pre-versions, but I don't know which ones :oops:

Example usage:
- start the script
- select earth
- select your hometown, land on surface

- you should now see the current azimuth and elevation at the lower border of the screen
- get the position of the next iridium flare from heavens-above.com, and check where it will appear using Celestia ;)

UPDATE:
Version 1.1 is now available. Now RA and Dec are displayed as well. Azimuth and Elevation is always displayed. The base-planet doesn't change automatically and defaults to Earth. To change it, select another planet and press S.

Get it here:
show-azimuth-elevation_v1.1.celx

UPDATE v 1.2
New version: v1.2 (lunar-eclipse edition ;) )
Changes:
You can now enter Azimuth and Elevation: Press "A".
You can now force the horizon to stay horizontal, i.e. to make up always point away from ground: Press "F".

show-azimuth-elevation_v1.2.celx
(or via my website)

Harald
Last edited by Harry on 04.05.2004, 20:04, edited 2 times in total.

don
Posts: 1709
Joined: 12.07.2003
With us: 21 years 4 months
Location: Colorado, USA (7000 ft)

Post #2by don » 30.04.2004, 18:34

Nice script Harald! 8)

Will you be adding the RA / Dec mode?

What about being able to select an object in space, after you are on the surface, and have the script display it's Az/Ele or RA/Dec?
-Don G.
My Celestia Scripting Resources page

Avatar: Total Lunar Eclipse from our back yard, Oct 2004. Panasonic FZ1 digital camera (no telescope), 36X digital zoom, 8 second exposure at f6.5.

Topic author
Harry
Posts: 559
Joined: 05.09.2003
With us: 21 years 2 months
Location: Germany

Post #3by Harry » 01.05.2004, 00:42

don wrote:Will you be adding the RA / Dec mode?
As soon as I find out the coordinate axis (given in universal coordinates) for RA/Dec...
What about being able to select an object in space, after you are on the surface, and have the script display it's Az/Ele or RA/Dec?

Why not simply center on the object? Then you get the Az/Elev data for the object. I am not sure how the script should decide when to display what - either the Az/Elev for the selected object, or for the center of the screen.

Harald

don
Posts: 1709
Joined: 12.07.2003
With us: 21 years 4 months
Location: Colorado, USA (7000 ft)

Post #4by don » 01.05.2004, 00:49

Harry wrote:As soon as I find out the coordinate axis (given in universal coordinates) for RA/Dec...
Not sure exactly what you need, or I'd do a web search for ya <sigh>.


Harry wrote:Why not simply center on the object?

As soon as you select another object, the display goes away. The object needs to be selected in order to center it. But, when centering it, the planet could go off-screen, making it impossible to re-select it in order to re-display the numbers. Catch-22.

Or am I doing something wrong, which is not at all out of the question?
-Don G.

My Celestia Scripting Resources page



Avatar: Total Lunar Eclipse from our back yard, Oct 2004. Panasonic FZ1 digital camera (no telescope), 36X digital zoom, 8 second exposure at f6.5.

Topic author
Harry
Posts: 559
Joined: 05.09.2003
With us: 21 years 2 months
Location: Germany

Post #5by Harry » 01.05.2004, 01:27

don wrote:Not sure exactly what you need, or I'd do a web search for ya <sigh>
Did that already, now I know how RA/Dec is defined, but still haven't got the actual values I need - though I should be able to get them.

Harry wrote:Why not simply center on the object?
As soon as you select another object, the display goes away.

The Az/Elev display goes away (i.e. display "not near surface" warning) when you select another planet, I did not think of that. But it should work fine when only selecting stars, moons etc. However you must keep your current position...

The problem is easily fixable, but maybe it would be even better to hardcode Earth as the reference point for the display - does any other planet make sense?

Harald

don
Posts: 1709
Joined: 12.07.2003
With us: 21 years 4 months
Location: Colorado, USA (7000 ft)

Post #6by don » 01.05.2004, 01:39

Harry wrote:Did that already, now I know how RA/Dec is defined, but still haven't got the actual values I need - though I should be able to get them.
Glad to hear it!

Harry wrote:The problem is easily fixable, but maybe it would be even better to hardcode Earth as the reference point for the display - does any other planet make sense?

Probably not unless you were a resident of that planet and had an observatory with printed references to other stellar objects at hand. :wink:

But, then you will probably need to make sure that Earth is at least close-at-hand (ie. observer on the Earth's surface), right?
-Don G.

My Celestia Scripting Resources page



Avatar: Total Lunar Eclipse from our back yard, Oct 2004. Panasonic FZ1 digital camera (no telescope), 36X digital zoom, 8 second exposure at f6.5.

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

Post #7by selden » 01.05.2004, 01:51

Personally, I think it'd be very useful for the Az/Elev values to be available no matter which planet you're "on". For example, when figuring out when one of the Mars communications relay satellites is above the horizon when seen from one of the rovers. Or where Cassini is from the point of view of Huygens as it lands.
Selden

don
Posts: 1709
Joined: 12.07.2003
With us: 21 years 4 months
Location: Colorado, USA (7000 ft)

Post #8by don » 01.05.2004, 05:16

don wrote:Probably not unless you were a resident of that planet and had an observatory with printed references to other stellar objects at hand. :wink:

Well, I sit corrected. 8O I guess between Celestia and NASA, this is exactly what we've become -- part-time residents of other planets! :D
-Don G.

My Celestia Scripting Resources page



Avatar: Total Lunar Eclipse from our back yard, Oct 2004. Panasonic FZ1 digital camera (no telescope), 36X digital zoom, 8 second exposure at f6.5.

Topic author
Harry
Posts: 559
Joined: 05.09.2003
With us: 21 years 2 months
Location: Germany

Post #9by Harry » 01.05.2004, 13:02

I've just updated the script. See the top post, besides adding RA/Dec this should solve the problem of selecting other planets while still allowing displaying Az/Elev of other planets (assuming they use the same definition of Azimuth and Elevation ;)

Harald

don
Posts: 1709
Joined: 12.07.2003
With us: 21 years 4 months
Location: Colorado, USA (7000 ft)

Post #10by don » 03.05.2004, 05:12

Hey, lookin' good Harald! Both modes *seem* to work okay, on Earth and Mars. I say *seem* because I don't have any texts with actual values.

Thanks for the great script! :D
-Don G.

My Celestia Scripting Resources page



Avatar: Total Lunar Eclipse from our back yard, Oct 2004. Panasonic FZ1 digital camera (no telescope), 36X digital zoom, 8 second exposure at f6.5.

Topic author
Harry
Posts: 559
Joined: 05.09.2003
With us: 21 years 2 months
Location: Germany

Post #11by Harry » 04.05.2004, 20:16

Another update, now version 1.2:
Now allows to enter Az/Elev (press "A"), and you use the script to have up always pointing away from ground (press "F", with this you don't need to activate azimuth-mode).

Have fun,

Harald

don
Posts: 1709
Joined: 12.07.2003
With us: 21 years 4 months
Location: Colorado, USA (7000 ft)

Post #12by don » 06.05.2004, 04:59

Sounds great Harald!

Now all I have to do is get my disk drives and space sorted out (this weekend hopefully) and find a big enough time-slot to do some "playing" with scripts. Looking forward to trying it out.
-Don G.

My Celestia Scripting Resources page



Avatar: Total Lunar Eclipse from our back yard, Oct 2004. Panasonic FZ1 digital camera (no telescope), 36X digital zoom, 8 second exposure at f6.5.

don
Posts: 1709
Joined: 12.07.2003
With us: 21 years 4 months
Location: Colorado, USA (7000 ft)

Post #13by don » 07.05.2004, 00:47

Very nice additions Harald! 8)
-Don G.

My Celestia Scripting Resources page



Avatar: Total Lunar Eclipse from our back yard, Oct 2004. Panasonic FZ1 digital camera (no telescope), 36X digital zoom, 8 second exposure at f6.5.


Return to “Scripting”