IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changes between Version 11 and Version 12 of Stack_Sky_Levels


Ignore:
Timestamp:
May 12, 2014, 5:37:16 PM (12 years ago)
Author:
watersc1
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • Stack_Sky_Levels

    v11 v12  
     1== 2014-05-07 ==
     2
     3After a suggestion from Gene and a series of tests, I've come to the
     4conclusion that the small residual chip background is a function of
     5the image quantization/compression code.  The following table shows
     6the background mean/sigma values for two warps for a series of tests.
     7
     8The first two rows are the entries from the gpc1 database for the
     9skycell and primary chip image (this skycell are comprised primarily
     10of one OTA) in the test.
     11
     12All subsequent tests were performed with identical random seed (1234).
     13The seed.passX rows are the background values generated in ppImage
     14with a three-pass change (fit background, subtract, repeat).  They
     15seem to confirm that the statistic is working just fine.
     16
     17Next is the in-and-out test, where after writing the image, psphot is
     18used to remeasure the background.  This provides the ~0.3 count offset
     19seen in previous tests.  To confirm that this is a compression
     20artifact, I repeated with an image saved by ppImage uncompressed.
     21There are three sigma based scaling methods defined in psLib, and I
     22checked that they exhibit biases around zero that make some sort of
     23sense (the positive scale is what is used in the normal compressed
     24image, so that is shown in the in-and-out test).
     25
     26Finally, I noticed that the statistic used to generate the mean/sigma
     27values for the scaling is psLib was the "robust" median/stddev, not
     28the "fitted" that is used for the background tests.  Changing this and
     29repeating the tests did not improve the result significantly.
     30
     31
     32The way the scaling flips around zero (and that the "both" is still
     33offset in one direction) makes me suspect that there's an off-by-one
     34error in the scaling code.  I haven't yet tracked it down, but I
     35wanted to get this status note out.
     36
     37||#test           ||warp.964581  ||||                   warp.964593||||
     38||chip.bg        || 25.1021       ||  17.3215    ||     28.8274   ||      8.38539
     39||warp.bg        || 0.366421      ||  6.898341   ||     0.357391  ||      6.962276
     40||seed.pass1.bg  || 25.729        ||  8.0774     ||     28.7602    ||     8.075996
     41||seed.pass2.bg  || 0.0147        ||  8.0745     ||     0.000294  ||      8.07090
     42||seed.pass3.bg  || 0.000620      ||  8.0765     ||     0.004085  ||      8.066377
     43||in-and-out     || 0.281408       || 7.734210   ||     0.296758  ||      25.729009
     44||io.uncomp      || 0.013544      ||  8.066099   ||     -0.002336 ||      8.080612
     45||io.both        || 0.182691      ||  7.497421   ||     0.193386  ||      7.664834
     46||io.neg         || -0.307696     ||  7.727381   ||     -0.230592 ||      7.777576
     47||io.fitted      || 0.298210      ||  7.775235   ||     0.253315  ||      7.689663
     48||io.fitted-both || 0.159112      ||  7.453220   ||     0.142325  ||      7.238388
     49||io.fitted.int  || 0.027772      ||  8.151440   ||     -0.108624 ||      7.896051
     50
     51
     52== 2014-05-01 ==
     53
     54After looking through the code on this, I think I've finally sorted
     55out the source of this background.  In order to ensure that all stacks
     56have a zeropoint of 25, the input fluxes are normalized, such that:
     57
     58{{{
     59f_stack = \sum (f_i * w_i)/sum(w_i) * n_i
     60with
     61n_i = 10**( -0.4 * ([z_filter + eps_seeing + 2.5 log10(t_i)] -
     62                       [z_stack + 2.5 log10(t_stack)]))
     63  ~ N * 10**(-0.4 * [z_filter - z_stack]);
     64}}}
     65
     66This means that any residual background is the stack is multiplied by
     67N and a zeropoint factor that ranges from 1.3 (r) to 5.1 (y).  This
     68means for a typical g-band 8-input stack, the residual background is
     69multipled by ~13.5.
     70
     71A typical g warp seems to have a residual background of ~.3-.4 with a
     72sigma of ~7-8.  The current psStats implementation simply cannot find
     73that small of a signal.  As we start stacking, the normalization
     74scaling pushes up that signal much faster than the image variance:
     75
     76|| Ninput||      gauss_mean||      gauss_sigma||
     77|| 4 ||  2.22026||         35.853||
     78|| 8 ||  5.57725||         51.721||
     79|| 12 ||         8.83167||         50.0609||
     80|| 19||          14.4736||         82.931||
     81
     82We do not generate a background model of the final stack, but this is
     83done prior to doing the photometry.  As the s/n of the background is
     84much higher in the stacks, this can identify and subtract it off,
     85yielding measured SKY values that are non-zero.
     86
     87
     88
     89Stacks assign weights the input exposures, and this weight has a term related to the difference between the input zeropoint and the target zeropoint of 25.0.
     90
     91#test           warp.964581                     warp.964593
     92chip.bg         25.1021         17.3215         28.8274         8.38539
     93warp.bg         0.366421        6.898341        0.357391        6.962276
     94seed.pass1.bg   25.729          8.0774          28.7602         8.075996
     95seed.pass2.bg   0.0147          8.0745          0.000294        8.07090
     96seed.pass3.bg   0.000620        8.0765          0.004085        8.066377
     97in-and-out      0.281408        7.734210        0.296758        25.729009
     98io.uncomp       0.013544        8.066099        -0.002336       8.080612
     99io.both         0.182691        7.497421        0.193386        7.664834
     100io.neg          -0.307696       7.727381        -0.230592       7.777576
     101io.fitted       0.298210        7.775235        0.253315        7.689663
     102io.fitted-both  0.159112        7.453220        0.142325        7.238388
     103io.fitted.int   0.027772        8.151440        -0.108624       7.896051
     104
     105
    1106== 2013-12-04 ==
    2107