Chris Beaumont's IDL Library

Download source code

single page | use frames     summary     class     fields     routine details     file attributes

./

gcrot.pro

topgcrot

coordinate systems

result = gcrot(l, b [, degree=degree])

This function computes, as a function of galactic coordinates, the angle between a vector pointing towards the galactic north pole and a vector pointing towards the North Celestial Pole. This can be used to orient images aligned to ecliptic and galactic coordinate systems.

This has not been tested for accuracy higher than roughly .5 degrees. I wouldn't use this to determine the orientation of spectra slits or other high precision tasks without testing first.

Uses a spherical trig identity taken from wikipedia.org/wiki/Great-circle_distance

Return value

The clockwise rotation that aligns the galactic north pole with the NCP (in J2000 coordinates). In radians by default.

Parameters

l in required

Galactic longitude. Radians are assumed unless /DEGREE is set.

b in required

Galactic latitude. Radians are assumed unless /DEGREE is set.

Keywords

degree in optional

If set, the input and output are given in degrees.

Author information

History:

Written by: Chris Beaumont, May 2008. June 2008 Added /degree keyword. cnb

File attributes

Modifcation date: Mon Mar 22 16:17:13 2010
Lines: 77