LSST Applications  21.0.0-172-gfb10e10a+18fedfabac,22.0.0+297cba6710,22.0.0+80564b0ff1,22.0.0+8d77f4f51a,22.0.0+a28f4c53b1,22.0.0+dcf3732eb2,22.0.1-1-g7d6de66+2a20fdde0d,22.0.1-1-g8e32f31+297cba6710,22.0.1-1-geca5380+7fa3b7d9b6,22.0.1-12-g44dc1dc+2a20fdde0d,22.0.1-15-g6a90155+515f58c32b,22.0.1-16-g9282f48+790f5f2caa,22.0.1-2-g92698f7+dcf3732eb2,22.0.1-2-ga9b0f51+7fa3b7d9b6,22.0.1-2-gd1925c9+bf4f0e694f,22.0.1-24-g1ad7a390+a9625a72a8,22.0.1-25-g5bf6245+3ad8ecd50b,22.0.1-25-gb120d7b+8b5510f75f,22.0.1-27-g97737f7+2a20fdde0d,22.0.1-32-gf62ce7b1+aa4237961e,22.0.1-4-g0b3f228+2a20fdde0d,22.0.1-4-g243d05b+871c1b8305,22.0.1-4-g3a563be+32dcf1063f,22.0.1-4-g44f2e3d+9e4ab0f4fa,22.0.1-42-gca6935d93+ba5e5ca3eb,22.0.1-5-g15c806e+85460ae5f3,22.0.1-5-g58711c4+611d128589,22.0.1-5-g75bb458+99c117b92f,22.0.1-6-g1c63a23+7fa3b7d9b6,22.0.1-6-g50866e6+84ff5a128b,22.0.1-6-g8d3140d+720564cf76,22.0.1-6-gd805d02+cc5644f571,22.0.1-8-ge5750ce+85460ae5f3,master-g6e05de7fdc+babf819c66,master-g99da0e417a+8d77f4f51a,w.2021.48
LSST Data Management Base Package
Public Member Functions | Public Attributes | Static Public Attributes | List of all members
lsst.meas.modelfit.display.densityPlot.SurfaceLayer Class Reference

Public Member Functions

def __init__ (self, tag, steps1d=200, steps2d=200, filled=False, kwds1d=None, kwds2d=None)
 
def eval1d (self, data, dim, x)
 
def eval2d (self, data, xDim, yDim, x, y)
 
def plotX (self, axes, data, dim)
 
def plotY (self, axes, data, dim)
 
def plotXY (self, axes, data, xDim, yDim)
 

Public Attributes

 tag
 
 steps1d
 
 steps2d
 
 filled
 
 kwds1d
 
 kwds2d
 

Static Public Attributes

 defaults1d = dict(linewidth=2, color='r')
 
 defaults2d = dict(linewidths=2, cmap=matplotlib.cm.Reds)
 

Detailed Description

A Layer class for analytic N-d distributions that can be evaluated in 1-d or 2-d slices.

The 2-d slices are drawn as contours, and the 1-d slices are drawn as simple curves.

Relies on eval1d and eval2d methods in the data object; this can be avoided by subclassing
SurfaceLayer and reimplementing its own eval1d and eval2d methods.

Definition at line 172 of file densityPlot.py.

Constructor & Destructor Documentation

◆ __init__()

def lsst.meas.modelfit.display.densityPlot.SurfaceLayer.__init__ (   self,
  tag,
  steps1d = 200,
  steps2d = 200,
  filled = False,
  kwds1d = None,
  kwds2d = None 
)

Definition at line 184 of file densityPlot.py.

184  def __init__(self, tag, steps1d=200, steps2d=200, filled=False, kwds1d=None, kwds2d=None):
185  self.tag = tag
186  self.steps1d = int(steps1d)
187  self.steps2d = int(steps2d)
188  self.filled = bool(filled)
189  self.kwds1d = mergeDefaults(kwds1d, self.defaults1d)
190  self.kwds2d = mergeDefaults(kwds2d, self.defaults2d)
191 

Member Function Documentation

◆ eval1d()

