This is a description of an older version of the Hubble Source Catalog.
The current version is preferred for most purposes.

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 HST CasJobs webpage http://mastweb.stsci.edu/hcasjobs/ and create an account using the button in the top menu bar (blue). Go ahead and login (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 HSC (green), using the dropdown menu on the top left. This shows the available views, tables, functions and procedures related to the HSC database.

For example, click Tables (green) , and then select SumMagAper2Cat (i.e., the HSC Summary Form using magaper2 magnitudes) (orange). Scroll across to see the fields located in this table, such as Match ID (yellow), the instrument and filter used (i.e., W2_F122M is the magaper2 magnitude using the Wide Field Planetary Camera 2 image and the F122M filter) (yellow). A description of the table and some of the columns are provided. You might want to examine the Function SearchSumCatalog also, since you will be using it in a minute.


Step 3 - Query the database. The query below is designed to find globular clusters in the galaxy M87.



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 (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 betwen 0.0 and 1.0
     iii) number of images in a match (>50).

The ORDER BY defines the order of the results (i.e. by matchID).

Now click Query. Change the context from MyDB to HSC (if necessary) (blue). Copy and paste the text from above into the blank query text box (green). Click Quick (orange) to submit the job.

Since this is a Quick submission, the table is not saved to MyDB, but is instead listed below. If you want to save the table, add "INTO M87_V2" to the end of the query (see Step 8).

The table can also be downloaded to a local file using the Save As botton (yellow) at the bottom of the page.

Another option is the Submit button, which is generally used for longer queries. The table is saved using the name in the box under "Table(optional)", which defaults to MyTable; change this to M87_V2 for our example. Try this. It takes about a minute. To see the table click the MyDB tab, click on M87_V2, and click on Sample to see the file.





Step 4 - Examine an image. It is a good idea to look at the HSC overlayed on an image, to check for artifacts and uniformity. Copy the MatchRA and MatchDec values of the first source from your table. Open the HLA and paste those values into the search box (blue). Click Search.

Note: The HLA displays your search coordinates in both decimal degrees and sexidecimal format (blue). This is useful if you want to find a specific object in the Interactive Display.

In the Detector field enter *acs/wfc* (green) to select just the ACS Wide Field Camera images. Click on the Display (orange) button for the F814W/F606W (color) image (or click on the Images button if you would like to look at previews of all the images).



Step 5 - Determine the value of NumImages to use. Click advanced 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 in a star-like ring around the inner region. If you click on a few of the real objects (green) you find they all have more than NumImages = 50. Some have over 120 !

Go back and change to Require NumImages > 50 (orange) to remove essentially all of the artifacts (although you are still missing some objects near the center of the galaxy). DETERMINING THE BEST VALUE OF NUMIMAGES IS OFTEN ONE OF THE MOST IMPORTANT DECISIONS YOU WILL HAVE WHEN USING THE HSC !





Step 6 - You can also use the MAST Discovery Portal to make the same query, since this is a relatively small dataset. Several other HSC Use Cases (e.g., # 1: Using the Discovery Portal to Query the HSC - Stellar Photometry in M31; Brown et al. 2009) provide more detail. The Discovery Portal can be used to make plots (like in Step 7) and to reach the HLA Interactive Display (like in Step 5).

In this example we center on the coordinates of the first object (blue) in the list from the CasJobs search in Step 3 to find the object with matchID = 250841 (orange). Also note that M87 has been visited 116 times using 172 different images (green) !


Step 7 - Make a plot using CasJobs. Click on MyDB (blue) in two places, then find the table M87_V2 (made in Step 3) and click on that (green). You can then click on Sample (orange) to see the data, and Plot (orange) to make a plot. Designate the X and Y columns (orange) on the right and click Plot at the bottom (yellow).

You will be directed to the output tab in the menu bar, where you will see the plot is pending. The queue gets refreshed every 30 seconds; you can hit the refresh icon in your browser to check more frequently. Click Download when it is ready to see the plot on the right.




Step 8 - Now lets try something a little bigger by making a Color Magnitude Diagram (CMD) for the Small Magellanic Clouds (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_v1 should appear in MyDb in a minute or so.



Next make the plot of V-I vs V shown in the upper right (flipped from how it will appear using CasJobs). There are 385,675 datapoints in this figure using dozens 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.