LSST Applications 27.0.0,g0265f82a02+469cd937ee,g02d81e74bb+21ad69e7e1,g1470d8bcf6+cbe83ee85a,g2079a07aa2+e67c6346a6,g212a7c68fe+04a9158687,g2305ad1205+94392ce272,g295015adf3+81dd352a9d,g2bbee38e9b+469cd937ee,g337abbeb29+469cd937ee,g3939d97d7f+72a9f7b576,g487adcacf7+71499e7cba,g50ff169b8f+5929b3527e,g52b1c1532d+a6fc98d2e7,g591dd9f2cf+df404f777f,g5a732f18d5+be83d3ecdb,g64a986408d+21ad69e7e1,g858d7b2824+21ad69e7e1,g8a8a8dda67+a6fc98d2e7,g99cad8db69+f62e5b0af5,g9ddcbc5298+d4bad12328,ga1e77700b3+9c366c4306,ga8c6da7877+71e4819109,gb0e22166c9+25ba2f69a1,gb6a65358fc+469cd937ee,gbb8dafda3b+69d3c0e320,gc07e1c2157+a98bf949bb,gc120e1dc64+615ec43309,gc28159a63d+469cd937ee,gcf0d15dbbd+72a9f7b576,gdaeeff99f8+a38ce5ea23,ge6526c86ff+3a7c1ac5f1,ge79ae78c31+469cd937ee,gee10cc3b42+a6fc98d2e7,gf1cff7945b+21ad69e7e1,gfbcc870c63+9a11dc8c8f
LSST Data Management Base Package
|
Public Member Functions | |
__init__ (self) | |
makeBackgroundModel (self, in_x, pars=None) | |
fitFootprintBackground (self, source, posImage, order=1) | |
makeStarModel (self, bbox, psf, xcen, ycen, flux) | |
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) | |
Public Attributes | |
debug | |
log | |
Protected Member Functions | |
_generateXYGrid (self, bbox) | |
_getHeavyFootprintSubimage (self, fp, badfill=np.nan, grow=0) | |
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 192 of file dipoleFitTask.py.
lsst.ip.diffim.dipoleFitTask.DipoleModel.__init__ | ( | self | ) |
Definition at line 200 of file dipoleFitTask.py.
|
protected |
Generate a meshgrid covering the x,y coordinates bounded by bbox Parameters ---------- bbox : `lsst.geom.Box2I` input Bounding Box defining the coordinate limits Returns ------- in_x : `numpy.array` (2, w, h)-dimensional numpy array containing the grid indexing over x- and y- coordinates
Definition at line 248 of file dipoleFitTask.py.
|
protected |
Extract the image from a ``~lsst.afw.detection.HeavyFootprint`` as an `lsst.afw.image.ImageF`. Parameters ---------- fp : `lsst.afw.detection.HeavyFootprint` HeavyFootprint to use to generate the subimage badfill : `float`, optional Value to fill in pixels in extracted image that are outside the footprint grow : `int` Optionally grow the footprint by this amount before extraction Returns ------- subim2 : `lsst.afw.image.ImageF` An `~lsst.afw.image.ImageF` containing the subimage.
Definition at line 269 of file dipoleFitTask.py.
lsst.ip.diffim.dipoleFitTask.DipoleModel.fitFootprintBackground | ( | self, | |
source, | |||
posImage, | |||
order = 1 ) |
Fit a linear (polynomial) model of given order (max 2) to the background of a footprint. Only fit the pixels OUTSIDE of the footprint, but within its bounding box. Parameters ---------- source : `lsst.afw.table.SourceRecord` SourceRecord, the footprint of which is to be fit posImage : `lsst.afw.image.Exposure` The exposure from which to extract the footprint subimage order : `int` Polynomial order of background gradient to fit. Returns ------- pars : `tuple` of `float` `tuple` of length (1 if order==0; 3 if order==1; 6 if order == 2), containing the resulting fit parameters
Definition at line 295 of file dipoleFitTask.py.
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 205 of file dipoleFitTask.py.
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, ycenPos : `float` Desired x,y-centroid of the positive lobe of the dipole xcenNeg, ycenNeg : `float` Desired x,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 : `dict` [`str`] 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 396 of file dipoleFitTask.py.
lsst.ip.diffim.dipoleFitTask.DipoleModel.makeStarModel | ( | self, | |
bbox, | |||
psf, | |||
xcen, | |||
ycen, | |||
flux ) |
Generate a 2D image model of a single PDF centered at the given coordinates. Parameters ---------- bbox : `lsst.geom.Box` Bounding box marking pixel coordinates for generated model psf : TODO: DM-17458 Psf model used to generate the 'star' xcen : `float` Desired x-centroid of the 'star' ycen : `float` Desired y-centroid of the 'star' flux : `float` Desired flux of the 'star' Returns ------- p_Im : `lsst.afw.image.Image` 2-d stellar image of width/height matching input ``bbox``, containing PSF with given centroid and flux
Definition at line 353 of file dipoleFitTask.py.
lsst.ip.diffim.dipoleFitTask.DipoleModel.debug |
Definition at line 202 of file dipoleFitTask.py.
lsst.ip.diffim.dipoleFitTask.DipoleModel.log |
Definition at line 203 of file dipoleFitTask.py.