def lsst.meas.modelfit.display.densityPlot.SurfaceLayer.eval1d (   self,
  data,
  dim,
  x 
)
Return analytic function values for the given values.

Definition at line 192 of file densityPlot.py.

192  def eval1d(self, data, dim, x):
193  """Return analytic function values for the given values."""
194  return data.eval1d(dim, x)
195 

◆ eval2d()

def lsst.meas.modelfit.display.densityPlot.SurfaceLayer.eval2d (   self,
  data,
  xDim,
  yDim,
  x,
  y 
)
Return analytic function values for the given values.

Definition at line 196 of file densityPlot.py.

196  def eval2d(self, data, xDim, yDim, x, y):
197  """Return analytic function values for the given values."""
198  return data.eval2d(xDim, yDim, x, y)
199 

◆ plotX()

def lsst.meas.modelfit.display.densityPlot.SurfaceLayer.plotX (   self,
  axes,
  data,
  dim 
)

Definition at line 200 of file densityPlot.py.

200  def plotX(self, axes, data, dim):
201  xMin, xMax = axes.get_xlim()
202  x = numpy.linspace(xMin, xMax, self.steps1d)
203  z = self.eval1d(data, dim, x)
204  if z is None:
205  return
206  return axes.plot(x, z, **self.kwds1d)
207 

◆ plotXY()

def lsst.meas.modelfit.display.densityPlot.SurfaceLayer.plotXY (   self,
  axes,
  data,
  xDim,
  yDim 
)

Definition at line 216 of file densityPlot.py.

216  def plotXY(self, axes, data, xDim, yDim):
217  xMin, xMax = axes.get_xlim()
218  yMin, yMax = axes.get_ylim()
219  xc = numpy.linspace(xMin, xMax, self.steps2d)
220  yc = numpy.linspace(yMin, yMax, self.steps2d)
221  xg, yg = numpy.meshgrid(xc, yc)
222  z = self.eval2d(data, xDim, yDim, xg, yg)
223  if z is None:
224  return
225  if self.filled:
226  return axes.contourf(xg, yg, z, 6, **self.kwds2d)
227  else:
228  return axes.contour(xg, yg, z, 6, **self.kwds2d)
229 
230 

◆ plotY()

def lsst.meas.modelfit.display.densityPlot.SurfaceLayer.plotY (   self,
  axes,
  data,
  dim 
)

Definition at line 208 of file densityPlot.py.

208  def plotY(self, axes, data, dim):
209  yMin, yMax = axes.get_ylim()
210  y = numpy.linspace(yMin, yMax, self.steps1d)
211  z = self.eval1d(data, dim, y)
212  if z is None:
213  return
214  return axes.plot(z, y, **self.kwds1d)
215 

Member Data Documentation

◆ defaults1d

lsst.meas.modelfit.display.densityPlot.SurfaceLayer.defaults1d = dict(linewidth=2, color='r')
static

Definition at line 181 of file densityPlot.py.

◆ defaults2d

lsst.meas.modelfit.display.densityPlot.SurfaceLayer.defaults2d = dict(linewidths=2, cmap=matplotlib.cm.Reds)
static

Definition at line 182 of file densityPlot.py.

◆ filled

lsst.meas.modelfit.display.densityPlot.SurfaceLayer.filled

Definition at line 188 of file densityPlot.py.

◆ kwds1d

lsst.meas.modelfit.display.densityPlot.SurfaceLayer.kwds1d

Definition at line 189 of file densityPlot.py.

◆ kwds2d

lsst.meas.modelfit.display.densityPlot.SurfaceLayer.kwds2d

Definition at line 190 of file densityPlot.py.

◆ steps1d

lsst.meas.modelfit.display.densityPlot.SurfaceLayer.steps1d

Definition at line 186 of file densityPlot.py.

◆ steps2d

lsst.meas.modelfit.display.densityPlot.SurfaceLayer.steps2d

Definition at line 187 of file densityPlot.py.

◆ tag

lsst.meas.modelfit.display.densityPlot.SurfaceLayer.tag

Definition at line 185 of file densityPlot.py.


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