calc_rad¶
- tessilator.aperture.calc_rad(flux_vals, positions, f_lim=0.1, max_rad=4, default_rad=1, frame_num=0)[source]¶
Calculate the appropriate pixel radius for the aperture
This function uses a basic algorithm to calculate the most appropriate radius size to use for the circular aperture photometry of the TESS image frames. If the ratio of the median value of neighbouring (8, in a square surrounding the central pixel) pixels compared to the central pixel is greater than ‘f_lim’, then expand the radius by one pixel, and test the next set of surrounding pixels. The pixel radius is linearly interpolated either side of the f_lim boundary. If, after ‘n_pix’ pixels the condition is still satisfied, set the pixel radius equal to 1. The latter constraint is intended to avoid contamination from neighbouring sources.
- Parameters:
- flux_vals
np.array The raw flux values from each pixel in the image.
- positions
tuple The X,Y position of the central pixel.
- f_lim
float, optional, default=0.1 The limiting threshold flux for the criterion.
- max_rad
int, optional, default=4 The maximum number of pixels for the aperture radius.
- default_rad
int, optional, default=1 The default aperture radius to be used in case of an error.
- frame_num
int The running number of the image frame of the input fits file. This is only used for logging purposes.
- flux_vals
- Returns:
- aper_rad
float The pixel radius.
- aper_rad