skultrafast.twoD_dataset
¶
Module Contents¶
Classes¶
Result of a single CLS fit. |
|
Baseclass for FFCF determination methods. |
|
Class holding the data of CLS-analysis. Has methods to analyze and plot them. |
|
A dataclass to hold the results of the Gaussian fit. |
|
Dataset for an two dimensional dataset. Requires the t- (waiting times),the |
Attributes¶
- class skultrafast.twoD_dataset.SingleCLSResult[source]¶
Result of a single CLS fit.
- class skultrafast.twoD_dataset.FFCFResult[source]¶
Baseclass for FFCF determination methods.
For backwards compatibility, the values are always called slopes
- class skultrafast.twoD_dataset.CLSResult[source]¶
Bases:
FFCFResult
Class holding the data of CLS-analysis. Has methods to analyze and plot them.
- class skultrafast.twoD_dataset.GaussResult[source]¶
Bases:
FFCFResult
A dataclass to hold the results of the Gaussian fit.
- class skultrafast.twoD_dataset.TwoDim[source]¶
Dataset for an two dimensional dataset. Requires the t- (waiting times),the probe- and pump-axes in addition to the three dimensional spec2d data.
- spec2d: numpy.ndarray[source]¶
Array with the data, shape must be (t.size, wn_probe.size, wn_pump.size)
- single_cls_result_: SingleCLSResult | None[source]¶
Contains the data from a Single CLS analysis
- plot: skultrafast.twoD_plotter.TwoDimPlotter[source]¶
Plot object offering plotting methods
- interpolator_: scipy.interpolate.RegularGridInterpolator | None[source]¶
Contains the interpolator for the 2d-spectra
- exp_fit_result_: ExpFit2DResult | None[source]¶
Contains the result of the exponential fit
- t_idx(t: float) int [source]¶
- t_idx(t: Iterable[float]) List[int]
Return nearest idx to nearest time value
- data_at(t: float | None = None, probe_wn: float | None = None, pump_wn: float | None = None) numpy.ndarray [source]¶
Extracts the data at given coordinates.
- probe_idx(wn: float | Iterable[float]) int | List[int] [source]¶
Return nearest idx to nearest probe_wn value
- pump_idx(wn: float | Iterable[float]) int | List[int] [source]¶
Return nearest idx to nearest pump_wn value
- select_range(pump_range: Tuple[float, float], probe_range: Tuple[float, float], invert: bool = False) TwoDim [source]¶
Return a dataset containing only the selected region.
- select_t_range(t_min: float = -np.inf, t_max: float = np.inf) TwoDim [source]¶
” Returns a dataset only containing the data within given time limits.
- integrate_pump(lower: float = -np.inf, upper: float = np.inf) skultrafast.dataset.TimeResSpec [source]¶
Calculate and return 1D Time-resolved spectra for given range.
Uses trapezoidal integration.
- Parameters:
- Returns:
The corresponding 1D Dataset
- Return type:
- single_cls(t: float, pr_range: float | Tuple[float, float] = 9.0, pu_range: float | Tuple[float, float] = 7.0, mode: Literal[neg, pos] = 'neg', method: Literal[com, quad, fit, log_quad, skew_fit] = 'com') SingleCLSResult [source]¶
Calculate the CLS for single 2D spectrum.
- Parameters:
t (float) – Delay time of the spectrum to analyse
pr_range (float or float, optional) – How many wavenumbers away from the maximum to use for determining the exact position, by default 9, resulting a total range of 18 wavenumbers. Also accepts a tuple, which is interpreted as (lower, upper) range.
pu_range (float, optional) – The range around the pump-maxima used for calculating the CLS. If given a float, the range is calculated as (max - pu_range, max + pu_range). If given a tuple, it is interpreted as (lower, upper) range.
mode (('neg', 'pos'), optional) – negative or positive maximum, by default ‘neg’. Ignored when method is ‘nodal’.
method (('com', 'quad', 'fit', 'log_quad', 'skew_fit', 'nodal'), optional) – Selects the method used for determination of the maximum signal.
com
uses the center-of-mass,quad
uses a quadratic fit andfit
uses a gaussian fit. ‘log_quad’ uses a quadratic fit on the logarithm of the signal. ‘skew_fit’ uses a gaussian fit with a linear background. ‘nodal’ finds the zero-crossing of the signal.
- Returns:
pump_wn max_pos max_pos_err slope reg_result recentered_pump_wn linear_fit
- Return type:
Returns SingleCLSResult object with attributes
- cls(joblib_kws=None, **cls_args) CLSResult [source]¶
Calculates the CLS for all 2d-spectra. The arguments are given to the single cls function, except joblib_kw, which is forwarded to joblib.Parallel.
Returns as
CLSResult
.
- diag_and_antidiag(t: float, offset: float | None = None, p: float | None = None) DiagResult [source]¶
Extracts the diagonal and anti-diagonal.
- Parameters:
t (float) – Waiting time of the 2d-spectra from which the data is extracted.
offset (float) – Offset of the diagonal, if none, it will we determined by the going through the signal minimum.
p (float) – The point where the anti-diagonal crosses the diagonal. If none, it also goes through the signal minimum.
- Returns:
Contains the diagonals, coordinates and points.
- Return type:
- pump_slice_amp(t: float, bg_correct: bool = True) numpy.ndarray [source]¶
” Calculates the pump-slice-amplitude for a given delay t.
- apply_filter(kind: Literal[uniform, gaussian], size, *args) TwoDim [source]¶
” Returns filtered dataset.
- save_txt(pname: PathLike, **kwargs)[source]¶
Saves 2d-spectra as a text files a directory.
- Parameters:
pname (PathLike) – Path to the file.
kwargs – Additional arguments for the np.savetxt function.
- background_correction(excluded_range: Tuple[float, float], deg: int = 3) None [source]¶
Fits and subtracts a background for each pump-frequency. Done for each waiting time. Does the subtraction inplace, e.g. modifies the dataset.
- get_minmax(t: float, com: int = 3) Dict[str, float] [source]¶
Returns the position of the minimum and maximum of the dataset at time t. If com > 0, it return the center of mass around the minimum and maximum. The com argument gives the number of points to be used for the center of mass.
- integrate_reg(pump_range: Tuple[float, float], probe_range: Tuple[float, float] = None) numpy.ndarray [source]¶
Integrates the 2D spectra over a given range, using the trapezoidal rule.
- Parameters:
- Returns:
The integrated spectral signal for all waiting times.
- Return type:
np.ndarray
- fit_taus(taus: numpy.ndarray)[source]¶
Given a set of decay times, fit the data to a sum of the exponentials. Used by the
fit_taus
method.
- fit_das(taus, fix_last_decay=False) ExpFit2DResult [source]¶
Fit the data to a sum of exponentials (DAS), starting from the given decay constants. The results are stored in the
fit_exp_result
attribute.
- fit_gauss(mode='both') GaussResult [source]¶
Fits the 2D spectra using two gaussians peaks.