Getting started tutorial part 5: measuring sources

This is part 5 of the getting started tutorial series. Before starting this tutorial, make sure you’ve completed the previous parts.

To recap, we collected raw data in a Butler repository (part 1), calibrated (part 2) and viewed (part 3) that data, and made deep coadditions in HSC-R and HSC-I bands across nine patches of the sky (part 4). In this step, we’ll measure these coadditions to build catalogs of stars and galaxies.

This is our measurement strategy:

  1. Detect sources in individual coadd patches.
  2. Merge those multi-band source detections into a single detection catalog.
  3. Measure and deblend sources in the individual coadds using the unified detection catalog.
  4. Merge the multi-band catalogs of source measurements to identify the best positional measurements for each source.
  5. Re-measure the coadds in each band using fixed positions (forced photometry).

Tip

Instead of running multiple command line tasks, like we’ll do here, you could instead run the multiBandDriver.py command as an integrated multi-band source measurement pipeline.

Setup check

Let’s take a moment to make sure your command line environment is set up. Run:

eups list lsst_distrib

The line printed out should contain the word setup. If not, review the installation tutorials on activating the environment and setting up lsst_distrib.

Your shell’s working directory also needs to contain the Butler repository directory called DATA.

Let’s get back to it.

Detecting sources in coadded images

To start, we will detect sources in the coadded images to take advantage of their depth and high signal-to-noise ratio. We’ll use the detectCoaddSources.py command line task to accomplish this. Run this command to detect sources in all HSC-R-band patches:

detectCoaddSources.py DATA --rerun coadd \
    --id filter=HSC-R tract=0 patch=0,0^0,1^0,2^1,0^1,1^1,2^2,0^2,1^2,2

Repeat source detection in HSC-I-band patches:

detectCoaddSources.py DATA --rerun coadd \
    --id filter=HSC-I tract=0 patch=0,0^0,1^0,2^1,0^1,1^1,2^2,0^2,1^2,2

Merging multi-band detection catalogs

Next, use the mergeCoaddDetections.py command to combine the individual HSC-R and HSC-I-band detection catalogs. Run:

mergeCoaddDetections.py DATA --rerun coadd:coaddPhot --id filter=HSC-R^HSC-I

Measuring source catalogs on coadds

Now we’ll use the merged detection catalog to measure sources in both the HSC-R and HSC-I coadd patches. We’ll accomplish this with measureCoaddSources.py:

measureCoaddSources.py DATA --rerun coaddPhot --id filter=HSC-R

And repeat with the HSC-I-band coadd:

measureCoaddSources.py DATA --rerun coaddPhot --id filter=HSC-I

Merging multi-band source catalogs from coadds

The previous step created measurement catalogs for each patch in both the HSC-R and HSC-I bands. We get even more complete and consistent multi-band photometry by measuring the same source in multiple bands at a fixed position (the forced photometry method) rather than fitting the source’s location individually for each band.

For forced photometry we want to use the best position measurements for each source, which could be from different filters depending on the source. We call the filter that measures a source best the reference filter. Let’s use the mergeCoaddMeasurements.py command to create a table that identifies the reference filter for each source in the tables we created with the previous step. Run:

mergeCoaddMeasurements.py DATA --rerun coaddPhot --id filter=HSC-R^HSC-I

Running Forced photometry on coadds

Now we have accurate positions for sources in the patches. Let’s re-measure the coadds using these fixed source positions (the forced photometry method) to create the best possible photometry of sources in our coadds. Run:

forcedPhotCoadd.py DATA --rerun coaddPhot:coaddForcedPhot --id filter=HSC-R

Also run forced photometry on the HSC-I-band coadds:

forcedPhotCoadd.py DATA --rerun coaddForcedPhot --id filter=HSC-I

The forcedPhotCoadd.py command creates table datasets called deepCoadd_forced_src in the Butler repository. In the next part of this tutorial we’ll see how to work with these tables.

Note

You can also try the forcedPhotCcd.py command to apply forced photometry to individual exposures, which may in principle yield better measurements. forcedPhotCcd.py doesn’t currently deblend sources, though. Thus forced coadd photometry, as we performed here, provides the best photometry of coadded sources.

Next up

Continue this tutorial series in part 6 where we will analyze and plot the source catalogs we just measured.