2
2
3
3
import pytest
4
4
from astropy .coordinates import SkyCoord
5
- from astropy .table import Table
6
5
import astropy .units as u
7
6
8
7
from astroquery .ipac .irsa import Irsa
11
10
OBJ_LIST = ["00h42m44.330s +41d16m07.50s" ,
12
11
SkyCoord (l = 121.1743 * u .deg , b = - 21.5733 * u .deg , frame = "galactic" )]
13
12
13
+ SIZE_LIST = [2 * u .arcmin , '0d2m0s' ]
14
14
15
- @pytest .mark .parametrize (("coordinates" ), OBJ_LIST )
16
- def test_query_region_cone (coordinates ):
17
- query = Irsa .query_region (coordinates , catalog = 'fp_psc' , spatial = 'Cone' , radius = 2 * u .arcmin ,
15
+
16
+ @pytest .mark .parametrize ("coordinates" , OBJ_LIST )
17
+ @pytest .mark .parametrize ("radius" , SIZE_LIST )
18
+ def test_query_region_cone (coordinates , radius ):
19
+ query = Irsa .query_region (coordinates , catalog = 'fp_psc' , spatial = 'Cone' , radius = radius ,
18
20
get_query_payload = True )
19
21
20
22
# We don't fully float compare in this string, there are slight differences due to the name-coordinate
@@ -24,13 +26,15 @@ def test_query_region_cone(coordinates):
24
26
assert ",0.0333" in query
25
27
26
28
27
- @pytest .mark .skip ("Upstream TAP doesn't support Box geometry yet" )
28
29
@pytest .mark .parametrize ("coordinates" , OBJ_LIST )
29
- def test_query_region_box (coordinates ):
30
- result = Irsa .query_region (
31
- coordinates , catalog = 'fp_psc' , spatial = 'Box' , width = 2 * u .arcmin )
30
+ @pytest .mark .parametrize ("width" , SIZE_LIST )
31
+ def test_query_region_box (coordinates , width ):
32
+ query = Irsa .query_region (coordinates , catalog = 'fp_psc' , spatial = 'Box' , width = 2 * u .arcmin ,
33
+ get_query_payload = True )
32
34
33
- assert isinstance (result , Table )
35
+ assert "SELECT * FROM fp_psc WHERE CONTAINS(POINT('ICRS',ra,dec),BOX('ICRS',10.68" in query
36
+ assert ",41.26" in query
37
+ assert ",0.0333" in query
34
38
35
39
36
40
poly1 = [SkyCoord (ra = 10.1 * u .deg , dec = 10.1 * u .deg ),
0 commit comments