Exploring the contents of HEASARC catalogs using Python#

Learning Goals#

This notebook will teach you:

  • How to retrieve and explore a HEASARC catalog’s column names, descriptions, and units.

  • How to retrieve the entire contents of a HEASARC catalog.

  • How to retrieve a subset of a HEASARC catalog with easy-to-use Astroquery features.

Introduction#

This bite-sized tutorial will show you how to retrieve and explore the contents of HEASARC catalogs in Python.

To learn how to use Python to search for a particular HEASARC catalog, please see the ‘Find specific HEASARC catalogs using Python’ tutorial.

Runtime#

As of 16th March 2026, this notebook takes ~30 s to run to completion on Fornax using the ‘small’ server with 8GB RAM/ 2 cores.

Imports#

This notebook uses features from an Astroquery pre-release. You will need to install the latest version using the command below. We will remove this once Astroquery v0.4.12 is officially released.

%pip install --pre astroquery --upgrade

Hide code cell output

Requirement already satisfied: astroquery in /opt/envs/heasoft/lib/python3.12/site-packages (0.4.11)
Collecting astroquery
  Downloading astroquery-0.4.12.dev10525-py3-none-any.whl.metadata (6.5 kB)
Requirement already satisfied: numpy>=1.20 in /opt/envs/heasoft/lib/python3.12/site-packages (from astroquery) (2.4.2)
Requirement already satisfied: astropy>=5.0 in /opt/envs/heasoft/lib/python3.12/site-packages (from astroquery) (7.2.0)
Requirement already satisfied: requests>=2.19 in /opt/envs/heasoft/lib/python3.12/site-packages (from astroquery) (2.32.5)
Requirement already satisfied: beautifulsoup4>=4.8 in /opt/envs/heasoft/lib/python3.12/site-packages (from astroquery) (4.14.3)
Requirement already satisfied: html5lib>=0.999 in /opt/envs/heasoft/lib/python3.12/site-packages (from astroquery) (1.1)
Requirement already satisfied: keyring>=15.0 in /opt/envs/heasoft/lib/python3.12/site-packages (from astroquery) (25.7.0)
Requirement already satisfied: pyvo>=1.5 in /opt/envs/heasoft/lib/python3.12/site-packages (from astroquery) (1.8.1)
Requirement already satisfied: pyerfa>=2.0.1.1 in /opt/envs/heasoft/lib/python3.12/site-packages (from astropy>=5.0->astroquery) (2.0.1.5)
Requirement already satisfied: astropy-iers-data>=0.2025.10.27.0.39.10 in /opt/envs/heasoft/lib/python3.12/site-packages (from astropy>=5.0->astroquery) (0.2026.2.23.0.48.33)
Requirement already satisfied: PyYAML>=6.0.0 in /opt/envs/heasoft/lib/python3.12/site-packages (from astropy>=5.0->astroquery) (6.0.3)
Requirement already satisfied: packaging>=22.0.0 in /opt/envs/heasoft/lib/python3.12/site-packages (from astropy>=5.0->astroquery) (26.0)
Requirement already satisfied: soupsieve>=1.6.1 in /opt/envs/heasoft/lib/python3.12/site-packages (from beautifulsoup4>=4.8->astroquery) (2.8.3)
Requirement already satisfied: typing-extensions>=4.0.0 in /opt/envs/heasoft/lib/python3.12/site-packages (from beautifulsoup4>=4.8->astroquery) (4.15.0)
Requirement already satisfied: six>=1.9 in /opt/envs/heasoft/lib/python3.12/site-packages (from html5lib>=0.999->astroquery) (1.17.0)
Requirement already satisfied: webencodings in /opt/envs/heasoft/lib/python3.12/site-packages (from html5lib>=0.999->astroquery) (0.5.1)
Requirement already satisfied: SecretStorage>=3.2 in /opt/envs/heasoft/lib/python3.12/site-packages (from keyring>=15.0->astroquery) (3.5.0)
Requirement already satisfied: jeepney>=0.4.2 in /opt/envs/heasoft/lib/python3.12/site-packages (from keyring>=15.0->astroquery) (0.9.0)
Requirement already satisfied: jaraco.classes in /opt/envs/heasoft/lib/python3.12/site-packages (from keyring>=15.0->astroquery) (3.4.0)
Requirement already satisfied: jaraco.functools in /opt/envs/heasoft/lib/python3.12/site-packages (from keyring>=15.0->astroquery) (4.4.0)
Requirement already satisfied: jaraco.context in /opt/envs/heasoft/lib/python3.12/site-packages (from keyring>=15.0->astroquery) (6.1.0)
Requirement already satisfied: charset_normalizer<4,>=2 in /opt/envs/heasoft/lib/python3.12/site-packages (from requests>=2.19->astroquery) (3.4.4)
Requirement already satisfied: idna<4,>=2.5 in /opt/envs/heasoft/lib/python3.12/site-packages (from requests>=2.19->astroquery) (3.11)
Requirement already satisfied: urllib3<3,>=1.21.1 in /opt/envs/heasoft/lib/python3.12/site-packages (from requests>=2.19->astroquery) (2.6.3)
Requirement already satisfied: certifi>=2017.4.17 in /opt/envs/heasoft/lib/python3.12/site-packages (from requests>=2.19->astroquery) (2026.1.4)
Requirement already satisfied: cryptography>=2.0 in /opt/envs/heasoft/lib/python3.12/site-packages (from SecretStorage>=3.2->keyring>=15.0->astroquery) (46.0.5)
Requirement already satisfied: cffi>=2.0.0 in /opt/envs/heasoft/lib/python3.12/site-packages (from cryptography>=2.0->SecretStorage>=3.2->keyring>=15.0->astroquery) (2.0.0)
Requirement already satisfied: pycparser in /opt/envs/heasoft/lib/python3.12/site-packages (from cffi>=2.0.0->cryptography>=2.0->SecretStorage>=3.2->keyring>=15.0->astroquery) (3.0)
Requirement already satisfied: more-itertools in /opt/envs/heasoft/lib/python3.12/site-packages (from jaraco.classes->keyring>=15.0->astroquery) (10.8.0)
Downloading astroquery-0.4.12.dev10525-py3-none-any.whl (11.2 MB)
?25l   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 0.0/11.2 MB ? eta -:--:--
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 11.2/11.2 MB 56.4 MB/s  0:00:00
?25h
Installing collected packages: astroquery
  Attempting uninstall: astroquery
    Found existing installation: astroquery 0.4.11
    Uninstalling astroquery-0.4.11:
      Successfully uninstalled astroquery-0.4.11
Successfully installed astroquery-0.4.12.dev10525
Note: you may need to restart the kernel to use updated packages.
Collecting astroquery
  Downloading astroquery-0.4.12.dev10525-py3-none-any.whl.metadata (6.5 kB)
