Boxes and Polygons in ADQL/STC. Questions and recommendation.

Tamas Budavari budavari at pha.jhu.edu
Sat Oct 24 02:05:05 PDT 2009


I believe that both BOX definitions would have advantages and clearly 
very different uses:

  - Using "RA-Dec" BOXes one could tile the entire sky without any overlap 
and, as Tom points out, they are extremely simple to implement.

  - A "great circle" BOX could represent a simple region that can describe 
the coverage of a rectangular detector with WCS TAN projection.

Considering that STC/s is part of the ADQL geometry specs, whose polygons 
are apparently restricted to great circles, one could argue that BOX 
should be interpreted in the "RA-Dec" sense for simplicity, and use the 
STC/s polygon for the other case.

Alternatively, one could define the BOX to be a shortcut to the STC/s 
polygon, and implement RA-Dec constraints by explicitely spelling them out 
in the query.

I don't feel strongly either way but perhaps the latter is a bit more 
appealing to me, because this way a simple and common geometry constraint 
(TAN coverage of, say, a CCD) could be described in ADQL without 
supporting the more advanced STC/s constructs that might be a little more 
challenging for some implementations in terms of parsing and query 
optimization.

Cheers, T.

P.S. Of course, one could also just have both boxes in ADQL with separate 
keywords.


On Fri, 23 Oct 2009, Tom McGlynn wrote:

> Alberto Micol wrote:
>> On 23 Oct 2009, at 21:19, Arnold Rots wrote:
>>
>> 
>>> 4.5.1.5 Box
>>> A Box is a special case of a Polygon, defined purely for  convenience. It 
>>> is
>>> specified by a center position and size (in both coordinates)  defining a 
>>> cross
>>> centered on the center position and with arms extending, parallel to  the
>>> coordinate axes at the center position, for half the respective  sizes on 
>>> either side.
>>> The box?s sides are line segments or great circles intersecting the  arms 
>>> of the
>>> cross in its end points at right angles with the arms.
>>> 
>> 
>> My trouble is with the sentence that  the arms extend "parallel to the 
>> coordinate axes".
>> "Parallel" to the equator cannot be a great circle unless it is the 
>> equator itself. Hence:
>> Does that mean that the I should measure the size of the "horizontal"  arm 
>> along
>> the small circle parallel to the equator?
>> If this is correct, then a size of 180 deg is an hemisphere if and  only if 
>> the centre is placed
>> on the equator.
>> 
>> I appreciate some help, thanks!
>>
>> 
> Hi Alberto,
>
> I understood this to mean that the horizontal arm goes along great circle 
> which has an apex (highest latitude, or lowest
> if the point is in the southern hemisphere) at the point.  So the great 
> circle is 'parallel' to the equator but only
> instantaneously at that point  However I wouldn't mind one of the experts 
> chiming in here.
>
>> Then, regarding the usefulness of a BOX made of great circle arcs:
>> that is useful because to find if a point is inside or outside such BOX
>> it is just matter to compute the scalar product of the vector  representing 
>> the point
>> and the 4 vectors representing the half-spaces of the 4 box sides.
>> 
>> Of course this means that it will no longer be possible to use (ra,  dec) 
>> as we are used to,
>> as in:  ra BETWEEN this AND that AND dec BETWEEN d0 AND d1
>> and instead we have to go to a vectorial representation of the sky 
>> coordinates.
>>
>> 
>
> My problem is that as far as I can see, the problem that the astronomers want 
> to answer will be phrased
> in terms of limits on RA and Dec so that even though it might be 
> mathematically handy it's not necessarily relevant
> to the problems we want to solve.   In any case there's nothing special about 
> the box here.  It's true for any
> (convex?) polygon isn't it?
>
> Tom
>
> P.S.  I think I've gotten the equations for the vertices of a box (assuming 
> my interpretation above is correct).  The derivation
> was pretty easy once I abandoned trying to do things using pure geometry and 
> attacked it using the centers of the great circles and
> analytic geometry.  I'll try to post it somewhere tomorrow.
>
>
>>



More information about the dal mailing list