@@ -325,8 +325,9 @@ def query_object_async(self, object_name, catalog=None, radius=None,
325
325
326
326
def query_region_async (self , coordinates , radius = None , inner_radius = None ,
327
327
width = None , height = None , catalog = None ,
328
- get_query_payload = False , frame = 'fk5' , cache = True ,
329
- return_type = 'votable' , column_filters = {}):
328
+ get_query_payload = False , cache = True ,
329
+ return_type = 'votable' , column_filters = {},
330
+ frame = 'fk5' ):
330
331
"""
331
332
Serves the same purpose as `query_region` but only
332
333
returns the HTTP response rather than the parsed result.
@@ -354,19 +355,22 @@ def query_region_async(self, coordinates, radius=None, inner_radius=None,
354
355
catalog : str or list, optional
355
356
The catalog(s) which must be searched for this identifier.
356
357
If not specified, all matching catalogs will be searched.
357
- frame : str, optional
358
- The frame to use for the request: can be 'galactic' or 'fk5'.
359
- It influences the orientation of box requests.
360
358
column_filters: dict, optional
361
359
Constraints on columns of the result. The dictionary contains
362
360
the column name as keys, and the constraints as values.
361
+ frame : str, optional
362
+ The frame to use for the request. It should be 'fk5', 'icrs',
363
+ or 'galactic'. This choice influences the the orientation of
364
+ box requests.
363
365
364
366
Returns
365
367
-------
366
368
response : `requests.Response`
367
369
The response of the HTTP request.
368
370
369
371
"""
372
+ if frame not in ('galactic' , 'fk5' , 'icrs' ):
373
+ raise ValueError ("Only the 'galactic', 'icrs', and 'fk5' frames are supported by VizieR" )
370
374
catalog = VizierClass ._schema_catalog .validate (catalog )
371
375
center = {}
372
376
columns = []
@@ -379,14 +383,12 @@ def query_region_async(self, coordinates, radius=None, inner_radius=None,
379
383
center ["-c" ] = []
380
384
for pos in c :
381
385
if frame == 'galactic' :
382
- glon_deg = pos .l .to_string (unit = "deg" , decimal = True ,
383
- precision = 8 )
384
- glat_deg = pos .b .to_string (unit = "deg" , decimal = True ,
385
- precision = 8 , alwayssign = True )
386
- center ["-c" ] += ["B{}{}" .format (glon_deg , glat_deg )]
386
+ glon_deg = pos .l .to_string (unit = "deg" , decimal = True , precision = 8 )
387
+ glat_deg = pos .b .to_string (unit = "deg" , decimal = True , precision = 8 ,
388
+ alwayssign = True )
389
+ center ["-c" ] += ["G{}{}" .format (glon_deg , glat_deg )]
387
390
else :
388
- ra_deg = pos .ra .to_string (unit = "deg" , decimal = True ,
389
- precision = 8 )
391
+ ra_deg = pos .ra .to_string (unit = "deg" , decimal = True , precision = 8 )
390
392
dec_deg = pos .dec .to_string (unit = "deg" , decimal = True ,
391
393
precision = 8 , alwayssign = True )
392
394
center ["-c" ] += ["{}{}" .format (ra_deg , dec_deg )]
@@ -395,12 +397,12 @@ def query_region_async(self, coordinates, radius=None, inner_radius=None,
395
397
if frame == 'galactic' :
396
398
glon = c .l .to_string (unit = 'deg' , decimal = True , precision = 8 )
397
399
glat = c .b .to_string (unit = "deg" , decimal = True , precision = 8 ,
398
- alwayssign = True )
400
+ alwayssign = True )
399
401
center ["-c" ] = "G{glon}{glat}" .format (glon = glon , glat = glat )
400
402
else :
401
403
ra = c .ra .to_string (unit = 'deg' , decimal = True , precision = 8 )
402
404
dec = c .dec .to_string (unit = "deg" , decimal = True , precision = 8 ,
403
- alwayssign = True )
405
+ alwayssign = True )
404
406
center ["-c" ] = "{ra}{dec}" .format (ra = ra , dec = dec )
405
407
elif isinstance (coordinates , tbl .Table ):
406
408
if (("_RAJ2000" in coordinates .keys ()) and ("_DEJ2000" in
0 commit comments