Requirement already satisfied: numpy>=1.20 in /opt/envs/heasoft/lib/python3.12/site-packages (from astroquery) (2.4.2)
Requirement already satisfied: astropy>=5.0 in /opt/envs/heasoft/lib/python3.12/site-packages (from astroquery) (7.2.0)
Requirement already satisfied: requests>=2.19 in /opt/envs/heasoft/lib/python3.12/site-packages (from astroquery) (2.32.5)
Requirement already satisfied: beautifulsoup4>=4.8 in /opt/envs/heasoft/lib/python3.12/site-packages (from astroquery) (4.14.3)
Requirement already satisfied: html5lib>=0.999 in /opt/envs/heasoft/lib/python3.12/site-packages (from astroquery) (1.1)
Requirement already satisfied: keyring>=15.0 in /opt/envs/heasoft/lib/python3.12/site-packages (from astroquery) (25.7.0)
Requirement already satisfied: pyvo>=1.5 in /opt/envs/heasoft/lib/python3.12/site-packages (from astroquery) (1.8.1)
Requirement already satisfied: pyerfa>=2.0.1.1 in /opt/envs/heasoft/lib/python3.12/site-packages (from astropy>=5.0->astroquery) (2.0.1.5)
Requirement already satisfied: astropy-iers-data>=0.2025.10.27.0.39.10 in /opt/envs/heasoft/lib/python3.12/site-packages (from astropy>=5.0->astroquery) (0.2026.2.23.0.48.33)
Requirement already satisfied: PyYAML>=6.0.0 in /opt/envs/heasoft/lib/python3.12/site-packages (from astropy>=5.0->astroquery) (6.0.3)
Requirement already satisfied: packaging>=22.0.0 in /opt/envs/heasoft/lib/python3.12/site-packages (from astropy>=5.0->astroquery) (26.0)
Requirement already satisfied: soupsieve>=1.6.1 in /opt/envs/heasoft/lib/python3.12/site-packages (from beautifulsoup4>=4.8->astroquery) (2.8.3)
Requirement already satisfied: typing-extensions>=4.0.0 in /opt/envs/heasoft/lib/python3.12/site-packages (from beautifulsoup4>=4.8->astroquery) (4.15.0)
Requirement already satisfied: six>=1.9 in /opt/envs/heasoft/lib/python3.12/site-packages (from html5lib>=0.999->astroquery) (1.17.0)
Requirement already satisfied: webencodings in /opt/envs/heasoft/lib/python3.12/site-packages (from html5lib>=0.999->astroquery) (0.5.1)
Requirement already satisfied: SecretStorage>=3.2 in /opt/envs/heasoft/lib/python3.12/site-packages (from keyring>=15.0->astroquery) (3.5.0)
Requirement already satisfied: jeepney>=0.4.2 in /opt/envs/heasoft/lib/python3.12/site-packages (from keyring>=15.0->astroquery) (0.9.0)
Requirement already satisfied: jaraco.classes in /opt/envs/heasoft/lib/python3.12/site-packages (from keyring>=15.0->astroquery) (3.4.0)
Requirement already satisfied: jaraco.functools in /opt/envs/heasoft/lib/python3.12/site-packages (from keyring>=15.0->astroquery) (4.4.0)
Requirement already satisfied: jaraco.context in /opt/envs/heasoft/lib/python3.12/site-packages (from keyring>=15.0->astroquery) (6.1.0)
Requirement already satisfied: charset_normalizer<4,>=2 in /opt/envs/heasoft/lib/python3.12/site-packages (from requests>=2.19->astroquery) (3.4.4)
Requirement already satisfied: idna<4,>=2.5 in /opt/envs/heasoft/lib/python3.12/site-packages (from requests>=2.19->astroquery) (3.11)
Requirement already satisfied: urllib3<3,>=1.21.1 in /opt/envs/heasoft/lib/python3.12/site-packages (from requests>=2.19->astroquery) (2.6.3)
Requirement already satisfied: certifi>=2017.4.17 in /opt/envs/heasoft/lib/python3.12/site-packages (from requests>=2.19->astroquery) (2026.1.4)
Requirement already satisfied: cryptography>=2.0 in /opt/envs/heasoft/lib/python3.12/site-packages (from SecretStorage>=3.2->keyring>=15.0->astroquery) (46.0.5)
Requirement already satisfied: cffi>=2.0.0 in /opt/envs/heasoft/lib/python3.12/site-packages (from cryptography>=2.0->SecretStorage>=3.2->keyring>=15.0->astroquery) (2.0.0)
Requirement already satisfied: pycparser in /opt/envs/heasoft/lib/python3.12/site-packages (from cffi>=2.0.0->cryptography>=2.0->SecretStorage>=3.2->keyring>=15.0->astroquery) (3.0)
Requirement already satisfied: more-itertools in /opt/envs/heasoft/lib/python3.12/site-packages (from jaraco.classes->keyring>=15.0->astroquery) (10.8.0)
Downloading astroquery-0.4.12.dev10525-py3-none-any.whl (11.2 MB)
?25l   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 0.0/11.2 MB ? eta -:--:--
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 11.2/11.2 MB 56.4 MB/s  0:00:00
?25h
Installing collected packages: astroquery
  Attempting uninstall: astroquery
    Found existing installation: astroquery 0.4.11
    Uninstalling astroquery-0.4.11:
      Successfully uninstalled astroquery-0.4.11
Successfully installed astroquery-0.4.12.dev10525
Note: you may need to restart the kernel to use updated packages.
from astroquery.heasarc import Heasarc

1. Listing a HEASARC catalog’s columns#

For this demonstration, we’re assuming that you already have a HEASARC-hosted catalog in mind; if not, you might find the ‘Find specific HEASARC catalogs using Python’ tutorial useful.

We will use the Archive of Chandra Cluster Entropy Profile Tables (ACCEPT) catalog (Cavagnolo K. W. et al. 2009) as an example.

The best way to get an idea of a catalog’s contents is to list the column names and descriptions. We can do this using the Heasarc.list_columns(...) method, passing the name of the catalog as the first argument.

Each HEASARC catalog has a subset of ‘standard’ columns that will be returned by default, which is why the table below contains only a few column names, descriptions, and units even though this catalog has 79 columns:

# We pass the name of the catalog as the first argument
Heasarc.list_columns("acceptcat")
Table length=11
namedescriptionunit
str15str80str6
raRight Ascensiondegree
nameCluster Designation
chi_squared_1Chi-Squared of Best-Fit Model
alpha_1Best-Fit Power-Law Index
num_radial_binsNumber of Radial Bins in Fit
alpha_1_errorUncertainty in Best-Fit Power-Law Index
fit_method_1Method of T_X Interpolation in Inner Region: flat or extr (Linear Extrapolation)
redshiftRedshift
dof_1Degrees of Freedom in Fit
ktAverage Cluster TemperaturekeV
decDeclinationdegree

If, as is likely, you want to examine the full set of columns, you can pass the full=True argument:

# Pass an additional argument to ensure all columns are returned
all_accept_cols = Heasarc.list_columns("acceptcat", full=True)
all_accept_cols
Table length=79
namedescriptionunit
str23str80str8
fit_method_4Method of T_X Interpolation in Inner Region: flat or extr (Linear Extrapolation)
raRight Ascensiondegree
bf_core_entropy_2Best-Fit Core Entropy, K_0keV.cm^2
exposure_obsid_3Exposure Time for Chandra Observation 3s
nameCluster Designation
biiGalactic Latitudedegree
bf_100k_entropy_4Best-Fit Entropy at 100 kpckeV.cm^2
exposure_obsid_2Exposure Time for Chandra Observation 2s
center_ccd_obsid_2CCD Location of Cluster Center in Chandra Observation 2
.........
dof_4Degrees of Freedom in Fit
num_sigma_k0_gt_0_2Number of Sigma Best-Fit Core Entropy Is Away from Zero
dof_3Degrees of Freedom in Fit
chi_squared_4Chi-Squared of Best-Fit Model
obsid_5Chandra Observation Identifier 5
p_value_4Probability of Worse Fit Given Chi-Squared and DOF
alpha_4Best-Fit Power-Law Index
bf_core_entropy_2_errorUncertainty in Best-Fit Core Entropy, K_0keV.cm^2
obsid_1Chandra Observation Identifier 1
center_ccd_obsid_4CCD Location of Cluster Center in Chandra Observation 4

