Astro-satpass
view release on metacpan or search on metacpan
lib/Astro/Coord/ECI/TLE.pm view on Meta::CPAN
$event->{event};
}
}
=head1 NOTICE
Users of JSON functionality (if any!) should be aware of a potential
problem in the way L<JSON::XS|JSON::XS> encodes numbers. The problem
basically is that the locale leaks into the encoded JSON, and if the
locale uses commas for decimal points the encoded JSON can not be
decoded. As I understand the discussion on the associated Perl ticket
the problem has always been there, but changes introduced in Perl 5.19.8
made it more likely to manifest.
Unfortunately the nature of the JSON interface is such that I have no
control over the issue, since the workaround needs to be applied at the
point the JSON C<encode()> method is called. See test F<t/tle_json.t>
for the workaround that allows tests to pass in the affected locales.
The relevant L<JSON::XS|JSON::XS> ticket is
L<https://rt.cpan.org/Public/Bug/Display.html?id=93307>. The relevant Perl
ticket is L<https://github.com/perl/perl5/issues/13620>.
lib/Astro/Coord/ECI/TLE.pm view on Meta::CPAN
time, an empty list is returned.
B<Note> that this is a change from the behavior of
Astro::Coord::ECI::TLE version 0.010, which threw an exception if the
backdate adjustment placed the start time after the end time.
The default is 1 (i.e. true).
=item bstardrag (numeric, parse)
This attribute contains the B* drag term, decoded into a number.
=item classification (string, parse)
This attribute contains the security classification. You should
expect to see only the value 'U', for 'Unclassified.'
=item ds50 (numeric, readonly, parse)
This attribute contains the C<epoch>, in days since 1950.
Setting the C<epoch> also modifies this attribute.
tools/heavens-above-mag view on Meta::CPAN
local $YAML::LoadBlessed = 1;
return Load( <$fh> );
};
}
state $ua = LWP::UserAgent->new();
my $resp = $ua->get( $uri );
$resp->is_success()
or die "Failed to fetch $uri: ", $resp->status_line();
my ( $last_modified ) = $resp->header( 'Last-Modified' );
my $content = $resp->decoded_content();
$content =~ s/ \r (?= \n ) //smxg;
my $data = {
last_modified => $last_modified,
content => $content,
};
open my $fh, '>:encoding(utf-8)', $path
or die "Failed to open $path for output: $!\n";
print { $fh } Dump( $resp );
return $resp;
}
tools/heavens-above-mag view on Meta::CPAN
or die "Unable to open $fn: $!\n";
my $content = <$fh>;
close $fh;
return $content;
}
sub get_html {
my ( $oid ) = @_;
my $url = heavens_above_url( $oid );
my $resp = get_cached( "oid-$oid", $url );
return $resp->decoded_content();
}
sub heavens_above_url {
my ( $oid ) = @_;
$oid =~ m/ \A [0-9]+ \z /smx
or die "OID '$oid' not numeric\n";
return sprintf 'https://www.heavens-above.com/SatInfo.aspx?satid=%05d', $oid;
}
sub open_file_for_output {
tools/heavens-above-mag view on Meta::CPAN
my %oid = parse_visual( $visual );
process_perl( sort { $a <=> $b } keys %oid );
say ');';
print @postamble;
return;
}
sub parse_visual {
my ( $resp ) = @_;
my $content = $resp->decoded_content();
local $_ = undef; # while (<>) ... does not localize $_.
my %oid;
open my $fh, '<', \$content;
local $_ = undef; # while (<>) ... does not localize $_.
while ( <$fh> ) {
my ( $id, $name ) = unpack 'A5A*';
$oid{$id} = $name;
}
close $fh;
foreach (
( run in 0.246 second using v1.01-cache-2.11-cpan-1dc43b0fbd2 )