interp_epsf
- acstools.focus_diverse_epsfs.interp_epsf(ePSFs, x, y, chip, pixel_space=False, subpixel_x=0, subpixel_y=0)
Function to perform further spatial interpolations given the input ePSF array. It uses bi-linear interpolation for the integer pixel shifts, and bi-cubic interpolation for any specified subpixel phase shifts.
This function allows users to interpolate the provided ePSF arrays to any arbitrary
(x, y)
pixel coordinates. It can be called withpixel_space=True
to downsample the ePSF into detector space.Subpixel phase shifts can be applied by setting
subpixel_x
andsubpixel_y
between 0 and 0.99. Note that a 1 pixel border is removed from the subpixel phase shifted ePSF, such that the final dimensions are 23x23. Results from this subpixel phase shift routine may differ from other algorithmic implementations, typically at the level of <0.5% in the core of the ePSF.Note
This function requires an optional
scipy
dependency to be installed forpixel_space=True
.Note
This function requires users to specify the WFC chip (WFC1 or WFC2).
- Parameters:
ePSFs (numpy.ndarray) – Array with the ePSFs.
x (int) – X-coordinate (1-indexed) of the desired output ePSF. Please note that the range here is between 1 and 4096, inclusive. The ePSF grid begins off the detector, at (0,0).
y (int) – Y-coordinate (1-indexed) of the desired output ePSF. Please note that the range here is between 1 and 2048, inclusive. The ePSF grid begins off the detector, at (0,0).
chip (str) – String corresponding to which ACS/WFC detector the user is specifying the coordinates on, either “WFC1” or “WFC2”.
pixel_space (bool) – If
True
, downsample the ePSF into detector space.subpixel_x (float) – The desired subpixel coordinate, between 0 and 0.99.
pixel_space
must be set toTrue
to use this option. The defaults for both x and y are 0, and are relative to the central pixel of the ePSF. By default, ePSFs are centered on the central pixel.subpixel_y (float) – The desired subpixel coordinate, between 0 and 0.99.
pixel_space
must be set toTrue
to use this option. The defaults for both x and y are 0, and are relative to the central pixel of the ePSF. By default, ePSFs are centered on the central pixel.
- Returns:
P – An ePSF array with the specified interpolation parameters, if successful.
- Return type:
numpy.ndarray or
None
See also