Depth Measurements

SPTW Coadd Noise and Limiting Magnitudes in i band

I've (Eli) taken the 10 frames from SV of the SPTW observation of SPT J2332-5358 to investigate the noise properties and the depth as a function of number of coadded frames for good quality i-band images. These images are a set of 10 consecutive i-band images, each 90s, taken with 35% lunar illumination and good seeing (0.9") and good tracking. The DECam image numbers are 152706 - 152715. These are the same images used for Huan's initial cluster stacks for SV.

For these tests I started with the firstcut reduced images from run 20121119092323_20121118. I took all the CCDs that covered a central 5000x5000 (0.4x0.4 deg) region around the center of the field. I used scamp for astrometry and then swarp to combine the images in stacks of 1,2,3...10 images, starting with image 152706 and then stacking them sequentially. I ran swarp in two modes: median mode for the cleanest CR rejected images, and weighted average mode for the deepest possible stack (though contaminated by CRs). In the future, when we iron out the CR issues, we should be able to do coaddition in weighted average mode. No psf homogenization or any other manipulations were applied other than the standard swarp resampling.

I used the SExtractor CHECKIMAGE type MINIBACK_RMS to measure the sky noise in each image (as described below), calculated on a 64x64 pixel grid. For each MINIBACK_RMS I calculated the median sky noise in that image. This ensures that we're measuring the typical sky noise in the central 0.4x0.4 deg.

In the following figure, we can see the effect on the sky noise of the coaddition:

Sky noise vs. n images

The white triangles show the noise level when doing median combinations, and the red diamonds when using the weighted average. The dotted and dashed lines are the expectations for the noise level when you combine N equal exposure images with the sky noise measured from the first image. (Note that for stacks of 1 and 2 deep both measurements use the mean and not the median.) The noise characteristics are indeed in line with expectations. The noise in the mean-combined images is indeed significantly smaller than in the median combined images, and the reduction in noise is mostly consistent with the model. (There may be some extra noise in the mean compared to the model, but it is not large). Therefore, at the sky level nothing is going horribly wrong in the coadds.

