scopesim.effects.psfs.semianalytical.AnisocadoConstPSF#
- class scopesim.effects.psfs.semianalytical.AnisocadoConstPSF(**kwargs)#
Bases:
SemiAnalyticalPSFMakes a SCAO on-axis PSF with a desired Strehl ratio at a given wavelength.
To make the PSFs a map connecting Strehl, Wavelength, and residual wavefront error is required.
- Parameters:
filename (str) – Path to Strehl map with axes (x, y) = (wavelength, wavefront error).
strehl (float) – Desired Strehl ratio. Either percentage [1, 100] or fractional [1e-3, 1].
wavelength (float) – [um] The given strehl is valid for this wavelength.
psf_side_length (int) – [pixel] Default is 512. Side length of the kernel images.
offset (tuple) – [arcsec] SCAO guide star offset from centre (dx, dy).
rounded_edges (bool) – Default is True. Sets all halo values below a threshold to zero. The threshold is determined from the max values of the edge rows of the kernel image.
convolve_mode (str) – [“same”, “full”] convolution keywords from scipy.signal.convolve
Examples
Add an AnisocadoConstPSF with code:
from scopesim.effects import AnisocadoConstPSF psf = AnisocadoConstPSF(filename="test_AnisoCADO_rms_map.fits", strehl=0.5, wavelength=2.15, convolve_mode="same", psf_side_length=512)
Add an AnisocadoConstPSF to a yaml file:
effects: - name: Ks_Stehl_40_PSF description: A 40% Strehl PSF over the field of view class: AnisocadoConstPSF kwargs: filename: "test_AnisoCADO_rms_map.fits" strehl: 0.5 wavelength: 2.15 convolve_mode: full psf_side_length: 512
- __init__(**kwargs)#
Methods
__init__(**kwargs)apply_to(obj, **kwargs)Apply the PSF.
get_from_meta(item)get_kernel(fov)info()Print basic information on the effect, notably the description.
plot([obj])Remake the kernel based on either a pixel_scale of FieldOfView.
report([filename, output, rst_title_chars])For Effect objects, generates a report based on the data and meta-data.
Attributes
datadisplay_nameincludemeta_stringnmRmsreport_plot_includereport_table_includerequired_keysstrehl_ratiotablewavelengthz_order- apply_to(obj, **kwargs)#
Apply the PSF.
- remake_kernel(x)#
Remake the kernel based on either a pixel_scale of FieldOfView.
- Parameters:
x (float, FieldOfView) – [um] if float
- report(filename=None, output='rst', rst_title_chars='*+', **kwargs)#
For Effect objects, generates a report based on the data and meta-data.
This is to aid in the automation of the documentation process of the instrument packages in the IRDB.
Note
If the Effect can generate a plot, this will be saved to disc
- Parameters:
filename (str, optional) – Where to save the RST file
output (str, optional) – [“rst”, “latex”] Output file format
rst_title_chars (2-str, optional) – Two unique characters used to denote rst subsection headings. Options: = - ` : ‘ “ ~ ^ _ * + # < >
parameters (Additional)
---------------------
**kwargs (Either from the self.meta["report"] dictionary or via)
"report_table_include" (False)
"report_table_caption"
"report_plot_caption"
"report_plot_include" (False)
"report_plot_file_formats" (["png"]) – Multiple formats can be saved. The last entry is used for the RST.
"report_plot_filename" (None) – If None, uses self.meta[“name”] as the filename
"file_description" (str) – Taken from the header of a file, if available
"class_description" (str) – Taken from the docstring of the subclass
"changes_str" (list of str) – Take from the header of a file, if available
- Returns:
rst_str – The full reStructureText string
- Return type:
Notes
The format of the RST output is as follows:
<ClassType>: <effect name> ************************** File Description: <description for file meta data> Class Description: <description from class docstring> Changes: <list of changes from file meta data> Data ++++ .. figure:: <Figure_name>.png If the <Effect> object contains a ``.plot()`` function, add plot and write it to disc Figure caption Table caption Table If the <Effect> object contains a ``.table()`` function, add a pprint version of the table Meta-data +++++++++ :: A code block print out of the ``.meta`` dictionary