Hi all,
I’m trying to retrieve coordinates for all objects from the dp1.Object
table within the footprint of a visit . Here’s a minimal example:
from lsst.rsp import get_tap_service
from lsst.daf.butler import Butler
def ivoa2adql(ivoa_string: str, frame: str = "ICRS") -> str:
figure, *coords = ivoa_string.strip().split()
coord_string = ", ".join(f"{c:.7f}" for c in map(float, coords))
return f"{figure}('{frame}', {coord_string})"
butler = Butler("dp1", collections="LSSTComCam/DP1")
dataset_refs = butler.query_datasets(
"visit_image",
where=f"visit.id = 2024120200214 and detector = 4",
)
visit = butler.get(*dataset_refs)
service = get_tap_service("tap")
sources = service.search(
f"""SELECT coord_ra, coord_dec,
FROM dp1.Object
WHERE CONTAINS(POINT('ICRS', coord_ra, coord_dec),
{ivoa2adql(visit.getConvexPolygon().to_ivoa_pos())}) = 1"""
).to_table()
Here is a plot of the returned objects overlaid on the visit image:
As you can see, there are noticeable gaps where objects are missing even though the image contains obvious stars in those regions.
Is this expected behavior? Could this be due to selection cuts in the Object
table, incomplete processing (possibly due to background), or some issue with the polygon query itself?
Appreciate any insights or suggestions!
As always, thank you!