11
11
from astropy .coordinates import SkyCoord , Angle
12
12
from astropy import units as u
13
13
from astropy .utils .decorators import deprecated_renamed_argument
14
+
14
15
from pyvo .dal import TAPService
16
+
17
+ try :
18
+ from pyvo .dal .sia2 import SIA2Service
19
+ except ImportError :
20
+ # Can be removed once min version of pyvo is 1.5
21
+ from pyvo .dal .sia2 import SIAService as SIA2Service
22
+
15
23
from astroquery import log
16
24
from astroquery .query import BaseVOQuery
17
25
from astroquery .utils .commons import parse_coordinates
@@ -26,9 +34,17 @@ class IrsaClass(BaseVOQuery):
26
34
27
35
def __init__ (self ):
28
36
super ().__init__ ()
37
+ self .sia_url = conf .sia_url
29
38
self .tap_url = conf .tap_url
39
+ self ._sia = None
30
40
self ._tap = None
31
41
42
+ @property
43
+ def sia (self ):
44
+ if not self ._sia :
45
+ self ._sia = SIA2Service (baseurl = self .sia_url )
46
+ return self ._sia
47
+
32
48
@property
33
49
def tap (self ):
34
50
if not self ._tap :
@@ -60,6 +76,48 @@ def query_tap(self, query, *, maxrec=None):
60
76
log .debug (f'TAP query: { query } ' )
61
77
return self .tap .search (query , language = 'ADQL' , maxrec = maxrec )
62
78
79
+ def query_sia (self , * , pos = None , band = None , time = None , pol = None ,
80
+ field_of_view = None , spatial_resolution = None ,
81
+ spectral_resolving_power = None , exptime = None ,
82
+ timeres = None , publisher_did = None ,
83
+ facility = None , collection = None ,
84
+ instrument = None , data_type = None ,
85
+ calib_level = None , target_name = None ,
86
+ res_format = None , maxrec = None ,
87
+ ** kwargs ):
88
+ """
89
+ Use standard SIA2 attributes to query the IRSA SIA service.
90
+
91
+ Parameters
92
+ ----------
93
+ _SIA2_PARAMETERS
94
+
95
+ Returns
96
+ -------
97
+ Results in `pyvo.dal.SIAResults` format.
98
+ result.table in Astropy table format
99
+ """
100
+ return self .sia .search (
101
+ pos = pos ,
102
+ band = band ,
103
+ time = time ,
104
+ pol = pol ,
105
+ field_of_view = field_of_view ,
106
+ spatial_resolution = spatial_resolution ,
107
+ spectral_resolving_power = spectral_resolving_power ,
108
+ exptime = exptime ,
109
+ timeres = timeres ,
110
+ publisher_did = publisher_did ,
111
+ facility = facility ,
112
+ collection = collection ,
113
+ instrument = instrument ,
114
+ data_type = data_type ,
115
+ calib_level = calib_level ,
116
+ target_name = target_name ,
117
+ res_format = res_format ,
118
+ maxrec = maxrec ,
119
+ ** kwargs )
120
+
63
121
@deprecated_renamed_argument (("selcols" , "cache" , "verbose" ), ("columns" , None , None ), since = "0.4.7" )
64
122
def query_region (self , coordinates = None , * , catalog = None , spatial = 'Cone' ,
65
123
radius = 10 * u .arcsec , width = None , polygon = None ,
0 commit comments