Astro-satpass
view release on metacpan or search on metacpan
Makefile.PL view on Meta::CPAN
use 5.006002; # for 'our'.
use strict;
use warnings;
use lib qw{ inc };
use My::Module::Meta;
use My::Module::Recommend;
use Config;
use ExtUtils::MakeMaker qw{WriteMakefile prompt};
use FileHandle;
use Getopt::Std;
my %opt;
getopts ('ny', \%opt) or die <<eod;
The only legal options are
-n = answer all questions 'no'.
-y = answer all questions 'yes'.
You may not assert both of these at once - it is too confusing.
eod
script/satpass view on Meta::CPAN
extinction => 1,
flare_mag_day => -6,
flare_mag_night => 0,
geometric => 1,
gmt => 0,
## horizon => 20, set below
illum => SUN_CLASS_DEFAULT,
local_coord => 'azel_rng',
model => 'model',
pass_threshold => undef,
prompt => 'satpass>',
## simbad_url => 'simbad.harvard.edu',
## simbad_version => 3,
refraction => 1,
simbad_url => 'simbad.u-strasbg.fr',
simbad_version => 4,
singleton => 0,
sun => SUN_CLASS_DEFAULT,
time_format => '%H:%M:%S',
## timing => 0,
## twilignt => 'civil', set below
script/satpass view on Meta::CPAN
gmt => \&_set_unmodified,
height => \&_set_unmodified,
horizon => \&_set_angle,
illum => \&_set_illum_class,
latitude => \&_set_angle,
local_coord => \&_set_local_coord,
location => \&_set_unmodified,
longitude => \&_set_angle,
model => \&_set_unmodified,
perltime => \&_set_perltime,
prompt => \&_set_unmodified,
refraction => \&_set_unmodified,
simbad_url => \&_set_unmodified,
simbad_version => \&_set_simbad_version,
singleton => \&_set_unmodified,
sun => \&_set_sun_class,
pass_threshold => \&_set_angle_or_undef,
time_format => \&_set_unmodified,
## timing => \&_set_unmodified,
twilight => \&_set_twilight, # 'civil', 'nautical', 'astronomical'
# (or a unique abbreviation thereof),
script/satpass view on Meta::CPAN
while (1) {
# Select the default output
select ($frame[$#frame]{stdout});
# Get the next command, wherever it comes from.
my $cntind = $frame[$#frame]{cntind} || '';
my $buffer = @frame > 1 ? $fh->getline () :
$reader->( $fh, "$cntind$parm{prompt} " );
# If it was end-of-file, pop one level off the stack of input
# files. If it's empty, we exit the execution loop. Otherwise
# we select the proper STDOUT and redo the loop.
defined $buffer or do {
defined ($fh = _frame_pop ()) or last;
redo;
};
script/satpass view on Meta::CPAN
};
# Help the parser deal with things like '.' and '!'
$buffer =~ s/^(\W)\s*/$1 /;
$buffer =~ s/\s+$//;
# Echo the line, if this is selected.
$parm{echo} && (@frame > 1 || !-t $fh) and
print "$cntind$parm{prompt} $buffer\n";
# Pull the verb off by brute force, because we need to know what
# it is before we know how to parse the rest of the line.
my ($cmdspec, $rest) = split '\s+', $buffer, 2;
$cmdspec = $alias{$cmdspec} if $alias{$cmdspec};
# Pull the namespace off the command spec. We make use
# of the $cmdspec argument later as a macro name, since
# with the 'core.' on the front it will be invalid, and
script/satpass view on Meta::CPAN
random text in the output.
=item exit
satpass> exit
This command causes this script to terminate immediately. If issued
from a 'source' file, this is done without giving control back to the
user.
'bye' and 'quit' are synonyms. End-of-file at the command prompt will
also cause this script to terminate.
=item export
satpass> export name value
This command exports the given value to an environment variable. This
value will be available to spawned commands, but will not persist after
we exit.
script/satpass view on Meta::CPAN
to model the shape of the earth. Any reference ellipsoid supported by
Astro::Coord::ECI may be used. For details,
see L<Astro::Coord::ECI|Astro::Coord::ECI>.
The default is 'WGS84'.
=item error_out
This Boolean parameter specifies the behavior on encountering an error. If
true, all macros, source files, etc are aborted and control is returned
to the command prompt. If standard in is not a terminal, we exit. If
false, we ignore the error.
The default is 0 (i.e. false).
=item exact_event
This Boolean parameter specifies whether visibility events (rise, set, max,
into or out of shadow, beginning or end of twilight) should be computed
to the nearest second. If false, such events are reported to the step
size specified when the 'pass' command was issued.
script/satpass view on Meta::CPAN
If you turn this setting on, 'jul 1 noon' comes out 4:00 PM GMT even
if done in January. If you plan to parse times B<with zones> (e.g.
'jul 1 noon edt'), you should turn this setting off.
Note that at at some point this setting will be no-oped and its use
deprecated, though given the state of things this may well not happen
until this script itself starts requiring Perl 5.010.
The default is 0 (i.e. false).
=item prompt
This string parameter specifies the string used to prompt for commands.
The default is 'satpass>'.
=item refraction
This Boolean parameter specifies whether atmospheric refraction should be taken
into account in the azel() calculation.
The default is 1 (i.e. true).
( run in 1.107 second using v1.01-cache-2.11-cpan-6aa56a78535 )