Astro::Coord::ECI::TLE::Iridium is a Perl module to compute behavior of Iridium satellites.
SYNOPSIS
The following is a semi-brief script to calculate Iridium flares. You will need to substitute your own location where indicated.
use Astro::SpaceTrack;
use Astro::Coord::ECI;
use Astro::Coord::ECI::TLE;
use Astro::Coord::ECI::Utils qw{deg2rad rad2deg};
# 1600 Pennsylvania Avenue, Washington DC, USA
my $your_north_latitude_in_degrees = 38.898748;
my $your_east_longitude_in_degrees = -77.037684;
my $your_height_above_sea_level_in_meters = 16.68;
# Create object representing the observers' location.
# Note that the input to geodetic() is latitude north
# and longitude west, in RADIANS, and height above sea
# level in KILOMETERS.
my $loc = Astro::Coord::ECI->geodetic (
deg2rad ($your_north_latitude_in_degrees),
deg2rad ($your_east_longitude_in_degrees),
$your_height_above_sea_level_in_meters/1000);
# Get all the Iridium data from Celestrak; it is direct-
# fetched, so no password is needed.
my $st = Astro::SpaceTrack->new (direct => 1);
my $data = $st->celestrak ('iridium');
$data->is_success or die $data->status_line;
# Parse the fetched data, yielding Iridium objects.
my @sats = Astro::Coord::ECI::TLE->parse ($data->content);
# We want flares for the next 2 days. In order to try to
# duplicate http://www.heavens-above.com/ as closely as
# possible, we throw away daytime flares dimmer than -6,
# and nighttime flares dimmer than -1. We also calculate
# flares for spares, and assume night is any time the Sun
# is below the horizon.
my $start = time ();
my $finish = $start + 2 * 86400;
my @flares;
my %mag_limit = (am => -1, day => -6, pm => -1);
foreach my $irid (@sats) {
$irid->can_flare (1) or next;
$irid->set (twilight => 0);
foreach my $flare ($irid->flare ($loc, $start, $finish)) {
$flare->{magnitude} {type}}
and push @flares, $flare;
}
}
print {time}} @flares) {
# If we wanted to make use of the Iridium object that
# produced the flare (e.g. to get apparant equatorial
# coordinates) we would need to set the time first.
## $flare->{body}->universal ($flare->{time});
# The returned angles are in radians, so we need to
# convert back to degrees.
printf "%s %-15s %9.1f %9.1f %5.1f
",
scalar localtime $flare->{time},
$flare->{body}->get ('name'),
rad2deg ($flare->{elevation}),
rad2deg ($flare->{azimuth}),
$flare->{magnitude};
}
This class is a subclass of Astro::Coord::ECI::TLE, representing Iridium satellites. The Astro::Coord::ECI::TLE->parse method makes use of built-in data to determine which satellites to rebless into this class, based on the object's NORAD SATCAT ID. This internal data can be modified using the Astro::Coord::ECI::TLE->status method to correct errors or for historical research. It is also possible to get an Iridium object by calling $tle->rebless (iridium => {status => $status}) directly.
What this subclass adds is the ability to generate information on Iridium flares (or glints, as they are also called). Members of this class are considered capable of generating flares based on their status, as follows:
0 => in service
1 => spare (may or may not flare)
2 => failed - no predictable flares.
Celestrak-style statuses ('+', 'S', and '-' respectively) are accepted on input. See Astro::SpaceTrack method iridium_status for a way to get current Iridium constellation status.
Product's homepage
Requirements:
· Perl