0 votes
318 views

When using the web query interface (datalab.noao.edu/query.php), I get PSQL errors when I try to use some ADQL functions like POINT and CIRCLE.

For example, the following query runs fine:

SELECT ra, dec FROM ls_dr7.tractor_primary WHERE
(ra > -.05) AND (ra < .05) AND (dec > -.05) AND (dec < .05)

But this similar query fails:

SELECT ra, dec FROM ls_dr7.tractor_primary WHERE
CONTAINS(
POINT('ICRS', ra, dec),
CIRCLE('ICRS', 0.0, 0.0, 1.0))=1

with error:

Error: PSQLException: ERROR: function point(unknown, double precision, double precision) does not exist Hint: No function matches the given name and argument types. You might need to add explicit type casts. Position: 59

Why is this, and how do I get these ADQL functions to work in the web Query Interface?

by | 318 views

1 Answer

0 votes
Best answer
Hi Eric,

So our ADQL implementation doesn't currently support the functions CONTAINS, POINT, and CIRCLE.  Implementing these are in our development plans.  But for a cone search, you can instead use the q3c function q3c_radial_query:

SELECT ra, dec FROM ls_dr7.tractor_primary WHERE
't' = Q3C_RADIAL_QUERY(ra, dec,0.0,0.0,0.1)

where ra and dec are the RA and DEC columns of ls_dr7.tractor_primary, the following two numbers are the ra and dec of a point in degrees, and 0.1 is the cone search radius in degrees.
by kolsen (2.7k points)

414 questions

430 answers

436 comments

635 users

Welcome to Data Lab Help Desk, where you can ask questions and receive answers from other members of the community.

Categories