20.07.2013 Views

Introduction to Image Reduction

Introduction to Image Reduction

Introduction to Image Reduction

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Motivation & background Instrumental Signature Removal Combining multiple images Pho<strong>to</strong>metric calibration<br />

<strong>Introduction</strong> <strong>to</strong> <strong>Image</strong> <strong>Reduction</strong><br />

David Wittman<br />

University of California, Davis<br />

2011 Summer School:<br />

Weak and Strong Gravitational Lensing<br />

Beijing


Motivation & background Instrumental Signature Removal Combining multiple images Pho<strong>to</strong>metric calibration<br />

Goals<br />

Everyone believes an experiment except the experimenter; no one<br />

believes a theory except the theorist.<br />

So my goals are<br />

• <strong>to</strong> give theorists some appreciation of observational difficulties<br />

• <strong>to</strong> give potential observers a roadmap


Motivation & background Instrumental Signature Removal Combining multiple images Pho<strong>to</strong>metric calibration<br />

What do you see on a raw image?


Motivation & background Instrumental Signature Removal Combining multiple images Pho<strong>to</strong>metric calibration<br />

What do you see on a raw image?<br />

Some things can be removed (or at least masked) as part of instrumental<br />

signature removal:<br />

• response (“flatfield”)<br />

variations<br />

• saturation and bleeding<br />

• cosmic rays<br />

• bad columns or areas<br />

• different amplifier gains<br />

• fringing (if present)<br />

Instrumental signature removal “cleans” your images:<br />

→<br />

and allows you <strong>to</strong> do relative pho<strong>to</strong>metry (these are not the same thing!).


Motivation & background Instrumental Signature Removal Combining multiple images Pho<strong>to</strong>metric calibration<br />

Beyond ISR<br />

ISR is also necessary before you can combine multiple images:<br />

20x →<br />

Other effects will be treated later:<br />

• point-spread function (PSF): the response of the optical<br />

system <strong>to</strong> a point source is not a point<br />

• pho<strong>to</strong>metric calibration: comparing with standard stars <strong>to</strong><br />

calibrate sources in terms of Wm −2 s −1 (in the relevant<br />

bandpass)


Motivation & background Instrumental Signature Removal Combining multiple images Pho<strong>to</strong>metric calibration<br />

Important parameters:<br />

• quantum efficiency<br />

How a CCD works<br />

Amplifier<br />

• full well and saturation/bleeding<br />

• charge transfer inefficiency<br />

One pixel<br />

• pixel size and (mostly) other variations: flatfield response<br />

• readnoise and gain (next page)


Motivation & background Instrumental Signature Removal Combining multiple images Pho<strong>to</strong>metric calibration<br />

Noise and S/N<br />

If electrons accumulate at a rate r, after a time t a pixel will contain rt<br />

electrons and the Poisson noise will be √ rt. The readout electronics add<br />

a Gaussian noise σ so that the signal-<strong>to</strong>-noise ratio is:<br />

S<br />

N =<br />

rt<br />

√<br />

σ + rt<br />

For long (“sky noise limited”) exposures S<br />

N ∝ √ t so it’s hard <strong>to</strong> go deep!<br />

(Note tradeoff with area.) Be aware short exposures suffer a relatively<br />

large read noise penalty.<br />

The amplifier applies a “gain” fac<strong>to</strong>r G <strong>to</strong> obtain a digital number (DN)<br />

or analog <strong>to</strong> digital unit (ADU):<br />

where G is in e − /ADU.<br />

ADU = rt<br />

G


Motivation & background Instrumental Signature Removal Combining multiple images Pho<strong>to</strong>metric calibration<br />

Major types of CCDs<br />

• Front vs back illuminated: Back is best<br />

for quantum efficiency.<br />

