You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/mast/mast_catalog.rst
+33-31Lines changed: 33 additions & 31 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,10 +4,10 @@ Catalog Queries
4
4
***************
5
5
6
6
`~astroquery.mast.CatalogsClass` is a versatile tool for discovering and querying the wide range of astronomical catalogs hosted by the
7
-
[Mikulski Archive for Space Telescopes (MAST)](https://archive.stsci.edu/). `~astroquery.mast.CatalogsClass` is a Python wrapper
8
-
for our [MAST Table Access Protocol (TAP) Service](https://mast.stsci.edu/vo-tap/), which allows you to query for catalog
7
+
`Mikulski Archive for Space Telescopes (MAST)<https://archive.stsci.edu/>`_. `~astroquery.mast.CatalogsClass` is a Python wrapper
8
+
for our `MAST Table Access Protocol (TAP) Service<https://mast.stsci.edu/vo-tap/>`_, which allows you to query for catalog
9
9
metadata and data. If you were querying the MAST TAP service directly, you would need to write your queries in
10
-
[Astronomical Data Query Language (ADQL)](https://www.ivoa.net/documents/latest/ADQL.html). With `~astroquery.mast.CatalogsClass`,
10
+
`Astronomical Data Query Language (ADQL)<https://www.ivoa.net/documents/latest/ADQL.html>`_. With `~astroquery.mast.CatalogsClass`,
11
11
you can construct and execute these queries using a more intuitive Python interface, without needing to learn ADQL syntax.
12
12
13
13
The catalogs available through MAST are diverse, covering a wide range of astronomical objects and phenomena.
@@ -17,6 +17,7 @@ The `~astroquery.mast.CatalogsClass` interface is designed for flexible querying
17
17
as well as the ability to filter results based on specific criteria.
18
18
19
19
At a high level, querying MAST catalogs with `~astroquery.mast.CatalogsClass` involves the following steps:
20
+
20
21
1. **Discover** available collections and catalogs.
21
22
2. **Inspect** catalog metadata to understand available columns and data types, as well as the capabilities of each catalog.
22
23
3. **Query** the catalog using spatial and/or non-spatial criteria to retrieve relevant data.
@@ -33,7 +34,7 @@ is specified in a query, these attributes will be used as defaults. The ``collec
33
34
representing the current collection, and the ``catalog`` attribute is a string representing the name of the current
34
35
catalog within that collection.
35
36
36
-
The default value for the ``collection`` attribute is "hsc", referring to the [Hubble Source Catalog version 3](https://archive.stsci.edu/hst/hsc/).
37
+
The default value for the ``collection`` attribute is "hsc", referring to the `Hubble Source Catalog version 3<https://archive.stsci.edu/hst/hsc/>`_.
37
38
The default value for ``catalog`` is "dbo.SumMagAper2CatView". This is a summary source catalog with data describing sources detected in Hubble images,
38
39
including their positions, magnitudes, and other properties.
39
40
@@ -55,7 +56,7 @@ at any time after instantiation to set new defaults for subsequent queries. Both
55
56
collection, the catalog will be reset to the default catalog for the new collection.
56
57
57
58
Here, we'll change the value of ``collection`` to "ullyses", referring to the
58
-
[Hubble Ultraviolet Legacy Library of Young Stars as Essential Standards (ULLYSES)](https://ullyses.stsci.edu/) program. The default catalog
59
+
`Hubble Ultraviolet Legacy Library of Young Stars as Essential Standards (ULLYSES)<https://ullyses.stsci.edu/>`_ program. The default catalog
59
60
for this collection is "sciencemetadata", which contains metadata about the scientific exposures taken as part of the ULLYSES program,
60
61
including their coordinates, observation dates, instruments used, and other properties.
61
62
@@ -93,9 +94,6 @@ Discovering Available Collections
93
94
To list all of the catalog collections that are accessible via the MAST TAP Service, use the `~astroquery.mast.CatalogsClass.get_collections` method.
94
95
This returns an `~astropy.table.Table` containing the names of all available collections.
95
96
96
-
Some historical collections are no longer supported for querying, and will not appear in this list. If a collection
97
-
has been renamed or deprecated, Astroquery will issue a warning and suggest the appropriate replacement where possible.
98
-
99
97
.. doctest-remote-data::
100
98
101
99
>>> collections = Catalogs.get_collections()
@@ -121,6 +119,12 @@ has been renamed or deprecated, Astroquery will issue a warning and suggest the
121
119
tic_v82
122
120
ullyses
123
121
122
+
.. attention::
123
+
Some historical collections are no longer supported for querying and will not appear in this list. If a collection
124
+
has been renamed or deprecated, Astroquery will issue a warning and suggest the appropriate replacement where possible.
125
+
To query a catalog that is no longer supported, you can install an older version of Astroquery that still supports it.
126
+
To install the latest version that supports legacy collections, use the following command: ``pip install astroquery==0.4.12``
127
+
124
128
Discovering Catalogs Within a Collection
125
129
-----------------------------------------
126
130
@@ -207,21 +211,21 @@ Shared Query Parameters
207
211
208
212
The following parameters are shared across all three query methods:
209
213
210
-
- ``collection`` : The name of the catalog collection to query. If not specified, the ``collection`` class attribute will be used as the default.
211
-
- ``collection``: The name of the catalog collection to query. If not specified, the ``collection`` class attribute will be used as the default.
212
-
- ``catalog``: The name of the catalog to query within the specified collection. If not specified, the ``catalog`` class attribute will be used as the default.
213
-
- ``limit``: An integer specifying the maximum number of results to return. The default is 5,000.
214
-
- ``offset``: An integer specifying the number of results to skip before starting to return results. This is useful for paginating through large result sets. Default is 0.
215
-
- ``count_only``: A boolean indicating whether to return only the count of matching results instead of the results themselves. Default is False.
216
-
- ``select_cols``: A list of column names to include in the results. If not specified, all columns will be returned.
217
-
- ``sort_by``: A string or list of strings specifying the column(s) to sort the results by. Default is None (no sorting).
218
-
- ``sort_desc``: A boolean or list of booleans specifying whether to sort in descending order for each column specified in ``sort_by``.
219
-
Default is False (ascending order).
220
-
- ``filters``: Another parameter used to specify criteria filters as a dictionary. Use this option when the name of a column conflicts
221
-
with a named parameter of this method.
222
-
- ``run_async``: If True, run the query in asynchronous mode. This mode is more robust and preferable for long-running queries.
223
-
- ``return_adql``: If True, return the ADQL query string instead of executing the query. This is useful for debugging or for users who want
224
-
to run the query directly against the TAP service. When False, the ADQL query string is also returned in the metadata of the result table.
214
+
- ``collection`` : The name of the catalog collection to query. If not specified, the ``collection`` class attribute will be used as the default.
215
+
- ``collection``: The name of the catalog collection to query. If not specified, the ``collection`` class attribute will be used as the default.
216
+
- ``catalog``: The name of the catalog to query within the specified collection. If not specified, the ``catalog`` class attribute will be used as the default.
217
+
- ``limit``: An integer specifying the maximum number of results to return. The default is 5,000.
218
+
- ``offset``: An integer specifying the number of results to skip before starting to return results. This is useful for paginating through large result sets. Default is 0.
219
+
- ``count_only``: A boolean indicating whether to return only the count of matching results instead of the results themselves. Default is False.
220
+
- ``select_cols``: A list of column names to include in the results. If not specified, all columns will be returned.
221
+
- ``sort_by``: A string or list of strings specifying the column(s) to sort the results by. Default is None (no sorting).
222
+
- ``sort_desc``: A boolean or list of booleans specifying whether to sort in descending order for each column specified in ``sort_by``.
223
+
Default is False (ascending order).
224
+
- ``filters``: Another parameter used to specify criteria filters as a dictionary. Use this option when the name of a column conflicts
225
+
with a named parameter of this method.
226
+
- ``run_async``: If True, run the query in asynchronous mode. This mode is more robust and preferable for long-running queries.
227
+
- ``return_adql``: If True, return the ADQL query string instead of executing the query. This is useful for debugging or for users who want
228
+
to run the query directly against the TAP service. When False, the ADQL query string is also returned in the metadata of the result table.
225
229
226
230
These parameters allow users to control the scope and format of their queries consistently across all three methods.
227
231
@@ -294,7 +298,7 @@ If a catalog supports spatial queries, the following parameters can be used to s
294
298
- ``radius``: The radius of a cone search around ``coordinates`` or ``object_name``. Can be defined as a string with units (e.g., "10 arcsec"),
295
299
a `~astropy.units.Quantity`, or a float in degrees. Default is 0.2 degrees.
296
300
- ``region``: Specifies the spatial region of interest for more complex spatial queries, such as polygon searches.
297
-
Please see the [Specifying Spatial Regions](#specifying-spatial-regions) section below for details on how to use this parameter.
301
+
Please see the `Specifying Spatial Regions`_ section below for details on how to use this parameter.
298
302
299
303
If no spatial parameters are provided, the query is purely column-based and will not filter results based on position. If they are supplied, the
300
304
spatial parameters are combined with any column-based criteria using a logical **AND**, meaning that only results that satisfy both the spatial and
@@ -338,7 +342,7 @@ The `~astroquery.mast.CatalogsClass.query_region` and `~astroquery.mast.Catalogs
338
342
Both methods also support column-based criteria, sorting, and limiting of results, just like `~astroquery.mast.CatalogsClass.query_criteria`.
339
343
340
344
For these queries, we will use the ``tic_v82`` collection, which refers to the
341
-
[TESS Input Catalog version 8.2](https://ui.adsabs.harvard.edu/abs/2022yCat.4039....0P/abstract). We'll use the `~astroquery.mast.CatalogsClass.query_region`
345
+
`TESS Input Catalog version 8.2<https://ui.adsabs.harvard.edu/abs/2022yCat.4039....0P/abstract>`_. We'll use the `~astroquery.mast.CatalogsClass.query_region`
342
346
method to perform a simple cone search for sources within 1 arcminute of the coordinates (158.47924, -7.30962).
343
347
344
348
.. doctest-remote-data::
@@ -359,7 +363,7 @@ method to perform a simple cone search for sources within 1 arcminute of the coo
359
363
841736289 158.475246467012 -7.29984176473098
360
364
361
365
For this next query, we'll use the `~astroquery.mast.CatalogsClass.query_object` method to search for sources within 0.1 degrees of the object
362
-
["M11"](https://science.nasa.gov/mission/hubble/science/explore-the-night-sky/hubble-messier-catalog/messier-11/), which is an open star cluster
366
+
`M11<https://science.nasa.gov/mission/hubble/science/explore-the-night-sky/hubble-messier-catalog/messier-11/>`_, which is an open star cluster
363
367
also known as the Wild Duck Cluster. We'll also filter for sources that are stars, sort results by the effective temperature of the source, and
364
368
limit the number of results to 10.
365
369
@@ -409,7 +413,7 @@ Cone searches are the most common type of spatial query, defined by a center pos
409
413
- A Space-Time Coordinate (STC) string in the format ``CIRCLE [frame] <ra> <dec> <radius>``, where ra, dec, and radius are in degrees.
410
414
411
415
Let's demonstrate this on the ``skymapperdr4`` collection, which contains catalogs from the
412
-
[SkyMapper Southern Survey: Data Release 4](https://skymapper.anu.edu.au/data-release/). The catalog we query will be "dr4.master", which is
416
+
`SkyMapper Southern Survey: Data Release 4<https://skymapper.anu.edu.au/data-release/>`_. The catalog we query will be "dr4.master", which is
413
417
a master catalog of sources detected in the SkyMapper DR4 survey, containing their positions, magnitudes, and other properties. Our cone
414
418
search will be centered on the coordinate (18.855, -6.945) with a radius of 0.01 degrees.
415
419
@@ -487,16 +491,14 @@ previous cone search, so the results may look similar!
487
491
Counting Results
488
492
-----------------
489
493
490
-
All query methods support a ``count_only=True`` option, which returns only the number of matching records:
491
-
492
494
Each of the three query methods supports a ``count_only`` parameter. When set to ``True``, it returns only the number of matching results.
493
495
This can be useful for quickly assessing the size of a result set without having to retrieve all the data.
494
496
495
497
Let's demonstrate this on the ``caom`` collection, which refers to the
496
-
[Common Archive Observation Model](https://www.ivoa.net/documents/CAOM/20240927/WD-CAOM-2.5-20240927.pdf), a data model used to
498
+
`Common Archive Observation Model<https://www.ivoa.net/documents/CAOM/20240927/WD-CAOM-2.5-20240927.pdf>`_, a data model used to
497
499
describe astronomical observations. We'll query the ``obspointing`` catalog, which contains metadata about scientific observations at MAST.
498
500
We'll perform a query to count the number of observations that are within 0.2 degrees of the exoplanet
499
-
[WASP-12b](https://science.nasa.gov/exoplanet-catalog/wasp-12-b/). You'll notice that this query takes several seconds to complete.
501
+
`WASP-12b<https://science.nasa.gov/exoplanet-catalog/wasp-12-b/>`_. You'll notice that this query takes several seconds to complete.
500
502
The ``obspointing`` catalog is huge, and if you were to run the same query without the ``count_only`` parameter, it would typically take
501
503
longer to return the full results, especially if there are many matching sources.
0 commit comments