Astro-Catalog

 view release on metacpan or  search on metacpan

lib/Astro/Catalog/Query/MPC.pm  view on Meta::CPAN

                    $ra =~ s/ /:/g;
                    $dec =~ s/^\s+//;
                    $dec =~ s/ /:/g;

                    my $coords = new Astro::Coords(
                            name => $name,
                            ra => $ra,
                            dec => $dec,
                            type => 'J2000',
                            epoch => $epoch,
                        );

                    $star->coords($coords);

                    # Push the star onto the catalog.
                    $catalog->pushstar( $star );
                }
                $counter++;
            }
            $line = $counter
        }
    }

    return $catalog;
}

=back

=head2 Translation Methods

The query options stored internally in the object are not necessarily
the form required for a query to a remote server. Methods for converting
from the internal representation to the external query format are
provided in the form of _from_$opt. ie:

    ($outkey, $outvalue) = $q->_from_ra();
    ($outkey, $outvalue) = $q->_from_object();

The base class only includes one to one mappings.

=over 4

=item B<_translate_one_to_one>

Return a list of internal options (as defined in C<_get_allowed_options>)
that are known to support a one-to-one mapping of the internal value
to the external value.

    %one = $q->_translate_one_to_one();

Returns a hash with keys and no values (this makes it easy to
check for the option).

This method also returns the values from the parent class.

=cut

sub _translate_one_to_one {
    my $self = shift;
    # convert to a hash-list
    return ($self->SUPER::_translate_one_to_one,
            map {$_, undef} (qw/
                year month day obscode
                ra dec radius limit
                which mot tmot mpcsort
                needed ps type textarea
                /)
           );
}

1;

__END__

=back

=end __PRIVATE_METHODS__

=head1 COPYRIGHT

Copyright (C) 2004 Particle Physics and Astronomy Research
Council. All Rights Reserved.

This program is free software; you can redistribute it and/or
modify it under the terms of the GNU Public License.

=head1 AUTHORS

Brad Cavanagh E<lt>b.cavanagh@jach.hawaii.eduE<gt>

=cut



( run in 0.677 second using v1.01-cache-2.11-cpan-8f98c5d2c55 )