Celetial Latitude and Longitude

General discussion about Celestia that doesn't fit into other forums.
Topic author
trenner
Posts: 58
Joined: 27.09.2002
With us: 22 years 1 month
Location: Nanaimo, B.C., Canada

Celetial Latitude and Longitude

Post #1by trenner » 02.06.2005, 05:22

Is it possible for Celestia to give the Latitude and Longitude of each of the stars in the constellations? At a fixed time of course. I have a few dozen lenses that give point lights, and I'd like to take a crack at building a projector. I already have a theodolite, using a laser light, partly built for doing set up.

Regards
Terry Renner

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

Post #2by selden » 02.06.2005, 19:33

The locations of stars on the sky are measured in Right Ascension (RA) and Declination (Dec), which are similar to longitude and latitude, respectively, but are on the sky, not the ground.

Celestia uses a reformatted version of the Hipparcos database. I'd suggest getting your information directly from the source. You can get a copy of the database from http://cdsweb.u-strasbg.fr/cgi-bin/Cat?I/239
Selden

Gib
Posts: 1
Joined: 04.06.2005
With us: 19 years 5 months
Location: Fairfax, California

Post #3by Gib » 04.06.2005, 05:12

Helllo
In responce to Terry Renner's question of 6-2-05:
"Is it possible for Celestia to give the Latitude and Longitude of each of the stars in the constellations?"...

One way to get celestial latitude and longitude coordinates is to rewrite the function get-ra-dec() in the Lua script: "show-azimuth-elevation.celx" (v1.2 or 1.3) by Harald Schmidt.
Simply change the word 'planetographic" to "ecliptical" in the line:
frame = celestia:newframe("planetographic", EARTH).
It will return the celestial longitude and latitude. You will need to 'select' and 'center' on the star first in order for it to grab the coordinates. It works for the planets too.

...In other words... take the function:

--[[
## Return current RA and Dec for obs (sel_pl is ignored) ##
]]
function get_ra_dec(obs, sel_pl)
base_rot = celestia:newrotation(celestia:newvector(1,0,0), -math.rad(23.4392911))
frame = celestia:newframe("planetographic", EARTH)
--[[center = frame:from(celestia:newposition(0,0,0), J2000)
x_axis = frame:from(celestia:newposition(1,0,0), J2000) - center
y_axis = frame:from(celestia:newposition(0,1,0), J2000) - center
z_axis = frame:from(celestia:newposition(0,0,1), J2000) - center]]
rot = obs:getorientation() * base_rot
--rot = frame:to(rot, J2000)
look = (rotation_transform(LOOK,rot)):normalize()
r,theta,phi = transform_xyz2rtp(look.x, look.z, look.y)
phi = math.mod(720 - math.deg(phi), 360)
theta = math.deg(theta)
if theta > 0 then
theta = 90 - theta
else
theta = (-90 - theta)
end
return phi, theta
end

...and the call in the 'main loop':

ra, dec = get_ra_dec(obs, base_planet)
h,m,s = deg2hms(ra)
local radec_string = string.format("RA: %2ih %2im %2.1fs Dec: %3.2f?¬???", h, m, s, dec)

...and rewrite the function as something like:

function get_CelLong_CelLat(obs, sel_pl)
base_rot = celestia:newrotation(celestia:newvector(1,0,0), -math.rad(23.4392911))
frame = celestia:newframe("ecliptical", EARTH)
--
rot = obs:getorientation() * base_rot
--
look = (rotation_transform(LOOK,rot)):normalize()
r,theta,phi = transform_xyz2rtp(look.x, look.z, look.y)
phi = math.mod(720 - math.deg(phi), 360)
theta = math.deg(theta)
if theta > 0 then
theta = 90 - theta
else
theta = (-90 - theta)
end
return phi, theta
end

... changing only the function name and the word 'planetographic'.
... and then call the function with something like:

CelLong, CelLat = get_CelLong_CelLat(obs, EARTH)
local Ecliptical_string = string.format("CelLong: %3f CelLat: %2f", CelLong, CelLat)

... and print it with something like:

celestia:print(Ecliptical_string); wait(10)


Gib
Last edited by Gib on 26.06.2005, 04:59, edited 1 time in total.

Topic author
trenner
Posts: 58
Joined: 27.09.2002
With us: 22 years 1 month
Location: Nanaimo, B.C., Canada

Post #4by trenner » 08.06.2005, 03:17

uhhhh...ok... I'll give that a try. I think my "swiss cheese" intelligence is starting to show here.... (full of holes)


Return to “Celestia Users”