If you examine the output of the above cell, you’ll notice that only part of the table has been displayed; this is a common behavior when displaying long tables in Jupyter notebooks, across multiple modules (e.g., Astropy, Pandas, etc.), as ‘printing’ many lines can dramatically affect Jupyter’s performance.

On the other hand, a table like this isn’t going to destroy your computer, so we can safely sidestep this issue by using the pprint_all() method of the list_columns() output (an Astropy Table object, more on them in Section 4):

# The 'pprint' stands for 'pretty print'
all_accept_cols.pprint_all()
          name                                            description                                      unit  
----------------------- -------------------------------------------------------------------------------- --------
           fit_method_4 Method of T_X Interpolation in Inner Region: flat or extr (Linear Extrapolation)         
                     ra                                                                  Right Ascension   degree
      bf_core_entropy_2                                                       Best-Fit Core Entropy, K_0 keV.cm^2
       exposure_obsid_3                                          Exposure Time for Chandra Observation 3        s
                   name                                                              Cluster Designation         
                    bii                                                                Galactic Latitude   degree
      bf_100k_entropy_4                                                      Best-Fit Entropy at 100 kpc keV.cm^2
       exposure_obsid_2                                          Exposure Time for Chandra Observation 2        s
     center_ccd_obsid_2                          CCD Location of Cluster Center in Chandra Observation 2         
          alpha_4_error                                          Uncertainty in Best-Fit Power-Law Index         
bf_100k_entropy_3_error                                       Uncertainty in Best-Fit Entropy at 100 kpc keV.cm^2
          chi_squared_1                                                    Chi-Squared of Best-Fit Model         
                "__row"                                                              System index column         
bf_core_entropy_1_error                                        Uncertainty in Best-Fit Core Entropy, K_0 keV.cm^2
       exposure_obsid_5                                          Exposure Time for Chandra Observation 5        s
       exposure_obsid_4                                          Exposure Time for Chandra Observation 4        s
                obsid_7                                                 Chandra Observation Identifier 7         
              p_value_1                               Probability of Worse Fit Given Chi-Squared and DOF         
     center_ccd_obsid_1                          CCD Location of Cluster Center in Chandra Observation 1         
           fit_method_3 Method of T_X Interpolation in Inner Region: flat or extr (Linear Extrapolation)         
           "__z_ra_dec"                                                        System unit vector column         
    num_sigma_k0_gt_0_3                          Number of Sigma Best-Fit Core Entropy Is Away from Zero         
      bf_core_entropy_3                                                       Best-Fit Core Entropy, K_0 keV.cm^2
           "__x_ra_dec"                                                        System unit vector column         
     center_ccd_obsid_5                          CCD Location of Cluster Center in Chandra Observation 5         
     center_ccd_obsid_3                          CCD Location of Cluster Center in Chandra Observation 3         
      bf_100k_entropy_3                                                      Best-Fit Entropy at 100 kpc keV.cm^2
    num_sigma_k0_gt_0_4                          Number of Sigma Best-Fit Core Entropy Is Away from Zero         
                alpha_1                                                         Best-Fit Power-Law Index         
                    lii                                                               Galactic Longitude   degree
    num_sigma_k0_gt_0_1                          Number of Sigma Best-Fit Core Entropy Is Away from Zero         
                alpha_2                                                         Best-Fit Power-Law Index         
        num_radial_bins                                                     Number of Radial Bins in Fit         
                obsid_6                                                 Chandra Observation Identifier 6         
          alpha_2_error                                          Uncertainty in Best-Fit Power-Law Index         
     center_ccd_obsid_7                          CCD Location of Cluster Center in Chandra Observation 7         
bf_core_entropy_4_error                                        Uncertainty in Best-Fit Core Entropy, K_0 keV.cm^2
     center_ccd_obsid_6                          CCD Location of Cluster Center in Chandra Observation 6         
           "__y_ra_dec"                                                        System unit vector column         
                obsid_4                                                 Chandra Observation Identifier 4         
bf_100k_entropy_1_error                                       Uncertainty in Best-Fit Entropy at 100 kpc keV.cm^2
bf_core_entropy_3_error                                        Uncertainty in Best-Fit Core Entropy, K_0 keV.cm^2
      bf_100k_entropy_2                                                      Best-Fit Entropy at 100 kpc keV.cm^2
          alpha_3_error                                          Uncertainty in Best-Fit Power-Law Index         
                  notes                                                                 Assigned Note(s)         
          alpha_1_error                                          Uncertainty in Best-Fit Power-Law Index         
              p_value_2                               Probability of Worse Fit Given Chi-Squared and DOF         
bf_100k_entropy_4_error                                       Uncertainty in Best-Fit Entropy at 100 kpc keV.cm^2
           fit_method_1 Method of T_X Interpolation in Inner Region: flat or extr (Linear Extrapolation)         
              p_value_3                               Probability of Worse Fit Given Chi-Squared and DOF         
                obsid_2                                                 Chandra Observation Identifier 2         
                obsid_3                                                 Chandra Observation Identifier 3         
               redshift                                                                         Redshift         
                  dof_1                                                        Degrees of Freedom in Fit         
      bf_100k_entropy_1                                                      Best-Fit Entropy at 100 kpc keV.cm^2
                  dof_2                                                        Degrees of Freedom in Fit         
      bf_core_entropy_4                                                       Best-Fit Core Entropy, K_0 keV.cm^2
          chi_squared_2                                                    Chi-Squared of Best-Fit Model         
                     kt                                                      Average Cluster Temperature      keV
                    dec                                                                      Declination   degree
bf_100k_entropy_2_error                                       Uncertainty in Best-Fit Entropy at 100 kpc keV.cm^2
           fit_method_2 Method of T_X Interpolation in Inner Region: flat or extr (Linear Extrapolation)         
       exposure_obsid_7                                          Exposure Time for Chandra Observation 7        s
                alpha_3                                                         Best-Fit Power-Law Index         
       exposure_obsid_1                                          Exposure Time for Chandra Observation 1        s
      bf_core_entropy_1                                                       Best-Fit Core Entropy, K_0 keV.cm^2
         max_fit_radius                                                           Maximum Radius for Fit      Mpc
          chi_squared_3                                                    Chi-Squared of Best-Fit Model         
       exposure_obsid_6                                          Exposure Time for Chandra Observation 6        s
                  dof_4                                                        Degrees of Freedom in Fit         
    num_sigma_k0_gt_0_2                          Number of Sigma Best-Fit Core Entropy Is Away from Zero         
                  dof_3                                                        Degrees of Freedom in Fit         
          chi_squared_4                                                    Chi-Squared of Best-Fit Model         
                obsid_5                                                 Chandra Observation Identifier 5         
              p_value_4                               Probability of Worse Fit Given Chi-Squared and DOF         
                alpha_4                                                         Best-Fit Power-Law Index         
