lsst.meas.algorithms g8588faa8eb+d2f309c3d6
Loading...
Searching...
No Matches
Functions | Variables
lsst.meas.algorithms.utils Namespace Reference

Functions

 splitId (oid, asDict=True)
 
 showSourceSet (sSet, xy0=(0, 0), display=None, ctype=afwDisplay.GREEN, symb="+", size=2)
 
 showPsfSpatialCells (exposure, psfCellSet, nMaxPerCell=-1, showChi2=False, showMoments=False, symb=None, ctype=None, ctypeUnused=None, ctypeBad=None, size=2, display=None)
 
 showPsfCandidates (exposure, psfCellSet, psf=None, display=None, normalize=True, showBadCandidates=True, fitBasisComponents=False, variance=None, chi=None)
 
 makeSubplots (fig, nx=2, ny=2, Nx=1, Ny=1, plottingArea=(0.1, 0.1, 0.85, 0.80), pxgutter=0.05, pygutter=0.05, xgutter=0.04, ygutter=0.04, headroom=0.0, panelBorderWeight=0, panelColor='black')
 
 plotPsfSpatialModel (exposure, psf, psfCellSet, showBadCandidates=True, numSample=128, matchKernelAmplitudes=False, keepPlots=True)
 
 showPsf (psf, eigenValues=None, XY=None, normalize=True, display=None)
 
 showPsfMosaic (exposure, psf=None, nx=7, ny=None, showCenter=True, showEllipticity=False, showFwhm=False, stampSize=0, display=None, title=None)
 
 showPsfResiduals (exposure, sourceSet, magType="psf", scale=10, display=None)
 
 saveSpatialCellSet (psfCellSet, fileName="foo.fits", display=None)
 

Variables

bool keptPlots = False
 
 _LOG = logging.getLogger(__name__)
 

Detailed Description

Support utilities for Measuring sources

Function Documentation

◆ makeSubplots()

lsst.meas.algorithms.utils.makeSubplots (   fig,
  nx = 2,
  ny = 2,
  Nx = 1,
  Ny = 1,
  plottingArea = (0.1, 0.1, 0.85, 0.80),
  pxgutter = 0.05,
  pygutter = 0.05,
  xgutter = 0.04,
  ygutter = 0.04,
  headroom = 0.0,
  panelBorderWeight = 0,
  panelColor = 'black' 
)
Return a generator of a set of subplots, a set of Nx*Ny panels of nx*ny plots.  Each panel is fully
filled by row (starting in the bottom left) before the next panel is started.  If panelBorderWidth is
greater than zero a border is drawn around each panel, adjusted to enclose the axis labels.

E.g.
subplots = makeSubplots(fig, 2, 2, Nx=1, Ny=1, panelColor='k')
ax = subplots.next(); ax.text(0.3, 0.5, '[0, 0] (0,0)')
ax = subplots.next(); ax.text(0.3, 0.5, '[0, 0] (1,0)')
ax = subplots.next(); ax.text(0.3, 0.5, '[0, 0] (0,1)')
ax = subplots.next(); ax.text(0.3, 0.5, '[0, 0] (1,1)')
fig.show()

Parameters
----------
fig : `matplotlib.pyplot.figure`
    The matplotlib figure to draw
nx : `int`
    The number of plots in each row of each panel
ny : `int`
    The number of plots in each column of each panel
Nx : `int`
    The number of panels in each row of the figure
Ny : `int`
    The number of panels in each column of the figure
plottingArea : `tuple`
    (x0, y0, x1, y1) for the part of the figure containing all the panels
pxgutter : `float`
    Spacing between columns of panels in units of (x1 - x0)
pygutter : `float`
    Spacing between rows of panels in units of (y1 - y0)
xgutter : `float`
    Spacing between columns of plots within a panel in units of (x1 - x0)
ygutter : `float`
    Spacing between rows of plots within a panel in units of (y1 - y0)
headroom : `float`
    Extra spacing above each plot for e.g. a title
