| | 7 | |
| | 8 | I spent the week looking at minutia of psphot to understand some of the issues Nigel and Michael have raised recently: |
| | 9 | |
| | 10 | * I've set the minimum Kron radius to that appropriate to the bright stars for an image; this should address the undershoot of the kron mags for some faint galaxies. |
| | 11 | * I've set a maximum Kron radius based on the window (based in turn on the isophotal footprint) -- some faint sources were getting absurd values |
| | 12 | * I've addressed some errors with the PSF_QF and PSF_QF_PERFECT masking for stacks (but an error remains: the stacks are missing certain bits in the 'bad' mask bit set -- TBD). |
| | 13 | * I've updated the PSF I/O function save and load both the aperture correction model and the growth curve. I've also adjusted the |
| | 14 | photometry code to apply both corrections as appropriate to the psf-related mags and fluxes. Michael: you already tried the update |
| | 15 | with the aperture correction; the offset for extended sources was due to a test that did not apply it for extended sources. But, the growth |
| | 16 | curve needs to be applied consistently to both output of the straight and the forced photometry, so I needed to add that to the PSF model. This should address the offset you were seeing. the only remaining discrepancies I saw were due to the fact that psphot-straight subtracts an extended model for objects if it has one, but the cmf file does not store that model information; psphotForced is thus forced to subtract psf models for everyone. This can eventually be addressed, but it requires saving a lot more info. let me know if this is a high priority for you. |
| | 17 | * I've updated the curve of growth analysis to use the bright stars (used for the psf model); I had been cheating by using the psf model |
| | 18 | itself to judge the growth correction. some of my tests show that this was resulting in an error of about 1% for the reference aperture |
| | 19 | normally used in the analysis (25 pixels) |
| | 20 | * I have NOT changed the config files, but I have concluded that we need to move from 25 pixels for the reference aperture to something larger -- probably 35 pixels for the single image analysis. This conclusion is driven by trends I see in the zero points in the MD fields that correlated with the FWHM, but corroborated by the fact that the curve of growth still has ~1-1.5% more to go at 25 pixels, |
| | 21 | depending on the seeing. I would like to run a set of tests to confirm that bumping up the reference aperture fixes the apparent zero |
| | 22 | point trend. |
| | 23 | * the aperture magnitudes are measured in an interpolated image shifted to be centered in the circular mask; I found an error in the |
| | 24 | interpolation used for this shift. i changed the interpolation method to bilinear, which did not have the error (note that only this |
| | 25 | aperture interpolation uses that particular interpolation mode, so there are no other implied errors). The error is small for relatively |
| | 26 | large apertures, but for the smallest apertures used in the curve-of-growth analysis, it introduced some noise. I don't think anyone will notice the impact of this particular fix... |
| | 27 | |
| | 28 | Just to be clear: there are 2 different corrections which are applied: |
| | 29 | |
| | 30 | * the psf magnitude is measured for the psf model and integrated to infinity (actually, 50 sigma). this is the raw PSF magnitude |
| | 31 | * the aperture magnitude is measured in a modest-sized aperture. this aperture is set based on the FWHM, and is typically in the range 8 - 15 pixels. This aperture is meant to be small so that neighbor confusion is minimal, but this implies that they will lose a fraction |
| | 32 | of the light of the object. this is the AP_MAG_RAW value reported in the CMF file. |
| | 33 | * the aperture magnitudes are corrected via the curve of growth from the measurement aperture to the reference aperture. This is meant to be large enough to capture essentially all light regardless of seeing (or at least to lose a fixed amount and be insensitive to seeing). 25 pixels is apparently to small to meet this goal. This is the AP_MAG value reported in the CMF file. |
| | 34 | * the psf model magnitudes are corrected for the mean difference between the aperture flux and the raw psf model. This correction is |
| | 35 | measured as a 2D map across the image. Note that this correction is measured relative to the *growth corrected* aperture mags. Regarding the '2D map': values are interpolated to positions within the image based on a coarse gridded image; the scale of the map is set dynamically by the number of stars to have ~3 stars per cell (probably too small -- but I have not yet bumped this up. |
| | 36 | |
| | 37 | Finally, I've added a function to psphot to measure the kron magnitudes with the other source models subtracted. With the min and |
| | 38 | max radii set above, I think this cleans up a lot of the bad kron mags, but I'd like to have feedback on that point; I've asked Nigel & Michael to re-run their tests. |