pyepr.pulses.Pulse¶
- class pyepr.pulses.Pulse(*, tp, t=None, scale=None, flipangle=None, pcyc=[0], name=None, **kwargs)¶
Represents a general experimental pulse.
The class for a general pulse.
- Parameters:
- tpfloat
The pulse length in ns.
- scalefloat
The arbitary experimental pulse amplitude, 0-1.
- tfloat, optional
The pulse start time in ns.
- name¶
- Progression = False¶
- property bandwidth¶
- _addPhaseCycle(phases, detections=None)¶
Adds a phase cycle to the pulse sequence.
- Args:
phases (list): List of phases to add to the phase cycle. detections (list, optional): List of detection signs. Defaults to None. If None then all cycles are summed.
- Returns:
None
- _buildFMAM(func, ax=None)¶
Builds the amplitude modulation (AM) and frequency modulation (FM) of a given function.
- Args:
func: A function that takes in an array of values and returns two arrays, representing the AM and FM of the function.
- Returns:
Two arrays representing the AM and FM of the function.
- build_shape(ax=None)¶
- build_table()¶
Builds a table of variables, axes, and UUIDs for all non-static Parameters in the object.
- Returns:
dict: A dictionary containing the following keys: “Variable”, “axis”, and “uuid”. The values for each key are lists of the corresponding values for each non-static Parameter.
- is_static()¶
Check if all parameters in the pulse object are static.
- Returns:
bool: True if all parameters are static, False otherwise.
- isDelayFocused()¶
Does the pulse contain a specified time, t?
If so then it is not delay focused.
- isPulseFocused()¶
Does the pulse contain a specified time, t?
If so then it is delay focused.
- plot(pad=1000)¶
Plots the time domain representation of this pulse.
- Parameters:
- padint, optional
The number of zeros to pad the data with, by default 1000
- _calc_fft(pad=10000)¶
- property amp_factor¶
The B1 amplitude factor (nutation frequency) for the pulse in GHz
- exciteprofile_old(freqs=None, resonator=None)¶
Excitation profile
Generates the exciatation profiles for this pulse.
This function is ported from EasySpin (https://easyspin.org/easyspin/documentation/sop.html) [1-2], and based upon the method from Gunnar Jeschke, Stefan Pribitzer and Andrin Doll[3].
References:¶
[1] Stefan Stoll, Arthur Schweiger EasySpin, a comprehensive software package for spectral simulation and analysis in EPR J. Magn. Reson. 178(1), 42-55 (2006)
[2] Stefan Stoll, R. David Britt General and efficient simulation of pulse EPR spectra Phys. Chem. Chem. Phys. 11, 6614-6625 (2009)
[3] Jeschke, G., Pribitzer, S. & DollA. Coherence Transfer by Passage Pulses in Electron Paramagnetic Resonance Spectroscopy. J. Phys. Chem. B 119, 13570-13582 (2015)
- Parameters:
- freqs: np.ndarray, optional
The frequency axis. Caution: A larger number of points will linearly increase computation time.
- resonator: ad.ResonatorProfile, optional
- Returns:
- Mx: np.ndarray
The magentisation in the X direction.
- My: np.ndarray
The magentisation in the Y direction.
- Mz: np.ndarray
The magentisation in the Z direction.
- exciteprofile(freqs=None, resonator=None, trajectory=False)¶
Excitation profile
Generates the exciatation profiles for this pulse, using the two-level system model developed by Jeschke et al. [1]. And then optimised in the PulseShape software package by Maxx Tessmer [2], reproduced under the GNU GPL v3 license.
References:¶
- [1] Jeschke, G., Pribitzer, S. & Doll, A.
Coherence Transfer by Passage Pulses in Electron Paramagnetic Resonance Spectroscopy. J. Phys. Chem. B 119, 13570-13582 (2015)
[2] https://github.com/mtessmer/PulseShape
- Parameters:
- freqs: np.ndarray, optional
The frequency axis. Caution: A larger number of points will linearly increase computation time.
- resonator: ad.ResonatorProfile, optional
The resonator profile to apply resonator compensation.
- trajectory: bool, optional
If True, the function will return the magnetisation at each time point. Default is False.
- Returns:
- Mag: np.ndarray
The magnetisation in the X, Y, and Z directions.
- plot_fft()¶
- _pcyc_str()¶
- __str__()¶
- copy(clear=False, **kwargs)¶
Creates a deep-copy of the pulse. I.e. Every parameter object is re-created at another memory space.
Parameter can be chaged at this stage by adding them as keyword- arguments (kwargs).
- Returns:
- Pulse
A deep copy of the pulse
- _to_dict()¶
- _to_json()¶
- save(filename)¶
Save the Pulse to a JSON file.
- Parameters:
- filenamestr
Path to the JSON file.
- Returns:
- None
- Raises:
- TypeError
If the object cannot be serialized to JSON.
- classmethod _from_dict(dct)¶
- classmethod _from_json(JSONstring)¶
- classmethod load(filename)¶
Load a Pulse object from a JSON file.
- Parameters:
- filenamestr
Path to the JSON file.
- Returns:
- objPulse
The Pulse loaded from the JSON file.
- Raises:
- FileNotFoundError
If the file does not exist.