scopesim.effects.psf_utils module¶
- scopesim.effects.psf_utils.get_bkg_level(obj, bg_w)[source]¶
Determine the background level of image or cube slices.
Returns a scalar if obj is a 2d image or a vector if obj is a 3D cube (one value for each plane). The method for background determination is decided by self.meta[“bkg_width”]: If 0, the background is returned as zero (implying no background subtraction). If -1, the background is estimated as the median of the entire image (or cube plane). If positive, the background is estimated as the median of a frame of width bkg_width around the edges.
- scopesim.effects.psf_utils.get_psf_wave_exts(hdu_list, wave_key='WAVE0')[source]¶
Return a dict of {extension : wavelength}.
- Parameters:
- hdu_list
- Returns:
- wave_set, wave_ext
- scopesim.effects.psf_utils.make_strehl_map_from_table(tbl, pixel_scale=<Quantity 1. arcsec>)[source]¶
- scopesim.effects.psf_utils.nmrms_from_strehl_and_wavelength(strehl: float, wavelength, strehl_hdu, plot=False) float [source]¶
Return the wavefront error needed to make a PSF with desired strehl ratio.
- Parameters:
- strehlfloat
[0.001, 1] Desired strehl ratio. Values 1<sr<100 will be scale to <1
- wavelengthfloat
[um]
- strehl_hdunp.ndarray
2D map of strehl ratio as a function of wavelength [um] and residual wavefront error [nm RMS]
- plotbool
- Returns:
- nmfloat
[nm] residual wavefront error for generating an on-axis AnisoCADO PSF with the desired strehl ratio at a given wavelength