Skip to content

Commit ca7acc1

Browse files
authored
Merge branch 'astropy:main' into feature/ISSUE-3138-TAP
2 parents 4b775f8 + f553876 commit ca7acc1

File tree

11 files changed

+184
-96
lines changed

11 files changed

+184
-96
lines changed

CHANGES.rst

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@ gaia
1919

2020
- Deprecated ``band`` from ``load_data`` as it has no effect on upstream
2121
response any more. [#3278]
22+
- New datalink retrieve types EPOCH_PHOTOMETRY_CROWDED_FIELD, EPOCH_ASTROMETRY_BRIGHT, XP_MEAN_SPECTRUM_GRAVLENS,
23+
EPOCH_FLAGS_NSS, EPOCH_PARAMETERS_RVS_SINGLE, EPOCH_PARAMETERS_RVS_DOUBLE, EPOCH_FLAGS_VARI. [#3371, #3372]
2224

2325
Service fixes and enhancements
2426
------------------------------
@@ -48,6 +50,7 @@ gaia
4850
^^^^
4951

5052
- New method cross_match_basic that simplifies the positional x-match method [#3320]
53+
- new DR4 datalink retrieve type MEAN_SPECTRUM_RVS [#3342]
5154

5255
linelists.cdms
5356
^^^^^^^^^^^^^^
@@ -60,6 +63,7 @@ heasarc
6063
- Add support for astropy.table.Row in Heasarc.download_data and Heasarc.locate_data. [#3270]
6164
- Heasarc.locate_data returns empty rows with an error in the error_message column if there are
6265
no data associated with that row rather than filtering it out. [#3275]
66+
- Heasarc.locate_data changed to use POST request instead of GET to accomodate large requests. [#3356]
6367

6468
imcce
6569
^^^^^
@@ -70,6 +74,14 @@ imcce
7074
- Changing RuntimeError to NoResultsWarning when an empty result is
7175
returned. [#3307]
7276

77+
ipac.irsa
78+
^^^^^^^^^
79+
80+
- Fix ``list_catalogs`` to not include image metadata tables, only
81+
catalogs. The ``include_metadata_tables`` keyword argument allows opting
82+
in to return all TAP tables, including non-spatial and metadata ones,
83+
too. [#3334]
84+
7385
SIMBAD
7486
^^^^^^
7587

@@ -121,6 +133,12 @@ query.py
121133
Some corner cases where downloads were not properly continued have been
122134
fixed. [#3232]
123135

136+
skyview
137+
^^^^^^^
138+
139+
- Changed SkyView URL to https. [#3346]
140+
141+
124142
utils
125143
^^^^^
126144

astroquery/gaia/__init__.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ class Conf(_config.ConfigNamespace):
2929
'XP_CONTINUOUS',
3030
'XP_SAMPLED',
3131
'RVS',
32+
'MEAN_SPECTRUM_RVS',
3233
'MCMC_GSPPHOT',
3334
'MCMC_MSC',
3435
'EPOCH_ASTROMETRY',
@@ -37,14 +38,20 @@ class Conf(_config.ConfigNamespace):
3738
'RVS_EPOCH_SPECTRUM',
3839
'RVS_TRANSIT',
3940
'EPOCH_ASTROMETRY_CROWDED_FIELD',
41+
'EPOCH_PHOTOMETRY_CROWDED_FIELD',
4042
'EPOCH_IMAGE',
4143
'EPOCH_PHOTOMETRY_CCD',
4244
'XP_EPOCH_SPECTRUM_SSO',
4345
'XP_EPOCH_CROWDING',
4446
'XP_MEAN_SPECTRUM',
4547
'XP_EPOCH_SPECTRUM',
4648
'CROWDED_FIELD_IMAGE',
47-
'EPOCH_ASTROMETRY_BRIGHT']
49+
'EPOCH_ASTROMETRY_BRIGHT',
50+
'XP_MEAN_SPECTRUM_GRAVLENS',
51+
'EPOCH_FLAGS_NSS',
52+
'EPOCH_PARAMETERS_RVS_SINGLE',
53+
'EPOCH_PARAMETERS_RVS_DOUBLE',
54+
'EPOCH_FLAGS_VARI']
4855

4956
VALID_LINKING_PARAMETERS = {'SOURCE_ID', 'TRANSIT_ID', 'IMAGE_ID'}
5057

astroquery/gaia/core.py

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -184,18 +184,20 @@ def load_data(self, ids, *, data_release=None, data_structure='INDIVIDUAL', retr
184184
in a single bundle, even if only one source/file is considered
185185
'RAW' means products are provided following a Data Model similar to that used in the MDB, meaning in
186186
particular that parameters stored as arrays will remain as such. A single file is provided for the data of
187-
all sourceIds together, but in this case there will be always be one row per sourceId
187+
all sourceIds together, but in this case there will be always be one row per sourceId.
188188
retrieval_type : str, optional, default 'ALL' to retrieve all data from the list of sources
189189
retrieval type identifier. For GAIA DR2 possible values are ['EPOCH_PHOTOMETRY']
190190
For GAIA DR3, possible values are ['EPOCH_PHOTOMETRY', 'RVS', 'XP_CONTINUOUS', 'XP_SAMPLED',
191191
'MCMC_GSPPHOT' or 'MCMC_MSC']
192-
For GAIA DR4, possible values will be ['EPOCH_PHOTOMETRY', 'RVS', 'XP_CONTINUOUS', 'XP_SAMPLED',
193-
'MCMC_GSPPHOT', 'MCMC_MSC', 'EPOCH_ASTROMETRY', 'RVS_EPOCH_DATA_SINGLE',
192+
For GAIA DR4, possible values will be ['EPOCH_PHOTOMETRY', 'MEAN_SPECTRUM_RVS', 'XP_CONTINUOUS',
193+
'XP_SAMPLED', 'MCMC_GSPPHOT', 'MCMC_MSC', 'EPOCH_ASTROMETRY', 'RVS_EPOCH_DATA_SINGLE',
194194
'RVS_EPOCH_DATA_DOUBLE','RVS_EPOCH_SPECTRUM', 'RVS_TRANSIT', 'EPOCH_ASTROMETRY_CROWDED_FIELD',
195-
'EPOCH_IMAGE', 'EPOCH_PHOTOMETRY_CCD', 'XP_EPOCH_SPECTRUM_SSO', 'XP_EPOCH_CROWDING', 'XP_MEAN_SPECTRUM',
196-
'XP_EPOCH_SPECTRUM', 'CROWDED_FIELD_IMAGE', 'EPOCH_ASTROMETRY_BRIGHT']. Note that for
197-
'CROWDED_FIELD_IMAGE' only the format 'fits' can be used, and that its image, in the principal header, will
198-
not be available in the returned dictionary. Set 'output_file' to retrieve all data: image + tables.
195+
'EPOCH_PHOTOMETRY_CROWDED_FIELD', 'EPOCH_IMAGE', 'EPOCH_PHOTOMETRY_CCD', 'XP_EPOCH_SPECTRUM_SSO',
196+
'XP_EPOCH_CROWDING', 'XP_MEAN_SPECTRUM', 'XP_EPOCH_SPECTRUM', 'CROWDED_FIELD_IMAGE',
197+
'EPOCH_ASTROMETRY_BRIGHT', 'XP_MEAN_SPECTRUM_GRAVLENS', 'EPOCH_FLAGS_NSS', 'EPOCH_PARAMETERS_RVS_SINGLE',
198+
EPOCH_PARAMETERS_RVS_DOUBLE', 'EPOCH_FLAGS_VARI']. Note that for 'CROWDED_FIELD_IMAGE' only the format
199+
'fits' can be used, and that its image, in the principal header, will not be available in the returned
200+
dictionary. Set 'output_file' to retrieve all data: image + tables.
199201
linking_parameter : str, optional, default SOURCE_ID, valid values: SOURCE_ID, TRANSIT_ID, IMAGE_ID
200202
By default, all the identifiers are considered as source_id
201203
SOURCE_ID: the identifiers are considered as source_id

astroquery/heasarc/core.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -517,13 +517,18 @@ def locate_data(self, query_result=None, catalog_name=None):
517517

518518
# datalink url
519519
dlink_url = f'{self.VO_URL}/datalink/{catalog_name}'
520-
521520
query = pyvo.dal.adhoc.DatalinkQuery(
522521
baseurl=dlink_url,
523522
id=query_result['__row'],
524523
session=self._session
525524
)
526-
dl_result = query.execute().to_table()
525+
526+
dl_result = pyvo.dal.DALResults(
527+
query.execute_votable(post=True),
528+
url=query.queryurl,
529+
session=query._session
530+
).to_table()
531+
527532
# include rows that have directory links (i.e. data) and those
528533
# that report errors (usually means there are no data products)
529534
dl_result = dl_result[np.ma.mask_or(

astroquery/ipac/irsa/core.py

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -304,7 +304,7 @@ def query_region(self, coordinates=None, *, catalog=None, spatial='Cone',
304304
return response.to_table()
305305

306306
@deprecated_renamed_argument("cache", None, since="0.4.7")
307-
def list_catalogs(self, *, full=False, filter=None, cache=False):
307+
def list_catalogs(self, *, full=False, filter=None, include_metadata_tables=False, cache=False):
308308
"""
309309
Return information of available IRSA catalogs.
310310
@@ -316,8 +316,19 @@ def list_catalogs(self, *, full=False, filter=None, cache=False):
316316
filter : str or None
317317
If specified we only return catalogs when their catalog_name
318318
contains the filter string.
319+
include_metadata_tables : bool
320+
If True returns not just the catalogs but all table holdings including the image metadata tables.
321+
These are not suitable for spatial queries with e.g. ``query_region``.
319322
"""
320-
tap_tables = self.query_tap("SELECT * FROM TAP_SCHEMA.tables").to_table()
323+
324+
if include_metadata_tables:
325+
more_filtering = ""
326+
else:
327+
# Filter out non-spatial catalogs and metadata tables with
328+
# irsa_pos=y and irsa_dbms=21
329+
more_filtering = "WHERE irsa_dbms=21 AND irsa_pos='y'"
330+
331+
tap_tables = self.query_tap(f"SELECT * FROM TAP_SCHEMA.tables {more_filtering}").to_table()
321332

322333
if filter:
323334
mask = [filter in name for name in tap_tables['table_name']]

astroquery/ipac/irsa/tests/test_irsa_remote.py

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -72,14 +72,26 @@ def test_list_columns(self):
7272
def test_list_catalogs(self):
7373
catalogs = Irsa.list_catalogs()
7474
# Number of available catalogs may change over time, test only for significant drop.
75-
# (at the time of writing there are 933 tables in the list).
76-
assert len(catalogs) > 900
75+
# (at the time of writing there are 521 catalogs in the list).
76+
assert len(catalogs) > 520
7777
assert isinstance(catalogs, dict)
7878

79+
catalogs_full = Irsa.list_catalogs(full=True)
80+
assert isinstance(catalogs_full, Table)
81+
7982
def test_list_catalogs_filter(self):
80-
spitzer_catalogs = Irsa.list_catalogs(filter='spitzer')
83+
allwise_catalogs = Irsa.list_catalogs(filter='allwise')
84+
85+
assert len(allwise_catalogs) == 4
86+
87+
def test_list_catalogs_metadata(self):
88+
catalogs = Irsa.list_catalogs(filter='wise')
89+
all_tables = Irsa.list_catalogs(filter='wise', include_metadata_tables=True)
90+
91+
assert len(catalogs) < len(all_tables)
8192

82-
assert len(spitzer_catalogs) == 142
93+
assert 'wise.wise_allwise_p3am_cdd' not in catalogs
94+
assert 'wise.wise_allwise_p3am_cdd' in all_tables
8395

8496
@pytest.mark.parametrize('servicetype', (None, 'sia', 'ssa'))
8597
def test_list_collections(self, servicetype):

astroquery/mast/missions.py

Lines changed: 27 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -188,19 +188,16 @@ def query_region_async(self, coordinates, *, radius=3*u.arcmin, limit=5000, offs
188188
coordinates : str or `~astropy.coordinates` object
189189
The target around which to search. It may be specified as a
190190
string or as the appropriate `~astropy.coordinates` object.
191-
radius : str or `~astropy.units.Quantity` object, optional
192-
Default 3 degrees.
191+
radius : str or `~astropy.units.Quantity` object
192+
Default is 3 arcminutes. The radius around the coordinates to search within.
193193
The string must be parsable by `~astropy.coordinates.Angle`. The
194-
appropriate `~astropy.units.Quantity` object from
195-
`~astropy.units` may also be used. Defaults to 3 arcminutes.
194+
appropriate `~astropy.units.Quantity` object from `~astropy.units` may also be used.
196195
limit : int
197-
Optional and default is 5000.
198-
the maximum number of dataset IDs in the results.
196+
Default is 5000. The maximum number of dataset IDs in the results.
199197
offset : int
200-
Optional and default is 0
201-
the number of records you wish to skip before selecting records.
202-
select_cols: list, None
203-
Default None. Names of columns that will be included in the result table.
198+
Default is 0. The number of records you wish to skip before selecting records.
199+
select_cols: list, optional
200+
Default is None. Names of columns that will be included in the result table.
204201
If None, a default set of columns will be returned.
205202
**criteria
206203
Other mission-specific criteria arguments.
@@ -224,7 +221,7 @@ def query_region_async(self, coordinates, *, radius=3*u.arcmin, limit=5000, offs
224221
# Put coordinates and radius into consistent format
225222
coordinates = commons.parse_coordinates(coordinates)
226223

227-
# if radius is just a number we assume degrees
224+
# If radius is just a number, assume arcminutes
228225
radius = coord.Angle(radius, u.arcmin)
229226

230227
# Dataset ID column should always be returned
@@ -233,7 +230,7 @@ def query_region_async(self, coordinates, *, radius=3*u.arcmin, limit=5000, offs
233230
elif self.mission == 'ullyses':
234231
select_cols = self._default_ullyses_cols
235232

236-
# basic params
233+
# Basic params
237234
params = {'target': [f"{coordinates.ra.deg} {coordinates.dec.deg}"],
238235
'radius': radius.arcsec,
239236
'radius_units': 'arcseconds',
@@ -258,23 +255,20 @@ def query_criteria_async(self, *, coordinates=None, objectname=None, radius=3*u.
258255
string or as the appropriate `~astropy.coordinates` object.
259256
objectname : str
260257
The name of the target around which to search.
261-
radius : str or `~astropy.units.Quantity` object, optional
262-
Default 3 degrees.
258+
radius : str or `~astropy.units.Quantity` object
259+
Default is 3 arcminutes. The radius around the coordinates to search within.
263260
The string must be parsable by `~astropy.coordinates.Angle`. The
264-
appropriate `~astropy.units.Quantity` object from
265-
`~astropy.units` may also be used. Defaults to 3 arcminutes.
261+
appropriate `~astropy.units.Quantity` object from `~astropy.units` may also be used.
266262
limit : int
267-
Optional and default is 5000.
268-
the maximum number of dataset IDs in the results.
263+
Default is 5000. The maximum number of dataset IDs in the results.
269264
offset : int
270-
Optional and default is 0.
271-
the number of records you wish to skip before selecting records.
272-
select_cols: list, None
273-
Default None. Names of columns that will be included in the result table.
265+
Default is 0. The number of records you wish to skip before selecting records.
266+
select_cols: list, optional
267+
Default is None. Names of columns that will be included in the result table.
274268
If None, a default set of columns will be returned.
275269
resolver : str, optional
276-
The resolver to use when resolving a named target into coordinates. Valid options are "SIMBAD" and "NED".
277-
If not specified, the default resolver order will be used. Please see the
270+
Default is None. The resolver to use when resolving a named target into coordinates. Valid options are
271+
"SIMBAD" and "NED". If not specified, the default resolver order will be used. Please see the
278272
`STScI Archive Name Translation Application (SANTA) <https://mastresolver.stsci.edu/Santa-war/>`__
279273
for more information. Default is None.
280274
**criteria
@@ -339,22 +333,19 @@ def query_object_async(self, objectname, *, radius=3*u.arcmin, limit=5000, offse
339333
objectname : str
340334
The name of the target around which to search.
341335
radius : str or `~astropy.units.Quantity` object, optional
342-
Default 3 arcmin.
343-
The string must be parsable by `~astropy.coordinates.Angle`.
344-
The appropriate `~astropy.units.Quantity` object from
345-
`~astropy.units` may also be used. Defaults to 3 arcminutes.
336+
Default is 3 arcminutes. The radius around the coordinates to search within.
337+
The string must be parsable by `~astropy.coordinates.Angle`. The
338+
appropriate `~astropy.units.Quantity` object from `~astropy.units` may also be used.
346339
limit : int
347-
Optional and default is 5000.
348-
the maximum number of dataset IDs in the results.
340+
Default is 5000. The maximum number of dataset IDs in the results.
349341
offset : int
350-
Optional and default is 0.
351-
the number of records you wish to skip before selecting records.
352-
select_cols: list, None
353-
Default None. Names of columns that will be included in the result table.
342+
Default is 0. The number of records you wish to skip before selecting records.
343+
select_cols: list, optional
344+
Default is None. Names of columns that will be included in the result table.
354345
If None, a default set of columns will be returned.
355346
resolver : str, optional
356-
The resolver to use when resolving a named target into coordinates. Valid options are "SIMBAD" and "NED".
357-
If not specified, the default resolver order will be used. Please see the
347+
Default is None. The resolver to use when resolving a named target into coordinates. Valid options are
348+
"SIMBAD" and "NED". If not specified, the default resolver order will be used. Please see the
358349
`STScI Archive Name Translation Application (SANTA) <https://mastresolver.stsci.edu/Santa-war/>`__
359350
for more information. Default is None.
360351
**criteria

astroquery/skyview/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ class Conf(_config.ConfigNamespace):
77
Configuration parameters for `astroquery.skyview`.
88
"""
99
url = _config.ConfigItem(
10-
'http://skyview.gsfc.nasa.gov/current/cgi/basicform.pl',
10+
'https://skyview.gsfc.nasa.gov/current/cgi/basicform.pl',
1111
'SkyView URL')
1212

1313

astroquery/skyview/tests/data/survey_dict.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"HardX-ray": ["INT GAL 17-35 Flux", "INT GAL 17-60 Flux", "INT GAL 35-80 Flux", "INTEGRAL/SPI GC", "GRANAT/SIGMA", "RXTE Allsky 3-8keV Flux", "RXTE Allsky 3-20keV Flux", "RXTE Allsky 8-20keV Flux"],
33
"X-ray:SwiftBAT": ["BAT SNR 14-195", "BAT SNR 14-20", "BAT SNR 20-24", "BAT SNR 24-35", "BAT SNR 35-50", "BAT SNR 50-75", "BAT SNR 75-100", "BAT SNR 100-150", "BAT SNR 150-195"],
44
"UV": ["GALEX Near UV", "GALEX Far UV", "ROSAT WFC F1", "ROSAT WFC F2", "EUVE 83 A", "EUVE 171 A", "EUVE 405 A", "EUVE 555 A"],
5-
"Optical:SDSS": ["SDSSg", "SDSSi", "SDSSr", "SDSSu", "SDSSz", "SDSSdr7g", "SDSSdr7i", "SDSSdr7r", "SDSSdr7u", "SDSSdr7z"],
5+
"Optical:SDSS class=": ["SDSSg", "SDSSi", "SDSSr", "SDSSu", "SDSSz"],
66
"OtherOptical": ["TESS", "Mellinger Red", "Mellinger Green", "Mellinger Blue", "H-Alpha Comp", "SHASSA H", "SHASSA CC", "SHASSA C", "SHASSA Sm"],
77
"IR:IRAS": ["IRIS 12", "IRIS 25", "IRIS 60", "IRIS 100", "SFD100m", "SFD Dust Map", "IRAS 12 micron", "IRAS 25 micron", "IRAS 60 micron", "IRAS 100 micron"],
88
"IR:Planck": ["Planck 857 I", "Planck 545 I", "Planck 353 I", "Planck 353 Q", "Planck 353 U", "Planck 353 PI", "Planck 353 PA", "Planck 353 PI/I", "Planck 217 I", "Planck 217 Q", "Planck 217 U", "Planck 217 PI", "Planck 217 PA", "Planck 217 PI/I", "Planck 143 I", "Planck 143 Q", "Planck 143 U", "Planck 143 PI", "Planck 143 PA", "Planck 143 PI/I", "Planck 100 I", "Planck 100 Q", "Planck 100 U", "Planck 100 PI", "Planck 100 PA", "Planck 100 PI/I", "Planck 070 I", "Planck 070 Q", "Planck 070 U", "Planck 070 PI", "Planck 070 PA", "Planck 070 PI/I", "Planck 044 I", "Planck 044 Q", "Planck 044 U", "Planck 044 PI", "Planck 044 PA", "Planck 044 PI/I", "Planck 030 I", "Planck 030 Q", "Planck 030 U", "Planck 030 PI", "Planck 030 PA", "Planck 030 PI/I"],

astroquery/splatalogue/core.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -219,7 +219,7 @@ def _parse_kwargs(self, *, min_frequency=None, max_frequency=None,
219219
cm/K for *inverse* cm, i.e. wavenumber, or K for Kelvin
220220
intensity_lower_limit : `None` or float
221221
Lower limit on the intensity. See intensity_type
222-
intensity_type : `None` or ``'sij'``, ``'cdms_jpl'``, ``'aij'``
222+
intensity_type : `None`, ``'CDMS/JPL (log)'``, ``'Sij-mu2'``, ``'Aij (log)'``
223223
The type of intensity on which to place a lower limit
224224
transition : str
225225
e.g. 1-0

0 commit comments

Comments
 (0)