LSSTApplications  18.0.0+46,18.0.0+93,19.0.0,19.0.0+1,19.0.0+2,19.0.0+3,19.0.0+4,19.0.0-1-g20d9b18+2,19.0.0-1-g3dc8cbe+2,19.0.0-1-g425ff20,19.0.0-1-g5549ca4,19.0.0-1-g580fafe+2,19.0.0-1-g5db401e+3,19.0.0-1-g6fe20d0+1,19.0.0-1-g7011481+2,19.0.0-1-g8c57eb9+2,19.0.0-1-g9828021+2,19.0.0-1-gb5175dc+2,19.0.0-1-gd7f3e1b+2,19.0.0-1-gdc0e4a7+2,19.0.0-1-ge272bc4+2,19.0.0-2-g0d9f9cd+2,19.0.0-2-g1c703f9ef+1,19.0.0-2-g3d9e4fb2+2,19.0.0-2-gd955cfd+2,19.0.0-3-g2d13df8,19.0.0-3-g63079e6+2,19.0.0-7-g8a434f2+1,19.0.0-7-gf796fef9+3,w.2019.49
LSSTDataManagementBasePackage
Classes | Functions
lsst.meas.algorithms.objectSizeStarSelector Namespace Reference

Classes

class  EventHandler
 
class  ObjectSizeStarSelectorConfig
 
class  ObjectSizeStarSelectorTask
 A star selector that looks for a cluster of small objects in a size-magnitude plot. More...
 

Functions

def plot (mag, width, centers, clusterId, marker="o", markersize=2, markeredgewidth=0, ltype='-', magType="model", clear=True)
 

Function Documentation

◆ plot()

def lsst.meas.algorithms.objectSizeStarSelector.plot (   mag,
  width,
  centers,
  clusterId,
  marker = "o",
  markersize = 2,
  markeredgewidth = 0,
  ltype = '-',
  magType = "model",
  clear = True 
)

Definition at line 265 of file objectSizeStarSelector.py.

265  magType="model", clear=True):
266 
267  log = Log.getLogger("objectSizeStarSelector.plot")
268  try:
269  import matplotlib.pyplot as plt
270  except ImportError as e:
271  log.warn("Unable to import matplotlib: %s", e)
272  return
273 
274  try:
275  fig
276  except NameError:
277  fig = plt.figure()
278  else:
279  if clear:
280  fig.clf()
281 
282  axes = fig.add_axes((0.1, 0.1, 0.85, 0.80))
283 
284  xmin = sorted(mag)[int(0.05*len(mag))]
285  xmax = sorted(mag)[int(0.95*len(mag))]
286 
287  axes.set_xlim(-17.5, -13)
288  axes.set_xlim(xmin - 0.1*(xmax - xmin), xmax + 0.1*(xmax - xmin))
289  axes.set_ylim(0, 10)
290 
291  colors = ["r", "g", "b", "c", "m", "k", ]
292  for k, mean in enumerate(centers):
293  if k == 0:
294  axes.plot(axes.get_xlim(), (mean, mean,), "k%s" % ltype)
295 
296  li = (clusterId == k)
297  axes.plot(mag[li], width[li], marker, markersize=markersize, markeredgewidth=markeredgewidth,
298  color=colors[k % len(colors)])
299 
300  li = (clusterId == -1)
301  axes.plot(mag[li], width[li], marker, markersize=markersize, markeredgewidth=markeredgewidth,
302  color='k')
303 
304  if clear:
305  axes.set_xlabel("Instrumental %s mag" % magType)
306  axes.set_ylabel(r"$\sqrt{(I_{xx} + I_{yy})/2}$")
307 
308  return fig
309