panelBorderWeight : `int`
    Width of border drawn around panels
panelColor : `str`
    Colour of border around panels

Definition at line 342 of file utils.py.

◆ plotPsfSpatialModel()

lsst.meas.algorithms.utils.plotPsfSpatialModel (   exposure,
  psf,
  psfCellSet,
  showBadCandidates = True,
  numSample = 128,
  matchKernelAmplitudes = False,
  keepPlots = True 
)
Plot the PSF spatial model.

Definition at line 475 of file utils.py.

◆ saveSpatialCellSet()

lsst.meas.algorithms.utils.saveSpatialCellSet (   psfCellSet,
  fileName = "foo.fits",
  display = None 
)
Write the contents of a SpatialCellSet to a many-MEF fits file

Definition at line 846 of file utils.py.

◆ showPsf()

lsst.meas.algorithms.utils.showPsf (   psf,
  eigenValues = None,
  XY = None,
  normalize = True,
  display = None 
)
Display a PSF's eigen images

If normalize is True, set the largest absolute value of each eigenimage to 1.0 (n.b. sum == 0.0 for i > 0)

Definition at line 641 of file utils.py.

◆ showPsfCandidates()

lsst.meas.algorithms.utils.showPsfCandidates (   exposure,
  psfCellSet,
  psf = None,
  display = None,
  normalize = True,
  showBadCandidates = True,
  fitBasisComponents = False,
  variance = None,
  chi = None 
)
Display the PSF candidates.

If psf is provided include PSF model and residuals;  if normalize is true normalize the PSFs
(and residuals)

If chi is True, generate a plot of residuals/sqrt(variance), i.e. chi

If fitBasisComponents is true, also find the best linear combination of the PSF's components
(if they exist)

Definition at line 137 of file utils.py.

◆ showPsfMosaic()

lsst.meas.algorithms.utils.showPsfMosaic (   exposure,
  psf = None,
  nx = 7,
  ny = None,
  showCenter = True,
  showEllipticity = False,
  showFwhm = False,
  stampSize = 0,
  display = None,
  title = None 
)
Show a mosaic of Psf images.  exposure may be an Exposure (optionally with PSF),
or a tuple (width, height)

If stampSize is > 0, the psf images will be trimmed to stampSize*stampSize

Definition at line 673 of file utils.py.

◆ showPsfResiduals()

lsst.meas.algorithms.utils.showPsfResiduals (   exposure,
  sourceSet,
  magType = "psf",
  scale = 10,
  display = None 
)

Definition at line 786 of file utils.py.

◆ showPsfSpatialCells()

lsst.meas.algorithms.utils.showPsfSpatialCells (   exposure,
  psfCellSet,
  nMaxPerCell = -1,
  showChi2 = False,
  showMoments = False,
  symb = None,
  ctype = None,
  ctypeUnused = None,
  ctypeBad = None,
  size = 2,
  display = None 
)
Show the SpatialCells.

If symb is something that afwDisplay.Display.dot() understands (e.g. "o"),
the top nMaxPerCell candidates will be indicated with that symbol, using
ctype and size.

Definition at line 81 of file utils.py.

◆ showSourceSet()

lsst.meas.algorithms.utils.showSourceSet (   sSet,
  xy0 = (0, 0),
  display = None,
  ctype = afwDisplay.GREEN,
  symb = "+",
  size = 2 
)
Draw the (XAstrom, YAstrom) positions of a set of Sources.  Image has the given XY0

Definition at line 62 of file utils.py.

◆ splitId()

lsst.meas.algorithms.utils.splitId (   oid,
  asDict = True 
)

Definition at line 52 of file utils.py.

Variable Documentation

◆ _LOG

lsst.meas.algorithms.utils._LOG = logging.getLogger(__name__)
protected

Definition at line 49 of file utils.py.

◆ keptPlots

bool lsst.meas.algorithms.utils.keptPlots = False

Definition at line 45 of file utils.py.