Skip to content

Commit

Permalink
Adding draft for IRSA's SSA method
Browse files Browse the repository at this point in the history
  • Loading branch information
bsipocz committed Aug 1, 2024
1 parent 91d160f commit 78d9c10
Show file tree
Hide file tree
Showing 2 changed files with 48 additions and 3 deletions.
1 change: 1 addition & 0 deletions astroquery/ipac/irsa/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ class Conf(_config.ConfigNamespace):
60,
'Time limit for connecting to the IRSA server.')
sia_url = _config.ConfigItem('https://irsa.ipac.caltech.edu/SIA', 'IRSA SIA URL')
ssa_url = _config.ConfigItem('https://irsa.ipac.caltech.edu/SSA', 'IRSA SSA URL')
tap_url = _config.ConfigItem('https://irsa.ipac.caltech.edu/TAP', 'IRSA TAP URL')


Expand Down
50 changes: 47 additions & 3 deletions astroquery/ipac/irsa/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,7 @@
from astropy import units as u
from astropy.utils.decorators import deprecated_renamed_argument

from pyvo.dal import TAPService

from pyvo.dal.sia2 import SIA2Service, SIA2_PARAMETERS_DESC
from pyvo.dal import TAPService, SIA2Service, SIA2_PARAMETERS_DESC, SSAService

from astroquery import log
from astroquery.query import BaseVOQuery
Expand All @@ -31,8 +29,10 @@ class IrsaClass(BaseVOQuery):
def __init__(self):
super().__init__()
self.sia_url = conf.sia_url
self.ssa_url = conf.ssa_url
self.tap_url = conf.tap_url
self._sia = None
self._ssa = None
self._tap = None

@property
Expand All @@ -41,6 +41,12 @@ def sia(self):
self._sia = SIA2Service(baseurl=self.sia_url, session=self._session)
return self._sia

@property
def ssa(self):
if not self._ssa:
self._ssa = SSAService(baseurl=self.sia_url, session=self._session)
return self._ssa

@property
def tap(self):
if not self._tap:
Expand Down Expand Up @@ -116,6 +122,44 @@ def query_sia(self, *, pos=None, band=None, time=None, pol=None,

query_sia.__doc__ = query_sia.__doc__.replace('_SIA2_PARAMETERS', SIA2_PARAMETERS_DESC)

def query_ssa(self, *, pos=None, diameter=None, band=None, time=None, format=None, **kwargs):
"""
Use standard SSA attributes to query the IRSA SSA service.
Parameters
----------
pos : `~astropy.coordinates.SkyCoord` class or sequence of two floats
the position of the center of the circular search region.
assuming icrs decimal degrees if unit is not specified.
diameter : `~astropy.units.Quantity` class or scalar float
the diameter of the circular region around pos in which to search.
assuming icrs decimal degrees if unit is not specified.
band : `~astropy.units.Quantity` class or sequence of two floats
the bandwidth range the observations belong to.
assuming meters if unit is not specified.
time : `~astropy.time.Time` class or sequence of two strings
the datetime range the observations were made in.
assuming iso 8601 if format is not specified.
format : str
the image format(s) of interest. "all" indicates
all available formats; "graphic" indicates
graphical images (e.g. jpeg, png, gif; not FITS);
"metadata" indicates that no images should be
returned--only an empty table with complete metadata.
**kwargs :
additional case insensitive parameters can be given via arbitrary
case insensitive keyword arguments. Where there is overlap
with the parameters set by the other arguments to
this function, these keywords will override.
Returns
-------
Results in `pyvo.dal.SSAResults` format.
result.table in Astropy table format
"""
return self.ssa.search(pos=pos, diameter=diameter, band=band, time=time,
format=format, **kwargs)

def list_collections(self):
"""
Return information of available IRSA SIAv2 collections to be used in ``query_sia`` queries.
Expand Down

0 comments on commit 78d9c10

Please sign in to comment.