Telescope#
- class Telescope(surface=None, optics=None, meta={})[source]#
Bases:
objectTelescope: collecting area, mirror thermal emission and Airy PSF.
- Parameters:
surface (
floatorNone, optional) – Collecting area in m^2. If None, it is computed from the"diameter_ext"and"diameter_int"entries ofmeta. Default is None.optics (
ThermalOpticsorNone, optional) – Thermal properties of the telescope mirrors. Default is None.meta (
dict, optional) – Telescope specifications (e.g."diameter_ext"and"diameter_int"in m). Default is an empty dict.
- Variables:
mutable_parameters (
listofstr) – Parameters that can be changed after initialization withupdate.- Warns:
UserWarning – If
surfaceis None and the diameters are not given inmeta.
Methods
Build a telescope from a configuration dictionary.
Get the Airy disk radius.
Get the fraction of the PSF energy encircled within given radii.
Get the radius encircling a given fraction of the PSF energy.
Get the Noise Equivalent Area (NEA) of the Airy disk.
Get the diffraction-limited PSF image.
Get the mirror thermal signal received by a spaxel.
Show the PSF image (log scale, axes in arcsec).
Update mutable parameters.
Attributes
External diameter (assumed circular) in m.
Internal diameter (assumed circular) in m.
Mirror emissivity (one value per mirror).
Metadata dictionary containing the telescope specifications.
Number of mirrors sharing each temperature and emissivity.
ThermalOpticsdescribing the mirrors' thermal emission.Collecting area in m^2.
Mirror temperature(s) in K.
- classmethod from_config(config)[source]#
Build a telescope from a configuration dictionary.
- Parameters:
config (
dict) – Configuration dictionary (e.g. the[telescope]section of a configuration file). It may contain"surface"[m^2], otherwise"diameter_ext"and"diameter_int"[m] are used, and must contain the thermal parameters required byfrom_config(at least"temperature"and"emissivity"). It is stored asmeta.- Returns:
Telescope– The telescope instance.
- get_airy_radius(lbda, norm_scale=1)[source]#
Get the Airy disk radius.
The radius of the first minimum of the Airy disk is
1.22 * lbda / diameter_ext(in radian).- Parameters:
lbda (
floator array_like) – Wavelength(s) in Angstrom.norm_scale (
float, optional) – Scale by which the radius is divided (e.g. a pixel size in arcsec to get the radius in pixels). Default is 1.
- Returns:
numpy.ndarray– Radius of the first minimum in arcsec (divided bynorm_scale), one value per wavelength.
- get_encircled_energy(lbda, radius, profile='airy', normal_scatter=None, size=2, **kwargs)[source]#
Get the fraction of the PSF energy encircled within given radii.
- Parameters:
lbda (
float) – Wavelength in Angstrom.radius (
floator array_like) – Radius or radii in arcsec.profile (
str, optional) – PSF profile to use (seeget_psfprofile). Default is"airy".normal_scatter (
floatorNone, optional) – Sigma of an additional Gaussian scatter convolved with the PSF, in arcsec. Default is None.size (
float, optional) – Minimum size of the PSF image in arcsec; it is enlarged to include the largest radius if needed. Default is 2.**kwargs – Additional arguments passed to
get_psfprofile.
- Returns:
numpy.ndarray– Encircled energy fraction, one value per radius.
- get_encircled_energy_radius(lbda, ee, profile='airy', normal_scatter=None, max_radius=2, nbins=1000, **kwargs)[source]#
Get the radius encircling a given fraction of the PSF energy.
The encircled energy is computed on a grid of
nbinsradii between 0 andmax_radiusand the closest grid radius is returned.- Parameters:
lbda (
float) – Wavelength in Angstrom.ee (
floator array_like) – Encircled energy fraction(s), between 0 and 1.profile (
str, optional) – PSF profile to use (seeget_psfprofile). Default is"airy".normal_scatter (
floatorNone, optional) – Sigma of an additional Gaussian scatter convolved with the PSF, in arcsec. Default is None.max_radius (
float, optional) – Maximum radius of the search grid in arcsec. Default is 2.nbins (
int, optional) – Number of radii in the search grid. Default is 1000.**kwargs – Additional arguments passed to
get_encircled_energy.
- Returns:
numpy.ndarray– Radius in arcsec, one value peree.
- get_nea_airy(lbda, norm_scale=1, padding=5, position=(0, 0), **kwargs)[source]#
Get the Noise Equivalent Area (NEA) of the Airy disk.
- Parameters:
lbda (
floator array_like) – Wavelength(s) in Angstrom.norm_scale (
float, optional) – Scale by which the Airy radius is divided (seeget_airy_radius). Default is 1.padding (
float, optional) – Half-width of the evaluation grid, in units of the (mean) Airy radius. Default is 5.position (
tupleoffloat, optional) – Position of the PSF centroid. Default is(0, 0).**kwargs – Additional arguments passed to
get_2dpsf_nea.
- Returns:
floatornumpy.ndarray– Noise Equivalent Area of the Airy disk, in the squared units of the radius (arcsec^2 divided bynorm_scale**2).
- get_psfprofile(lbda, profile='airy', shape=(10, 10), normal_scatter=None, oversampling=10, **kwargs)[source]#
Get the diffraction-limited PSF image.
Internally, the PSF is computed in units of the smallest Airy radius (a “pixel”), each pixel being divided into
oversamplingsub-pixels.- Parameters:
lbda (
floator array_like) – Wavelength(s) in Angstrom used to compute the Airy radius.profile (
str, optional) – PSF profile:"airy", or"gaussian"(aliases"gauss","norm","normal") with a sigma matching the Airy radius (seeairyradius_to_gaussiansigma). Default is"airy".shape (
tupleoffloatorNone, optional) – Size(height, width)of the PSF image in arcsec. If None, ten times the largest Airy radius is used. Default is(10, 10).normal_scatter (
floatorNone, optional) – Sigma of an additional Gaussian scatter convolved with the PSF, in arcsec. Default is None.oversampling (
int, optional) – Number of sub-pixels per pixel. Default is 10.**kwargs – Additional arguments passed to
get_profilepsf(e.g.position,norm_pixels).
- Returns:
psf (
numpy.ndarray) – PSF image (one image per wavelength iflbdais an array).pixelarea (
float) – Area of a PSF image (sub-)pixel, in pixel^2 units.arcsec_to_pixels (
float) – Conversion factor from arcsec to PSF image (sub-)pixels.radius (
numpy.ndarray) – Airy radius in arcsec, one value per wavelength.
- get_thermal_signal(lbda_bin, solid_angle, as_sum=True)[source]#
Get the mirror thermal signal received by a spaxel.
- Parameters:
lbda_bin (array_like) – Wavelength bin(s) in Angstrom, either 1D
[lbda_min, lbda_max]or 2D[[lbda_min, lbda_max], [lbda_min, lbda_max], ...].solid_angle (
float) – Spaxel solid angle in steradian.as_sum (
bool, optional) – If True, return the sum of the contributions of all mirrors. Otherwise, return one entry per mirror. Default is True.
- Returns:
floatornumpy.ndarray– Thermal signal in ph/s/spaxel, integrated over each wavelength bin.
- show_psfprofile(lbda, ax=None, profile='airy', oversampling=10, show_radius=False, shape=None, normal_scatter=None, **kwargs)[source]#
Show the PSF image (log scale, axes in arcsec).
- Parameters:
lbda (
float) – Wavelength in Angstrom.ax (
matplotlib.axes.AxesorNone, optional) – Axes to plot on. If None, a new figure and axes are created. Default is None.profile (
str, optional) – PSF profile to use (seeget_psfprofile). Default is"airy".oversampling (
int, optional) – Number of sub-pixels per pixel. Default is 10.show_radius (
bool, optional) – If True, show the Airy radius as horizontal and vertical lines. Default is False.shape (
tupleoffloatorNone, optional) – Size of the PSF image in arcsec. If None, ten times the Airy radius is used. Default is None.normal_scatter (
floatorNone, optional) – Sigma of an additional Gaussian scatter convolved with the PSF, in arcsec. Default is None.**kwargs – Additional arguments passed to
matplotlib.axes.Axes.imshow.
- Returns:
matplotlib.figure.Figure– The figure containing the plot.
- update(reset_others=False, **kwargs)[source]#
Update mutable parameters.
See
mutable_parametersfor the list of accepted names. Settingdiameter_extordiameter_intresets a previously givensurface, which is then computed from the diameters.- Parameters:
reset_others (
bool, optional) – If True, parameters not given inkwargsare reset to their initial values. Default is False.**kwargs – Parameters to update.
- Warns:
UserWarning – If a given parameter is not mutable (it is then ignored).
- diameter_ext#
External diameter (assumed circular) in m.
- diameter_int#
Internal diameter (assumed circular) in m.
- emissivity#
Mirror emissivity (one value per mirror).
- meta#
Metadata dictionary containing the telescope specifications.
- mutable_parameters = ['temperature', 'emissivity', 'diameter_ext', 'diameter_int', 'surface']#
- nelements#
Number of mirrors sharing each temperature and emissivity.
- optics#
ThermalOpticsdescribing the mirrors’ thermal emission.
- surface#
Collecting area in m^2.
If not given explicitly, it is computed from
diameter_extanddiameter_int.
- temperature#
Mirror temperature(s) in K.