WFC3UVISHandler¶
- class one_pass_fitting.data_handlers.WFC3UVISHandler(image, catalog)¶
Bases:
ImageHandlerImageHandler subclass for HST WFC3/UVIS
Methods Summary
calculate_apcorr([radius, sky_in, sky_out, ...])Calculate the aperture correction for photometric measurements.
For each position in catalog, return the correction factor for pixel area
Converts flux values in the catalog to ABMag and STMag.
correct_catalog([aperture, pixel_area, ...])Applies various corrections to catalogs, and calculates physical mags.
ee_func()Updates the RA and Dec columns in
self.catalogto be consistent withself.wcsMethods Documentation
- calc_encircled_corr()¶
- calculate_apcorr(radius: float | None = None, sky_in=None, sky_out=None, sky_stat='mode')¶
Calculate the aperture correction for photometric measurements.
This method calculates the scalar offset between the PSF fit fluxes and aperture photometry measurements at the provided aperture/annulus radii. This is necessary to calibrate the PSF fluxes. It is recommended that
radiusbe equal to an aperture where the PSF and thus encircled energy are known to be stable, e.g. 0.4” for WFC3Parameters:¶
- radiusfloat, optional
The radius of the circular aperture used for photometry.
- sky_infloat or None, optional
The inner radius of the annulus for sky background estimation. If None, it is set to 2 *
radius.- sky_outfloat or None, optional
The outer radius of the annulus for sky background estimation. If None, it is set to 3 *
radius.- sky_statstr, optional
The statistic to use for sky background estimation, one of “mean”, “median” or “mode”.
Returns:¶
None
Notes:¶
This method calculates the aperture correction by comparing the instrumental magnitudes to
calibrated magnitudes of stars in the catalog. - The computed aperture correction is stored in the object’s
ap_corrattribute.Example:¶
# Create an
ImageHandlerobject and calculate the aperture correction img_hand = ImageHandler(image, catalog) img_hand.calculate_apcorr(radius=1.0, sky_stat=”mode”) # The aperture correction is now available asimg_phot.ap_corr.
- calculate_area_corr()¶
For each position in catalog, return the correction factor for pixel area
- convert_mags()¶
Converts flux values in the catalog to ABMag and STMag.
This method applies scaling factors and zeropoints to convert the fluxes measured in the image to ABMag and STMag units. It handles various starting units for HST and JWST data and performs necessary calculations to obtain the final magnitudes.
Notes¶
For HST data with units in ELECTRONS, the method corrects for exposure time and applies inverse sensitivity factors to convert flux to STMag, then converts to ABMag
For HST data with units in ELECTRONS/s, the method applies inverse sensitivity factors to convert flux to STMag, then converts to ABMag
For JWST data with units in MJy/sr, the method calculates first ABMag using pixel area (in steradians) to convert to Jy, then to ABMag, and then to STMag.
For unit conversion definitions see
here https://www.stsci.edu/hst/instrumentation/acs/data-analysis/zeropoints#section-c5a9e052-dcf3-4b57-b783-5c66578b479c
Warning¶
This method modifies the ‘ST’ and ‘AB’ columns in the catalog in-place.
- correct_catalog(aperture=False, pixel_area=False, encircled=False, **kwargs)¶
Applies various corrections to catalogs, and calculates physical mags.
Depending on the PSF model used when generating the catalogs, certain corrections need to be applied in order to 1) remove systematic offsets between fits from different images, and 2) photometrically calibrate them. For instance the if the PSF model is normalized at a radius of 5.5 pixels, then the fit fluxes do not account for the light outside of 5.5 pixels. This then requires an aperture correction to calibrate out. Furthermore, if combining catalogs from different regions of a detector, then the flux may be off by a factor of the pixel area. Lastly, for HST and JWST, the units of the image (and thus the measured flux from the PSF fit) are not physical flux units, and must be scaled by the appropriate factors. This function does these corrections.
The first (optional) correction is the aperture correction. This measures the aperture photometric flux for good sources in the image at a larger radius, and computes the correction factor between it and the PSF fit flux. This is needed when using Jay Anderson’s STDPSF models, as the tapering of these models to be 0 at some radius causes some flux to be left out. IF USING WEBBPSF MODELS THIS IS NOT NEEDED, SO
apertureSHOULD REMAINFalse. Seecalculate_apcorrfor more info.The next (optional) correction is the pixel area correction. This is necessary as the flatfielding step of the HST pipeline corrects images to make surface brightness flat across the image, which make point source fluxes show a spatial systematic. Puzzlingly, this is not needed when using WebbPSF models either? So keep
pixel_areaFalse for JWST catalogs if using Webb PSF Models. Seecalculate_area_corrfor more info.The third (optional) correction is the encircled energy correction. This is typically needed if doing the aperture correction above, as above a certain radius, it is difficult to measure the aperture correction (depending on crowding). This means the flux from the aperture correction radius out to infinity is left out from the flux. This correction relies upon pre-tabulated encircled energy tables, usually provided by the instrument team, and accounts for all the remaining flux outside of the aperture correction radius. Since these models are often unreliable at small radii, we must measure the aperture correction in the image out to some radius, and then apply this correction to account for all the light.
encircledSHOULD ALSO BEFalseIF USING WEBBPSF MODELS. Seecalc_encircled_corrfor details.The last correction is the correction to ST and AB mag systems. This is pretty much just applying zeropoints and unit conversion. Vegamag will come soon. See
convert_magsfor details.Parameters:¶
- aperturebool, optional
Perform the intermediate aperture correction? Default
False- pixel_areabool, optional
Perform the pixel area correction? Default
False- encircledbool, optional
Perform the intermediate aperture to infinite aperture correction? Default
False- **kwargsoptional
Keyword arguments to be passed to aperture correction. See
calculate_apcorrfor details
Returns:¶
None
- ee_func()¶
- make_area_array()¶
- update_sky_coords()¶
Updates the RA and Dec columns in
self.catalogto be consistent withself.wcs