skultrafast.messpy¶
Classes¶
Class for working with older messpy2 files. |
|
Functions¶
|
Get array from group of datasets, assuming they are named 0, 1, 2, ... |
|
Determine t0 from a semiconductor messuarement in the IR. For that, it opens |
Module Contents¶
- class skultrafast.messpy.MessPy2File(fname: os.PathLike)[source]¶
Class for working with older messpy2 files.
- process_ir(t0=0, min_scans=0, max_scans=None, subtract_background=True, center_ch=16, disp=14, sigma=3) skultrafast.dataset.PolTRSpec[source]¶
- class skultrafast.messpy.MessPyFile(fname, invert_data=False, is_pol_resolved=False, pol_first_scan: Literal['magic', 'para', 'perp', 'unknown'] = 'unknown', valid_channel=None)[source]¶
-
- average_scans(sigma=3, max_iter=3, min_scan=0, max_scan=None, disp_freq_unit=None)[source]¶
Calculate the average of the scans. Uses sigma clipping, which also filters nans. For polarization resolved measurements, the function assumes that the polarisation switches every scan.
- Parameters:
sigma (float) – sigma used for sigma clipping.
max_iter (int) – Maximum iterations in sigma clipping.
min_scan (int or None) – All scans before min_scan are ignored.
max_scan (int or None) – If
None, use all scan, else just use the scans up to max_scan.disp_freq_unit ('nm', 'cm' or None) – Sets
disp_freq_unitof the created datasets.
- Returns:
TimeResSpec or Dict of DataSets containing the averaged datasets. If the first delay-time are identical, they are interpreted as background and their mean is subtracted.
- Return type:
dict or TimeResSpec
- recalculate_wavelengths(dispersion, center_ch=None, offset=0)[source]¶
Recalculates the wavelengths, assuming linear dispersion. Currently assumes that the wavelength set by spectrometer is stored in channel 16
- Parameters:
dispersion (float) – The dispersion per channel.
center_ch (int) – Determines the mid-channel. Defaults to len(wl)/2.
- class skultrafast.messpy.MessPyPlotter(messpyds)[source]¶
Bases:
skultrafast.dataset.PlotterMixin- compare_spec(t_region=(0, 4), every_nth=1, ax=None)[source]¶
Plots the averaged spectra of every central wavelenth and polarisation.
- Parameters:
t_region (tuple of floats) – Contains the the start and end-point of the times to average.
every_nth (int) – Only every n-th scan is plotted.
- Return type:
None
- skultrafast.messpy._get_group_arr(grp: h5py.Group)[source]¶
Get array from group of datasets, assuming they are named 0, 1, 2, … and have the same shape
- skultrafast.messpy.get_t0(fname: str, sigma: float = 1, scan: int | slice = -1, display_result: bool = True, plot: bool = True, t_range: Tuple[float, float] = (-2, 2), invert: bool = False, no_slope: bool = True) TzResult[source]¶
Determine t0 from a semiconductor messuarement in the IR. For that, it opens the given file, takes the mean of all channels and fits the resulting curve with a step function.
Note that the parameter
- Parameters:
fname (str) – Filename of the messpy file containing the data
sigma (float, optional) – Used for calculating the displayed nummerical derviate, by default 1.
scan (int or slice) – Which scan to use, by default -1, the last scan. If given a slice, it takes the mean of the scan slice.
display_result (bool, optional) – If true, show the fitting results, by default True
plot (bool, optional) – If true, plot the result, by default True
t_range ((float, flot)) – The range which is used to fit the data.
invert (bool) – If true, invert data.
no_slope (bool) – Determines if a variable slope is added to the fit model.
- Returns:
Result and presentation of the fit.
- Return type: