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
- from pyvo .dal .sia2 import SIA2Service , SIA2_PARAMETERS_DESC
18
-
15
+ from pyvo .dal import TAPService , SIA2Service , SSAService
16
+ from pyvo .dal .sia2 import SIA2_PARAMETERS_DESC
19
17
from astroquery import log
20
18
from astroquery .query import BaseVOQuery
21
19
from astroquery .utils .commons import parse_coordinates
@@ -31,8 +29,10 @@ class IrsaClass(BaseVOQuery):
31
29
def __init__ (self ):
32
30
super ().__init__ ()
33
31
self .sia_url = conf .sia_url
32
+ self .ssa_url = conf .ssa_url
34
33
self .tap_url = conf .tap_url
35
34
self ._sia = None
35
+ self ._ssa = None
36
36
self ._tap = None
37
37
38
38
@property
@@ -41,6 +41,12 @@ def sia(self):
41
41
self ._sia = SIA2Service (baseurl = self .sia_url , session = self ._session )
42
42
return self ._sia
43
43
44
+ @property
45
+ def ssa (self ):
46
+ if not self ._ssa :
47
+ self ._ssa = SSAService (baseurl = self .ssa_url , session = self ._session )
48
+ return self ._ssa
49
+
44
50
@property
45
51
def tap (self ):
46
52
if not self ._tap :
@@ -122,6 +128,41 @@ def query_sia(self, *, pos=None, band=None, time=None, pol=None,
122
128
123
129
query_sia .__doc__ = query_sia .__doc__ .replace ('_SIA2_PARAMETERS' , SIA2_PARAMETERS_DESC )
124
130
131
+ def query_ssa (self , * , pos = None , radius = None , band = None , time = None , collection = None ):
132
+ """
133
+ Use standard SSA attributes to query the IRSA SSA service.
134
+
135
+ Parameters
136
+ ----------
137
+ pos : `~astropy.coordinates.SkyCoord` class or sequence of two floats
138
+ the position of the center of the circular search region.
139
+ assuming icrs decimal degrees if unit is not specified.
140
+ raidus : `~astropy.units.Quantity` class or scalar float
141
+ the radius of the circular region around pos in which to search.
142
+ assuming icrs decimal degrees if unit is not specified.
143
+ band : `~astropy.units.Quantity` class or sequence of two floats
144
+ the bandwidth range the observations belong to.
145
+ assuming meters if unit is not specified.
146
+ time : `~astropy.time.Time` class or sequence of two strings
147
+ the datetime range the observations were made in.
148
+ assuming iso 8601 if format is not specified.
149
+ collection : str
150
+ Name of the collection that the data belongs to.
151
+
152
+ Returns
153
+ -------
154
+ Results in `pyvo.dal.SSAResults` format.
155
+ result.to_table() in Astropy table format
156
+ """
157
+
158
+ if radius is None :
159
+ diameter = None
160
+ else :
161
+ diameter = 2 * radius
162
+
163
+ return self .ssa .search (pos = pos , diameter = diameter , band = band , time = time ,
164
+ format = 'all' , collection = collection )
165
+
125
166
def list_collections (self , servicetype = None ):
126
167
"""
127
168
Return information of available IRSA SIAv2 collections to be used in ``query_sia`` queries.
0 commit comments