bf_core_entropy_2_error                                        Uncertainty in Best-Fit Core Entropy, K_0 keV.cm^2
                obsid_1                                                 Chandra Observation Identifier 1         
     center_ccd_obsid_4                          CCD Location of Cluster Center in Chandra Observation 4

2. Retrieving the entire contents of a HEASARC catalog#

The simplest use case of a HEASARC catalog is that you want to retrieve the entire table.

We can easily fetch the entire catalog using Astroquery functions, but before we do, we should check how many rows there are - we want to know what we’re getting into with respect to the size of the table.

Counting the rows in a HEASARC catalog involves writing a very simple ‘Astronomical Data Query Language’ (ADQL) query.

ADQL is a cousin of the extremely popular ‘Structured Query Language’ (SQL) that has been used for database management in industry for many years; the syntax is similar, but with additions specific to astronomical searches.

We use the COUNT(*) function to return the number of rows in a table:

# Send query designed to count the rows of a catalog
accept_nrow_res = Heasarc.query_tap("SELECT COUNT(*) FROM acceptcat")

# Store the integer number of rows in a variable
accept_nrows = accept_nrow_res["count"][0]

# Visualize the returned table
accept_nrow_res
<DALResultsTable length=1>
count
int64
-----
  240

From the output above, we can see that there are ‘only’ 240 rows in the catalog; combine that information with the number of columns (which we explored in Section 1), and you get a sense of the table’s scale.

As the ACCEPT catalog is quite small (relatively speaking), we can retrieve the whole table without worrying about download time or memory issues.

See also

A general tutorial on the many uses and features of ADQL is out of the scope of this bite-sized demonstration. Various resources for learning ADQL are available online, such as this short course (Demleitner M. and Heinl H. 2024), or the NASA Astronomical Virtual Observatories (NAVO) catalog queries tutorial.

On the other hand, HEASARC hosts much larger catalogs than ACCEPT. The Chandra Source Catalog 2 (CSC 2; Evans I. N. et al. 2024), for instance:

# Same again, but CSC
Heasarc.query_tap("SELECT COUNT(*) FROM csc")
<DALResultsTable length=1>
count 
int64 
------
407806

Warning

For large catalogs like the CSC, we do not recommend retrieving the entire table at once.

