Astro-Catalog

 view release on metacpan or  search on metacpan

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

                    # Distance
                    my $distance = $separated[16];
                    $star->distance($distance);

                    # Position Angle
                    my $pos_angle = $separated[17];
                    $star->posangle($pos_angle);
                }

                # Push the star into the catalog
                $catalog->pushstar($star);

                # increment counter
                $counter = $counter + 1;
            }

            # reset $line to correct place
            $line = $counter;
        }

    }
    # Set the field centre
    $catalog->fieldcentre(%field);

    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.

=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/
                chart epoch catalogue
                /)
           );
}


sub _from_multi {
    my $self = shift;
    my $key = "multi";
    my $value = $self->query_options($key);

    # convert boolean to "yes" or "no"
    if (! $value || $value =~ /^no%/i) {
        # boolean false is always false
        # as is "no"
        $value = 'no';
    }
    else {
        # must be true
        $value = 'yes';
    }

    my %allow = $self->_get_allowed_options();
    return ($allow{$key}, $value);
}

1;

__END__

=end __PRIVATE_METHODS__

=head1 COPYRIGHT

Copyright (C) 2001 University of Exeter. All Rights Reserved.
Some modifications copyright (C) 2003 Particle Physics and Astronomy
Research Council. All Rights Reserved.

This program was written as part of the eSTAR project and is free software;
you can redistribute it and/or modify it under the terms of the GNU Public
License.

=head1 AUTHORS

Alasdair Allan E<lt>aa@astro.ex.ac.ukE<gt>,
Tim Jenness E<lt>tjenness@cpan.orgE<gt>

=cut



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