skultrafast.messpy2D¶
Classes¶
Class for working with MessPy2D 2D-IR files. |
|
Functions¶
|
Compute the means and standard errors of the interferograms at a given |
Module Contents¶
- skultrafast.messpy2D._compute_means_and_stderr(t2_index, ifr, use_clip) Tuple[dict, dict][source]¶
Compute the means and standard errors of the interferograms at a given t2 index. If
use_clipis True, use sigma clipping to filter outliers. Not part of class to be used with joblib.- Parameters:
t2_index (int) – The index of the t2 array to use.
ifr (dict) – Dictionary containing the interferogram data.
use_clip (bool) – If True, use sigma clipping to filter outliers.
- class skultrafast.messpy2D.Messpy25File[source]¶
Class for working with MessPy2D 2D-IR files.
- h5_file: str | pathlib.Path[source]¶
h5py file object containing the 2D dataset, the only required parameter
- is_para_array: Literal['Probe1', 'Probe2'] = 'Probe1'[source]¶
which dataset has parallel polarisation
- pump_wn: numpy.ndarray[source]¶
Array with the pump wavenumbers. Depends on the upsampling used during measurment
- normalization_factor(n_phi=2) float[source]¶
Return the factor to turn the FFT out into a proper 2D spectrum.
- get_all_ifr(scan_selection: Any | None = None) dict[str, dict[str, list[numpy.ndarray]]][source]¶
Retrieves and organizes interferogram (ifr) data from an HDF5 file.
This method iterates over the ‘ifr_data’ group in the HDF5 file, and for each item, it creates a nested dictionary structure in Python. The outer dictionary’s keys are the names of the items in ‘ifr_data’, and the values are inner dictionaries. The inner dictionaries’ keys are the string representations of the indices in the range of the size of ‘self.t2’, and the values are lists of data from the datasets in the HDF5 file.
- Returns:
A nested dictionary containing the organized ifr data.
- Return type:
dict
- get_ifr(probe_filter: None | float | tuple[int, int] = None, bg_correct=None, ch_shift: int = 0, use_clip=True, scan_selection=None, is_para_array: Literal['Probe1', 'Probe2'] | None = None) Tuple[numpy.ndarray, numpy.ndarray, numpy.ndarray][source]¶
Returns the interferograms. If necessary, apply probefilter and background correction.
- Parameters:
probe_filter (float or tuple or None) – The probe filter width in channels. (Gaussian filter) If a tuple of length two is given, apply savgol filter with the given parameters window and polynomial degree. If None, no filter is applied.
bg_correct (Tuple[int, int]) – Number of left and right channels to use for background correction.
ch_shift (int) – Number of o shift the Probe2 data. Corrects for missaligned channels.
use_clip (bool) – If true, use sigma clipping to filter outliers.
scan_selection (list or None) – If not None, only use the scans in the list.
is_para_array (Literal["Probe1", "Probe2"]) – Which array is the parallel polarisation. If Probe1, Probe1 is parallel, else Probe2 is parallel. Overrides the
is_para_arrayattribute of the class.
- 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, use_clip: bool = False, t0_factor: float = 0.5, scan_selection: list | None = None, subtract_ifr_mean: bool = False, is_para_array: Literal['Probe1', 'Probe2'] | None = None) 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.
use_clip (bool) – If true, use sigma clipping to filter outliers.
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.
scan_selection (list or None) – If not None, only use the scans in the list. Useful for filtering out bad scans.
subtract_ifr_mean (bool) – If True, subtract the mean of the interferograms before FFT.
is_para_array (Literal["Probe1", "Probe2"]) – Which array is the parallel polarisation. If Probe1, Probe1 is parallel, else Probe2 is parallel. Overrides the
is_para_arrayattribute of the class.
- get_scan_times(which_point='0') numpy.ndarray[source]¶
Returns a dictionary with the scan numbers and their creation times for the specified point in the interferogram data.
- Parameters:
which_point (str) – The point in the interferogram data to retrieve scan times for. Default is ‘0’, which corresponds to the first point in the t2 array.
- Returns:
An array of datetime64 objects representing the creation times of each scan.
- Return type:
np.ndarray
- get_detector_signals()[source]¶
Returns the averaged detector signals for each scan, for both probes.
- get_single_probe_spectrum(scan: int, t2_index: int = 0, probe: Literal['Probe1', 'Probe2'] = 'Probe1') numpy.ndarray[source]¶
- 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
- class skultrafast.messpy2D.Messpy25Plotter[source]¶
-
- probe_spec(det: Literal['Probe1', 'Probe2', 'Ref'], scan_idx: int, t2_idx: int, ax: None | matplotlib.axes.Axes = None)[source]¶
Plots the probe spectrum for a given scan index and t2 index.
- Parameters:
scan_idx (int) – The index of the scan to plot.
t2_idx (int) – The index of the t2 array to use.
ax (matplotlib.axes.Axes, optional) – The axes to plot on. If None, it uses the current axes.