Astro::Coords

Class for handling astronomical coordinates
Download

Astro::Coords Ranking & Summary

Advertisement

  • Rating:
  • License:
  • Perl Artistic License
  • Publisher Name:
  • Tim Jenness
  • Publisher web site:
  • http://search.cpan.org/~tjenness/

Astro::Coords Tags


Astro::Coords Description

Class for handling astronomical coordinates Astro::Coords is a Perl class for manipulating and transforming astronomical coordinates. Can handle the following coordinate types: + Equatorial RA/Dec, galactic (including proper motions and parallax) + Planets + Comets/Asteroids + Fixed locations in azimuth and elevations + interpolated apparent coordinatesFor time dependent calculations a telescope location and reference time must be provided. See Astro::Telescope and DateTime for details on specifying location and reference epoch.SYNOPSIS use Astro::Coords; $c = new Astro::Coords( name => "My target", ra => '05:22:56', dec => '-26:20:40.4', type => 'B1950' units=> 'sexagesimal'); $c = new Astro::Coords( long => '05:22:56', lat => '-26:20:40.4', type => 'galactic'); $c = new Astro::Coords( planet => 'mars' ); $c = new Astro::Coords( elements => \%elements ); $c = new Astro::Coords( az => 345, el => 45 ); # Associate with an observer location $c->telescope( new Astro::Telescope( 'JCMT' )); # ...and a reference epoch for all calculations $date = Time::Piece->strptime($string, $format); $c->datetime( $date ); # or use DateTime $date = DateTime->from_epoch( epoch => $epoch, time_zone => 'UTC' ); $c->datetime( $date ); # Return coordinates J2000, for the epoch stored in the datetime # object. This will work for all variants. ($ra, $dec) = $c->radec(); $radians = $ra->radians; # or individually $ra = $c->ra(); # returns Astro::Coords::Angle::Hour object $dec = $c->dec( format => 'deg' ); # Return coordinates J2000, epoch 2000.0 $ra = $c->ra2000(); $dec = $c->dec2000(); # Return coordinats apparent, reference epoch, from location # In sexagesimal format. ($ra_app, $dec_app) = $c->apparent; $ra_app = $c->ra_app( format => 's'); $dec_app = $c->dec_app( format => 's' ); # Azimuth and elevation for reference epoch from observer location ($az, $el) = $c->azel; my $az = $c->az; my $el = $c->el; # obtain summary string of object $summary = "$c"; # Obtain full summary as an array @summary = $c->array; # See if the target is observable for the current time # and telescope $obs = 1 if $c->isObservable; # Calculate distance to another coordinate (in radians) $distance = $c->distance( $c2 ); # Calculate the rise and set time of the source $tr = $c->rise_time; $ts = $c->set_time; # transit elevation $trans = $c->transit_el; # transit time $mtime = $c->meridian_time(); Requirements: · Perl


Astro::Coords Related Software