Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Making a plot in equatorial coordinates

124 views
Skip to first unread message

Christian Herenz

unread,
Jun 26, 2009, 6:03:03 PM6/26/09
to
Hi,

I have a list of objects given in equatorial coordinates... Is there a programm
which lets me plot a projection of these coordinates (like you would print out a
map of the world) with my datapoints in it?

Greetings,
Christian Herenz

Eric Flesch

unread,
Jul 1, 2009, 1:03:33 PM7/1/09
to
On Fri, 26 Jun 2009, Christian Herenz wrote:
>I have a list of objects given in equatorial coordinates... Is there a programm
>which lets me plot a projection of these coordinates (like you would print out a
>map of the world) with my datapoints in it?

I use SkyMap, but it isn't free, and of course you need to do a little
work to prepare the data and define it to SkyMap.

Eric

Stupendous_Man

unread,
Jul 2, 2009, 3:17:42 PM7/2/09
to
On Jun 26, 6:03 pm, Christian Herenz <her...@physik.hu-berlin.de>
wrote:

Below is a Perl subroutine to convert a series of (RA, Dec)
values into a Hammer-Aitoff projection. The resulting
(x, y) values can then be plotted with any ordinary graphics
package to show the projected locations.


####################################################################
# Given (RA, Dec), convert to (x, y) in Hammer-Aitoff projection
#
# The two arguments are RA and Dec in decimal degrees,
# and we return a two-element list for x, y.
# We scale (x, y) so that they range from
#
# 0 < x < 360
# -90 < y < 90
#
# so that labels will correspond to (RA, Dec) in decimal degrees.
#
# MWR 7/22/2006

sub convert_radec_to_hammeraitoff {
my($ra, $dec);
my($tra, $tdec);
my($x, $y, $z);
my($DEGTORAD);
my($pi);

$ra = $_[0];
$dec = $_[1];

$pi = 3.14159;
$DEGTORAD = $pi/180.0;

# convert RA and Dec into radians
$tra = ($ra*$DEGTORAD) - $pi;
$tdec = ($dec*$DEGTORAD);

# calc auxiliary variable z
$z = sqrt( 1.0 + cos($tdec)*cos($tra/2.0) );

# calc Hammer-Aitoff normalized coords (x, y)
$x = ( cos($tdec)*sin($tra/2.0) ) / $z;
$y = sin($tdec) / $z;

# now scale the normalized coords so that X ranges over 0 to 360,
# and y ranges over -90 to +90.
$x = ($x*180.0) + 180.0;
$y *= 90.0;

return($x, $y);
}

0 new messages