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 inself.psf_latest
.- The property
self.strehl_ratio
is always calculated from self.psf_latest
(orself.psf_on_axis
if no shift has been applied).
- Parameters:
- Nint
[pixel] Default: 512 pixel. Side-length of the kernel array
- pixelSizefloat
[arcsec] Default: 0.004 arcsec. On-sky pixel scale
- wavelengthfloat
[um] Default: 2.15 um. Wavelength for which the PSF should be generated
- rotdegreefloat
[deg] Default: 0 deg. Rotation angle of the pupil w.r.t the plane of the optical axis
- nmRmsfloat
[nm] Default: 100 nm. Residual wavefront error of the system
- L0float
[m] Default: 25 m. Outer scale
- profile_namestr
[‘EsoQ1’, ‘EsoMedian’, ‘EsoQ4’, ‘oldEso’, ‘gendron’]. Default: EsoMedian Names of specific atmospheric conditions for which presets exist. See
psf_utils.get_atmospheric_turbulence
- deadSegmentsint
Default: 5. Number of segments missing from the ELT primary mirror
- Vfloat
[m/s] Default: 10 m/s. Wind speed
- Fefloat
[Hz] Default: 500 Hz. AO sampling frequency of the system
- tretfloat
[s] Default: 0.004 s. Delay in the AO loop
- gainfloat
Default: 0.3. Closed-loop gain
- dactufloat
[m] Default: 0.5403 m. Interactuator distance on M4
- x_last, y_lastfloat
[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:
hdu
Return the
ImageHDU
fromget_hdu()
kernel
Return the kernel held in
self.psf_latest
strehl_ratio
Return an Strehl ratio of the kernel in
self.psf_latest
Methods
get_hdu
(**kwargs)Makes an
ImageHDU
with the kernel and relevant header infomake_psf
()Generates a analytical SCAO PSF for a long (>10 sec) exposure
make_short_exposure_psf
([dit, ...])Returns a PSF for an 'short' exposure time of
DIT
plot_psf
([which])Plots a logscale PSF kernel: ["psf_latest", "psf_on_axis"]
shift_off_axis
(dx, dy)Shifts the on-axis PSF off axis by an amount
(dx, dy)
in arcsecupdate
(**kwargs)Updates the parameter needed to generate a PSF and/or shift if off-axis
writeto
(**kwargs)Calls the
writeto
method of the ImageHDU fromself.hdu
- get_hdu(**kwargs)[source]¶
Makes an
ImageHDU
with the kernel and relevant header infoAdditional keyword-value pairs can be passed to the header as kwargs
- Returns:
- hdu_psffits.ImageHDU
- property hdu¶
Return the
ImageHDU
fromget_hdu()
- property 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 asa kwarg. Valid keywords can be found in
self.kwarg_names
.- Returns:
- psfarray
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-screenstep
length.- Parameters:
- ditfloat
[s] Default is 1.0 sec. Exposure time for the PSF
- screen_step_lengthfloat
[m] Sample step length for atmospheric phase screen Default is 0.5m - the length of the M4 actuator pitch
- Returns:
- psfLEarray
- shift_off_axis(dx, dy)[source]¶
Shifts the on-axis PSF off axis by an amount
(dx, dy)
in arcsec- Parameters:
- dx, dyfloat
[arcsec] Offset in each of the dimensions relative to the plane of the optical axis
- Returns:
- psfarray
The PSF kernel
- property strehl_ratio¶
Return an Strehl ratio of the kernel in
self.psf_latest
- The property