| line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
|
1
|
|
|
|
|
|
|
package Astro::Catalog::Query::CMC; |
|
2
|
|
|
|
|
|
|
|
|
3
|
|
|
|
|
|
|
=head1 NAME |
|
4
|
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
Astro::Catalog::Query::CMC - A query request to the Carlsberg Meridian Catalog |
|
6
|
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
=head1 SYNOPSIS |
|
8
|
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
$gsc = new Astro::Catalog::Query::CMC( RA => $ra, |
|
10
|
|
|
|
|
|
|
Dec => $dec, |
|
11
|
|
|
|
|
|
|
Radius => $radius, |
|
12
|
|
|
|
|
|
|
Nout => $number_out ); |
|
13
|
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
my $catalog = $gsc->querydb(); |
|
15
|
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
=head1 WARNING |
|
17
|
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
This code should be superceeded by the generic Vizier query class. |
|
19
|
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
=head1 DESCRIPTION |
|
21
|
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
The module is an object orientated interface to the online |
|
23
|
|
|
|
|
|
|
Carlsberg Meridian Catalogues (CMC11) |
|
24
|
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
Stores information about an prospective query and allows the query to |
|
26
|
|
|
|
|
|
|
be made, returning an Astro::Catalog::Query::CMC object. |
|
27
|
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
The object will by default pick up the proxy information from the HTTP_PROXY |
|
29
|
|
|
|
|
|
|
and NO_PROXY environment variables, see the LWP::UserAgent documentation for |
|
30
|
|
|
|
|
|
|
details. |
|
31
|
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
See L for the catalog-independent methods. |
|
33
|
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
=cut |
|
35
|
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
# L O A D M O D U L E S -------------------------------------------------- |
|
37
|
|
|
|
|
|
|
|
|
38
|
2
|
|
|
2
|
|
9321648
|
use 5.006; |
|
|
2
|
|
|
|
|
16
|
|
|
|
2
|
|
|
|
|
107
|
|
|
39
|
2
|
|
|
2
|
|
13
|
use strict; |
|
|
2
|
|
|
|
|
10
|
|
|
|
2
|
|
|
|
|
123
|
|
|
40
|
2
|
|
|
2
|
|
67
|
use warnings; |
|
|
2
|
|
|
|
|
14
|
|
|
|
2
|
|
|
|
|
152
|
|
|
41
|
2
|
|
|
2
|
|
13
|
use base qw/ Astro::Catalog::Transport::REST /; |
|
|
2
|
|
|
|
|
4
|
|
|
|
2
|
|
|
|
|
1713
|
|
|
42
|
|
|
|
|
|
|
use vars qw/ $VERSION /; |
|
43
|
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
use File::Spec; |
|
45
|
|
|
|
|
|
|
use Carp; |
|
46
|
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
# generic catalog objects |
|
48
|
|
|
|
|
|
|
use Astro::Catalog; |
|
49
|
|
|
|
|
|
|
use Astro::Catalog::Star; |
|
50
|
|
|
|
|
|
|
|
|
51
|
|
|
|
|
|
|
$VERSION = "4.31"; |
|
52
|
|
|
|
|
|
|
|
|
53
|
|
|
|
|
|
|
=head1 REVISION |
|
54
|
|
|
|
|
|
|
|
|
55
|
|
|
|
|
|
|
$Id: CMC.pm,v 1.3 2003/09/25 15:56:59 aa Exp $ |
|
56
|
|
|
|
|
|
|
|
|
57
|
|
|
|
|
|
|
=begin __PRIVATE_METHODS__ |
|
58
|
|
|
|
|
|
|
|
|
59
|
|
|
|
|
|
|
=head2 Private methods |
|
60
|
|
|
|
|
|
|
|
|
61
|
|
|
|
|
|
|
These methods are for internal use only. |
|
62
|
|
|
|
|
|
|
|
|
63
|
|
|
|
|
|
|
=over 4 |
|
64
|
|
|
|
|
|
|
|
|
65
|
|
|
|
|
|
|
=item B<_default_remote_host> |
|
66
|
|
|
|
|
|
|
|
|
67
|
|
|
|
|
|
|
=cut |
|
68
|
|
|
|
|
|
|
|
|
69
|
|
|
|
|
|
|
sub _default_remote_host { |
|
70
|
|
|
|
|
|
|
return "vizier.u-strasbg.fr"; |
|
71
|
|
|
|
|
|
|
} |
|
72
|
|
|
|
|
|
|
|
|
73
|
|
|
|
|
|
|
=item B<_default_url_path> |
|
74
|
|
|
|
|
|
|
|
|
75
|
|
|
|
|
|
|
=cut |
|
76
|
|
|
|
|
|
|
|
|
77
|
|
|
|
|
|
|
sub _default_url_path { |
|
78
|
|
|
|
|
|
|
return "viz-bin/asu-acl?"; |
|
79
|
|
|
|
|
|
|
} |
|
80
|
|
|
|
|
|
|
|
|
81
|
|
|
|
|
|
|
=item B<_get_allowed_options> |
|
82
|
|
|
|
|
|
|
|
|
83
|
|
|
|
|
|
|
Returns a hash with keys, being the internal options supported |
|
84
|
|
|
|
|
|
|
by this subclass, and values being the key name actually required |
|
85
|
|
|
|
|
|
|
by the remote system (and to be included in the query). |
|
86
|
|
|
|
|
|
|
|
|
87
|
|
|
|
|
|
|
=cut |
|
88
|
|
|
|
|
|
|
|
|
89
|
|
|
|
|
|
|
sub _get_allowed_options { |
|
90
|
|
|
|
|
|
|
my $self = shift; |
|
91
|
|
|
|
|
|
|
return ( |
|
92
|
|
|
|
|
|
|
ra => '-c.ra', |
|
93
|
|
|
|
|
|
|
dec => '-c.dec', |
|
94
|
|
|
|
|
|
|
radmax => '-c.rm', |
|
95
|
|
|
|
|
|
|
nout => '-out.max', |
|
96
|
|
|
|
|
|
|
catalog => '-source', |
|
97
|
|
|
|
|
|
|
); |
|
98
|
|
|
|
|
|
|
} |
|
99
|
|
|
|
|
|
|
|
|
100
|
|
|
|
|
|
|
|
|
101
|
|
|
|
|
|
|
=item B<_get_default_options> |
|
102
|
|
|
|
|
|
|
|
|
103
|
|
|
|
|
|
|
Get the default query state. |
|
104
|
|
|
|
|
|
|
|
|
105
|
|
|
|
|
|
|
=cut |
|
106
|
|
|
|
|
|
|
|
|
107
|
|
|
|
|
|
|
sub _get_default_options { |
|
108
|
|
|
|
|
|
|
return ( |
|
109
|
|
|
|
|
|
|
# Internal |
|
110
|
|
|
|
|
|
|
catalog => 'I/282/cmc12', |
|
111
|
|
|
|
|
|
|
|
|
112
|
|
|
|
|
|
|
# Target information |
|
113
|
|
|
|
|
|
|
ra => undef, |
|
114
|
|
|
|
|
|
|
dec => undef, |
|
115
|
|
|
|
|
|
|
|
|
116
|
|
|
|
|
|
|
# Limits |
|
117
|
|
|
|
|
|
|
radmax => 5, |
|
118
|
|
|
|
|
|
|
nout => 20000, |
|
119
|
|
|
|
|
|
|
); |
|
120
|
|
|
|
|
|
|
} |
|
121
|
|
|
|
|
|
|
|
|
122
|
|
|
|
|
|
|
=item B<_parse_query> |
|
123
|
|
|
|
|
|
|
|
|
124
|
|
|
|
|
|
|
Private function used to parse the results returned in an GSC query. |
|
125
|
|
|
|
|
|
|
Should not be called directly. Instead use the querydb() assessor method to |
|
126
|
|
|
|
|
|
|
make and parse the results. |
|
127
|
|
|
|
|
|
|
|
|
128
|
|
|
|
|
|
|
=cut |
|
129
|
|
|
|
|
|
|
|
|
130
|
|
|
|
|
|
|
sub _parse_query { |
|
131
|
|
|
|
|
|
|
my $self = shift; |
|
132
|
|
|
|
|
|
|
|
|
133
|
|
|
|
|
|
|
print $self->{BUFFER}; |
|
134
|
|
|
|
|
|
|
return new Astro::Catalog( Format => 'TST', Data => $self->{BUFFER}, |
|
135
|
|
|
|
|
|
|
Origin => 'Carlsberg Meridian Catalogue (CMC/11)', |
|
136
|
|
|
|
|
|
|
ReadOpt => { ra_col => 2, dec_col => 4, } |
|
137
|
|
|
|
|
|
|
); |
|
138
|
|
|
|
|
|
|
} |
|
139
|
|
|
|
|
|
|
|
|
140
|
|
|
|
|
|
|
|
|
141
|
|
|
|
|
|
|
=back |
|
142
|
|
|
|
|
|
|
|
|
143
|
|
|
|
|
|
|
=head2 Translation Methods |
|
144
|
|
|
|
|
|
|
|
|
145
|
|
|
|
|
|
|
The query options stored internally in the object are not necessarily |
|
146
|
|
|
|
|
|
|
the form required for a query to a remote server. Methods for converting |
|
147
|
|
|
|
|
|
|
from the internal representation to the external query format are |
|
148
|
|
|
|
|
|
|
provided in the form of _from_$opt. ie: |
|
149
|
|
|
|
|
|
|
|
|
150
|
|
|
|
|
|
|
($outkey, $outvalue) = $q->_from_ra(); |
|
151
|
|
|
|
|
|
|
($outkey, $outvalue) = $q->_from_object(); |
|
152
|
|
|
|
|
|
|
|
|
153
|
|
|
|
|
|
|
The base class only includes one to one mappings. |
|
154
|
|
|
|
|
|
|
|
|
155
|
|
|
|
|
|
|
=over 4 |
|
156
|
|
|
|
|
|
|
|
|
157
|
|
|
|
|
|
|
=item B<_translate_one_to_one> |
|
158
|
|
|
|
|
|
|
|
|
159
|
|
|
|
|
|
|
Return a list of internal options (as defined in C<_get_allowed_options>) |
|
160
|
|
|
|
|
|
|
that are known to support a one-to-one mapping of the internal value |
|
161
|
|
|
|
|
|
|
to the external value. |
|
162
|
|
|
|
|
|
|
|
|
163
|
|
|
|
|
|
|
%one = $q->_translate_one_to_one(); |
|
164
|
|
|
|
|
|
|
|
|
165
|
|
|
|
|
|
|
Returns a hash with keys and no values (this makes it easy to |
|
166
|
|
|
|
|
|
|
check for the option). |
|
167
|
|
|
|
|
|
|
|
|
168
|
|
|
|
|
|
|
This method also returns, the values from the parent class. |
|
169
|
|
|
|
|
|
|
|
|
170
|
|
|
|
|
|
|
=cut |
|
171
|
|
|
|
|
|
|
|
|
172
|
|
|
|
|
|
|
sub _translate_one_to_one { |
|
173
|
|
|
|
|
|
|
my $self = shift; |
|
174
|
|
|
|
|
|
|
# convert to a hash-list |
|
175
|
|
|
|
|
|
|
return ($self->SUPER::_translate_one_to_one, |
|
176
|
|
|
|
|
|
|
map { $_, undef }(qw/ |
|
177
|
|
|
|
|
|
|
catalog |
|
178
|
|
|
|
|
|
|
/) |
|
179
|
|
|
|
|
|
|
); |
|
180
|
|
|
|
|
|
|
} |
|
181
|
|
|
|
|
|
|
|
|
182
|
|
|
|
|
|
|
=back |
|
183
|
|
|
|
|
|
|
|
|
184
|
|
|
|
|
|
|
=end __PRIVATE_METHODS__ |
|
185
|
|
|
|
|
|
|
|
|
186
|
|
|
|
|
|
|
=head1 COPYRIGHT |
|
187
|
|
|
|
|
|
|
|
|
188
|
|
|
|
|
|
|
Copyright (C) 2001 University of Exeter. All Rights Reserved. |
|
189
|
|
|
|
|
|
|
Some modifications copyright (C) 2003 Particle Physics and Astronomy |
|
190
|
|
|
|
|
|
|
Research Council. All Rights Reserved. |
|
191
|
|
|
|
|
|
|
|
|
192
|
|
|
|
|
|
|
This program was written as part of the eSTAR project and is free software; |
|
193
|
|
|
|
|
|
|
you can redistribute it and/or modify it under the terms of the GNU Public |
|
194
|
|
|
|
|
|
|
License. |
|
195
|
|
|
|
|
|
|
|
|
196
|
|
|
|
|
|
|
=head1 AUTHORS |
|
197
|
|
|
|
|
|
|
|
|
198
|
|
|
|
|
|
|
Alasdair Allan Eaa@astro.ex.ac.ukE, |
|
199
|
|
|
|
|
|
|
Tim Jenness Etjenness@cpan.orgE |
|
200
|
|
|
|
|
|
|
|
|
201
|
|
|
|
|
|
|
=cut |
|
202
|
|
|
|
|
|
|
|
|
203
|
|
|
|
|
|
|
# L A S T O R D E R S ------------------------------------------------------ |
|
204
|
|
|
|
|
|
|
|
|
205
|
|
|
|
|
|
|
1; |