LorentzGauss.fromPars constructor
Constructs a mixed Gauss-Lorentz shape defined by:
a
- amplitude
c
- center
w
- width
m
- mixing factors (0 <= m <= 1) where
m=1=pure Lorentzian, then w = Lorentzian width
m=0=pure Gaussian, then w = Gaussian sigma
The dimension n of c,w,m must be the same (>0) and define the dimension of
the shape. Otherwise an exception is thrown.
fGauss
and fLorentz
will take on defaults (see above) when omitted.
Different literature references are using different defaults. The factors
ensure that w
is the line width at half maximum height for L, G, and mixed.
Implementation
LorentzGauss.fromPars(double this.a, List<double> this.c, List<double> this.w,
List<double> this.m,
[double this.fGauss, double this.fLorentz]) {
if (fGauss == null) fGauss = FGAUSS;
if (fLorentz == null) fLorentz = FLORENTZ;
dim = c.length;
if (dim != w.length || dim != m.length) {
throw "List size error\n. Expected: $dim";
}
pars = new List<double>(1 + c.length + w.length + m.length);
pars[0] = a;
for (int i = 0; i < dim; i++) {
pars[i + 1] = c[i];
pars[i + 1 + dim] = w[i];
pars[i + 1 + dim + dim] = m[i];
}
shapeParameters = pars;
}