Fix Version/s: None
Team:Data Access and Database
For deepcoadd images of 'r' filter, some image queries for cutouts centered on ra, dec are returning None, due to the patch being returned via metaserv SQL is wrong, in the sense that the patch does NOT actually contain the ra, dec specified.
Known ra,dec that show the issue (reported by Tatiana @ SUIT team): 9.6, -1.1
On PDAC database:
SELECT ra,decl,run,camcol,field,filterName,(power((ra - 9.6),2) + power((decl - -1.1),2)) as distance FROM Science_Ccd_Exposure WHERE filtername = 'r' AND scisql_s2PtInBox(9.6, -1.1, corner1Ra, corner1Decl, corner3Ra, corner3Decl) = 1 order by distance LIMIT 1
Serge recommends "(If one has 4 CCD corner vertices, one should call scisql_s2PtInCPoly, which can accept vertices in clockwise or counter-clockwise order)"