giant.point_spread_functions.psf_meta¶
Provides abstract base classes for the construction of Point Spread Function classes for GIANT.
In this module there are a number of abstract base classes (ABCs) that define the interface for and provide some common functionality for point spread functions (PSFs) in GIANT. In general, most users will not interact with these directly, and will instead use a predefined implementation of a PSF, however, if you wish to define a new PSF for GIANT to use then you will likely benefit from what is available in this module.
To define a new PSF you will most likely want to subclass at least one of the ABCs defined in this module, which will
help you to be sure you’ve defined all the interfaces GIANT expects and possibly add some shared functionality so that
you don’t need to reinvent the wheel. However, this is not strictly necessary. While type checkers will complain if
you don’t at least inherit from PointSpreadFunction
, GIANT will not actually error so long as you have defined
all the appropriate interfaces (so called duck typing).
Use¶
To implement a fully function custom PSF for GIANT you must at minimum implement the following methods and attributes
Method/Attribute |
Use |
---|---|
A class attribute which determines whether to save information about
the residuals from attempting to fit the PSF to data. If |
|
The built in call method for the class. This method should apply the defined PSF in the current instance to a 2D image, returning the image after the PSF has been applied. |
|
An analogous method to |
|
A method that generates a square unit kernel (sums to 1) of the current instance of the PSF. |
|
A method that evaluates the current instance of the PSF at provided x and y locations |
|
A class method which fits an instance of the PSF to supplied data and returns and initialized version of the PSF with the fit parameters. |
|
A property which returns the location of the peak of the PSF as a as a length 2 numpy array. |
|
A property which returns the root sum of squares of the rss of the fit
of the PSF iff the current instance was made by a call to
|
|
A property which returns the standard deviation of the rss of the fit
of the PSF iff the current instance was made by a call to
|
|
A property which returns the formal covariance of the fit
of the PSF iff the current instance was made by a call to
|
|
|
A method which computes the total volume under the PSF (integral from \(-\inf\) to \(\inf\)) |
Implementing these, plus whatever else is needed internally for the functionality of the PSF, will result in a PSF class that can be used throughout GIANT.
For examples of how this is done, refer to the pre-defined PSFs in gaussians
.
Classes
This abstract base class serves as the template for implementing a point spread function in GIANT. |
|
This ABC adds common functionality for a PSF where the required size can be determine algorithmically. |
|
This ABC adds concrete common functionality for applying the initialized PSF to 2D images to |
|
This ABC adds concrete common functionality for applying the initialized PSF to 1D scan lines to |
|
This ABC defines common attributes, properties, and methods for Iterative Non-linear least squares estimation of a Point Spread function. |
|
This class provides support for estimating the superposition of the PSF and a linear background gradient. |
|
This class provides a fit class method which generates the initial guess from a subclass and then converges to a better solution using iterative Nonlinear LSTSQ. |
|
This class provides a fit class method which generates the initial guess from a subclass and then converges to a better solution using iterative Nonlinear LSTSQ including a background gradient. |