IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changes between Initial Version and Version 1 of Stack_Algorithm


Ignore:
Timestamp:
Oct 22, 2013, 3:44:02 PM (13 years ago)
Author:
watersc1
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • Stack_Algorithm

    v1 v1  
     1= Intro =
     2
     3== Input selection ==
     4
     5== PSF Matching ==
     6
     7== Pixel Rejection ==
     8
     9The following conventions in the remainder of this discussion.  Lower case values are for a single
     10pixel on image "i", upper case values are values that are constant for
     11a given image "i" (i.e., all pixels on image i have that parameter),
     12greek values are combined values (the stacked values).
     13
     14# Set up
     15For a given pixel, define four parameters:
     16f_i   pixel value
     17v_i   pixel variance value
     18m_i   input mask value, 0 = bad, 1 = good
     19s_i   suspect mask value, 0 = not suspect, 1 = suspect
     20W_i   image weight
     21
     22There are also a set of configurable options:
     23NMIN     = 5       Minimum number of values for KMM test
     24MIN_UNI  = 0.05    Minimum probability to accept a bimodal solution
     25SYS_FRAC = 0.1     Systematic variance fraction
     26NSIG_REJ = 3.5     N-sigma rejection threshold
     27DISCARD  = 0.2     Fraction of values to exclude in Olympic mean
     28ITER     = 0.5     Number of rejection iterations per input
     29
     30After convolution to the target PSF, we add an additional variance
     31(ADDV_i) term equal to the chi^2 value found during the PSF matching.
     32For 1d Gaussian convolution, we have no real concept of this value, so
     33all chi^2 (and ADDV_i) are defined to be 1.0;
     34
     35v_i = v_i + ADDV_i
     36
     37The image weights are calculated by taking the inverse of the robust
     38median of the variance image:
     39
     40W_i ~ 1 / sum_{x,y} v_i_{x,y}
     41
     42# Calulate initial stack values
     43
     44- Calculate the weighted mean:
     45
     46mu    = sum_i( f_i * W_i) / sum_i(W_i)
     47sigma = 1 / sum_i(1 / W_i)
     48nu    = sum_i(m_i)
     49
     50# Rejection loop
     51
     52This loop is repeated ITER * Ninput times (minimum of once).
     53
     54- Determine distribution values:
     55
     56if (nu > NMIN) do Mixture Model test:
     57 mu_KMM      mean of most popular gaussian mode
     58 sigma_KMM   sigma of most popular gaussian mode
     59 pi_KMM      fraction of inputs in most popular gaussian mode
     60 rho_UNI     Probability that inputs are unimodal
     61
     62- Set rejection limits for each input:
     63
     64if (nu > NMIN) sys_var = sigma_KMM^2
     65else           sys_var = SYS_FRAC * f_i
     66
     67limit_i = (NSIG_REJ)^2 * (v_i + sys_var)
     68
     69- Determine distribution median
     70
     71if (nu > NMIN) mu_median = mu_KMM
     72else           mu_median = olympic_mean
     73where:
     74olympic_mean = sum_i(f_i * W_i) / sum_i(W_i)
     75from int((DISCARD * nu + 0.5)/2.0)
     76to int((DISCARD * nu + 0.5)/2.0) + int(nu) - int(DISCARD * nu + 0.5)
     77
     78- Determine most discrepant point
     79
     80if ( (f_i - mu_median)^2 > limit_i ) AND
     81   ( (f_i - mu_median)^2 / limit_i > delta ) THEN
     82 delta = (f_i - mu_median)^2 / limit_i
     83 delta_index = i
     84
     85- Do rejection.  If we have suspect pixels, throw those out first (so
     86  they'll be skipped in the next iteration).  Otherwise, remove the
     87  most discrepant point
     88
     89if DEFINED(dev_i)
     90   if (s_i != 0) m_i = 0
     91   else if (i = delta_index) m_i = 0
     92
     93- End rejection loop.
     94
     95
     96This completes the initial stack stage of ppStack.  We then use the
     97set of rejected pixels to identify the source pixels in the
     98unconvolved input images.  These are masked out, and the images are
     99reconvolved and a final stack is constructed using the same algorithm,
     100however the rejection loop is skipped (so the weighted mean is all
     101that is performed).
     102
     103
     104== Output Products ==
     105