LSSTApplications  18.0.0+56,19.0.0+1,19.0.0+18,19.0.0+19,19.0.0+21,19.0.0+26,19.0.0+5,19.0.0-1-g20d9b18+12,19.0.0-1-g425ff20,19.0.0-1-g5549ca4,19.0.0-1-g580fafe+12,19.0.0-1-g6fe20d0+4,19.0.0-1-g8c57eb9+12,19.0.0-1-ga72da6b,19.0.0-1-gbfe0924+3,19.0.0-1-gdc0e4a7+17,19.0.0-1-ge272bc4+12,19.0.0-1-ge3aa853+3,19.0.0-16-g3a790c8c,19.0.0-18-g955d782+1,19.0.0-2-g0d9f9cd+19,19.0.0-2-g260436e+3,19.0.0-2-g9b11441+6,19.0.0-2-gd955cfd+25,19.0.0-3-g6513920+3,19.0.0-3-gc4f6e04+2,19.0.0-4-g41ffa1d+5,19.0.0-4-g725f80e+21,19.0.0-5-g0745e3f+3,19.0.0-6-g5a632bb5+1,19.0.0-6-gb6b8b0a+3,19.0.0-7-g686a884,19.0.0-7-gea0a0fe+8,19.0.0-9-gd2f60f3c3,w.2020.03
LSSTDataManagementBasePackage
Classes | Functions | Variables
lsst.meas.modelfit.priors.priorsContinued Namespace Reference

Classes

class  SemiEmpiricalPrior
 
class  SoftenedLinearPrior
 

Functions

def fitMixture (data, nComponents, minFactor=0.25, maxFactor=4.0, nIterations=20, df=float("inf"))
 

Variables

 SemiEmpiricalPriorConfig = makeConfigClass(SemiEmpiricalPriorControl)
 
 SoftenedLinearPriorConfig = makeConfigClass(SoftenedLinearPriorControl)
 

Function Documentation

◆ fitMixture()

def lsst.meas.modelfit.priors.priorsContinued.fitMixture (   data,
  nComponents,
  minFactor = 0.25,
  maxFactor = 4.0,
  nIterations = 20,
  df = float("inf") 
)
Fit a ``Mixture`` distribution to a set of (e1, e2, r) data points,
returing a ``MixturePrior`` object.

Parameters
----------
data : numpy.ndarray
    array of data points to fit; shape=(N,3)
nComponents : int
    number of components in the mixture distribution
minFactor : float
    ellipticity variance of the smallest component in the initial mixture,
    relative to the measured variance
maxFactor : float
    ellipticity variance of the largest component in the initial mixture,
    relative to the measured variance
nIterations : int
    number of expectation-maximization update iterations
df : float
    number of degrees of freedom for component Student's T distributions
    (inf=Gaussian).

Definition at line 56 of file priorsContinued.py.

56  nIterations=20, df=float("inf")):
57  """Fit a ``Mixture`` distribution to a set of (e1, e2, r) data points,
58  returing a ``MixturePrior`` object.
59 
60  Parameters
61  ----------
62  data : numpy.ndarray
63  array of data points to fit; shape=(N,3)
64  nComponents : int
65  number of components in the mixture distribution
66  minFactor : float
67  ellipticity variance of the smallest component in the initial mixture,
68  relative to the measured variance
69  maxFactor : float
70  ellipticity variance of the largest component in the initial mixture,
71  relative to the measured variance
72  nIterations : int
73  number of expectation-maximization update iterations
74  df : float
75  number of degrees of freedom for component Student's T distributions
76  (inf=Gaussian).
77  """
78  components = Mixture.ComponentList()
79  rMu = data[:, 2].mean()
80  rSigma = data[:, 2].var()
81  eSigma = 0.5*(data[:, 0].var() + data[:, 1].var())
82  mu = np.array([0.0, 0.0, rMu], dtype=float)
83  baseSigma = np.array([[eSigma, 0.0, 0.0],
84  [0.0, eSigma, 0.0],
85  [0.0, 0.0, rSigma]])
86  for factor in np.linspace(minFactor, maxFactor, nComponents):
87  sigma = baseSigma.copy()
88  sigma[:2, :2] *= factor
89  components.append(Mixture.Component(1.0, mu, sigma))
90  mixture = Mixture(3, components, df)
91  restriction = MixturePrior.getUpdateRestriction()
92  for i in range(nIterations):
93  mixture.updateEM(data, restriction)
94  return mixture
95 

Variable Documentation

◆ SemiEmpiricalPriorConfig

lsst.meas.modelfit.priors.priorsContinued.SemiEmpiricalPriorConfig = makeConfigClass(SemiEmpiricalPriorControl)

Definition at line 38 of file priorsContinued.py.

◆ SoftenedLinearPriorConfig

lsst.meas.modelfit.priors.priorsContinued.SoftenedLinearPriorConfig = makeConfigClass(SoftenedLinearPriorControl)

Definition at line 40 of file priorsContinued.py.