Open bsipocz opened 1 year ago
On Wed, Jan 25, 2023 at 01:36:59PM -0800, Brigitta Sipőcz wrote:
it. IMO the whole position validation should be rewritten and make more reliant on astropy.coordinates as most of the logic is already been done there.
That sounds like an excellent plan to me.
Anyway, here is a list of POS inputs for single regions that I think we can easily support with what we have if we table the idea of queries for multiple objects. We already test for most of these, and the others are an easy fix (partial copy from test_sia2.py):
circle_pos (coordinate pair + radius) = [(2, 4, 0.0166),
(2, 4, 0.0028972 * u.rad),
(SkyCoord(2, 4, unit='deg'), 0.166 * u.deg)]
range_pos (two coordinate pairs) = [(12, 12.5, 34, 36),
(0.209 * u.rad, 0.218 * u.rad, 0.593 * u.rad, 0.628 * u.rad),
(SkyCoord(12, 34, unit='deg'), SkyCoord(12.5, 36, unit='deg'))]
polygon_pos (any 3+ coordinate pairs) = [(12.0 * u.deg, 34.0 * u.deg,
14.0 * u.deg, 35.0 * u.deg,
14.0 * u.deg, 36.0 * u.deg,
12.0 * u.deg, 35.0 * u.deg),
(SkyCoord(12.0 * u.deg, 34.0 * u.deg),
SkyCoord(14.0 * u.deg, 35.0 * u.deg),
SkyCoord(14.0 * u.deg, 36.0 * u.deg),
SkyCoord(12.0 * u.deg, 35.0 * u.deg))]
Now, the question of the vector SkyCoords are interesting, how should we distinguish between a single-position polygon search and multiple circle searches?
cc @keflavich
OK, so vector SkyCoord, maybe we only support the CIRCLE case?
On Mon, Sep 16, 2024 at 05:37:53PM -0700, Brigitta Sipőcz wrote:
Originally I was thinking here to support a vector skycoord to specify multiple position queries all at once, but I don't think that would work with the servers, so we may just leave the looping to the user?
Correctly implemented services should evaluate as many appearences of POS as there are. I frankly fought against these multi-valued parameters, but not that they're there we should use them. If this then breaks left and right, we (and the service operators) will have learned something, too :-)
So... I'm all for turning multiple geometries into a sequence of POS parameters.
-- Markus
but not that they're there we should use them. If this then breaks left and right
So far the only limitation I run into was blindly following and incrementally extending the current pyvo logic at parsing, and nothing on the actual query side. I even deleted those side-tracking comments I made where I wondered about what services will support, without remembering that you'll still see them in your emails :)
I was running into the issue of SIAv2 is not working with scalar coordinates (https://github.com/astropy/pyvo/issues/305), so I made them a vector SkyCoord, which is working even less, e.g.
_validate_pos()
indal.params
wrongly assumes ra and dec from it. IMO the whole position validation should be rewritten and make more reliant on astropy.coordinates as most of the logic is already been done there.