# Convert coordinates between RA/dec and WGS 84 (SRID=4326)

I've imported the HYG Database from http://www.astronexus.com/node/34 and now I need to convert all RA/dec stars positions to fit in a WGS 84 coordinates (SRID=4326) PostGIS map (-180 to 180, 90 to -90).

BayerFlamsteed  ProperName  RA            DEC
21Alp And       Alpheratz   0.13976888    29.09082805
11Bet Cas       Caph        0.15280269    59.15021814
88Gam Peg       Algenib     0.22059721    15.18361593
Alp Phe         Ankaa       0.43801871    -42.30512197
18Alp Cas       Shedir      0.67510756    56.53740928
16Bet Cet       Diphda      0.7264523     -17.98668410


Related to:

http://gis.stackexchange.com/questions/84389/spatial-database-containing-coordinates-for-stars-in-the-sky

http://gis.stackexchange.com/questions/2459/what-coordinate-system-should-be-used-to-store-geography-data-for-celestial-coor

EDIT: Ok, I think MerseyViking gives the answer in http://gis.stackexchange.com/questions/2459/what-coordinate-system-should-be-used-to-store-geography-data-for-celestial-coor telling to create a new coordinate system. Can someone give a look and some opinion?

EDIT 2 (After answered): Fantastic!! I need to show the results of whuber and Dieudonné's answer. The first picture I show the query in QGIS. In second picture you can see the real positions in a map. The scale is different - Find Shaula, Nunki and Antares.

This is the conversion method ('H' is for Hyparcus in my database):

insert into stars
select
id,
proper_name,
ST_SetSRID(ST_MakePoint( (-ra * 15), dec),4326),
mag,
'H'
from hygn
where (proper_name is not null)


-
I've never heard of this system. I did a little research on it and it seems that it's mainly used by the Global Positioning System community, which is why an astronomer has never come across it. I would have recommended astropy's coordinates package, however, having already looked to see if it were in there I can tell you you're probably not going to find it (unless it had another alias). – astromax Jan 29 '14 at 21:00
It probably depends on the accuracy you need, but if you map celestial coordinates (with a reference surface that is a sphere) to WGS84 (with a spheroidal reference surface) you will get distortions. What do you want to use it for? – Dieudonné Jan 29 '14 at 21:03
@Dieudonné : Nothing too professional. Small distortions are acceptable. As see in related link, whuber proposes the formula LONGITUDE = (RA*15) - 180 and LATITUDE = DEC. Can someone verify this? – Magno C Jan 29 '14 at 21:45