Next, I calculate the limiting magnitude as a function of number of images in the stack. The limiting magnitude is calculated as follows, after much discussion and convergence with Huan Lin. I run SExtractor in dual-image mode, using the 10 image median stack as the detection image. This is the deepest, cleanest detection. For each object I calculate MAG_APER in a 5.55 pixel (1.5") diameter aperture, which yields the optimal signal-to-noise, and MAG_AUTO, which is an estimate of the "total" magnitude for each galaxy. In the output catalog I use objects with FLAGS=0 and CLASS_STAR < 0.9, which is a reasonable first cut for a clean(ish) galaxy list. I then calculate the 1.5" aperture magnitude that corresponds to a mean magnitude error of 0.1086, which is a 10sigma detection as defined in the DES specifications. By selecting galaxies near this limiting magnitude we can then find the typical MAG_AUTO (total magnitude) that is associated with this aperture magnitude. This is the "total" aperture correction that takes into account both simple aperture corrections (expected to be ~0.3 for a Gaussian PSF with FWHM=0.9) and galaxy aperture corrections to account for the extended objects.

The limiting magnitudes are plotted here:

mag limit vs n stack

The image depth increases as expected, and in accordance with the reduction in the sky noise. The mean-combined images are indeed deeper than the median-combined images. And for the 10 image mean stack -- roughly full depth for DES -- we are reaching our target limiting magnitude in i band of ~23.7. This is good news!

However, as Huan has mentioned via e-mail, there is a catch. These images were taken under dark sky conditions. If all the observations are taken with the sky near the threshold for i-band imaging, then we will lose up to 0.5 mag in depth in the full stack. The depth of 23.7 is sufficient for cluster science at z~0.9-1.0, but 23.2 is not.

As expected, the mean-combined images are deeper than the median-combined images.

z band

I have done the same measurements for the other bands for the same fields.

noise vs n in z band limiting mag vs n in z band

z band depth: 23.0, with the target of 23.2. I expect that proper fringe correction will help, although the sky will be brighter in regularly scheduled observations.

r band

Noise vs n in r band -- fixed limiting mag vs n in r band

r band depth: 24.2, with a target of 24.5. These images were taken with some small amount of moon, which should improve things.

g band updated!

noise vs n g band update mlim vs n g band update

These were new images of the SPTW field taken on 11/8 (159021-159030) taken with dark skies. The seeing was ~1.1 arcsecond, perhaps attributable to the larger seeing in the g band? The sky magnitude is 22.05, very close to the dark sky zenith value of 22.1. However, the depth is 24.5 with a target of 24.9. This might be partly attributable to the PSF that is larger than the nominal target of 0.9". Some of this may be recoverable by using DETMODEL magnitudes for color measurements: we aren't planning on using g-band as a detection band. However, it should be noted that we are not reaching our target magnitude limit in g even with dark skies.

5sigma depth for Stars with PSF Magnitudes

By popular demand, I have done a similar analysis for stellar magnitudes. For this I ran psfex to fit the psf, and then calculated MAG_PSF as well as MAG_MODEL magnitudes (using a Sersic fit). MAG_PSF should be close to ideal for stellar magnitudes. Star-galaxy separation was performed by cutting SPREAD_MODEL < 0.002. In FWHM -- Magnitude space this appears to do a reasonable job of selecting star-like objects, though of course this is not perfect. The SExtractor detector threshold was set very low (1.0 sigma) to ensure that we have a reasonably complete list of stars detected at 5 sigma. (My first run had a larger detection and analysis threshold, and combined with the gauss_3.0_7x6.conv filter I found that the apparent completeness at 5 sigma with the SPREAD_MODEL cut was very low.)

i band stellar magnitudes.

i band 5 sigma magnitude limit vs n (psf magnitudes)

The i band 5 sigma stellar limit is ~24.6, while the target is 25.3. We are ~0.7 mag too shallow. For reference, SDSS Stripe 82 (Annis coadds) has a 5 sigma PSF stellar magnitude limit of 23.7.

z band stellar magnitudes.

z band 5 sigma magnitude limit vs n (psf magnitudes)

The z band 5 sigma stellar limit is ~23.9, while the target is 24.7. We are ~0.8 mag too shallow. For reference, S82 has a 5 sigma PSF magnitude limit of 22.3.

r band stellar magnitudes.

r band 5 sigma magnitude limit vs n (psf magnitudes)

The r band 5 sigma stellar limit is ~25.3, while the target is 26.0. We are ~0.7 mag too shallow. For reference, S82 has a 5 sigma PSF magnitude limit of 24.3.

g band stellar magnitudes

g band 5 sigma magnitude limit vs n (psf magnitudes)

The g band 5 sigma stellar limit is ~25.4, while the target is 26.5. We are ~1.1 mag too shallow. For reference, S82 has a 5 sigma PSF magnitude limit of 24.7.


In all, for the 5 sigma stellar magnitude limits we are ~0.7 magnitude shallower than the target in all bands (except g which is a little bit worse, as above). I am not sure if perhaps psf homogenization would help here, and there is the possibility that my scamp solutions are not ideal. In particular, the stacked FWHM is ~1.03" for the i band where the raw images are closer to 0.9". So there's certainly a bit of shape noise introduced in my stacks. However, PSF fitting should recover some of this, so I'm not quite sure if this can explain a 0.7 magnitude discrepancy.

Original Post

I've (Eli) been looking at the coadd image depth that we've gotten so far in
SV. My primary concerns are:

- Are we achieving sufficient depth to get good red sequence
measurements at z~0.9?
- How will the current depth affect WL measurements?
- How will the current depth affect photometric redshifts?

To this end I've looked at all the coadd southern fields so far. The
best one is des0102-4914, the field of "El Gordo" a large SZ cluster at
z=0.87. The seeing was good for these images, ~0.9". I've been
concentrating on i-band depth, as this is the default detection band,
and it's also the most important for selecting red sequence galaxies.

There are two reductions of des0102-4914, the first being Huan's
quick-and-dirty standalone pipeline coadd (without psf homogenization
and without all the cleaning steps). The second was a run through DESDM
(though z band was erroneously used as the detection band rather than i,
but I don't think this makes much of a difference.)

The first plot attached is ierr_desdm_huan.png, which shows the i
magnitude error vs i magnitude (using mag_auto as a proxy for total
magnitude). The detection threshold for the DESDM run was set much
lower than for Huan's run, but the error model is very similar. The
DESDM run is nominally a bit deeper, which may be due to cleaning or the
psf homogenization. (And hopefully not an underestimation of the
errors). The lines show the 10sigma detection limit.

How does this compare to the spec? The target i band 10sigma depth is
23.7 mag, after applying an aperture correction to the defined depth
(24.0 in a 1.6*0.9" aperture). You can see in ierr_desdm_mock.png that
we aren't close to reaching this depth -- we're about 0.7 mag too shallow.

This is a problem for cluster red sequence measurements at z~0.9. We're
currently running a mock run with the SV error model to compare directly
with the spec error model to see exactly how much this impacts the
cluster science, but I don't think it will be good.

What I don't know is exactly how this will impact photo-zs and WL
science, as well as BAO and everything else (though see comments below on

Of particular concern for WL is the number of galaxies. By my calculation,
there are 8 galaxies per arcminute detected at the 10sigma level in this field,
while the spec is something larger than 11, I believe. (This is what's in Risa's
mocks). Now, I know from Erin that the effective number of galaxies is
not simply this value, but is instead weighted. Here in particular is where
input from the WL folks would be useful.

Finally, how does this compare to SDSS Stripe82? Thankfully, we are
indeed outperforming Stripe 82, as shown in ierr_desdm_stripe82.png.
But not by as much as we should, at least in 10sigma depth. (We're
easily outperforming in terms of seeing!)

So what can be done? We are wondering if maybe we should take back some
of the g/r band observations to get more dark time in i band to better
reach our desired depth. As it turns out, one of the main drivers for
moving to the "constant" time scenario (more g/r) was from Carlos's
photo-z prediction plots, shown as old.sigma.hi.8k.pdf. But it turns
out that a lot of this difference was caused by a bug in the plotting
code. Once this bug was fixed, Carlos sent us new.sigma.hi.8k.pdf. As
you can see, the time can be exchanged among the bands with much less
penalty on the photo-z quality.

Of course, this doesn't address the question of "what do the photo-zs
look like if we are 0.5-0.7 mag shallower than spec?", and this has yet
to be done.

Effective Sky Level


Gary pointed out that it may be that I wasn't taking into account fluctuations in the sky level properly, caused perhaps by illumination issues or non-final flat fields.

Gary, as usual, was correct.

To rerun this, I use the SExtractor background maps (64x64 pixel) and background rms maps to get the median background and median background rms on a local scale (after masking all sources).

And once you do this, the sky level implied from the RMS is within ~5% of the sky level measured directly from the counts.

The plots are here:

Fixed sky map

Equivalent sky:
Fixed equiv sky map.

fixed delta map

Original Post

The question I (Eli) set out to answer here is: what is the i-band sky level across the image, and is it consistent with expectations? If the sky isn't dark enough that could (partly) explain the depth...

For a sample image, I took 152706, a 90s (sky dominated) i-band image of SPTW taken with good seeing conditions and the moon down. The target sky level is 20.1 mag/arcsec^2.

I measured the sky in two different ways. The first way is direct and straightforward. I take the reduced (bias/dark subtracted and flat-fielded) images from the firstcut processing, and for each amplifier I fit a Gaussian histogram to the distribution of non-source pixels. At the moment, I use a single zero-point for all the CCDs, which was calculated by matching stars in the center of the field (CCD N4) to Huan's coadded catalog for this field. This zero-point was calculated to be 30.2 mag. (And is consistent within <10% a quick SLR reduction that I did.) Using 0.27"/pixel, 1" subtends 13.72 pixels^2. Then the sky is simply given by: sky = zp - 2.5*log10(13.72*sky_adu).

The sky level ranges from 20.1-20.3 mag/arcsec^2, which is indeed within specification.

Simple Sky measurements

But things are not necessarily that simple. As an alternative, we can measure the sky noise to infer the "effective" sky level. As it's the sky noise and not the absolute sky level that will determine our detection limits, I believe this is the more important quantity to determine the expected image depth. For the gain in each amplifier, I have used Jiangang's gain tables from 11/19/2012. Taking the sky error, we can calculate the effective sky as: sky_adu_per_pixel = (skynoise_adu*gain)^2/gain. Then we calculate the "effective" sky in mag/arcsec^2. This is "Effective" in that this the the sky level that would produce the noise level observed in the image.

Now, the effective sky level ranges from 19.8-20.1 mag/arcsec^2. This is brighter than the specification, and may be an issue:

Equivalent sky measurement

Finally, we can look at the difference between these over the full frame. The delta ranges from 0.15-0.27 mag/arcsec^2. That is, the effective sky is ~15-30% brighter than we would expect from Poisson statistics on the sky level, with a typical frame 20% brighter. There may be another source of noise that we are not accounting for. It is possible that this is related to the non-linearity issues, or to the uneven illumination issues, or something else...

Delta sky measurement