Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ENH: adding SSA method for IRSA #3076

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
52 changes: 48 additions & 4 deletions astroquery/ipac/irsa/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,8 @@
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, SSAService
from pyvo.dal.sia2 import SIA2_PARAMETERS_DESC
from astroquery import log
from astroquery.query import BaseVOQuery
from astroquery.utils.commons import parse_coordinates
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
Loading