skultrafast.fitter
¶
Module Contents¶
Classes¶
The fit object, takes all the need data and allows to fit it. |
Functions¶
|
|
|
Returns the solution for the least squares problem |Ax - b_i|^2. |
Attributes¶
- skultrafast.fitter.solve_mat(A, b_mat, method='ridge')[source]¶
Returns the solution for the least squares problem |Ax - b_i|^2.
- class skultrafast.fitter.Fitter(tup, model_coh=False, model_disp=1)[source]¶
Bases:
object
The fit object, takes all the need data and allows to fit it.
There a two different methods to fit the data. The fast one assumes, that the data has no dispersion, so the base vectors are the same for each channel. It is recommended to first work with the fast version. Note that the fast version is able to handle dispersion by using linear interpolation to transform the data to dispersion free data.
The slower version calculates the base vector for each channel, in which the dispersion is integrated.
The slower methods using the prefix full.
- Parameters:
wl (ndarray(M)) – Array containing the wavelength-coordinates.
t (ndarray(N)) – Array containing the time-coordinates.
data (ndarry(N,M)) – The 2d-data to fit.
model_coh (bool) – If the model contains coherent artifacts at the time zero, defaults to False.
model_disp (int) – Degree of the polynomial which models the dispersion. If 1, only a offset is modeled, which is very fast.
- make_model(para)[source]¶
Calculates the model for given parameters. After calling, the DAS is at self.c, the model at self.model.
If the dispersion is modeled, it is done via linear interpolation. This way, the base- vectors and their decomposition are only calculated once.
- Parameters:
para (ndarray(N)) –
- para has the following form:
[p_0, …, p_M, w, tau_1, …, tau_N]
Where p are the coefficients of the dispersion polynomial, w is the width of the system response and tau are the decay times. M is equal to self.model_disp.
- res(para)[source]¶
Return the residuals for given parameters using the same basevector for each channel. See make_model for para format.
- make_full_model(para)[source]¶
Calculates the model for given parameters. After calling, the DAS is at self.c, the model at self.model.
- Parameters:
para (ndarray(N)) –
- para has the following form:
[p_0, …, p_M, w, tau_1, …, tau_N]
Where p are the coefficients of the dispersion polynomial, w is the width of the system response and tau are the decay times. M is equal to self.model_disp.