|
def | __init__ (self) |
|
def | makeBackgroundModel (self, in_x, pars=None) |
|
def | fitFootprintBackground (self, source, posImage, order=1) |
|
def | makeStarModel (self, bbox, psf, xcen, ycen, flux) |
|
def | makeModel (self, x, flux, xcenPos, ycenPos, xcenNeg, ycenNeg, fluxNeg=None, b=None, x1=None, y1=None, xy=None, x2=None, y2=None, bNeg=None, x1Neg=None, y1Neg=None, xyNeg=None, x2Neg=None, y2Neg=None, **kwargs) |
|
Lightweight class containing methods for generating a dipole model for fitting
to sources in diffims, used by DipoleFitAlgorithm.
See also:
`DMTN-007: Dipole characterization for image differencing <https://dmtn-007.lsst.io>`_.
Definition at line 180 of file dipoleFitTask.py.
def lsst.ip.diffim.dipoleFitTask.DipoleModel.makeBackgroundModel |
( |
|
self, |
|
|
|
in_x, |
|
|
|
pars = None |
|
) |
| |
Generate gradient model (2-d array) with up to 2nd-order polynomial
Parameters
----------
in_x : `numpy.array`
(2, w, h)-dimensional `numpy.array`, containing the
input x,y meshgrid providing the coordinates upon which to
compute the gradient. This will typically be generated via
`_generateXYGrid()`. `w` and `h` correspond to the width and
height of the desired grid.
pars : `list` of `float`, optional
Up to 6 floats for up
to 6 2nd-order 2-d polynomial gradient parameters, in the
following order: (intercept, x, y, xy, x**2, y**2). If `pars`
is emtpy or `None`, do nothing and return `None` (for speed).
Returns
-------
result : `None` or `numpy.array`
return None, or 2-d numpy.array of width/height matching
input bbox, containing computed gradient values.
Definition at line 193 of file dipoleFitTask.py.
def lsst.ip.diffim.dipoleFitTask.DipoleModel.makeModel |
( |
|
self, |
|
|
|
x, |
|
|
|
flux, |
|
|
|
xcenPos, |
|
|
|
ycenPos, |
|
|
|
xcenNeg, |
|
|
|
ycenNeg, |
|
|
|
fluxNeg = None , |
|
|
|
b = None , |
|
|
|
x1 = None , |
|
|
|
y1 = None , |
|
|
|
xy = None , |
|
|
|
x2 = None , |
|
|
|
y2 = None , |
|
|
|
bNeg = None , |
|
|
|
x1Neg = None , |
|
|
|
y1Neg = None , |
|
|
|
xyNeg = None , |
|
|
|
x2Neg = None , |
|
|
|
y2Neg = None , |
|
|
** |
kwargs |
|
) |
| |
Generate dipole model with given parameters.
This is the function whose sum-of-squared difference from data
is minimized by `lmfit`.
x : TODO: DM-17458
Input independent variable. Used here as the grid on
which to compute the background gradient model.
flux : `float`
Desired flux of the positive lobe of the dipole
xcenPos : `float`
Desired x-centroid of the positive lobe of the dipole
ycenPos : `float`
Desired y-centroid of the positive lobe of the dipole
xcenNeg : `float`
Desired x-centroid of the negative lobe of the dipole
ycenNeg : `float`
Desired y-centroid of the negative lobe of the dipole
fluxNeg : `float`, optional
Desired flux of the negative lobe of the dipole, set to 'flux' if None
b, x1, y1, xy, x2, y2 : `float`
Gradient parameters for positive lobe.
bNeg, x1Neg, y1Neg, xyNeg, x2Neg, y2Neg : `float`, optional
Gradient parameters for negative lobe.
They are set to the corresponding positive values if None.
**kwargs
Keyword arguments passed through ``lmfit`` and
used by this function. These must include:
- ``psf`` Psf model used to generate the 'star'
- ``rel_weight`` Used to signify least-squares weighting of posImage/negImage
relative to diffim. If ``rel_weight == 0`` then posImage/negImage are ignored.
- ``bbox`` Bounding box containing region to be modelled
Returns
-------
zout : `numpy.array`
Has width and height matching the input bbox, and
contains the dipole model with given centroids and flux(es). If
``rel_weight`` = 0, this is a 2-d array with dimensions matching
those of bbox; otherwise a stack of three such arrays,
representing the dipole (diffim), positive and negative images
respectively.
Definition at line 384 of file dipoleFitTask.py.