Apcor updates rgc#96
Conversation
| The enclosed energy fractions are fixed at the JWST NIRCAM values: | ||
| x = [0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.85, 0.9, 0.95]. | ||
| Each value of the enclosed energy fraction has an accompanying pixel radius and aperture correction. | ||
| ee_radii: aperture radii in arcseconds, defined on a fixed grid from 0.025 to 5.0 arcsec in steps of 0.025 |
There was a problem hiding this comment.
I really appreciate that now the EE fraction is calculated as a function of circular aperture!
Regarding the choice of radii: 1) I would use pixels instead of arcseconds, since images are distorted and the distortion changes as a function of location on the detector and of the detector. This is particularly important when running the code on observed images; 2) I would increase the first aperture radius since there is no need to measure anything with a radius smaller than 1 pixel for the purpose of the EE correction. For instance, a set of radii from 2 pixels up to 45-50 would work. When we need to add real pixel values for the sky, the inner radius should be bigger than the last circular aperture radius, i.e. at least 46 or 51 pixels, with the outer radius at least 56 or 61 pixel. This would put "infinity" at around 6.5-7", which is a good approximation. I did some tests on images simulated with Romanisim, and the flux of measured stars in the field of view was getting constant around 4.5 to 5 arcseconds.
Regarding the spacing, 1 to 2 pixel should be enough, especially if you interpolate later, 2 pixels might be better.
There was a problem hiding this comment.
Did you test using one of the output files with simulated data from Romanisim? Or was that a separate test?
There was a problem hiding this comment.
I attach here the plot comparing the per correction reference file for WFI01 and F106 (black circles) with those obtained by: 1) simulating a LMC stellar field from synthetic photometry 2) the field around the standard star WD1657+343; 3) a catalog of 200 stars created by romanisim. All simulations were done with romanisim. In all 3 cases the EE fractions were calculated on a sample of selected stars in brightness and classified as stars by Source Extractor. These are about 10-20 stars. Values of the EE curve are a bit different in the 4 cases, in particular for the LMC simulations. These stars were fainter and more crowded compared to the other cases. The agreement of the current aperture correction reference file is very good with the simulations.
| Each value of the enclosed energy fraction has an accompanying pixel radius and aperture correction. | ||
| ee_radii: aperture radii in arcseconds, defined on a fixed grid from 0.025 to 5.0 arcsec in steps of 0.025 | ||
| ee_fractions: enclosed energy fraction evaluated at each radius | ||
| ap_corrections: aperture corrections at each radius, computed as the inverse of the EE fraction (1 / EE) |
There was a problem hiding this comment.
The aperture correction expressed as 1/EE fraction works if used to correct the star fluxes. For instance, this doesn't work if correcting star magnitudes. In that case the formula to use would be m_cor = m + 2.5×log(EE(r)) Should we provide a reference file with the EE fraction as a function of r and than the user will use the file as they prefer to correct the measurements? Or Romancal is reading a number from these files and dividing by it already? I don't think this part of Romancal is implemented yet so we might think about it. In this way the reference files would be useful to Romancal and to users at the same time.
There was a problem hiding this comment.
If you are seeing something that we need to add, please let @tddesjardins and me know asap. We can add extra arrays to the reference file but should note that they are not required by the schema yet if there are truly new.
| ee_radii: aperture radii in arcseconds, defined on a fixed grid from 0.025 to 5.0 arcsec in steps of 0.025 | ||
| ee_fractions: enclosed energy fraction evaluated at each radius | ||
| ap_corrections: aperture corrections at each radius, computed as the inverse of the EE fraction (1 / EE) | ||
| sky_background_rin, sky_background_rout: placeholders for sky annulus radii (currently not used and set to None) |
There was a problem hiding this comment.
I suppose these are currently set to none since there is no real sky background in the STPSF simulation?
|
|
||
| Generates a stpsf model and performs circular aperture photometry at integer oversampled pixel radii between min_radius and max_radius. Interpolating the aperture photometry and evaluating the interpolation at the enclosed energy fractions determines the enclosed energy pixel radii and allows for the aperture correction to be calculated. | ||
| # Define radii grid | ||
| radii_arcsec = np.arange(0.025, 5.0001, 0.025) |
| #TODO: this needs to be updated to include background effects | ||
| aperture_corrections = 1./enclosed_energy_fractions | ||
| # Aperture corrections | ||
| aperture_corrections = 1.0 / ee_fractions |
| 'ap_corrections': aperture_corrections, | ||
| 'sky_background_rin': 2.4, | ||
| 'sky_background_rout': 2.8, | ||
| } |
There was a problem hiding this comment.
Weren't the sky_rin adn sky_rout supposed to be set to "none" at the moment?
There was a problem hiding this comment.
These are the values requested from romancal red team.
BradleySappington
left a comment
There was a problem hiding this comment.
reviewed by SMEs


Following some examples of using stpsf from @tddesjardins I updated the aperture correction module to use some pre-baked functions accessible to the psf object in stpsf.