lsst.pipe.tasks ge4515c7036+ad4950a81d
Loading...
Searching...
No Matches
lsst.pipe.tasks.extended_psf.extended_psf_stack.ExtendedPsfStackTask Class Reference
Inheritance diagram for lsst.pipe.tasks.extended_psf.extended_psf_stack.ExtendedPsfStackTask:

Public Member Functions

 __init__ (self, initInputs=None, *args, **kwargs)
 
 runQuantum (self, butlerQC, inputRefs, outputRefs)
 
 run (self, ExtendedPsfCandidates extended_psf_candidates)
 

Static Public Attributes

 ConfigClass = ExtendedPsfStackConfig
 

Protected Member Functions

list[ExtendedPsfCandidate_get_candidates (self, ExtendedPsfCandidates extended_psf_candidates)
 
ExtendedPsfImage|None _make_extended_psf (self, list[ExtendedPsfCandidate] candidates)
 
tuple[ExtendedPsfCandidate|None, float|None] _fit_and_normalize (self, ExtendedPsfCandidate candidate, Image psf_image, float|None psf_amplitude)
 
Image|None _fit_bg (self, ExtendedPsfCandidate candidate, Sequence[str] mask_planes, Image psf_image, float|None psf_amplitude)
 
float|None _fit_psf_amplitude (self, ExtendedPsfCandidate candidate, Image psf_image, Sequence[str] mask_planes, bool mask_zeros=True)
 
tuple[np.ndarray, np.ndarray, np.ndarray|float] _get_span_data (self, ExtendedPsfCandidate candidate, Sequence[str] mask_planes, np.ndarray|None additional_mask=None, Image|None subtract_image=None)
 
tuple[np.ndarray|None, np.ndarray|None] _solve_design_matrix (self, np.ndarray design_matrix, np.ndarray data, bool calculate_covariance=False)
 
ExtendedPsfMoffatFit _fit_moffat (self, ExtendedPsfImage extended_psf, bool fix_center=False)
 

Static Protected Member Functions

float|None _focal_plane_radius_mm (ExtendedPsfCandidate candidate)
 

Protected Attributes

list _bg_powers = [(i, j) for i in range(order + 1) for j in range(order + 1) if i + j <= order]
 

Static Protected Attributes

str _DefaultName = "extendedPsfStack"
 

Detailed Description

Stack candidate cutouts to produce an extended PSF model.

Definition at line 133 of file extended_psf_stack.py.

Constructor & Destructor Documentation

◆ __init__()

lsst.pipe.tasks.extended_psf.extended_psf_stack.ExtendedPsfStackTask.__init__ ( self,
initInputs = None,
* args,
** kwargs )

Definition at line 140 of file extended_psf_stack.py.

Member Function Documentation

◆ _fit_and_normalize()

tuple[ExtendedPsfCandidate | None, float | None] lsst.pipe.tasks.extended_psf.extended_psf_stack.ExtendedPsfStackTask._fit_and_normalize ( self,
ExtendedPsfCandidate candidate,
Image psf_image,
float | None psf_amplitude )
protected
Fit and normalize a single candidate cutout.

Parameters
----------
candidate : `ExtendedPsfCandidate`
    Candidate cutout image to fit.
psf_image : `~lsst.images.Image`
    PSF model image for fitting.
psf_amplitude : `float` | `None`
    Prior PSF scaling to use during background fitting. If `None`, no
    PSF subtraction is performed during background fitting.

Returns
-------
candidate_normalized : `ExtendedPsfCandidate` | `None`
    Normalized candidate cutout image, or `None` if fitting fails.
psf_amplitude : `float` | `None`
    Fitted PSF amplitude, or `None` if fitting fails.

Definition at line 324 of file extended_psf_stack.py.

◆ _fit_bg()

Image | None lsst.pipe.tasks.extended_psf.extended_psf_stack.ExtendedPsfStackTask._fit_bg ( self,
ExtendedPsfCandidate candidate,
Sequence[str] mask_planes,
Image psf_image,
float | None psf_amplitude )
protected
Fit a polynomial background to a candidate cutout.

Parameters
----------
candidate : `ExtendedPsfCandidate`
    Candidate cutout image to fit.
mask_planes : `Sequence` [`str`]
    Mask planes for identifying bad pixels.
psf_image : `~lsst.images.Image`
    PSF image to optionally subtract prior to fitting.
psf_amplitude : `float` | `None`
    Amplitude to scale ``psf_image`` before subtraction. If `None`, no
    PSF subtraction is performed.

Returns
-------
bg_image : `~lsst.images.Image` | `None`
    Fitted background image, or `None` if fitting fails.

Definition at line 385 of file extended_psf_stack.py.

◆ _fit_moffat()

ExtendedPsfMoffatFit lsst.pipe.tasks.extended_psf.extended_psf_stack.ExtendedPsfStackTask._fit_moffat ( self,
ExtendedPsfImage extended_psf,
bool fix_center = False )
protected
Fit a Moffat2D model to the stacked extended PSF image.

Parameters
----------
extended_psf : `ExtendedPsfImage`
    Stacked extended PSF image to fit.
fix_center : `bool`, optional
    Whether to fix the Moffat2D center at the image center.

Returns
-------
fit : `ExtendedPsfMoffatFit`
    Moffat fit summary and fit statistics.

Definition at line 573 of file extended_psf_stack.py.

◆ _fit_psf_amplitude()

float | None lsst.pipe.tasks.extended_psf.extended_psf_stack.ExtendedPsfStackTask._fit_psf_amplitude ( self,
ExtendedPsfCandidate candidate,
Image psf_image,
Sequence[str] mask_planes,
bool mask_zeros = True )
protected
Fit the amplitude of the PSF model to one candidate cutout.

Parameters
----------
candidate : `ExtendedPsfCandidate`
    Candidate cutout image to fit.
psf_image : `~lsst.images.Image`
    PSF image to fit to the data.
mask_planes : `Sequence` [`str`]
    Mask planes for identifying bad pixels.
mask_zeros : `bool`, optional
    Whether to additionally mask zero-valued PSF pixels.

Returns
-------
psf_amplitude : `float` | `None`
    Fitted PSF amplitude, or `None` if fitting fails.

Notes
-----
NaN and negative values in the PSF image are always masked.

Definition at line 441 of file extended_psf_stack.py.

◆ _focal_plane_radius_mm()

float | None lsst.pipe.tasks.extended_psf.extended_psf_stack.ExtendedPsfStackTask._focal_plane_radius_mm ( ExtendedPsfCandidate candidate)
staticprotected

Definition at line 192 of file extended_psf_stack.py.

◆ _get_candidates()

list[ExtendedPsfCandidate] lsst.pipe.tasks.extended_psf.extended_psf_stack.ExtendedPsfStackTask._get_candidates ( self,
ExtendedPsfCandidates extended_psf_candidates )
protected
Get candidates that are within the configured focal-plane radius.

Parameters
----------
extended_psf_candidates : `ExtendedPsfCandidates`
    Candidate cutout collection.

Returns
-------
candidates : `list` [`ExtendedPsfCandidate`]
    Candidates within the configured focal-plane radius range.

Definition at line 200 of file extended_psf_stack.py.

◆ _get_span_data()

tuple[np.ndarray, np.ndarray, np.ndarray | float] lsst.pipe.tasks.extended_psf.extended_psf_stack.ExtendedPsfStackTask._get_span_data ( self,
ExtendedPsfCandidate candidate,
Sequence[str] mask_planes,
np.ndarray | None additional_mask = None,
Image | None subtract_image = None )
protected
Get fitting data and a boolean mask of good pixels.

Parameters
----------
candidate : `ExtendedPsfCandidate`
    Candidate cutout from which to extract fitting data.
mask_planes : `Sequence` [`str`]
    Mask planes for identifying bad pixels.
additional_mask : `numpy.ndarray` or `None`, optional
    Additional boolean mask to combine with the image mask.
subtract_image : `~lsst.images.Image` or `None`, optional
    Image to subtract before fitting (e.g., PSF model).

Returns
-------
good_pixels : `numpy.ndarray`
    Boolean array selecting good pixels.
image : `numpy.ndarray`
    Pixel values at good pixels after optional subtraction.
sigma : `numpy.ndarray` | `float`
    Pixel-wise uncertainties at good pixels.

Definition at line 485 of file extended_psf_stack.py.

◆ _make_extended_psf()

ExtendedPsfImage | None lsst.pipe.tasks.extended_psf.extended_psf_stack.ExtendedPsfStackTask._make_extended_psf ( self,
list[ExtendedPsfCandidate] candidates )
protected
Stack candidate cutouts to produce an extended PSF model.

Parameters
----------
candidates : `list` [`ExtendedPsfCandidate`]
    Candidate cutouts to stack.

Returns
-------
extended_psf : `ExtendedPsfImage` or `None`
    The stacked extended PSF model, or `None` if stacking fails.

Definition at line 243 of file extended_psf_stack.py.

◆ _solve_design_matrix()

tuple[np.ndarray | None, np.ndarray | None] lsst.pipe.tasks.extended_psf.extended_psf_stack.ExtendedPsfStackTask._solve_design_matrix ( self,
np.ndarray design_matrix,
np.ndarray data,
bool calculate_covariance = False )
protected
Solve a linear system for the given design matrix and data.

Parameters
----------
design_matrix : `numpy.ndarray`
    Design matrix for the linear system.
data : `numpy.ndarray`
    Data vector.
calculate_covariance : `bool`, optional
    Whether to return the covariance matrix.

Returns
-------
solutions : `numpy.ndarray` or `None`
    Solution vector, or `None` if solving fails.
covariance_matrix : `numpy.ndarray` or `None`
    Covariance matrix, if requested and available.

Definition at line 538 of file extended_psf_stack.py.

◆ run()

lsst.pipe.tasks.extended_psf.extended_psf_stack.ExtendedPsfStackTask.run ( self,
ExtendedPsfCandidates extended_psf_candidates )
Run the stacking task to produce an extended PSF model.

Parameters
----------
extended_psf_candidates : `ExtendedPsfCandidates`
    Set of preprocessed cutouts, each centered on a single star.

Returns
-------
extended_psf :
        `~lsst.pipe.tasks.extended_psf.ExtendedPsfImage` or `None`
    The extended PSF model if stacking succeeds; `None` if stacking
    was unsuccessful (e.g, no valid candidates).

Definition at line 154 of file extended_psf_stack.py.

◆ runQuantum()

lsst.pipe.tasks.extended_psf.extended_psf_stack.ExtendedPsfStackTask.runQuantum ( self,
butlerQC,
inputRefs,
outputRefs )

Definition at line 146 of file extended_psf_stack.py.

Member Data Documentation

◆ _bg_powers

lsst.pipe.tasks.extended_psf.extended_psf_stack.ExtendedPsfStackTask._bg_powers = [(i, j) for i in range(order + 1) for j in range(order + 1) if i + j <= order]
protected

Definition at line 144 of file extended_psf_stack.py.

◆ _DefaultName

str lsst.pipe.tasks.extended_psf.extended_psf_stack.ExtendedPsfStackTask._DefaultName = "extendedPsfStack"
staticprotected

Definition at line 137 of file extended_psf_stack.py.

◆ ConfigClass

lsst.pipe.tasks.extended_psf.extended_psf_stack.ExtendedPsfStackTask.ConfigClass = ExtendedPsfStackConfig
static

Definition at line 136 of file extended_psf_stack.py.


The documentation for this class was generated from the following file: