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