NAME
Image::Flight::Suborbital - draw diagram of suborbital rocket flight profile
SYNOPSIS
use Image::Flight::Suborbital;
# instantiate
$ifs = Image::Flight::Suborbital->new(
"height" => 800,
"width" => 250,
"title_text" => "120 km suborbital space flight",
"altitude_value" => 120,
"altitude_units" => "km",
);
# draw a PNG image and print it on the standard output
print $ifs->image;
DESCRIPTION
Image::Flight::Suborbital uses Perl's GD graphics library to draw a diagram of a suborbital space flight.
The following methods are available.
new() class method
$obj = Image::Flight::Suborbital->new( attribute => value, ... )
This instantiates an Image::Flight::Suborbital object and initializes its parameters. The following parameters are recognized. Unrecognized parameters are silently ignored - but should be avoided to prevent conflicts with future versions of the module.
height attribute
Set the height of the image.
The default is 800.
width attribute
Set the width of the image.
The default is 250.
altitude_value attribute
Set the value of the altitude in either miles, kilometers or feet as specified by the altitude_units attribute.
The default is 120.
altitude_units attribute
The units used by the altitude_value parameter.
This may only be one of the strings "km", "mi", "miles", "ft" or "feet". The default is "km".
bg_color attribute
Set the image background color.
This may be any color string recognized by the Graphics::ColorNames module. The default is "white".
bg_top_gradient_color attribute
If present, this turns the background to a grandient of colors. The gradient starts at the bottom of the image with the bg_color attribute and blending in 100 steps to the bg_top_gradient_color at the top of the image. The colors make the steepest transition toward the bottom of the image in order to look like the transition from low-altitude sky to space.
This may be any color string recognized by the Graphics::ColorNames module. If omitted, the bg_color is used as a solid background. The default is not to use a gradient.
flight_path_color attribute
Set the color of the flight path arc.
This may be any color string recognized by the Graphics::ColorNames module. The default is "black".
alt_label_color attribute
Set the color of the altitude labels.
This may be any color string recognized by the Graphics::ColorNames module. The default is "black".
title_text attribute
This is currently unused but reserved for a future version.
title_color attribute
This is currently unused but reserved for a future version.
image() object method
This method outputs the PNG image of the suborbital rocket flight to the standard output.
EXAMPLE
The following example will output a PNG image of the CSXT Space Shot 2004 which reached an apogee of 72 miles (116 km) on May 17, 2004.
#!/usr/bin/perl
use strict;
use Image::Flight::Suborbital;
my $ifs = Image::Flight::Suborbital->new(
"bg_color" => "skyblue",
"bg_top_gradient_color" => black,
"flight_path_color" => "yellow",
"alt_label_color" => "white",
"altitude_value" => 116,
"altitude_units" => "km" );
print $ifs->image();
BACKGROUND STORY
Image::Flight::Suborbital was written by Ian Kluft for Masten Space Systems ( http://www.masten-space.com/ ) for use in documentation of suborbital flights. Thought the original idea was inspired for use by the Stratofox Aerospace Tracking Team ( http://www.stratofox.org/ ), in order to draw images for the web site about space launches which Stratofox has participated in.
The module was "inspired" by an adjustment of the estimate of the altitude of the CSXT Space Shot 2004, the first amateur space launch. ( http://www.civilianspace.com/ and http://www.stratofox.org/pics/csxt-spaceshot-2004/ ) Upon inspection of the data from the flight computers, CSXT made an initial altitude estimate of 77 miles (about 123 km or 400,000ft). After further study, the official altitude was adjusted to a more conservative 72 miles (about 113km or 380,000ft). But that was after Stratofox had drawn diagrams manually. It had been a lot of work to draw the diagram and the scales in miles and kilometers. An automated method was preferred before a need came up to draw more. This module was written to solve that problem.
SEE ALSO
The amateur space launch which made this module necessary took place at the Black Rock Desert in Nevada. See Ian Kluft's Black Rock Page ( http://ian.kluft.com/blackrock/ ) for more information about rocketry at the Black Rock Desert.
More information about rocketry can be found at the Tripoli Rocketry Association ( http://www.tripoli.org/ ) or the National Association of Rocketry ( http://www.nar.org/ ).
AUTHOR
Ian Kluft, <ikluft-cpan@thunder.sbay.org>, http://ian.kluft.com/
COPYRIGHT AND LICENSE
Copyright (C) 2006 by Ian Kluft
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.6 or, at your option, any later version of Perl 5 you may have available.