TITLE

heavens-above-mag - Get magnitudes from Heavens Above

SYNOPSIS

heavens-above-mag 25544
heavens-above-mag --help
heavens-above-mag --version

OPTIONS

--age

--age 43200

This option specifies the maximum age of the cache, in seconds. Setting --age=0 disables the cache.

The default is --age=86400, i.e. one day.

--celestrak

If this Boolean option is asserted, the OIDs come from Celestrak's visual.txt file, and the output is the canned magnitude table in Astro::Coord::ECI::TLE. If this option is asserted, no non-option arguments may be specified, and --open is ignored.

The default is the value of --update.

--help

This option displays the documentation for this script. The script then exits.

--open

If this Boolean option is asserted, a web browser is spawned, displaying the Heavens-Above web page of the OIDs specified. You cannot specify file names if you specify this option.

--purge

This option causes the cache to be purged before any magnitudes are retrieved. The script will exit afterwards unless either arguments or --celestrak were specified.

--update

This option causes everything between the lines

# $$ BEGIN magnitude_table

and

# $$ END

in lib/Astro/Coord/ECI/TLE.pm to be replaced by the output of the --celestrak option. An error is reported if the file can not be opened, or if the markers are not found.

The default is --no-update.

--verbose

If this Boolean option is asserted, whatever information the author deems useful is displayed on STDERR.

The default is --no-verbose.

--version

This option displays the version of this script. The script then exits.

DETAILS

This Perl script parses intrinsic magnitude data out of Heavens Above data. You can specify either an OID (which is fetched) or a file name (which is read) or a mixture of the two.

Heavens Above defines intrinsic magnitude as the magnitude at a range of 1000km, and 50% illuminated.

All web I/O goes through a cache in top-level project directory cache/. Data will come from the cache rather than the web if the file in the cache is newer than the value of the --age option. The cache directory will be created if necessary.

AUTHOR

Thomas R. Wyant, III wyant at cpan dot org

COPYRIGHT AND LICENSE

Copyright (C) 2021-2025 by Thomas R. Wyant, III

This program is free software; you can redistribute it and/or modify it under the same terms as Perl 5.10.0. For more details, see the Artistic License 1.0 at https://www.perlfoundation.org/artistic-license-10.html, and/or the Gnu GPL at http://www.gnu.org/licenses/old-licenses/gpl-1.0.txt.

This program is distributed in the hope that it will be useful, but without any warranty; without even the implied warranty of merchantability or fitness for a particular purpose.