IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changes between Initial Version and Version 1 of GPC_DarkMask


Ignore:
Timestamp:
Feb 24, 2009, 4:23:55 PM (17 years ago)
Author:
trac
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • GPC_DarkMask

    v1 v1  
     1'''DISCLAIMER:''' This info was not written by an IPP developer, and has not been reviewed for accuracy or completeness.
     2 
     3=== Building a DARKMASK ===
     4
     5The 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:
     6
     71) build a composite dark image to serve as the baseline image
     8
     92) use the baseline dark to detrend a set of darks. Flag pixels for which the dark correction is not uniform across all input images.
     10
     11==== A "constant temperature" dark ====
     12
     13We want to create our baseline dark from a small subset of images with a nearly constant
     14temperature, 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:
     15
     16   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
     17
     18And here is another dark creation run using a different image set at a different temperature:
     19
     20   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
     21
     22Normally, 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"):
     23
     24   # 071115 : (SR) Set up for creating a dark to serve as
     25   # a darkmask input, so we let everything through
     26   DARK METADATA
     27     FILTER                  STR  *
     28     EXPECTED                F32 0.0
     29     IMFILE.MEAN             F32 0.0
     30     IMFILE.STDEV       F32 0.0
     31     IMFILE.MEANSTDEV   F32 0.0
     32     IMFILE.SKEWNESS    F32 0.0
     33     IMFILE.KURTOSIS    F32 0.0
     34     IMFILE.SNR         F32 0.0
     35     IMFILE.BIN.STDEV   F32 0.0
     36     IMFILE.BIN.SNR     F32 0.0
     37     IMFILE.FLUX        F32 0.0
     38     EXP.MEAN           F32 0.0
     39     EXP.STDEV          F32 0.0
     40     EXP.MEANSTDEV      F32 0.0
     41     EXP.SNR            F32 0.0
     42     EXP.BIN.STDEV      F32 0.0
     43     EXP.BIN.SNR        F32 0.0
     44     EXP.FLUX           F32 0.0
     45     ENSEMBLE.MEAN      F32 0.0
     46     ENSEMBLE.STDEV     F32 0.0
     47     ENSEMBLE.MEANSTDEV F32 0.0
     48   END
     49
     50After 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.
     51
     52Now 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.
     53
     54==== From DARK to DARKMASK ====
     55
     56Once 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:
     57
     58   mysql> update detRunSummary set accept=0 where det_id=2;
     59
     60(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:
     61
     62  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
     63
     64Now you can run this in pantasks, and out pops a DARKMASK. 
     65
     66===== What have we done? =====
     67The 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.
     68
     69----