• Thick (∼ 100µm vs thin ∼ 10µm: thick<br />

increases red sensitivity and decreases<br />

fringing<br />

• type of antireflective coating strongly<br />

influences red/blue sensitivity<br />

FRONT<br />

BACK<br />

CMOS and infrared sensors are not CCDs because they have an<br />

amplifier on each pixel and can read nondestructively.<br />

.


Motivation & background Instrumental Signature Removal Combining multiple images Pho<strong>to</strong>metric calibration<br />

Ground-based vs space-based<br />

Ground Space<br />

Background high ∗<br />

low<br />

CR rate low high<br />

Charge transfer efficiency good degrades with time †<br />

Pho<strong>to</strong>metric stability variable stable<br />

Angular resolution limited by atmospheric “seeing” can be very good ‡<br />

Wavelength limitations some none<br />

Cost low high<br />

Typical reduction mode do-it-yourself (software provided) more au<strong>to</strong>mated<br />

∗ most galaxies are much fainter than “blank” sky!<br />

† result: streaking as shown at right<br />

‡ depends greatly on observa<strong>to</strong>ry parameters


Motivation & background Instrumental Signature Removal Combining multiple images Pho<strong>to</strong>metric calibration<br />

Instrumental signature removal: overview<br />

• mask: identify bad pixels/areas <strong>to</strong> eliminate them from the<br />

following computations<br />

• overscan: correct for the bias of each row<br />

• crosstalk: correct for “signals” from nearby amplifiers<br />

• debias: correct for spatial variation of bias<br />

• defringe: subtract fringe pattern due <strong>to</strong> sky lines if present<br />

• flatfield: correct for nonuniform response


Motivation & background Instrumental Signature Removal Combining multiple images Pho<strong>to</strong>metric calibration<br />

Masking<br />

• identify<br />

pixels/areas<br />

which are always<br />

bad (eg dark<br />

column at left)<br />

• on each image,<br />

identify unique<br />

bad areas<br />

• always take<br />

multiple shifted<br />

exposures <strong>to</strong> fill<br />

in bad areas


Motivation & background Instrumental Signature Removal Combining multiple images Pho<strong>to</strong>metric calibration<br />

Overscan<br />

Determines ADU level corresponding <strong>to</strong> zero light, by reading out virtual<br />

pixels after the last real pixel in each row.<br />

Subtract the overscan level from each row.


Motivation & background Instrumental Signature Removal Combining multiple images Pho<strong>to</strong>metric calibration<br />

Bias and dark frames<br />

Bias (or zero) frames measure how the zero-light ADU level changes<br />

across each row. Always take multiple frames per night and average them<br />

for a robust measure.<br />

Dark frames measure how this level changes with time: usually negligible<br />

in modern cameras, but you should always check.<br />

Subtract the bias or dark frame from each data frame.


Motivation & background Instrumental Signature Removal Combining multiple images Pho<strong>to</strong>metric calibration<br />

Defringing<br />

Fringes have a stable spatial pattern, but amplitude varies in time.<br />

Make a fringe frame by median-combining your data and high-pass<br />

filtering the result:<br />

On each science frame, subtract the fringe frame times the best-fit<br />

amplitude.


Motivation & background Instrumental Signature Removal Combining multiple images Pho<strong>to</strong>metric calibration<br />

Flatfielding<br />

Basic idea: make a “uniformly illuminated” image (see below) and divide<br />

your data frames by it.<br />

This image shows dust (dark rings)<br />

and center-<strong>to</strong>-edge illumination<br />

gradient (vignetting) .<br />

Instead of uniformly illuminated, we really want an image illuminated just<br />

as the science objects are, e.g., vignetted in exactly the same way.


Motivation & background Instrumental Signature Removal Combining multiple images Pho<strong>to</strong>metric calibration<br />

Standard flatfielding options<br />

• dome flats: most telescopes have a (roughly) uniformly<br />

illuminated white screen inside the dome<br />

• twilight flats: the sky itself is roughly uniform (on camera<br />

scales) at twilight<br />

• dark-sky flats: median-combine the science frames<br />

None of these is perfect, for two reasons:<br />

• sky (and dome) pho<strong>to</strong>ns can travel through the optical system<br />

in different ways than object pho<strong>to</strong>ns!<br />

• response is a function of color


Motivation & background Instrumental Signature Removal Combining multiple images Pho<strong>to</strong>metric calibration<br />

Beyond Standard Flatfielding<br />

Ubercal (Padmanabhan et al 2008): use object pho<strong>to</strong>metry from multiple<br />

shifted expsures <strong>to</strong> solve for a model of required flatfield corrections.<br />

minstr = mtrue + kA + f (x, y)<br />

where A is the airmass of each exposure (assuming a pho<strong>to</strong>metric night!).<br />

Solve for k, f (x, y), and mtrue for each star (nuisance parameters). f (x, y)<br />

should be zero if standard flatfielding has worked.<br />

Results from Deep Lens Survey: ∼ 0.05 mag variations


Motivation & background Instrumental Signature Removal Combining multiple images Pho<strong>to</strong>metric calibration<br />

Beyond Standard Flatfielding II<br />

Stubbs et al: calibrate each pixel’s response at each wavelength<br />

with a tunable laser:<br />

Pan-STARRS at 901 nm.<br />

This way the colors of the sources can properly be taken in<strong>to</strong><br />

account.


Motivation & background Instrumental Signature Removal Combining multiple images Pho<strong>to</strong>metric calibration<br />

Caution for wide-field cameras<br />

The pixel size (as projected on the sky) changes from center <strong>to</strong><br />

edge in wide-field cameras, due <strong>to</strong> optical dis<strong>to</strong>rtion.<br />

Pixels at corners subtend less sky and appear fainter on sky flats,<br />

but do not collect fewer pho<strong>to</strong>ns from stars and galaxies!<br />

Model the optical dis<strong>to</strong>rtion <strong>to</strong> remove this effect.<br />

Also account for this effect when repixelizing on<strong>to</strong> a uniform grid!<br />

(See, eg, Mosaic data reduction manual for a more detailed<br />

explanation.)


Motivation & background Instrumental Signature Removal Combining multiple images Pho<strong>to</strong>metric calibration<br />

Why don’t we remove effect of PSF by deconvolving?<br />

from GREAT08, Bridle et al<br />

Deconvolution works well only in the high-S/N limit. (Same is true of<br />

many classical image-processing techniques.)<br />

Lensers extract lensing-specific corrections from the PSF, or<br />

forward-model the whole process.


Motivation & background Instrumental Signature Removal Combining multiple images Pho<strong>to</strong>metric calibration<br />

Combining multiple images: overview<br />

Conceptually, simply “coadd” multiple images of the same field <strong>to</strong> obtain<br />

a higher S/N “stacked image.”<br />

20x →<br />

This is a form of lossy data compression with (usually) high compression<br />

and low loss.<br />

There may be better ways <strong>to</strong> analyze your dataset (eg comeasurement,<br />

model fitting), but you usually want a stack at least for reference<br />

purposes.


Motivation & background Instrumental Signature Removal Combining multiple images Pho<strong>to</strong>metric calibration<br />

Cosmic ray rejection strategies<br />

• Start by building observa<strong>to</strong>ries/cameras with low-radioactivity materials!<br />

• If you have only one image, you can still identify most CR (at the catalog<br />

stage) as narrower than the PSF:<br />

• If you have two unshifted exposures, you can compare and mask.<br />

• Most often, you have multiple exposures and you can reject CR while<br />

stacking<br />

• CR are not the only things that change from image <strong>to</strong> image: also<br />

asteroids and satellite trails.


Motivation & background Instrumental Signature Removal Combining multiple images Pho<strong>to</strong>metric calibration<br />

Combining multiple images: prerequisites<br />

• coordinate transforms between stack and each exposure<br />

• relative pho<strong>to</strong>metric throughput of each exposure<br />

• relative S/N of each exposure (for weighting)<br />

• masks for each exposure<br />

• sky model for each exposure<br />

• other metadata for each exposure: eg saturation level<br />

• (ignoring PSF for now)


Motivation & background Instrumental Signature Removal Combining multiple images Pho<strong>to</strong>metric calibration<br />

Combining multiple images: subtleties<br />

• clipping biases the pho<strong>to</strong>metry (eg stars get much peakier in<br />

good seeing). Best <strong>to</strong> identify outliers before stacking (eg<br />

with psf-matched difference imaging)<br />

• for the same reason, a pixel saturated in any exposure should<br />

be considered always saturated<br />

• it’s not clear how <strong>to</strong> combine exposures with very different<br />

PSFs. May be best <strong>to</strong> forward-model everything.<br />

• track how many input pixels go in<strong>to</strong> each output pixel (and<br />

their variance)


Motivation & background Instrumental Signature Removal Combining multiple images Pho<strong>to</strong>metric calibration<br />

Pho<strong>to</strong>metric calibration<br />

• on “cloudless” (pho<strong>to</strong>metric) nights, image (and reduce, pho<strong>to</strong>meter)<br />

standard star fields several times, at a range of airmass<br />

• model the effect of airmass (usually linear in mag) and derive a<br />

pho<strong>to</strong>metric zeropoint m0 such that mtrue = minstr + m0 at zero airmass:


Motivation & background Instrumental Signature Removal Combining multiple images Pho<strong>to</strong>metric calibration<br />

Next lecture:<br />

Turning your image in<strong>to</strong> a catalog of stars and galaxies and<br />

their properties.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!