Astro-SpaceTrack
view release on metacpan or search on metacpan
number of OIDs is over 50.
Add the ability to handle OID ranges to the REST versions of
retrieve() and search_oid().
Have the output of names( 'spacetrack' ) depend on the value of the
space_track_version attribute.
Have the shell() method extract redirections from the command line
before un-quoting and un-escaping the data, so that we have a way to
force something that looks like a redirection to be taken as an
argument.
Add ':' to the list of 'safe' characters when URI-escaping arguments
to the Space Track REST interface. Percent-encoded colons seemed to
stop working some time between 13:15 and 19:15 GMT on July 27 2012.
Un-encoded colons go through fine.
Accept ':' as well as '/' as punctuation between username and password
in environment variable SPACETRACK_USER.
lib/Astro/SpaceTrack.pm view on Meta::CPAN
The argument is a satellite name or a portion thereof.
=item SPECIAL
The argument specifies a special data set.
=back
The default is C<'CATNR'> if the argument is numeric, C<'INTDES'> if the
argument looks like an international designator, or C<'GROUP'>
otherwise.
=back
A list of valid C<GROUP> names and brief descriptions can be obtained by
calling C<< $st->names ('celestrak') >>. If you have set the C<verbose>
attribute true (e.g. C<< $st->set (verbose => 1) >>), the content of the
error response will include this list. Note, however, that this list
does not determine what can be retrieved; if Dr. Kelso adds a data set,
it can be retrieved even if it is not on the list, and if he removes
lib/Astro/SpaceTrack.pm view on Meta::CPAN
The argument specifies a data source as specified at
L<https://celestrak.org/NORAD/documentation/sup-gp-queries.php>.
=item SPECIAL
The argument specifies a special data set.
=back
The default is C<'CATNR'> if the argument is numeric, C<'INTDES'> if the
argument looks like an international designator, or C<'FILE'> otherwise.
=item rms
This Boolean option specifies that RMS data be returned rather than TLE
data, if available. This option is valid only on known catalogs that
actually have RMS data. If this option is asserted, C<--format> and
C<--query> are invalid.
=back
lib/Astro/SpaceTrack.pm view on Meta::CPAN
last;
} else { # TODO this is just for debugging.
0;
}
}
return $resp;
}
# FIXME in the last couple days this has started returning nothing.
# It looks like -exclude debris excludes everything, as does
# -exclude rocket.
# Get Iridium status from Space Track. Unlike the other sources,
# Space Track does not know whether satellites are in service or
# not, but it does know about all of them, and whether or not they
# are on orbit. So the statuses we report are unknown and decayed.
# Note that the portable status for unknown is
# BODY_STATUS_IS_TUMBLING. Called dynamically
sub _iridium_status_spacetrack { ## no critic (ProhibitUnusedPrivateSubroutines)
my ( $self, undef, $rslt ) = @_; # $fmt arg not used
lib/Astro/SpaceTrack.pm view on Meta::CPAN
if ( defined $context->{data} ) {
$context->{data} =~ s{ \s* </xml> \s* \z }{}smx;
$content =~ s{ .* <xml> \s* }{}smx;
$context->{data} .= $content;
} else {
$context->{data} = $content;
}
return;
}
# _check_cookie_generic looks for our session cookie. If it is found, it
# returns true if it thinks the cookie is valid, and false otherwise. If
# it is not found, it returns false.
sub _record_cookie_generic {
my ( $self, $version ) = @_;
defined $version
or $version = $self->{space_track_version};
my $interface_info = $self->{_space_track_interface}[$version];
my $cookie_name = $interface_info->{cookie_name};
my $domain = $interface_info->{domain_space_track};
lib/Astro/SpaceTrack.pm view on Meta::CPAN
return;
}
}
# _dump_cookie is intended to be called from inside the
# HTTP::Cookie->scan method. The first argument is prefix text
# for the dump, and the subsequent arguments are the arguments
# passed to the scan method.
# It dumps the contents of the cookie to STDERR via a warn ().
# A typical session cookie looks like this:
# version => 0
# key => 'spacetrack_session'
# val => whatever
# path => '/'
# domain => 'www.space-track.org'
# port => undef
# path_spec => 1
# secure => undef
# expires => undef
# discard => 1
lib/Astro/SpaceTrack.pm view on Meta::CPAN
or return 'catnum';
$sort = lc $sort;
$valid{$sort}
or Carp::croak "Illegal sort '$sort'";
return $sort;
}
}
# $opt = _parse_retrieve_dates ($opt);
# This subroutine looks for keys start_epoch and end_epoch in the
# given option hash, parses them as YYYY-MM-DD (where the letters
# are digits and the dashes are any non-digit punctuation), and
# replaces those keys' values with a reference to a list
# containing the output of timegm() for the given time. If only
# one epoch is provided, the other is defaulted to provide a
# one-day date range. If the syntax is invalid, we croak.
#
# The return is the same hash reference that was passed in.
sub _parse_retrieve_dates {
xt/author/celestrak_datasets.t view on Meta::CPAN
# Celestrak supplemental dataset ends in an un-terminated comment
# which HTML::TreeBuilder 5.07 handles incorrectly (IM(NS)HO). So:
{ # Single-iteration loop
$string =~ m/ <!-- /smxgc
or last;
$string =~ m/ --> /smxgc
and redo;
$string .= ' -->';
}
# I wish I could capture the HTML::Parser events corresponding to
# the above, but it looks like there are none, so I have to hack it
# with regexen. GAH!
=end comment
=cut
my $tree = HTML::TreeBuilder->new_from_content( $string );
my %data;
foreach my $anchor ( $tree->look_down( _tag => 'a' ) ) {
my $href = $anchor->attr( 'href' )
( run in 0.382 second using v1.01-cache-2.11-cpan-64827b87656 )