Constructing an accurate weight map for use in photometry?

hkhandrikahkhandrika Member, Institute_Staff Posts: 4
edited December 2014 in Image Combination
How do I construct a true error image for my drizzled products? I think the description in the Handbook Section 4.1.12 is incorrect.


  •[email protected] Member, Institute_Staff, Moderator_DrizzlePac Posts: 30
    edited December 2014
    Hi, you are correct, that section should be revised.

    It currently says:
    For users who want an accurate weight map for use in photometry, a good approach may be to first run astrodrizzle using final_wht_type set to either EXP (when bright sources are most important) or IVM (if the faint sources are the primary objects of interest). This creates the final science image but not the final weight map. To create a final weight map, astrodrizzle needs to be run again, using the same weighting scheme as in the first drizzle; however, the original weight maps (drz_wht.fits images) should be drizzled rather than the images. This will give an output “image” that fully estimates the error at each pixel. At present, there’s no easy way for the user to do this. Perhaps this could be done by swapping in the flt.fits ERR array for the science (SCI) array, then running astrodrizzle on the modified images. If there is demand for this approach, it may be implemented as a feature in a future version of AstroDrizzle.

    Since the flt ERR arrays are meant to contain the standard error in e- per pixel, then the prescription above is not correct. You can't just swap them into the SCI arrays, drizzle them together, and get a valid error image to go with the (already drizzled) sci image. You'd first have to square the ERR arrays, then drizzle them (with no sky subtraction, etc), and the result would be a variance array, which you could give to SExtractor with MAP_VAR, or take the square root of, to get a MAP_RMS image.
  • mcaramcara Member Posts: 4
    edited December 2015
    Unfortunately, obtaining "true" error maps associated with a drizzled image is almost impossible using current software without performing some sort of mind-bending contortionism in processing data.

    Even the suggestion to drizzle ERR**2 above will not work if you want to add errors in quadrature from various input pixels contributing to an output pixel. For example, let's imagine that a pixel from an input image contributes to an output pixel with a fraction c=0.25 of its flux (counts). Let's also assume that standard deviation (e.g., the value of the same pixel in the ERR array) associated with this input pixel is s=10. If one were to drizzle ERR**2 array, then the value of the drizzled pixel would be (assuming no other input pixels contribute to this output pixel) c*(s**2)=0.25*10**2=25. Taking the square root of this value we would give us "MAP_RMS"=sqrt(25)=5. However, the standard deviation of the output pixel should have been c*s=2.5.

    The fundamental problem of the above suggestion to drizzle ERR**2 arrays is that only errors are being squared (before being added to the output image) without accounting correctly for the contribution of each input pixel to the output pixel. In other words, if multiple pixels (from the same image or from different input images) contribute (with a contribution c_i) to a single output pixel and each input pixel has a standard deviation s_i, then the output's pixel error (if we wanted to add errors in quadrature) would be Sqrt(Sum((c_i*s_i)**2)). The previous advice, however, leads to the following estimate Sqrt(Sum(c_i*(s_i)**2)) which is not the same as adding errors in quadrature.

    Now, even if you somehow managed to add errors in quadrature using correct formula, you will still likely not get "true" error estimates as, due to the nature of drizzling, errors will be correlated (unless you use "point" kernel).
Sign In or Register to comment.