Astro-satpass

 view release on metacpan or  search on metacpan

lib/Astro/Coord/ECI/TLE.pm  view on Meta::CPAN

85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
            $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

lib/Astro/Coord/ECI/TLE.pm  view on Meta::CPAN

8393
8394
8395
8396
8397
8398
8399
8400
8401
8402
8403
8404
8405
8406
8407
8408
8409
8410
8411
8412
8413
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

124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
            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

150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
        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";
}
 
sub open_file_for_output {

tools/heavens-above-mag  view on Meta::CPAN

232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
    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.240 second using v1.01-cache-2.11-cpan-1dc43b0fbd2 )