PumpProbeLoader#
- class artof.PumpProbeLoader(directory, run_prefix, start_run, stop_run, transform_format, t0, rev_period, stage_range, stage_t0=0, work_func=4.14, artof_center_x=0, artof_center_y=0)#
Class for loading and processing pump-probe data.
- Parameters:
directory (str)
run_prefix (str)
start_run (int)
stop_run (int)
transform_format (TransformFormat)
t0 (float)
rev_period (float)
stage_range (tuple[float, float])
stage_t0 (float)
work_func (float)
artof_center_x (float)
artof_center_y (float)
- export(path, file_format, axes=None, ranges=None, norm_step_size=False, binding_energy_scale=False, incident_energy=None, eln_path=None, delimiter=',')#
Export delay map data to file.
- Parameters:
path (str) – Path to which the data is saved. Including filename but excluding extension.
file_format (str) – Format of the file to which the data is saved (‘csv’ or ‘nxs’).
axes (list | None) – List of axes to project the data onto for plotting. Must be a subset of the axes used for processing the data. The order of axes determines the order of dimensions in the plotted data. For example, if the data was processed with axes [0, 1] and [1, 0] is passed for plotting
ranges (None | list[tuple[int]]) – List of ranges for the axes in the format [(ax_min, ax_max), …].
norm_step_size (bool) – Normalize data with step size before plotting (default False).
binding_energy_scale (bool) – Whether to use binding energy scale for the energy axis (default False). If True, the energy axis will be converted from kinetic energy to binding energy using the incident energy.
incident_energy (float) – Incident energy value in eV for binding energy scale. If None (default) value will be obtained from metadata.
eln_path (str | None) – NeXus only: path to the ELN file where the metadata is stored. If None, standard metadata is used (default None, only relevant for ‘hdf5’ export).
delimiter (str) – Delimiter by which the data is separated for format ‘csv’ (default ‘,’).
- Return type:
None
- Raises
- ValueError: If file format is not ‘csv’ or ‘nxs’ or if more than 2 axes are given for
csv export.
- classmethod from_custom_run_list(run_paths, transform_format, run_t0s, rev_period, stage_values, work_func=4.14, artof_center_x=0, artof_center_y=0)#
Alternative constructor for PumpProbeLoader class that allows to specify a custom list of run paths.
Note: This should only be used by advanced users, since not inconsistencies, like unevenly stage steps or different revolution periods, can lead to inaccurate results.
- Parameters:
run_paths (list[str]) – List of paths to the runs to load.
transform_format (TransformFormat) – Format to load the data in - raw: Load raw data in ticks (x,y,t). - raw_SI: Load raw data in SI units (x: m, y: m, t: s). - cylindrical: Load data in cylindrical coordinates (r: m, phi: rad, t: s). - spherical: Load data in spherical coordinates and associated energy (E: eV, theta: rad, phi: rad).
run_t0s (list[float]) – List of t0s corresponding to the excitation iteration in ticks for each run.
rev_period (float) – Period between two revolutions in ticks.
stage_values (ndarray[float]) – Array of stage delay values in seconds corresponding to the runs.
work_func (float) – Work function in eV for kspace transformation (default read from artof_utils.WORK_FUNC_DEFAULT).
artof_center_x (float) – X center of the ARTOF detector in mm (default 0).
artof_center_y (float) – Y center of the ARTOF detector in mm (default 0).
- Return type:
- get_binned_data(axes=None, ranges=None, norm_step_size=False, binding_energy_scale=False, incident_energy=None)#
Get the binned delay map
- Parameters:
axes (list | None) – List of axes to project the data onto for plotting. Must be a subset of the axes used for processing the data. The order of axes determines the order of dimensions in the plotted data. For example, if the data was processed with axes [0, 1] and [1, 0] is passed for plotting
ranges (None | list[tuple[int]]) – List of ranges for the axes in the format [(ax_min, ax_max), …].
norm_step_size (bool) – Normalize data with step size before plotting (default False).
binding_energy_scale (bool) – Whether to use binding energy scale for the energy axis (default False). If True, the energy axis will be converted from kinetic energy to binding energy using the incident energy.
incident_energy (float) – Incident energy value in eV for binding energy scale. If None (default) value will be obtained from metadata.
- Returns:
A tuple containing the axis values and the binned delay map data.
- Return type:
axes_values, data
- plot(axes, ranges=None, norm_step_size=False, binding_energy_scale=False, incident_energy=None, width=600, height=600)#
Plot the processed pump-probe data.
- Parameters:
axes (list[int]) – List of axes to project the data onto for plotting. Must be a subset of the axes used for processing the data. The order of axes determines the order of dimensions in the plotted data. For example, if the data was processed with axes [0, 1] and [1, 0] is passed for plotting
ranges (None | list[tuple[int]]) – List of ranges for the axes in the format [(ax_min, ax_max), …].
norm_step_size (bool) – Normalize data with step size before plotting (default False).
binding_energy_scale (bool) – Whether to use binding energy scale for the energy axis (default False). If True, the energy axis will be converted from kinetic energy to binding energy using the incident energy.
incident_energy (float | None) – Incident energy value in eV for binding energy scale. If None (default) value will be obtained from metadata.
width (int) – Width of plot.
height (int) – Height of plot.
- process_data(proj_axes, run_interval=None, rev_interval=None, iter_interval=None, cust_bin_confs=None, norm_modes=None, multithreading=True, igor_binning=False, ignore_memory_warning=False)#
Load, transform and bin pump-probe data.
- Parameters:
proj_axes (list[int] | None) – Axes to project the data onto. Pass ‘None’ to keep all axes.
run_interval (tuple[int, int] | None) – Tuple specifying the range of run indices to load (start inc., stop exc.). If None (default), all runs are loaded.
rev_interval (tuple[int, int] | None) – Tuple specifying the range of revolutions to load (start inc., stop exc.). Values must be between -1 and 205, where -1 corresponds to the revolution before t0 and 0 to the revolution of t0. If None (default), all revolutions are loaded.
iter_interval (tuple[int, int] | None) – Tuple specifying the range of iterations to load for all runs (start inc., stop exc.). If None (default), all iterations are loaded.
cust_bin_confs (list | None) – List of 3 custom binning configs for the 3 parameters for all runs [min, max, edges]. F.e.: [[-1500, 1500, 101], [-1500, 1500, 101], [12000, 18000, 201]]
norm_modes (list | None) – Normalization mode for binned data (‘iterations’, ‘dwell_time’). Default is None. - iterations: Normalize data by number of iterations. - dwell_time: Normalize data by dwell time.
multithreading (bool) – Use multithreading for data loading (default True).
igor_binning (bool) – DEPRECATED. Igor-like binning is only meant for legacy support, only use for comparision. Bin edges shifted by half bin width, default False.
ignore_memory_warning (bool) – Whether to ignore memory warning when loading and processing data. If False and trying to load all axes, runs and revolutions a ValueError is raised (default False).
- Raises:
ValueError – If invalid values were passed for proj_axes, run_interval or rev_interval.
- Return type:
None