anisocado.psf module

class anisocado.psf.AnalyticalScaoPsf(**psf_on_axis)[source]

Bases: object

A class to generate SCAO PSFs for the ELT

It is important to note that original PSF is generated for an on-axis guide star (self.psf_on_axis) at a specific wavelength. This PSF is kept as a reference for all further operations.

When the guide star is shifted off axis, the new PSF kernel is returned by the function self.shift_off_axis(). The kernel is also kept in self.psf_latest.

The property self.strehl_ratio is always calculated from
self.psf_latest (or self.psf_on_axis if no shift has been applied).
Parameters:

N : int

[pixel] Default: 512 pixel. Side-length of the kernel array

pixelSize : float

[arcsec] Default: 0.004 arcsec. On-sky pixel scale

wavelength : float

[um] Default: 2.15 um. Wavelength for which the PSF should be generated

rotdegree : float

[deg] Default: 0 deg. Rotation angle of the pupil w.r.t the plane of the optical axis

nmRms : float

[nm] Default: 100 nm. Residual wavefront error of the system

L0 : float

[m] Default: 25 m. Outer scale

profile_name : str

[‘EsoQ1’, ‘EsoMedian’, ‘EsoQ4’, ‘oldEso’, ‘gendron’]. Default: EsoMedian Names of specific atmospheric conditions for which presets exist. See psf_utils.get_atmospheric_turbulence

deadSegments : int

Default: 5. Number of segments missing from the ELT primary mirror

V : float

[m/s] Default: 10 m/s. Wind speed

Fe : float

[Hz] Default: 500 Hz. AO sampling frequency of the system

tret : float

[s] Default: 0.004 s. Delay in the AO loop

gain : float

Default: 0.3. Closed-loop gain

dactu : float

[m] Default: 0.5403 m. Interactuator distance on M4

x_last, y_last : float

[arcsec] Default: 0 arcsec. Shifts used to generate the psf_latest kernel

Examples

Make a PSF for a NGS 5 arcsec off axis and save it to disk:

from anisocado import AnalyticalScaoPsf
psf = AnalyticalScaoPsf(N=512, wavelength=2.15, seeing=0.8)
psf.shift_off_axis(5, 0)
psf.writeto("my_psf.fits")

Attributes

Methods

get_hdu(**kwargs)[source]

Makes an ImageHDU with the kernel and relevant header info

Additional keyword-value pairs can be passed to the header as kwargs

Returns:hdu_psf : fits.ImageHDU
hdu

Return the ImageHDU from get_hdu()

kernel

Return the kernel held in self.psf_latest

make_psf()[source]

Generates a analytical SCAO PSF for a long (>10 sec) exposure

Parameters need to be set be setting the attribute directly, or by calling self.update() with the desired keyword-value pair passed as

a kwarg. Valid keywords can be found in self.kwarg_names.
Returns:

psf : array

The PSF kernel

make_short_exposure_psf(dit=1.0, screen_step_length=0.5)[source]

Returns a PSF for an ‘short’ exposure time of DIT

The PSF kernel will be a single 2D array made from N stacked instantaneous PSFs, where the instantaneous PSFs are generated at time intervals during the DIT length determined by the wind speed, self.V, and the phase-screen step length.

Parameters:

dit : float

[s] Default is 1.0 sec. Exposure time for the PSF

screen_step_length : float

[m] Sample step length for atmospheric phase screen Default is 0.5m - the length of the M4 actuator pitch

Returns:

psfLE : array

plot_psf(which='psf_latest')[source]

Plots a logscale PSF kernel: [“psf_latest”, “psf_on_axis”]

shift_off_axis(dx, dy)[source]

Shifts the on-axis PSF off axis by an amount (dx, dy) in arcsec

Parameters:

dx, dy : float

[arcsec] Offset in each of the dimensions relative to the plane of the optical axis

Returns:

psf : array

The PSF kernel

strehl_ratio

Return an Strehl ratio of the kernel in self.psf_latest

update(**kwargs)[source]

Updates the parameter needed to generate a PSF and/or shift if off-axis

Valid parameter names can be found in self.kwarg_names

writeto(**kwargs)[source]

Calls the writeto method of the ImageHDU from self.hdu