Page 1 of 1

Celetial Latitude and Longitude

Posted: 02.06.2005, 05:22
by trenner
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

Posted: 02.06.2005, 19:33
by selden
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

Posted: 04.06.2005, 05:12
by Gib
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

Posted: 08.06.2005, 03:17
by trenner
uhhhh...ok... I'll give that a try. I think my "swiss cheese" intelligence is starting to show here.... (full of holes)