astropy / astropy/astroquery

IRSA review based on spectral retrieval

Open
#3,092 14 comments 0 reactions 1 assignee Claimed by @bsipocz View on GitHub
bug Documentation ipac.irsa
Dominant language
Python
Stars
791
Forks
451
Avg merge
1d 3h
Merged PRs (30d)
4

Description

I'm doing some experimenting with the IRSA module today.
https://gist.github.com/keflavich/33140330d1e1695d0d24ffdfdf9934fc

A question came up about the API:

```
---------------------------------------------------------------------------
InvalidQueryError Traceback (most recent call last)
Cell In[4], line 1
----> 1 Irsa.query_region(SkyCoord.from_name('Sgr B2'))

File [/orange/adamginsburg/miniconda3/envs/python312/lib/python3.12/site-packages/astropy/utils/decorators.py:603](http://localhost:23456/lab/workspaces/auto-n/tree/jwst/brick/notebooks/miniconda3/envs/python312/lib/python3.12/site-packages/astropy/utils/decorators.py#line=602), in deprecated_renamed_argument..decorator..wrapper(*args, **kwargs)
600 msg += f"\n Use {alternative} instead."
601 warnings.warn(msg, warning_type, stacklevel=2)
--> 603 return function(*args, **kwargs)

File [/red/adamginsburg/repos/astroquery/astroquery/ipac/irsa/core.py:176](http://localhost:23456/red/adamginsburg/repos/astroquery/astroquery/ipac/irsa/core.py#line=175), in IrsaClass.query_region(self, coordinates, catalog, spatial, radius, width, polygon, get_query_payload, columns, verbose, cache)
137 """
138 Queries the IRSA TAP server around a coordinate and returns a `~astropy.table.Table` object.
139
(...)
173 table : A `~astropy.table.Table` object.
174 """
175 if catalog is None:
--> 176 raise InvalidQueryError("Catalog name is required!")
178 adql = f'SELECT {columns} FROM {catalog}'
180 if spatial == 'All-Sky':

InvalidQueryError: Catalog name is required!
```
Why is `catalog` an optional keyword argument when it is required? Change was made here: https://github.com/astropy/astroquery/commit/6ab036275c23b0fef1bc7ca9153164202a7c3438

I think the `*` should be after the `catalog` keyword. I'll propose that change.

`query_sia`'s documentation has problems inherited from pyvo:
```
Parameters:
possingle or list of tuples
angle units (default: deg) the positional region(s) to be searched for data. Each region can be expressed as a tuple representing a CIRCLE, RANGE or POLYGON as follows: (ra, dec, radius) - for CIRCLE. (angle units - defaults to) (long1, long2, lat1, lat2) - for RANGE (angle units required) (ra, dec, ra, dec, ra, dec … ) ra/dec points for POLYGON all in angle units
```
Note that "defaults to" isn't followed by anything. By experimentation it appears to be degrees. It is not clear how to specify units for those with 'angle units required'. This is an upstream issue: https://github.com/astropy/pyvo/issues/593

Otherwise, I was pleasantly surprised to discover that SIA works just fine for retrieving spectra

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.