PSF#
Function to calculate PSF
- psf.Wavefront_pos(x, y, pupil_grid)#
Compute the wavefront with a given position.
- Parameters
x (float) – x-coordinate of the wavefront position.
y (float) – y-coordinate of the wavefront position.
pupil_grid – Grid representing the pupil plane.
- Returns
Wavefront at the specified position.
- Return type
Field
- psf.cir_psf(pre_img, planets_pos, planet_brightness, psf_scale, iwa_ignore, add_planet, img_pixel, psf_range, rot_number, psfs_name)#
Circular symmetric PSF processing calculation
Calculates the final image of a circular symmetric pre-image through circular symmetric PSF with added planets.
- Parameters
pre_img (np.ndarray) – The input image.
planets_pos (list) – List of planet positions.
planet_brightness (list) – List of planet brightness values.
psf_scale (float) – Scale of the PSF.
add_planet (bool) – Whether to add planets to the PSF.
img_pixel (int) – Number of pixels in the image.
psf_range (float) – Range of the PSF.
rot_number (int) – Number of rotations for generating the circular PSF.
psfs_name (str) – Name of the file containing PSFs.
- Returns
Final image.
- Return type
np.ndarray
- psf.cir_psf_contrast(pre_img, planet_psfs_number, planet_angle, planet_brightness, psf_scale, img_pixel, psf_range, rot_number, psfs_name)#
Contrast
Find the planet brightness and background brightness in the final image.
- Parameters
pre_img (np.ndarray) – The input image.
planet_psfs_number (int) – According to the distance between the planet and the origin, choose the nearest psf.
planet_angle (float) – The angle between the x-axis and the line of the planet and the origin.
planet_brightness (list) – List of planet brightness values.
psf_scale (float) – Scale of the PSF.
img_pixel (int) – Number of pixels in the image.
psf_range (float) – Range of the PSF.
rot_number (int) – Number of rotations for generating the circular PSF.
psfs_name (str) – Name of the file containing PSFs.
- Returns
planet brightness, background brightness, background brightness (ignored dust inside IWA) in Jy.
- Return type
brightness (tuple)
- psf.psf_calculation(charge, img_pixel=512, psf_range=16, num_cores=16)#
Calculate PSFs Calculates the PSFs of a vortex coronagraph for a given charge along the positive x-axis, and saves them to a file.
- Parameters
charge (int) – Charge of the vortex coronagraph.
img_pixel (int) – Number of pixels on one edge of the image.
psf_range (float) – Range of the PSF in lambda/D.
num_cores (int) – Number of CPU cores to use for multiprocessing.
- Returns
Array of calculated PSFs.
- Return type
np.ndarray
- psf.psf_chunk(i, img_pixel, psf_range, pupil_grid, prop, lyot_stop, coro)#
Calculate a chunk of PSF.
- Parameters
i (int) – Index of the chunk.
img_pixel (int) – Number of pixels in the image.
psf_range (float) – Range of the PSF.
pupil_grid – Grid representing the pupil plane.
prop – Propagator for the PSF calculation.
lyot_stop – Lyot stop for the coronagraph.
coro – Coronagraph for the PSF calculation.
- Returns
Index and the calculated PSF chunk as a 2D numpy array.
- Return type
tuple