def encloses_subpixels(self, x_min, x_max, y_min, y_max, nx, ny, subpixels): """Return a float array giving the fraction of each pixel covered by the aperture, using a sub-pixel sampling method. Parameters ---------- x_min, x_max : float x coordinates of outer edges of array y_min, y_max : float y coordinates of outer edges of array nx, ny : int dimension of array subpixels : int Returns ------- overlap_area : `~numpy.ndarray` (float) 2-d array of overlapping fraction. """ from circular_overlap import circular_overlap_grid return (circular_overlap_grid(x_min, x_max, y_min, y_max, nx, ny, self.r_out, 0, subpixels) - circular_overlap_grid(x_min, x_max, y_min, y_max, nx, ny, self.r_in, 0, subpixels))
def encloses_exact(self, x_min, x_max, y_min, y_max, nx, ny): """ Return a float array giving the fraction of each pixel covered by the aperture, using an exact calculation. Parameters ---------- x_min, x_max : float x coordinates of outer edges of array y_min, y_max : float y coordinates of outer edges of array nx, ny : int dimension of array Returns ------- overlap_area : `~numpy.ndarray` (float) 2-d array of overlapping fraction. """ from circular_overlap import circular_overlap_grid return (circular_overlap_grid(x_min, x_max, y_min, y_max, nx, ny, self.r_out, 1, 1) - circular_overlap_grid(x_min, x_max, y_min, y_max, nx, ny, self.r_in, 1, 1))