A Hubble Source Catalog (HSC) Use Case
Example #2: Using CASJOBS to Query the HSC
(Globular Clusters in M87 and a Color Magnitude Diagram for the SMC)
CasJobs is an online tool used to query large databases. Originally created for the SDSS catalog, it has now been adapted for selected MAST archival datasets - namely GALEX, Kepler and the HSC. While the MAST Discovery Portal is the primary tool for using the HSC, CasJobs provides a powerful tool for looking at larger datasets and making more detailed queries. The HSC Homepage is also available for some specific queries.
GOAL: This tutorial provides a first look at how to use CasJobs to query the Hubble Source Catalog. For a more detailed tutorial on the syntax behind the queries the SDSS SQL Tutorial is recommended.
SCIENCE CASES: The science cases are studies of: 1. slightly extended objects (i.e., globular clusters in M87) and 2. large datasets (i.e., a Color Magntiude Diagram for the SMC).
Step 1 - Enter the HSC Casjobs webpage and create an account using the button in the top menu bar (blue). Go ahead and log in (green). |
Step 2 - Inspect the HSC databases and functions. Click MyDB in the top menu bar (blue). This displays all the tables and functions you create in "MyDB" (My Database). Now change the "context" (the database used to run your query) from MyDB to HSCv4 (i.e., Hubble Source Catalog Version 4) (green), using the dropdown menu on the top left. This shows the available views, tables, functions and procedures related to the HSC database. |
Step 3 - Query the database. The query below is designed to find globular clusters in the galaxy M87.
SELECT
MatchRA, MatchDec, MatchID, CI, W2_F606W, W2_F814W, V_I=W2_F606W - W2_F814W
FROM
SearchSumCatalog(187.706, 12.391, 500.0, 1)
WHERE CI > 1.05 and CI < 1.5
and (W2_F606W - W2_F814W) > 0.0 and (W2_F606W - W2_F814W) < 1.0
and NumImages > 50
ORDER BY MatchID
The SELECT command defines the columns to include in the output table (such as the RA, DEC, ID, Concentration Index, and magnitudes).
The FROM command defines the query itself, and is composed of the following parts:
a) The HSC function SearchSumCatalog, which is used to search the HSC around the position of M87 (187.706, 12.391) with a specified search radius (500 arcsec), and retrieve the MagAper2 magnitudes (magtype = 1, i.e., aperture magnitudes within a 3 pixel = 0.30 arcsec radius).
b) The WHERE clause defines the search parameters
i) concentration index (CI = difference between magnitudes for apertures with a radius of 0.10 and 0.30 arcsec) with values between 1.05 and 1.5 (i.e., slightly extended)
ii) V - I (W2_F606W - W2_F814W) color between 0.0 and 1.0
iii) number of images in a match (NumImages>50).
The ORDER BY clause defines the order of the results (i.e. by MatchID).
Now click Query. Change the context from MyDB to HSCv4 (if necessary) (blue). Note that forgetting to change the context is the most common error causing CasJobs queries to fail. Copy and paste the text from above into the blank query text box (green). Click Quick (orange) to submit the job. |
Step 4 - Examine an image. It is a good idea to look at the HSC overlaid on an image, to check for artifacts and uniformity. Copy the MatchRA and MatchDec values of the 7th source from your table. Open the HLA and paste those values into the search box (blue). Click Search. You can open the advanced search options and request that the Images tab show image cutouts rather than full-frame previews. That will zoom in on your selected source position. Note that a similar approach can be used in other MAST interfaces such as the Portal and the MAST mission search form. |
Step 5 - Determine the value of NumImages to use via the interactive display. Click HSC controls, Require NumImages > 10, and then the HSC (blue) button to overlay the HSC on this particular image. We find that NumImages > 10 leaves a number of artifacts and apparently blank circles. If you click on a few of the real objects (green) you find they all have NumImages > 50. Some have over 200! |
Step 6 - Now let's try something a little bigger by making a Color Magnitude Diagram (CMD) for the Small Magellanic Cloud (SMC) using the ACS data. Following similar steps to those described above, cut and paste the following text into a Query box, and hit the Submit button (since this is a longer query). The table smc_v4 should appear in MyDB in about 5 minutes or so.
SELECT
MatchRA, MatchDec, MatchID, CI, A_F555W, A_F814W, V_I=(A_F555W - A_F814W)
INTO
smc_v4
FROM
SearchSumCatalog(13.1866,-72.8286,7200,1)
WHERE CI > 0.9 and CI < 1.6
and A_F555W > 0 and A_F814W > 0
and (A_F555W - A_F814W) < 1.5 and (A_F555W - A_F814W) > -1.5
and NumImages > 1
ORDER BY MatchID
Next make the plot of V-I vs V shown in the upper right. In HSCv4, there are 764,897 data points using hundreds of ACS fields, as shown in the HLA footprint image below! The entire exercise should only take a few minutes. Similar plots can be made for WFPC2 and WFC3. For comparison, see Figure 2 in Cignoni et al. (2013), which shows similar ACS/WFC color-magnitude diagrams for 4 fields in the SMC.
Step 7 - The above CasJobs queries can also be executed from a Jupyter notebook in Python using the mastcasjobs module or other access tools for the HSC. That allows executing either Quick or Submit queries, retrieving the data as an astropy table, and using all the tools in Python (such as matplotlib) to display or analyze the results. See the MAST Notebook Repository for a detailed example that generates the SMC color-magnitude diagram shown above.





