skultrafast.messpy
¶
Module Contents¶
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 |
- 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_unit
of 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
- class skultrafast.messpy.MessPyPlotter(messpyds)[source]¶
- 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
- class skultrafast.messpy.Messpy25File[source]¶
- h5_file: h5py.File | pathlib.Path[source]¶
h5py file object containing the 2D dataset, the only required parameter
- pump_wn: numpy.ndarray[source]¶
Array with the pump wavenumbers. Depends on the upsampling used during measurment
- get_ifr(probe_filter=None, bg_correct=None, ch_shift: int = 0)[source]¶
Returns the interferograms. If necessary, apply probefilter and background correction.
- Parameters:
- Returns:
ifr – The interferograms for paralllel, perpendicular and isotropic polarisation. The shape of each array is (n_t2, n_probe_wn, n_t1).
- Return type:
Tuple[np.ndarray, np.ndarray, np.ndarray]
- make_two_d(upsample: int = 4, window_fcn: Callable | None = np.hanning, ch_shift: int = 1, probe_filter: float | None = None, bg_correct: Tuple[int, int] | None = None, t0_factor: float = 0.5) Dict[str, skultrafast.twoD_dataset.TwoDim] [source]¶
Calculates the 2D spectra from the interferograms and returns it as a dictionary. The dictorary contains messpy 2D-objects for paralllel, perpendicular and isotropic polarisation.
- Parameters:
upsample (int) – Upsampling factor used in the FFT. A factor over 2 only does sinc interpolation.
window_fcn (Callable) – If given, apply a window function to the FFT.
probe_filter (float) – The probe filter width in channels. (Gaussian filter)
ch_shift (int) – Number of channels to shift the Probe2 data. Corrects for missaligned channels.
bg_correct (Tuple[int, int]) – Number of left and right channels to use for background correction.
t0_factor (float) – Factor to multiply the first t1 point (zero-delay between the pumps) to correct for the integration. In general, the default should not be touched.
- make_model_fitfiles(path, name, probe_filter=None, bg_correct=None)[source]¶
Saves the data in a format useable for the ModelFit Gui from Kevin Robben https://github.com/kevin-robben/model-fitting
- 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: