DISCLAIMER: This info was not written by an IPP developer, and has not been reviewed for accuracy or completeness.

Building a DARKMASK

The goal here is to construct a bad pixel mask using a set of darks as the input images. There are two steps to the process:

1) build a composite dark image to serve as the baseline image

2) use the baseline dark to detrend a set of darks. Flag pixels for which the dark correction is not uniform across all input images.

A "constant temperature" dark

We want to create our baseline dark from a small subset of images with a nearly constant temperature, and with the same exposure time. We have chosen the set of images from 20070913 with T between -90 and -84, and with etime = 100 sec. The database info on exposure time and temperature is incomplete, so we resort to using a list of exposure ids in definebytag mode:

dettool -definebytag -det_type DARK -workdir path://WORK/ -inst GPC1 -exp_id 400 -exp_id 403 -exp_id 406 -exp_id 409 -exp_id 412 -exp_id 415 -exp_id 418 -exp_id 421 -exp_id 424 -exp_id 427

And here is another dark creation run using a different image set at a different temperature:

dettool -definebytag -det_type DARK -workdir path://WORK/ -inst GPC1 -exp_id 451 -exp_id 454 -exp_id 457 -exp_id 460 -exp_id 463 -exp_id 466

Normally, a composite dark image is created by combining a set of masked dark images. Since the pipeline expects the input images to have bad pixels already masked, it will reject exposures that don't satisfy a set of rejection criteria, specified at the site level in the recipes/rejections.config file (and adjusted at the camera level in the gpc1/rejections.config file). For the purpose of building a darkmask, we actually want to let all pixels through. So you need to temporarily remove all the rejection criteria from your camera-level gpc1/rejections.config file by setting everything to zero (zero means "ignore this rejection criterion"):

# 071115 : (SR) Set up for creating a dark to serve as # a darkmask input, so we let everything through DARK METADATA

FILTER STR * EXPECTED F32 0.0 IMFILE.MEAN F32 0.0 IMFILE.STDEV F32 0.0 IMFILE.MEANSTDEV F32 0.0 IMFILE.SKEWNESS F32 0.0 IMFILE.KURTOSIS F32 0.0 IMFILE.SNR F32 0.0 IMFILE.BIN.STDEV F32 0.0 IMFILE.BIN.SNR F32 0.0 IMFILE.FLUX F32 0.0 EXP.MEAN F32 0.0 EXP.STDEV F32 0.0 EXP.MEANSTDEV F32 0.0 EXP.SNR F32 0.0 EXP.BIN.STDEV F32 0.0 EXP.BIN.SNR F32 0.0 EXP.FLUX F32 0.0 ENSEMBLE.MEAN F32 0.0 ENSEMBLE.STDEV F32 0.0 ENSEMBLE.MEANSTDEV F32 0.0

END

After creating the dark, you'll want to return these to their previous values, or allow the site-level recipes/rejections.config defaults by deleting this recipe from your camera-level gpc1/rejections.config file.

Now you can run those detRuns we set up, using pantasks in the usual way. When either of the darks have finished, fix up your rejections.config file and then proceed to the next phase: darkmask creation.

From DARK to DARKMASK

Once you have created a composite dark with no rejections, you can compare any set of dark images to the composite dark to create a darkmask. To choose which dark you want, edit the detRunSummary in mySQL. For example, to disable the second dark, use:

mysql> update detRunSummary set accept=0 where det_id=2;

(of course, your det_id number may be different). Now set up a darkmask run using dettool. For this darkmask, we're going to use the same darks that were used to create our first composite dark:

dettool -definebytag -det_type DARKMASK -workdir path://WORK/ -inst GPC1 -exp_id 403 -exp_id 406 -exp_id 409 -exp_id 412 -exp_id 415 -exp_id 418 -dbname gpctest

Now you can run this in pantasks, and out pops a DARKMASK.

What have we done?

The IPP has dark-corrected each dark in the input set, using the dark image you created above. At each pixel in the focal plane, the IPP has collected a vector of values from all these dark-corrected darks. If the standard deviation of the vector of pixel values is above a threshold value, that pixel is flagged. The final darkmask image has non-zero values for bad pixels, and zeroes for all pixels that pass through unflagged. You can tweak the criteria for bad pixel flagging by adjusting the values in the DARKMASK metadata recipe in the camera-level gpc1/rejections.config file.