| Astro::SkyPlot - Create very basic sky plots |
Astro::SkyPlot - Create very basic sky plots
use Astro::SkyPlot qw/:all/; # export the markers my $plot = Astro::SkyPlot->new(); # use defaults (see below) # specify options yourself: $plot = Astro::SkyPlot->new( xsize => 200, # mm ysize => 200, bgcolor => [0, 0, 0], # RGB => black projection => 'hammer', axiscolor => [100, 100, 100], # RGB => grey ); $plot->setcolor(255, 0, 0); # RGB => red $plot->plot_lat_long(1, 1); # units: radians $plot->plot_lat_long(1, 1, size => 0.2, marker => MARK_CIRCLE); # units: radians, radians, mm $plot->write(file => "skyplot.eps");
A module to create very basic sky plots as EPS documents.
There are multiple types of markers that can be plotted into the sky plot. These are defined through constants that can be exported from the module:
MARK_CIRCLE => circular markers MARK_CIRCLE_FILLED => filled circular markers MARK_BOX => square markers MARK_BOX_FILLED => filled square markers MARK_TRIANGLE => triangularmarkers MARK_TRIANGLE_FILLED => filled triangular markers MARK_DTRIANGLE => downward triangular markers MARK_DTRIANGLE_FILLED => filled downward triangular markers MARK_CROSS => cross shaped markers MARK_DIAGCROSS => diagonal cross shaped markers
Constructor. Without arguments, uses the default settings (cf. SYNOPSIS). Supports the following options:
xsize => Plot x-size in mm (def: 200mm)
ysize => Plot y-size in mm (def: 200mm)
bgcolor => Background color as array reference
(RGB value 0-255 per component)
(def: black, [0, 0, 0])
projection => Projection type. Default: Hammer projection ('hammer')
axiscolor => Color for the axes. (def: grey, [100, 100, 100])
Set a new drawing color. Takes three numbers corresponding to red, green and blue values between 0 and 255.
Draw a new latitude/longitude point.
These may be followed by key/value pairs of options. Supported options:
size: the size (radius) of the point (default: 0.1mm)
marker: The type of marker to use (see MARKERS).
Write the plot to the specified EPS file.
The following are read only accessors unless otherwise noted.
Get/Set the default marker type. The marker type for a single
plot operation can be specified as an option to plot_lat_long.
Returns the internals PostScript::Simple object.
Returns the image's width (in mm).
Returns the image's height (in mm).
Draws the plot's background.
Restores the previously saved color.
Plot the sky-plot axis.
Projects given lat/long to x/y to plot coordinates.
Draws a marker at the given plot coordinates. Arguments $x, $y, $markerno, $size.
For more general information on map projections: http://en.wikipedia.org/wiki/Map_projection
Map projections are implemented in the Astro::MapProjection manpage
Steffen Mueller, <smueller@cpan.org>
Copyright (C) 2009 by Steffen Mueller
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.8.0 or, at your option, any later version of Perl 5 you may have available.
| Astro::SkyPlot - Create very basic sky plots |