Learn R Programming

celestial (version 1.5.8)

eq2gal: Convert Equtorial to Galactic Coordinates

Description

Simple conversions accurate to about 0.1 arcseconds between J2000 Equatorial and MW Galactic.

Usage

eq2gal(RA, Dec, pole_RA = 192.859508, pole_Dec = 27.128336, eta = 32.932)
gal2eq(gal_long, gal_lat, pole_RA = 192.859508, pole_Dec = 27.128336, eta = 32.932)

Value

eq2gal returns the Galactic longitude and latitude in degrees (two column output). gal2eq returns the Equatorial RA and Dec in degress (two column output).

Arguments

RA

Numeric vector; Right Ascension in degrees (J2000 system). For convenience this can also be a two column matrix / data.frame containing RA and Dec columns.

Dec

Numeric vector; Declination in degrees (J2000 system).

gal_long

Numeric vector; Galactic Longitude in degrees (J2000 system). For convenience this can also be a two column matrix / data.frame containing gal_long and gal_lat columns.

gal_lat

Numeric vector; Galactic Latitude in degrees (J2000 system).

pole_RA

Numeric scalar; Right Ascension of Galactic Pole in degrees (J2000 system).

pole_Dec

Numeric scalar; Declination of Galactic Pole in degrees (J2000 system).

eta

Numeric scalar; Tilt of the Earth's axis in degrees (J2000 system).

Author

Aaron Robotham

Details

Approximate simple conversions, accurate usully to 0.1 arcseconds

References

"Practical astronomy with your calculator" (Peter Duffett-Smith)

See Also

sph2car,car2sph

Examples

Run this code
# Notice the conversion anbiguity at the poles

gal2eq(eq2gal(seq(0,360, len=19), seq(-90,90, len=19)))

Run the code above in your browser using DataLab