Query in a BOX is not possible?

Hello,
Unlike DP0 tutorials in which catalog query are done in a circle around a selected (ra,dec) I am trying to select regions in a square.

From the portal : https://data.lsst.cloud/portal/app/?__action=layout.showDropDown&view=TAPSearch

I see I could replace CIRCLE by BOX.

When I try my command shown below in the portal , then I obtain the error message : Function [BOX] is not found in TapSchema

Is it true that only CIRCLE search is implemented ?

Here is my command:

SELECT obj.ra, obj.dec, obj.objectId, obj.extendedness, truth.truth_type, truth.redshift, truth.match_objectId FROM dp01_dc2_catalogs.object as obj JOIN dp01_dc2_catalogs.truth_match as truth ON truth.match_objectId = obj.objectId WHERE CONTAINS(POINT(‘ICRS’, obj.ra, obj.dec),BOX(‘ICRS’, 62.0 , -40.0 , 10.0 , 10.0)) = 1 AND obj.good = 1 AND truth.match_objectid >= 0 AND truth.is_good_match = 1 AND truth.truth_type = 1 AND truth.redshift > 1.0 AND truth.redshift < 1.4

Thanks for your answer.

Sylvie

Hi Sylvie,

At the moment I can’t answer this question, only confirm that when I attempted a simple BOX search I received the same error message.

Search:


Error:


A quick solution might be to use POLYGON to define the BOX, as that does appear to work.

Initial polygon definition:

Convert to ADQL:

The above polygon search was successful at returning sources.


We will still follow up on the BOX functionality, though.

The BOX geometrical function is incompletely defined in the current ADQL standards documentation (for example, behavior when centered at a pole is ambiguous, language re. “line segments or great circles” is unclear, etc.) I have also heard that some in the IVOA community favor removing BOX from ADQL entirely.

Qserv (the back end catalog database supporting ADQL in DP0) has held off on implementing geometric support for BOX, waiting for the standard to stabilize. In the meantime, a POLYGON using the four intended corners, as recommended above, is indeed unambiguous at all points of the sphere, and probably the best supported option.

3 Likes

Thanks Melissa, POLYGON is a good idea.

Sylvie

Hi Fritz

Thanks for your relevant answer.

Sylvie