@@ -363,10 +363,8 @@ def query_region_async(self, coordinates, *, radius=None,
363
363
else :
364
364
sql_query = sql_query .replace (' ON p.objID = x.objID ORDER BY x.up_id' , '' )
365
365
366
- if (not isinstance (coordinates , list ) and
367
- not isinstance (coordinates , Column ) and
368
- not (isinstance (coordinates , commons .CoordClasses ) and
369
- not coordinates .isscalar )):
366
+ if (not isinstance (coordinates , (list , Column , commons .CoordClasses ))
367
+ and not coordinates .isscalar ):
370
368
coordinates = [coordinates ]
371
369
rectangles = list ()
372
370
for n , target in enumerate (coordinates ):
@@ -375,9 +373,13 @@ def query_region_async(self, coordinates, *, radius=None,
375
373
376
374
ra = target .ra .degree
377
375
dec = target .dec .degree
378
- dra = coord .Angle (width ).to ('degree' ).value / 2.0
379
- ddec = coord .Angle (height ).to ('degree' ).value / 2.0
380
- rectangles .append ('((p.ra BETWEEN {0:g} AND {1:g}) AND (p.dec BETWEEN {2:g} AND {3:g}))' .format (ra - dra , ra + dra , dec - ddec , dec + ddec ))
376
+ dra = Angle (width ).to ('degree' ).value / 2.0
377
+ ddec = Angle (height ).to ('degree' ).value / 2.0
378
+ rectangles .append ('((p.ra BETWEEN {0:g} AND {1:g}) '
379
+ 'AND (p.dec BETWEEN {2:g} AND {3:g}))' .format (ra - dra ,
380
+ ra + dra ,
381
+ dec - ddec ,
382
+ dec + ddec ))
381
383
rect = ' OR ' .join (rectangles )
382
384
if 'WHERE' in sql_query :
383
385
sql_query += f' AND ({ rect } )'
0 commit comments