STDPSFGrid#
- class photutils.psf.STDPSFGrid(filename)[source]#
Bases:
objectClass to read and plot ePSF model grids stored in the STDPSF format.
STDPSF files are FITS files containing a 3D array of ePSF models. The FITS header specifies the fiducial detector coordinates associated with each ePSF in the grid.
For STDPSF files, the oversampling factor is assumed to be 4 along both axes.
- Parameters:
- filenamestr or path-like
The name or URL of a STDPSF FITS file.
Examples
>>> from photutils.psf import STDPSFGrid >>> psfgrid = STDPSFGrid('STDPSF_ACSWFC_F814W.fits') >>> fig = psfgrid.plot_grid()
Attributes Summary
The 3D array of ePSFs.
The
(ny, nx)shape of the ePSF grid.The (x, y) positions of the ePSFs.
The integer oversampling factor(s) of the input ePSF images.
Methods Summary
plot_grid(*[, ax, vmax_scale, peak_norm, ...])Plot the grid of ePSF models.
Attributes Documentation
- data#
The 3D array of ePSFs.
The shape is
(N_psf, ePSF_ny, ePSF_nx).
- grid_shape#
The
(ny, nx)shape of the ePSF grid.
- grid_xypos#
The (x, y) positions of the ePSFs.
The order of positions matches the first axis of the 3D
ndarrayof ePSFs. In other words,grid_xypos[i]is the (x, y) position of the reference ePSF defined indata[i].
- oversampling#
The integer oversampling factor(s) of the input ePSF images.
- Returns:
- oversampling
ndarray The oversampling factors in
(y, x)order.
- oversampling
Methods Documentation
- plot_grid(*, ax=None, vmax_scale=None, peak_norm=False, deltas=False, cmap='viridis', dividers=True, divider_color='darkgray', divider_ls='-', figsize=None)[source]#
Plot the grid of ePSF models.
- Parameters:
- ax
matplotlib.axes.AxesorNone, optional The matplotlib axes on which to plot. If
None, then the currentAxesinstance is used.- vmax_scalefloat, optional
Scale factor to apply to the image stretch limits. This value is multiplied by the peak ePSF value to determine the plotting
vmax. The defaults are 1.0 for plotting the ePSF data and 0.03 for plotting the ePSF difference data (deltas=True). Ifdeltas=True, thevminis set to-vmax. Ifdeltas=Falsethevminis set tovmax/ 1e4.- peak_normbool, optional
Whether to normalize the ePSF data by the peak value. The default shows the ePSF flux per pixel.
- deltasbool, optional
Set to
Trueto show the differences between each ePSF and the average ePSF.- cmapstr or
matplotlib.colors.Colormap, optional The colormap to use. The default is ‘viridis’.
- dividersbool, optional
Whether to show divider lines between the ePSFs.
- divider_color, divider_lsstr, optional
Matplotlib color and linestyle options for the divider lines between ePSFs. These keywords have no effect unless
dividers=True.- figsize(float, float), optional
The figure (width, height) in inches.
- ax
- Returns:
- fig
matplotlib.figure.Figure The matplotlib figure object. This will be the current figure if
ax=None. Usefig.savefig()to save the figure to a file.
- fig
Notes
This method returns a figure object. If you are using this method in a script, you will need to call
fig.show()to display the figure. If you are using this method in a Jupyter notebook, the figure will be displayed automatically.When in a notebook, if you do not store the return value of this function, the figure will be displayed twice due to the REPL automatically displaying the return value of the last function call. Alternatively, you can append a semicolon to the end of the function call to suppress the display of the return value.