Finally, now we know that retrieving the entire ACCEPT catalog is reasonable, we can use the query_region(...) method of Heasarc to do just that. Few arguments are required:

  • catalog="acceptcat" - specifies the name of the catalog table to retrieve.

  • spatial="all-sky" - overrides query_region’s default behavior of searching a catalog around a given coordinate, and instead considers the entire catalog.

  • columns="*" - specifies that all columns should be returned (otherwise you will get a small subset, as discussed in Section 1.

accept_cat = Heasarc.query_region(catalog="acceptcat", spatial="all-sky", columns="*")
accept_cat
Table length=240
__rownameobsid_1radecliibiiexposure_obsid_1center_ccd_obsid_1redshiftktnotesobsid_2exposure_obsid_2center_ccd_obsid_2obsid_3exposure_obsid_3center_ccd_obsid_3obsid_4exposure_obsid_4center_ccd_obsid_4obsid_5exposure_obsid_5center_ccd_obsid_5obsid_6exposure_obsid_6center_ccd_obsid_6obsid_7exposure_obsid_7center_ccd_obsid_7fit_method_1num_radial_binsmax_fit_radiusbf_core_entropy_1bf_core_entropy_1_errornum_sigma_k0_gt_0_1bf_100k_entropy_1bf_100k_entropy_1_erroralpha_1alpha_1_errordof_1chi_squared_1p_value_1fit_method_2bf_core_entropy_2bf_core_entropy_2_errornum_sigma_k0_gt_0_2bf_100k_entropy_2bf_100k_entropy_2_erroralpha_2alpha_2_errordof_2chi_squared_2p_value_2fit_method_3bf_core_entropy_3bf_core_entropy_3_errornum_sigma_k0_gt_0_3bf_100k_entropy_3bf_100k_entropy_3_erroralpha_3alpha_3_errordof_3chi_squared_3p_value_3fit_method_4bf_core_entropy_4bf_core_entropy_4_errornum_sigma_k0_gt_0_4bf_100k_entropy_4bf_100k_entropy_4_erroralpha_4alpha_4_errordof_4chi_squared_4p_value_4__x_ra_dec__y_ra_dec__z_ra_dec
degdegdegdegskeVssssssMpccm2 keVcm2 keVcm2 keVcm2 keVcm2 keVcm2 keVcm2 keVcm2 keVcm2 keVcm2 keVcm2 keVcm2 keVcm2 keVcm2 keVcm2 keVcm2 keV
objectobjectint32float64float64float64float64float64objectfloat64float64objectint32float64objectint32float64objectint32float64objectint32float64objectint32float64objectint32float64objectobjectint16float64float64float64float64float64float64float64float64int16float64objectobjectfloat64float64float64float64float64float64float64int16float64objectobjectfloat64float64float64float64float64float64float64int16float64objectobjectfloat64float64float64float64float64float64float64int16float64objectfloat64float64float64
1RX J1539.5-83358266234.885354-83.589953307.565227-22.2917848000I30.07284.29------------------------extr290.2021.83.107.1115.15.81.320.112613.299.81e-01extr0.0----135.34.50.830.042740.394.71e-02flat25.92.909.1110.05.81.410.122613.529.79e-01flat0.0----133.74.50.790.042754.081.49e-03-0.0913244357272992-0.0642187695832523-0.993748357016153
2Abell S0405827257.886729-82.219497296.413320-32.4756657900I30.06134.11------------------------extr340.2023.521.001.1261.122.10.520.10318.241.00e+00extr0.0----281.911.30.430.03329.161.00e+00flat16.927.900.6274.227.30.450.10319.791.00e+00flat0.0----289.311.20.400.023210.101.00e+000.1146653634588830.0719664620044419-0.990793965852339
3Abell 39214973342.490954-64.428381321.953076-47.96731429400I30.09275.69------------------------extr470.40101.217.905.7151.523.00.860.11447.551.00e+00extr0.0----272.46.80.480.034522.089.98e-01flat101.217.905.7151.523.00.860.11447.551.00e+00flat0.0----272.46.80.480.034522.089.98e-01-0.1298613380630870.411640921482359-0.902046442616797
4Abell 326689967.805433-61.453497272.147700-40.15221029800I10.05909.07------------------------extr150.0863.741.901.5405.351.60.710.27120.791.00e+00extr0.0----418.937.80.440.06132.021.00e+00flat72.549.701.5376.748.00.640.28121.261.00e+00flat0.0----404.635.20.390.05132.341.00e+000.4424646321768390.180517527128831-0.878429548496581
5Abell 38277920330.471667-59.945289332.231736-46.37668245600S30.09848.05------------------------extr670.60144.613.4010.8113.115.21.230.10641651.916.60e-303extr0.0----287.27.40.600.03654867.530.00e+00flat164.612.5013.294.813.71.340.10641368.566.59e-244flat0.0----293.57.30.570.03655896.480.00e+00-0.2468344068244820.435775388415954-0.865547564526947
6Abell 38228269328.517513-57.867419335.580522-46.4421608100I30.07594.89e------------------------extr420.30108.776.401.4200.390.80.660.33393.241.00e+00extr0.0----322.516.60.380.07403.951.00e+00flat108.776.401.4200.390.80.660.33393.241.00e+00flat0.0----322.516.60.380.07403.951.00e+00-0.2777680144011180.453587341772272-0.846819610991399
7Abell 36675751303.171796-56.843250340.847529-33.415921128900I30.05566.51575260400I35753103600I388950300I2------------extr560.30149.317.208.7121.918.60.720.095321.141.00e+00extr0.0----278.72.30.340.015444.438.20e-01flat160.415.5010.4110.616.80.780.105322.841.00e+00flat0.0----279.52.30.330.015452.835.19e-01-0.4578000691628150.299254219489207-0.837177405806217
81E0657 563184104.623446-55.944386266.021486-21.25002887500I30.296011.64535697200I2536182600I3----------------extr481.00299.419.6015.320.57.01.840.164542.095.96e-01extr0.0----277.914.50.600.0446146.182.31e-12flat307.519.3015.918.66.51.880.174542.875.63e-01flat0.0----283.614.60.580.0446157.034.77e-140.541856754546199-0.141379913860058-0.828494404030337
9Abell 3395494496.701929-54.549781263.315160-25.26599921900I30.05105.13a,e------------------------extr240.12213.326.208.2133.530.41.580.79210.001.00e+00extr0.0----325.514.40.230.05225.731.00e+00flat247.225.209.8105.929.81.651.01210.011.00e+00flat0.0----332.814.00.160.05224.491.00e+000.576032134193855-0.0676878866481252-0.814619745879747
.............................................................................................................................................................................................................................................
232Abell 6653586127.74677565.838906149.78086234.70411029700I30.18107.45------------------------extr460.70134.623.505.7106.325.11.060.13433.791.00e+00extr0.0----254.810.10.610.044419.719.99e-01flat134.623.505.7106.325.11.060.13433.791.00e+00flat0.0----254.810.10.610.044419.719.99e-010.323646179067386-0.2505645092640460.912398255956438
233Abell 22181666248.96179666.21175397.74159338.13043148600I00.17137.35------------------------extr420.60288.620.0014.410.77.12.350.41394.831.00e+00extr0.0----294.514.70.410.054039.784.80e-01flat288.620.0014.410.77.12.350.41394.831.00e+00flat0.0----294.514.70.410.054039.784.80e-01-0.376470298518891-0.1448014968222260.915042425711038
234Abell 21252207235.30897566.265889101.13479642.97931581500I30.24652.88a------------------------extr100.20225.232.007.032.941.21.351.7370.061.00e+00extr0.0----264.511.50.100.0581.069.98e-01flat225.232.007.032.941.21.351.7370.061.00e+00flat0.0----264.511.50.100.0581.069.98e-01-0.330942982823881-0.2290790984765830.915423130995054
235Abell 5626936103.33968369.330886145.93595025.42104851500S30.11003.04e------------------------extr270.27202.139.305.134.645.31.091.19241.661.00e+00extr0.0----244.49.70.130.06252.411.00e+00flat202.139.305.134.645.31.091.19241.661.00e+00flat0.0----244.49.70.130.06252.411.00e+000.343447138085492-0.08143866982953990.935634440578841
236RX J0647.7+70153196101.95845470.247128144.84522825.11417119300I30.58409.07358420000I3--------------------extr240.80225.147.104.848.831.91.700.39210.421.00e+00extr0.0----275.632.00.710.10229.729.89e-01flat225.147.104.848.831.91.700.39210.421.00e+00flat0.0----275.632.00.710.10229.729.89e-010.330629440642765-0.07002692077433480.941159074411503
237MS J0735.6+74214197115.43435474.243953140.64897429.43698245500S30.21605.55------------------------extr180.3013.82.206.3109.94.61.120.051522.061.06e-01extr0.0----131.32.70.890.021660.723.95e-07flat16.02.107.5106.84.61.140.051525.594.26e-02flat0.0----131.52.70.870.021677.933.92e-100.245223617784179-0.1166209721166510.962426582209472
238RBS 7972202146.80288776.387056135.03160936.05310111700I30.35407.68d790238300S3--------------------extr240.3020.02.408.395.29.01.720.142189.641.86e-10extr0.0----116.28.00.980.06221061.581.51e-210flat20.92.408.993.29.11.750.1521104.704.22e-13flat0.0----114.68.00.960.06221188.561.25e-2370.128865483355103-0.1969487621872850.971907851739326
239Abell 22561386255.93569678.636531111.00715831.76573112400I30.05796.90a------------------------extr630.35349.611.6030.27.07.62.540.93602.241.00e+00extr0.0----378.46.90.080.026121.601.00e+00flat349.611.6030.27.07.62.540.93602.241.00e+00flat0.0----378.46.90.080.026121.601.00e+00-0.191125981636053-0.04788096212517590.98039699745033
240Abell 22943246261.04228785.886047118.58182228.58994610000I30.17809.98------------------------extr220.32128.552.002.5246.775.61.040.32190.601.00e+00extr0.0----409.828.70.570.09203.671.00e+00flat156.352.703.0235.776.31.030.33190.831.00e+00flat0.0----428.828.60.490.08204.231.00e+00-0.0708653619468596-0.01117036229001290.997423342158409

3. Retrieving a subset of a HEASARC catalog#

If you aren’t interested in the entire catalog, then we can also use Astroquery to impose some restrictions on the rows we retrieve, based on the values of certain columns.

For example, perhaps we’re only interested in galaxy clusters with a \(z>0.4\). We saw in Section 1 that the ACCEPT catalog includes a column called redshift, we can use that to filter the rows we retrieve.

The query_region(...) call below will return all columns (columns="*"), and all rows where the value of the redshift column is greater than 0.4 (column_filters={"redshift": (">", "0.4")}):

accept_cat_higherz = Heasarc.query_region(
    catalog="acceptcat",
    spatial="all-sky",
    column_filters={"redshift": (">", "0.4")},
    columns="*",
)
accept_cat_higherz
Table length=20
__rownameobsid_1radecliibiiexposure_obsid_1center_ccd_obsid_1redshiftktnotesobsid_2exposure_obsid_2center_ccd_obsid_2obsid_3exposure_obsid_3center_ccd_obsid_3obsid_4exposure_obsid_4center_ccd_obsid_4obsid_5exposure_obsid_5center_ccd_obsid_5obsid_6exposure_obsid_6center_ccd_obsid_6obsid_7exposure_obsid_7center_ccd_obsid_7fit_method_1num_radial_binsmax_fit_radiusbf_core_entropy_1bf_core_entropy_1_errornum_sigma_k0_gt_0_1bf_100k_entropy_1bf_100k_entropy_1_erroralpha_1alpha_1_errordof_1chi_squared_1p_value_1fit_method_2bf_core_entropy_2bf_core_entropy_2_errornum_sigma_k0_gt_0_2bf_100k_entropy_2bf_100k_entropy_2_erroralpha_2alpha_2_errordof_2chi_squared_2p_value_2fit_method_3bf_core_entropy_3bf_core_entropy_3_errornum_sigma_k0_gt_0_3bf_100k_entropy_3bf_100k_entropy_3_erroralpha_3alpha_3_errordof_3chi_squared_3p_value_3fit_method_4bf_core_entropy_4bf_core_entropy_4_errornum_sigma_k0_gt_0_4bf_100k_entropy_4bf_100k_entropy_4_erroralpha_4alpha_4_errordof_4chi_squared_4p_value_4__x_ra_dec__y_ra_dec__z_ra_dec
degdegdegdegskeVssssssMpccm2 keVcm2 keVcm2 keVcm2 keVcm2 keVcm2 keVcm2 keVcm2 keVcm2 keVcm2 keVcm2 keVcm2 keVcm2 keVcm2 keVcm2 keVcm2 keV
objectobjectint32float64float64float64float64float64objectfloat64float64objectint32float64objectint32float64objectint32float64objectint32float64objectint32float64objectint32float64objectobjectint16float64float64float64float64float64float64float64float64int16float64objectobjectfloat64float64float64float64float64float64float64int16float64objectobjectfloat64float64float64float64float64float64float64int16float64objectobjectfloat64float64float64float64float64float64float64int16float64objectfloat64float64float64
50MACS J0257.1-2325165444.288042-23.434958212.568244-61.41691619800I30.505310.50358118500I3--------------------extr130.40234.568.203.4195.8107.31.390.57100.241.00e+00extr0.0----489.150.90.470.12113.079.90e-01flat234.568.203.4195.8107.31.390.57100.241.00e+00flat0.0----489.150.90.470.12113.079.90e-010.6406674367975260.656790501024463-0.397707773611885
70MACS J2214.9-13593259333.739446-14.00259744.732830-51.28719019500I30.50268.80501118500I3--------------------extr130.40238.688.302.7203.6152.61.380.66100.081.00e+00extr0.0----507.670.90.520.16112.259.97e-01flat297.783.203.6172.0147.71.460.76100.101.00e+00flat0.0----534.073.00.400.14112.629.95e-01-0.4293062671425180.870142886221827-0.241965878895571
81MACS J0417.5-1154327064.394525-11.909086205.946190-39.47825912000I30.440011.07------------------------extr110.309.56.701.4101.614.81.520.2280.889.99e-01extr0.0----117.29.21.290.1392.519.81e-01flat27.17.303.799.715.11.420.2381.169.97e-01flat0.0----136.19.40.850.0897.226.14e-010.8823813247169550.422869972297137-0.206359357239186
82RX J1347.5-11453592206.877471-11.752792324.03735348.80761357700I30.451010.8850710000S3--------------------extr80.2212.520.700.6179.935.31.060.3454.005.49e-01extr0.0----196.418.30.900.0864.236.46e-01flat12.520.700.6179.935.31.060.3454.005.49e-01flat0.0----196.418.30.900.0864.236.46e-01-0.442606319178165-0.873275588033894-0.203689453746662
88MACS J0159.8-0849326529.956054-8.833583167.589086-65.58744917900I30.40509.59610635300I3--------------------extr150.4011.94.003.0133.710.01.250.08122.479.98e-01extr0.0----155.75.81.060.04139.447.39e-01flat18.83.705.0123.99.91.310.09123.689.89e-01flat0.0----158.35.91.010.041321.087.13e-020.493412762928930.8561317777342-0.15356504984051
89MACS J1206.2-08473277181.551150-8.800667284.39867752.43581823500I30.440010.21------------------------extr300.8061.010.106.097.114.61.270.11271.381.00e+00extr0.0----181.08.50.840.052825.366.08e-01flat69.010.106.894.714.51.280.11271.871.00e+00flat0.0----190.58.30.780.052830.003.63e-01-0.0267506692930981-0.987864473097787-0.15299733489052
97MACS J1311.0-03103258197.756937-3.177639312.55108859.32774614900I30.49405.60611063200I3--------------------extr140.4042.54.2010.167.17.41.580.12112.479.96e-01extr0.0----127.73.90.840.041267.111.11e-09flat47.44.1011.563.57.31.620.12112.399.97e-01flat0.0----130.23.90.770.041277.771.10e-11-0.304510700863697-0.950894602365-0.0554318342886903
98MS J0451.6-030590273.545850-3.014497201.496536-27.32942244200S30.53868.90------------------------extr160.50568.1115.604.915.649.92.812.27130.561.00e+00extr0.0----643.579.70.210.16143.739.97e-01flat568.1115.604.915.649.92.812.27130.561.00e+00flat0.0----643.579.70.210.16143.739.97e-010.9577196356374920.282856032808359-0.0525886320254252
101MACS J0329.6-0211325752.423671-2.196575186.444973-44.6742259900I30.45005.20358219900I3610839600I3----------------extr140.406.62.702.4102.96.51.210.07119.635.64e-01extr0.0----115.43.61.080.031214.832.51e-01flat11.12.504.496.76.41.260.071111.913.71e-01flat0.0----117.53.61.030.031226.778.33e-030.7919592952081790.60936970170641-0.0383280755531222
150MS J0016.9+16095204.63959616.436942111.606529-45.71053967400I30.54108.94------------------------extr160.50160.722.607.165.026.71.280.30133.179.97e-01extr0.0----258.511.80.400.051415.633.37e-01flat162.122.507.264.226.51.290.30133.179.97e-01flat0.0----259.311.70.400.051415.743.30e-010.0775820143606770.9559888676393520.282959919418579
158MACS J2228.5+20363285337.14113320.62175383.309076-31.04316019900I30.41207.86------------------------extr220.60118.839.203.0107.245.91.000.26190.601.00e+00extr0.0----246.717.60.550.07204.671.00e+00flat118.839.203.0107.245.91.000.26190.601.00e+00flat0.0----246.717.60.550.07204.671.00e+00-0.3635721291773680.8624225045900380.352197005186134
165MACS J1149.5+22231656177.39940022.398617228.18365975.19956618500I30.54408.40358920000I3--------------------extr321.00280.739.207.233.120.61.470.30291.621.00e+00extr0.0----282.322.10.520.063015.329.88e-01flat280.739.207.233.120.61.470.30291.621.00e+00flat0.0----282.322.10.520.063015.329.88e-010.0419502600453015-0.9236030294383880.381048054311216
167RX J1423.8+24041657215.94899624.07790329.75642568.98591718500I30.54505.924195115600S3--------------------extr70.2210.25.002.0119.910.81.270.1741.757.82e-01extr0.0----133.87.31.020.05515.011.03e-02flat10.25.002.0119.910.81.270.1741.757.82e-01flat0.0----133.87.31.020.05515.011.03e-02-0.535985261695602-0.7391031337820090.407978377954898
185CL J1226.9+33323180186.74322133.546489160.86107981.69379931700I30.890010.00501432700I39329800S3----------------extr100.40166.045.203.799.058.71.410.5070.759.98e-01extr0.0----308.725.30.550.1084.817.78e-01flat166.045.203.799.058.71.410.5070.759.98e-01flat0.0----308.725.30.550.1084.817.78e-01-0.0978621713887831-0.8276722900142490.552613405332916
196MACS J0717.5+37451655109.38189237.755144180.24822121.04634819900I30.548010.50420059200I3--------------------extr160.50158.7111.601.4202.0128.80.690.35131.311.00e+00extr0.0----378.626.00.400.07142.631.00e+00flat220.196.402.3160.1112.20.760.40131.031.00e+00flat0.0----404.825.20.330.06143.029.99e-010.745827433154779-0.2623823783866430.612288271540393
198MACS J1621.3+38103254245.35333838.16906960.94042245.0562619800I30.46107.53359419700I3610937500I3617229800I3------------extr170.5013.95.602.5135.011.61.160.08146.719.45e-01extr0.0----158.95.81.010.041511.727.00e-01flat20.15.403.7129.811.41.180.08147.049.33e-01flat0.0----164.45.80.960.041516.973.21e-01-0.714566125255865-0.3278581157974430.61798406819478
201MACS J0744.8+39273197116.22000839.456781180.12605026.65159020200I30.686011.29358519900I3611149500I3----------------extr170.6039.511.003.6113.917.41.100.11143.849.96e-01extr0.0----170.47.60.810.051511.916.86e-01flat42.410.903.9112.017.21.110.12143.889.96e-01flat0.0----172.67.50.790.041512.986.04e-010.692657845631228-0.3411304152962760.635495986332956
2193C 2952254212.83450052.20293197.51661960.80247790900I30.46415.16d------------------------extr170.5012.62.604.984.56.41.450.07147.529.13e-01extr0.0----108.23.81.200.041527.392.57e-02flat14.52.505.881.96.31.470.07148.368.70e-01flat0.0----109.33.81.180.041534.842.59e-03-0.332305024287539-0.5149552280408270.790186360263627
220MACS J1115.2+53203253168.81513353.334253150.54050858.3313148800I30.43908.03500818000I353506900I3----------------extr180.50292.360.504.827.642.31.731.01153.479.99e-01extr0.0----334.832.10.330.10166.989.74e-01flat292.360.504.827.642.31.731.01153.479.99e-01flat0.0----334.832.10.330.10166.989.74e-010.115831489217526-0.5858037867838030.802132775477606
236RX J0647.7+70153196101.95845470.247128144.84522825.11417119300I30.58409.07358420000I3--------------------extr240.80225.147.104.848.831.91.700.39210.421.00e+00extr0.0----275.632.00.710.10229.729.89e-01flat225.147.104.848.831.91.700.39210.421.00e+00flat0.0----275.632.00.710.10229.729.89e-010.330629440642765-0.07002692077433480.941159074411503

If we want to further restrict the results, we can use boolean operators to add extra filtering conditions. Here, for instance, we’ve decided we only want the higher-redshift, low-central-entropy, galaxy clusters to be returned:

accept_cat_higherz_lowk = Heasarc.query_region(
    catalog="acceptcat",
    spatial="all-sky",
    column_filters={"redshift": (">", "0.4"), "bf_core_entropy_1": ("<", "15")},
    columns="*",
)
accept_cat_higherz_lowk
Table length=7
__rownameobsid_1radecliibiiexposure_obsid_1center_ccd_obsid_1redshiftktnotesobsid_2exposure_obsid_2center_ccd_obsid_2obsid_3exposure_obsid_3center_ccd_obsid_3obsid_4exposure_obsid_4center_ccd_obsid_4obsid_5exposure_obsid_5center_ccd_obsid_5obsid_6exposure_obsid_6center_ccd_obsid_6obsid_7exposure_obsid_7center_ccd_obsid_7fit_method_1num_radial_binsmax_fit_radiusbf_core_entropy_1bf_core_entropy_1_errornum_sigma_k0_gt_0_1bf_100k_entropy_1bf_100k_entropy_1_erroralpha_1alpha_1_errordof_1chi_squared_1p_value_1fit_method_2bf_core_entropy_2bf_core_entropy_2_errornum_sigma_k0_gt_0_2bf_100k_entropy_2bf_100k_entropy_2_erroralpha_2alpha_2_errordof_2chi_squared_2p_value_2fit_method_3bf_core_entropy_3bf_core_entropy_3_errornum_sigma_k0_gt_0_3bf_100k_entropy_3bf_100k_entropy_3_erroralpha_3alpha_3_errordof_3chi_squared_3p_value_3fit_method_4bf_core_entropy_4bf_core_entropy_4_errornum_sigma_k0_gt_0_4bf_100k_entropy_4bf_100k_entropy_4_erroralpha_4alpha_4_errordof_4chi_squared_4p_value_4__x_ra_dec__y_ra_dec__z_ra_dec
degdegdegdegskeVssssssMpccm2 keVcm2 keVcm2 keVcm2 keVcm2 keVcm2 keVcm2 keVcm2 keVcm2 keVcm2 keVcm2 keVcm2 keVcm2 keVcm2 keVcm2 keVcm2 keV
objectobjectint32float64float64float64float64float64objectfloat64float64objectint32float64objectint32float64objectint32float64objectint32float64objectint32float64objectint32float64objectobjectint16float64float64float64float64float64float64float64float64int16float64objectobjectfloat64float64float64float64float64float64float64int16float64objectobjectfloat64float64float64float64float64float64float64int16float64objectobjectfloat64float64float64float64float64float64float64int16float64objectfloat64float64float64
81MACS J0417.5-1154327064.394525-11.909086205.946190-39.47825912000I30.440011.07------------------------extr110.309.56.701.4101.614.81.520.2280.889.99e-01extr0.0----117.29.21.290.1392.519.81e-01flat27.17.303.799.715.11.420.2381.169.97e-01flat0.0----136.19.40.850.0897.226.14e-010.8823813247169550.422869972297137-0.206359357239186
82RX J1347.5-11453592206.877471-11.752792324.03735348.80761357700I30.451010.8850710000S3--------------------extr80.2212.520.700.6179.935.31.060.3454.005.49e-01extr0.0----196.418.30.900.0864.236.46e-01flat12.520.700.6179.935.31.060.3454.005.49e-01flat0.0----196.418.30.900.0864.236.46e-01-0.442606319178165-0.873275588033894-0.203689453746662
88MACS J0159.8-0849326529.956054-8.833583167.589086-65.58744917900I30.40509.59610635300I3--------------------extr150.4011.94.003.0133.710.01.250.08122.479.98e-01extr0.0----155.75.81.060.04139.447.39e-01flat18.83.705.0123.99.91.310.09123.689.89e-01flat0.0----158.35.91.010.041321.087.13e-020.493412762928930.8561317777342-0.15356504984051
101MACS J0329.6-0211325752.423671-2.196575186.444973-44.6742259900I30.45005.20358219900I3610839600I3----------------extr140.406.62.702.4102.96.51.210.07119.635.64e-01extr0.0----115.43.61.080.031214.832.51e-01flat11.12.504.496.76.41.260.071111.913.71e-01flat0.0----117.53.61.030.031226.778.33e-030.7919592952081790.60936970170641-0.0383280755531222
167RX J1423.8+24041657215.94899624.07790329.75642568.98591718500I30.54505.924195115600S3--------------------extr70.2210.25.002.0119.910.81.270.1741.757.82e-01extr0.0----133.87.31.020.05515.011.03e-02flat10.25.002.0119.910.81.270.1741.757.82e-01flat0.0----133.87.31.020.05515.011.03e-02-0.535985261695602-0.7391031337820090.407978377954898
198MACS J1621.3+38103254245.35333838.16906960.94042245.0562619800I30.46107.53359419700I3610937500I3617229800I3------------extr170.5013.95.602.5135.011.61.160.08146.719.45e-01extr0.0----158.95.81.010.041511.727.00e-01flat20.15.403.7129.811.41.180.08147.049.33e-01flat0.0----164.45.80.960.041516.973.21e-01-0.714566125255865-0.3278581157974430.61798406819478
2193C 2952254212.83450052.20293197.51661960.80247790900I30.46415.16d------------------------extr170.5012.62.604.984.56.41.450.07147.529.13e-01extr0.0----108.23.81.200.041527.392.57e-02flat14.52.505.881.96.31.470.07148.368.70e-01flat0.0----109.33.81.180.041534.842.59e-03-0.332305024287539-0.5149552280408270.790186360263627

4. Interacting with HEASARC catalog contents#

The returns from our calls to the Heasarc.query_region method are Astropy Table objects:

type(accept_cat)
astropy.table.table.Table

You can extract information similarly to a Pandas DataFrame; e.g., indexing with a column name string retrieves the entries in that column:

# Extract source names from our subset of the ACCEPT catalog
accept_cat_higherz_lowk["name"]
<MaskedColumn name='name' dtype='object' description='Cluster Designation' length=7>
MACS J0417.5-1154
RX J1347.5-1145
MACS J0159.8-0849
MACS J0329.6-0211
RX J1423.8+2404
MACS J1621.3+3810
3C 295

To retrieve the entries for a row in the table, you can index with an integer; e.g., 0 for the first row:

accept_cat_higherz_lowk[0]
Row index=0
__rownameobsid_1radecliibiiexposure_obsid_1center_ccd_obsid_1redshiftktnotesobsid_2exposure_obsid_2center_ccd_obsid_2obsid_3exposure_obsid_3center_ccd_obsid_3obsid_4exposure_obsid_4center_ccd_obsid_4obsid_5exposure_obsid_5center_ccd_obsid_5obsid_6exposure_obsid_6center_ccd_obsid_6obsid_7exposure_obsid_7center_ccd_obsid_7fit_method_1num_radial_binsmax_fit_radiusbf_core_entropy_1bf_core_entropy_1_errornum_sigma_k0_gt_0_1bf_100k_entropy_1bf_100k_entropy_1_erroralpha_1alpha_1_errordof_1chi_squared_1p_value_1fit_method_2bf_core_entropy_2bf_core_entropy_2_errornum_sigma_k0_gt_0_2bf_100k_entropy_2bf_100k_entropy_2_erroralpha_2alpha_2_errordof_2chi_squared_2p_value_2fit_method_3bf_core_entropy_3bf_core_entropy_3_errornum_sigma_k0_gt_0_3bf_100k_entropy_3bf_100k_entropy_3_erroralpha_3alpha_3_errordof_3chi_squared_3p_value_3fit_method_4bf_core_entropy_4bf_core_entropy_4_errornum_sigma_k0_gt_0_4bf_100k_entropy_4bf_100k_entropy_4_erroralpha_4alpha_4_errordof_4chi_squared_4p_value_4__x_ra_dec__y_ra_dec__z_ra_dec
degdegdegdegskeVssssssMpccm2 keVcm2 keVcm2 keVcm2 keVcm2 keVcm2 keVcm2 keVcm2 keVcm2 keVcm2 keVcm2 keVcm2 keVcm2 keVcm2 keVcm2 keVcm2 keV
objectobjectint32float64float64float64float64float64objectfloat64float64objectint32float64objectint32float64objectint32float64objectint32float64objectint32float64objectint32float64objectobjectint16float64float64float64float64float64float64float64float64int16float64objectobjectfloat64float64float64float64float64float64float64int16float64objectobjectfloat64float64float64float64float64float64float64int16float64objectobjectfloat64float64float64float64float64float64float64int16float64objectfloat64float64float64
81MACS J0417.5-1154327064.394525-11.909086205.946190-39.47825912000I30.440011.07------------------------extr110.309.56.701.4101.614.81.520.2280.889.99e-01extr0.0----117.29.21.290.1392.519.81e-01flat27.17.303.799.715.11.420.2381.169.97e-01flat0.0----136.19.40.850.0897.226.14e-010.8823813247169550.422869972297137-0.206359357239186

You can also convert the return to a Pandas DataFrame if you prefer working with one of these data structures:

accept_cat_higherz_lowk_pd = accept_cat_higherz_lowk.to_pandas()
accept_cat_higherz_lowk_pd
__row name obsid_1 ra dec lii bii exposure_obsid_1 center_ccd_obsid_1 redshift ... bf_100k_entropy_4 bf_100k_entropy_4_error alpha_4 alpha_4_error dof_4 chi_squared_4 p_value_4 __x_ra_dec __y_ra_dec __z_ra_dec
0 81 MACS J0417.5-1154 3270 64.394525 -11.909086 205.946190 -39.478259 12000.0 I3 0.4400 ... 136.1 9.4 0.85 0.08 9 7.22 6.14e-01 0.882381 0.422870 -0.206359
1 82 RX J1347.5-1145 3592 206.877471 -11.752792 324.037353 48.807613 57700.0 I3 0.4510 ... 196.4 18.3 0.90 0.08 6 4.23 6.46e-01 -0.442606 -0.873276 -0.203689
2 88 MACS J0159.8-0849 3265 29.956054 -8.833583 167.589086 -65.587449 17900.0 I3 0.4050 ... 158.3 5.9 1.01 0.04 13 21.08 7.13e-02 0.493413 0.856132 -0.153565
3 101 MACS J0329.6-0211 3257 52.423671 -2.196575 186.444973 -44.674225 9900.0 I3 0.4500 ... 117.5 3.6 1.03 0.03 12 26.77 8.33e-03 0.791959 0.609370 -0.038328
4 167 RX J1423.8+2404 1657 215.948996 24.077903 29.756425 68.985917 18500.0 I3 0.5450 ... 133.8 7.3 1.02 0.05 5 15.01 1.03e-02 -0.535985 -0.739103 0.407978
5 198 MACS J1621.3+3810 3254 245.353338 38.169069 60.940422 45.056261 9800.0 I3 0.4610 ... 164.4 5.8 0.96 0.04 15 16.97 3.21e-01 -0.714566 -0.327858 0.617984
6 219 3C 295 2254 212.834500 52.202931 97.516619 60.802477 90900.0 I3 0.4641 ... 109.3 3.8 1.18 0.04 15 34.84 2.59e-03 -0.332305 -0.514955 0.790186

7 rows × 79 columns

About this notebook#

Author: David Turner, HEASARC Staff Scientist

Updated On: 2026-03-16

Additional Resources#

Support: HEASARC Helpdesk

Latest Astroquery Documentation

Short Course on ADQL Website

NAVO catalog queries tutorial

Latest PyVO Documentation

Acknowledgements#

References#

Ginsburg, Sipőcz, Brasseur et al. (2019) - astroquery: An Astronomical Web-querying Package in Python

Cavagnolo K. W., Donahue M., Voit G. M., Sun M. (2009) - Intracluster Medium Entropy Profiles for a Chandra Archival Sample of Galaxy Clusters

Evans I. N., Evans J. D., Martínez-Galarza J. R., Miller J. B. et al. (2024) - The Chandra Source Catalog Release 2 Series

Chandra Source Catalog 2 DOI - doi:10.25574/csc2

Demleitner M. and Heinl H. (2024) - A Short Course on ADQL; Virtual Observatory Resource