Aperture photometry

Petrosian-aperture photometry on the PSF-subtracted residual image, plus isophote fitting and inter-filter PSF aperture corrections.

sphot.aperture.aperture_routine(galaxy, petro=0.5, center_mask=3.5, plot=True, isophot_base_filter=None, isophot_frac_min=0.05, isophot_frac_max=0.95, fit_isophot_to='sersic_modelimg', measure_on='psf_sub_data', error_on='psf_sub_data_error', measure_sky_on='residual_masked', fill_max_nan_frac=0.7, fill_replace_with='sersic_modelimg', correct_PSF=True, PSF_corr_base_filter='F090W', custom_aperture=None, **kwargs)[source]

Run aperture photometry.

sphot.aperture.prepare_blurring_kernel(galaxy, filt, blur_to, window=photutils.psf_matching.TopHatWindow)[source]

Create a PSF-matching kernel

sphot.aperture.fill_nans(galaxy, apertures, apply_to='psf_sub_data', replace_with='sersic_modelimg', max_nan_frac=0.5)[source]

fill in NaN values in the data using median of the finite pixels within annulus defined by consequtive apertures. Creates a new attribute with ‘_filled’ suffix.

Parameters:
  • galaxy (MultiBandCutout) – the galaxy object

  • apertures (list) – a list of apertures to define the annulus

  • apply_to (str or list of str) – the attributes of the cutoutdata to fill NaNs in

  • replace_with (str) – the attribute to use as a reference for filling NaNs if the fraction of NaNs is too high

class sphot.aperture.IsoPhotApertures(cutoutdata)[source]

Bases: object

create_apertures(fit_to='sersic_modelimg', frac_enc=numpy.arange)[source]

create isophotal apertures, equally spaced in the surface brightness levels

Parameters:
  • fit_to (str) – the attribute of the cutoutdata to fit the isophotal apertures to

  • frac_enc (list) – approx. fractional levels of enclosed flux within aperture

fill_nans(apply_to='psf_sub_data', fill_method='median', max_nan_frac=0.5, add_noise=False)[source]

fill in NaN values in the data. creates a new attribute with ‘_filled’ suffix

Parameters:

fill_method (str) – ‘noise’ or ‘median’ – how to fill in NaN values in the data

measure_flux(measure_on='psf_sub_data')[source]

perform aperture photometry using pre-constructed isophotal apertures.

Parameters:

measure_on (str) – the attribute of the cutoutdata to measure the flux on

calc_petrosian_indices(bin_size=2)[source]
plot(x_attr='semi_major_axes')[source]
get_aper_at(petro=None, flux_frac=None, x_attr='semi_major_axes')[source]
class sphot.aperture.CutoutDataPhotometry(cutoutdata, aperture)[source]

Bases: object

measure_sky(measure_on='residual_masked', N_apers=200, center_mask=3, mode='random')[source]

Estimate the uncertainty in aperture photometry using the background and moving aperture

Parameters:
  • measure_on (str) – the attribute of the galaxy to measure the sky on

  • center_mask (float) – the size of the mask near the center to avoid when measuring sky, in units of aperture radius

  • mode (str) – ‘random’ or ‘grid’ – whether to sample the sky apertures randomly or in a grid

measure_flux(measure_on='psf_sub_data', error_on=None)[source]

perform aperture photometry using pre-constructed isophotal apertures

measure_frac(measure_on='residual_masked')[source]

measure fraction of flux enclosed within the aperture

calc_mag(pixel_scale=0.03)[source]
plot(title=None)[source]