NucleI API
Global functions
Variables
- AVOGADRO()
float: Avogadro’s number (particles/mol) = 6.022e23
- BOLTZMANN()
float: Boltzmann constant (J/K) = 1.38e-23
- C_to_K(celsius)
Shortcut to `CONST.C_to_K`
Converts from degrees Celsius to Kelvin.
- Return type:
float
- Parameters:
celsius (float)
- DeviceSettings()
_DeviceSettings: Currently applicable hardware settings of the device.
The fields can be modified in runtime and changes saved via
UI.save()
Changing the fields’ values will result in the actual change of the configuration.
- LastSignal()
_Signal | None: An instance of the last received NMR signal.
Only considers those received from the device internally.
- LastSpectrum()
_NMRSpectrum | None: An instance of the last received NMR spectrum.
Only considers those received from the device internally.
- SampleInfo()
_SampleInfo: Settings/Information about the currently active sample.
The fields can be modified in runtime and changes saved via
UI.save()
.
- WATER_DYNAMIC_VISCOSITY()
float: Dynamic viscosity of water at room temperature (Pa*s) = 8.9e-4
Acquisition
- disable_progress_bar()
Shortcut to `SCAN.disable_progress_bar`
Disabled any updates to the UI progress bar.
- Return type:
Any
- enable_progress_bar()
Shortcut to `SCAN.enable_progress_bar`
Enables all updates to the UI progress bar. Counteracts
disable_progress_bar
.- Return type:
Any
- estimate_duration(sequence)
Shortcut to `SCAN.estimate_duration`
Estimates the duration of the sequence in float seconds.
- Parameters:
sequence (
list
[HardwareEvent
|list
[HardwareEvent
]]) – Sequence to estimate the duration of.- Return type:
float
- Returns:
Estimate of the sequence duration including the repetition delay.
- no_finish_run()
Shortcut to `SCAN.no_finish_run`
A context manager to suppress the internal signals to finish an execution of an experiment.
Useful for executing nested or sequential sub-programs.
- Return type:
Generator
[None
,Any
,None
]
- offset_progress_bar(step_offset, total_offset)
Shortcut to `SCAN.offset_progress_bar`
A context manager to temporarily offset the UI progress bar.
- Return type:
Generator
[None
,Any
,None
]- Parameters:
step_offset (int)
total_offset (int)
- pause_progress_bar()
Shortcut to `SCAN.pause_progress_bar`
A context manager to temporarily pause the advance of the UI progress bar.
- Return type:
Generator
[None
,Any
,None
]
- report_progress(step, total, step_time)
Shortcut to `SCAN.report_progress`
Reports the experiment progress to the frontend.
- Parameters:
step (
int
) – Current step of the experiment.total (
int
) – Total number of steps in the experiment.step_time (
float
|None
) – How much time the current step requires. Estimated if None. Default: None.
- Return type:
None
- run_sequence(sequence, seq_null, phase_cycle, n_scans, report, dry_run)
Shortcut to `SCAN.run_sequence`
Runs a sequence and calculates the signals and spectra.
Notes
If phase_cycle=True, the n_scans must be a multiple of 4.
- Parameters:
sequence (
list
[HardwareEvent
|list
[HardwareEvent
]]) – Sequence to execute.seq_null (
float
|None
) – Sequence null time point. Default: None.phase_cycle (
bool
) – Whether to enable phase cycle. Default: False.n_scans (
int
) – Number of scans to perform. Default: 1.report (
bool
) – Whether to report the progress to the frontend. Default: True.dry_run (
bool
) – Whether to suspend any other callbacks. Default: False.
- Return type:
tuple
[Signal
|list
[Signal
],NMRSpectrum
|list
[NMRSpectrum
]]- Returns:
A signal and it’s spectrum if n_scans=1, lists of such for each scan otherwise.
Sequence Definition
- ADC(duration_us)
Shortcut to `SEQ.ADC`
Hardware ADC command. Turns the ADC on for a specified amount of time.
- Parameters:
duration_us (
float
) – Duration of the recording in us.- Return type:
HardwareEvent
- Cycle(n_repeats, sub_sequence)
Shortcut to `SEQ.Cycle`
Hardware CYCLE command. Repeats a sub-sequence N times.
- Parameters:
n_repeats (
int
) – How many times to repeat.sub_sequence (
list
[HardwareEvent
]) – Sub-sequence to repeat.
- Return type:
list
[HardwareEvent
]
- Pulse(phase, angle)
Shortcut to `SEQ.Pulse`
Hardware PULSE command.
- Parameters:
phase (
Literal
['x+'
,'y+'
,'x-'
,'y-'
]) – Phase of the pulse.angle (
Union
[Literal
[90
,180
,270
,360
],float
]) – Angle of the pulse. If not 90, 180, 270, or 360, treated as a duration of the pulse in us.
- Return type:
HardwareEvent
- Silence(duration_us)
Shortcut to `SEQ.Silence`
Hardware SILENCE command. “Sleeps” for the specified amount of time.
- Parameters:
duration_us (
float
|None
) – How long to sleep for in us. Uses the ringing time if None. Default: None.- Return type:
HardwareEvent
- Wobble(acq_time, tau_2, tau_1)
Shortcut to `SEQ.Wobble`
Preset WOBBLE sub-sequence.
- Equivalent to:
Pulse(x+, 180) -> Silence(TAU_2) -> Pulse(x+, 90) -> Silence(TAU_1) -> ADC(acq_time) -> Silence(TAU_1).
- Parameters:
acq_time (
float
) – Acquisition time (ADC).tau_2 (
float
) – Silence time in us between the pulses.tau_1 (
float
|None
) – Silence time in us after the pulses and ADC. Uses the ringing time if None. Default: None.
- Return type:
list
[HardwareEvent
]
- scheduled_iter(interval_minutes, duration_hours)
Shortcut to `SEQ.scheduled_iter`
An iterator that executes subsequent iterations every N minutes for M hours.
Important: The interval doesn’t “add” N minutes after the last iteration, it will only start the next one not earlier than N minutes after the last one.
- Parameters:
interval_minutes (
float
) – Time spacing between iterations.duration_hours (
float
) – For how many hours to repeat. Doesn’t abrupt the last iteration.
- Return type:
Iterator
[float
]
User Interface
- annotate(data, name, kind)
Shortcut to `UI.annotate`
Plots a signal/spectrum as an annotation.
Notes
If kind=”auto”, the data must be of type Signal or NMRspectrum.
Otherwise the appropriate kind must be provided manually.
- Parameters:
data (
Signal
|NMRSpectrum
|ndarray
|tuple
[ndarray
,ndarray
]) – Signal or spectrum to plot.name (
str
|None
) – Title of the annotation. Default: None.kind (
Literal
['signal'
,'spectrum'
,'auto'
]) – Whether the data should be treated as a signal or as a spectrum. Default: “auto”.
- Return type:
None
- clear_annotations(scope)
Shortcut to `UI.clear_annotations`
Clears all annotations.
- Parameters:
scope (
Literal
['all'
,'signal'
,'spectrum'
]) – Whether to clean all, signal-only, or spectrum-only annotations.- Return type:
None
- plot(data, kind, save_as_output)
Shortcut to `UI.plot`
Plots a signal/spectrum in the UI.
Notes
If kind=”auto”, the data must be of type Signal or NMRspectrum.
Otherwise the appropriate kind must be provided manually.
- Parameters:
data (
Signal
|NMRSpectrum
|ndarray
|tuple
[ndarray
,ndarray
]) – Signal or spectrum to plot.kind (
Literal
['signal'
,'spectrum'
,'auto'
]) – Whether the data should be treated as a signal or as a spectrum. Default: “auto”.save_as_output (
bool
) – Whether to push the plotted data to the respective stack. Default: True.
- Return type:
None
Namespaces
- class CONST
Bases:
object
- C_to_K()
Converts from degrees Celsius to Kelvin.
- Return type:
float
- Parameters:
celsius (float)
-
BOLTZMANN:
float
= Ellipsis Boltzmann constant (J/K) = 1.38e-23
- Type:
float
-
AVOGADRO:
float
= Ellipsis Avogadro’s number (particles/mol) = 6.022e23
- Type:
float
-
WATER_DYNAMIC_VISCOSITY:
float
= Ellipsis Dynamic viscosity of water at room temperature (Pa*s) = 8.9e-4
- Type:
float
-
DeviceSettings:
DeviceSettings
= Ellipsis Currently applicable hardware settings of the device.
The fields can be modified in runtime and changes saved via
UI.save()
Changing the fields’ values will result in the actual change of the configuration.- Type:
_DeviceSettings
-
SampleInfo:
SampleInfo
= Ellipsis Settings/Information about the currently active sample.
The fields can be modified in runtime and changes saved via
UI.save()
.- Type:
_SampleInfo
-
LastSignal:
Signal
|None
= Ellipsis An instance of the last received NMR signal.
Only considers those received from the device internally.
- Type:
_Signal | None
-
LastSpectrum:
NMRSpectrum
|None
= Ellipsis An instance of the last received NMR spectrum.
Only considers those received from the device internally.
- Type:
_NMRSpectrum | None
-
Spectrum:
type
[NMRSpectrum
] = Ellipsis A shortcut for
tqt_nmr.NMRSpectrum
- Type:
type[_NMRSpectrum]
-
NMRSpectrum:
type
[NMRSpectrum
] = Ellipsis A shortcut for
tqt_nmr.NMRSpectrum
- Type:
type[_NMRSpectrum]
-
NMRSpectraCollection:
type
[NMRSpectraCollection
] = Ellipsis A shortcut for
tqt_nmr.NMRSpectraCollection
- Type:
type[_NMRSpectraCollection]
- np: <module 'numpy' from 'C:\Users\WAR\.conda\envs\Nuclei\Lib\site-packages\numpy\__init__.py'> = Ellipsis
A shortcut for
import numpy as np
- Type:
_np
- tqt_nmr: <module 'tqt_nmr' from 'C:\TQT-DEV\Nuclei-deploy\tqt_nmr\tqt_nmr\__init__.py'> = Ellipsis
A shortcut for
import tqt_nmr
- Type:
_tqt_nmr
- class DEVICE
Bases:
object
- get_temp()
Fetches the current temperature in degrees Celsius of the on-board sensor.
- Return type:
float
- get_target_temp()
Fetches the set target temperature in degrees Celsius of the on-board sensor.
- Return type:
float
- set_target_temp()
Updates the target temperature of the on-board sensor.
- Return type:
None
- Parameters:
temp_c (float)
- class DISPERSION
Bases:
object
- optimize_t2_parameters(verbose)
Finds optimal experimental parameters for conducting CPMG (Carr-Purcell) NMR pulse sequence at benchtop NMR Relaxometer 20MHz.
** CURRENTLY IN ALPHA **
Task: Find triple (n_echo, decimation, acq) while echo_t=CONSTANT or quadruple (n_echo, decimation, echo_t, acq) of parameters that matches the overall length of CPMG pulse sequence (CPMG_period [us]) to full exponential decay of NMR signal (~exp(-t/T2)) i.e. equals to 5*T2 [us]
- Solution constrains arise from the particular type of NMR controlling board e.g.
maximum number of ADC points for one continuos sample = 25000 points;
ADC dwell time = 0.5 us [microseconds]
maximum number of various commands in one pulse sequence (Pulse, Silence, Cycle, ADC) = 256 items
minimal echo_t = 70 us
CPMG sequence: p_90 - [us] length 90-degree NMR pulse p_180 - [us] length 180-degree NMR pulse et = echo_t / decimation decimation_sequence = [[Pulse(“y-”, 180), Silence(et - p_180)] for _ in range(max(0, decimation - 1))] sequence = [Silence(100), Pulse(“x+”, 90), Silence(et / 2 - p_90 / 2 - p_180 / 2), Cycle( n_echo, [Pulse(“y-”, 180), Silence(et / 2 - p_180 / 2 - acq / 2), Silence(et / 2 - p_180 / 2 - acq / 2), *[action for step in decimation_sequence for action in step] ] ), Silence(13)]
- Parameters:
config (
DispersionSettings
) – DispersionSettings - anticipated_ms: [ms] expected or estimated T2 relaxation time of the test substance - n_echo: [int] number of 180-degree NMR pulses in CPMG sequence - decimation: [int] number of dummy 180-degree NMR pulses in CPMG sequence (p180 skips) - echo_t_us: [us] distance between 180-degree NMR pulses after which the NMR signal is recorded - acq_us: [us] amount of time for ADC recording of each not dummy 180-degree NMR pulseverbose (
bool
) – Whether to print extended logs.
- Returns:
found value of n_echo after optimization decimation_it: found value of decimation after optimization echo_t_it: found value of echo_t after optimization or original echo_t || fixed value from list acq_it: found value of acq after optimization
- Return type:
n_echo_it
- optimize_dispersion_parameters(verbose)
Finds the optimal experimental parameters for conducting CPMG (Carr-Purcell) NMR pulse sequence at benchtop NMR Relaxometer 20MHz.
** CURRENTLY IN ALPHA **
Task: Find triple (n_echo, decimation, acq) while echo_t=CONSTANT or quadruple (n_echo, decimation, echo_t, acq) of parameters that matches the overall length of CPMG pulse sequence (CPMG_period [us]) to full exponential decay of NMR signal (~exp(-t/T2)) i.e. equals to 5*T2 [us]
Solution constrains arise from the particular type of NMR controlling board e.g. - maximum number of ADC points for one continuos sample = 25000 points; - ADC dwell time = 0.5 us [microseconds] - maximum number of various commands in one pulse sequence (Pulse, Silence, Cycle, ADC) = 256 items - minimal echo_t = 70 us
CPMG sequence: p_90 - [us] length 90-degree NMR pulse p_180 - [us] length 180-degree NMR pulse et = echo_t / decimation decimation_sequence = [[Pulse(“y-”, 180), Silence(et - p_180)] for _ in range(max(0, decimation - 1))] sequence = [Silence(100), Pulse(“x+”, 90), Silence(et / 2 - p_90 / 2 - p_180 / 2), Cycle( n_echo, [Pulse(“y-”, 180), Silence(et / 2 - p_180 / 2 - acq / 2), Silence(et / 2 - p_180 / 2 - acq / 2), *[action for step in decimation_sequence for action in step] ] ), Silence(13)]
- Parameters:
config (
DispersionSettings
) – DispersionSettings - anticipated_ms: [ms] expected or estimated T2 relaxation time of the test substance - n_echo: [int] number of 180-degree NMR pulses in CPMG sequence - decimation: [int] number of dummy 180-degree NMR pulses in CPMG sequence (p180 skips) - echo_t_us: [us] distance between 180-degree NMR pulses after which the NMR signal is recorded - acq_us: [us] amount of time for ADC recording of each not dummy 180-degree NMR pulseverbose (
bool
) – Whether to print extended logs.
- Returns:
n_echo: found value of n_echo after optimization decimation: found value of decimation after optimization echo_t: found value of echo_t after optimization or original echo_t || fixed value from list acq: found value of acq after optimization
- Return type:
List of optimized scan points in the form of list[T2Optimization]
- run_dispersion(points, model, verbose, **kwargs)
Executes a dispersion experiment given the config and optimized points (see
optimize_dispersion_parameters
).** CURRENTLY IN ALPHA **
- Parameters:
config (
DispersionSettings
|None
) – DispersionSettings (optional) - anticipated_ms: [ms] expected or estimated T2 relaxation time of the test substance - n_echo: [int] number of 180-degree NMR pulses in CPMG sequence - decimation: [int] number of dummy 180-degree NMR pulses in CPMG sequence (p180 skips) - echo_t_us: [us] distance between 180-degree NMR pulses after which the NMR signal is recorded - acq_us: [us] amount of time for ADC recording of each not dummy 180-degree NMR pulsepoints (
list
[T2Optimization
] |None
) – Optimized sampling points provided byoptimize_dispersion_parameters
(optional). Default: None.model (
Optional
[Callable
[[array
],array
]]) – Mathematic model to fit. Default: ModelRelaxationEff_Double.verbose (
bool
) – Whether to print extended logs. Default: False.kwargs (Any)
- Return type:
- Returns:
Fitted R2 signal (using the model provided),
Fitted R2-eff signal (using the model provided),
Optimized parameters of the model.
- run_nano_particles(interval_minutes, duration_hours, molar_mass_g_mol, **kwargs)
Executes the non-particles experiment.
** CURRENTLY IN ALPHA **
- Parameters:
config (
DispersionSettings
) – DispersionSettings (optional) - anticipated_ms: [ms] expected or estimated T2 relaxation time of the test substance - n_echo: [int] number of 180-degree NMR pulses in CPMG sequence - decimation: [int] number of dummy 180-degree NMR pulses in CPMG sequence (p180 skips) - echo_t_us: [us] distance between 180-degree NMR pulses after which the NMR signal is recorded - acq_us: [us] amount of time for ADC recording of each not dummy 180-degree NMR pulseinterval_minutes (
float
) – Time to wait between sampling runs.duration_hours (
float
) – Total duration of the experiment.molar_mass_g_mol – Molar mass (g/mol) of the sample. Default: 241.8.
kwargs (Any)
- Return type:
Any
- Returns:
Time points when the measurements were taken,
List of fitted R2 signals (for each run),
List of fitted R2-eff signals (for each run),
List of R2 optimization parameters (for each run).
- class IO
Bases:
object
- save(spectrum)
Saves the signal and/or the spectrum as a last received scan.
- Parameters:
signal (
Signal
|None
) – Signal to save. Takes the latest one if None. Default: None.spectrum (
NMRSpectrum
|None
) – Spectrum to save. Takes the latest one if None. Default: None.
- Return type:
Any
- save_as_new(signal, spectrum)
Saves the signal and/or the spectrum as a new scan.
- Parameters:
name (
str
|None
) – Name of the recording. Uses the current date & time if None.signal (
Signal
|None
) – Signal to save. Takes the latest one if None. Default: None.spectrum (
NMRSpectrum
|None
) – Spectrum to save. Takes the latest one if None. Default: None.
- Return type:
Any
- add_metadata(value)
Adds arbitrary user-defined metadata to the sample record.
- Parameters:
name (
str
) – Key of the metadata entry.value – Value of the entry.
- Return type:
None
- format_timestamp(fmt)
Formats a UNIX-style timestamp into an ISO format.
- Return type:
str
- Parameters:
timestamp (float)
fmt (str)
- beep(theme)
Plays an audio signal (“beep”). Can be used to indicate an important event or an error.
- Parameters:
mode (
Literal
['success'
,'warning'
,'error'
,'info'
]) – The tone of the signal. Default: “info”.theme (
Literal
['big-sur'
,'chime'
,'mario'
,'material'
,'pokemon'
,'sonic'
,'zelda'
]) – Variation of the signal. Default: “material”.
- Return type:
Any
- class FIT
Bases:
object
- fit_model(model, initial_guess, loss, method, **kwargs)
Fits a mathematical model to given data.
- Parameters:
data (
Signal
|NMRSpectrum
|tuple
[array
,array
]) – Data to fit to. Signal, spectrum, or a custom pair of x-y sequences.model (
Callable
[[array
],array
]) – A callable model to fit.initial_guess (
tuple
[float
,...
] |None
) – Initial guess for all the model’s variables. [1, 1, …, 1] if None. Default: None.loss (
Callable
[[array
,array
],float
]) – Loss function to evaluate the fitting with. Default: MSE.method – Fitting method. Default: “Nelder-Mead”.
kwargs (Any)
- Returns:
[0]: Fitted model parameters in the order of appearance.
[1]: Final fit loss.
- Return type:
Tuple of form
- ModelExponentialDecay()
Exponential decay model.
Math equivalent: a * exp(-(x + x0) / b) + c, where a, x0, b, c are fittable variables.
- Parameters:
num_curves (
int
) – Number of summed exponents to fit. Default: 1.- Return type:
Callable
[[array
],array
]
- ModelRelaxationEff_Norris()
- Return type:
Callable
[[array
],array
]- Parameters:
num_curves (int)
- ModelRelaxationEff_Tollinger()
Tollinger et. al J Am Chem Soc. 2001 123 11341
Curve is independent of k_BA. We can only extract k_AB and ∆ω2. p_B = k_AB/k_ex; p_A = k_BA/k_ex.
- Return type:
Callable
[[array
],array
]- Parameters:
num_curves (int)
- ModelRelaxationEff_SDR()
- Return type:
Callable
[[array
],array
]- Parameters:
num_curves (int)
- For MNP solutions, the Static Dephasing Regime (SDR) model is typically used when the particles
are relatively large and their magnetic moments are strong enough that the diffusion of water molecules around them does not significantly average out the local magnetic field inhomogeneities they produce.
The Motional Averaging Regime (MAR) model can be more suitable when the nano-particles are smaller or when the water molecules diffuse fast enough to sample the magnetic field inhomogeneities, leading to motional averaging effects.
### Static Dephasing Regime (SDR) Model
The effective transverse relaxation rate ( R_{2, ext{eff}} ) (which is the inverse of ( T_2 )) in the SDR can be described by:
[ R_{2, ext{eff}} = R_{2,0} + Delta R_2 ]
where:
( R_{2,0} ): The intrinsic transverse relaxation rate of the solvent (water).
( Delta R_2 ): The contribution to the transverse relaxation rate due to
the presence of magnetic nano-particles.
The additional relaxation rate ( Delta R_2 ) in the SDR can be approximated by:
[ Delta R_2 =
rac{2}{3} gamma^2 G^2 au_D ]
- Where:
( gamma ): The gyromagnetic ratio of the water protons.
( G ): The strength of the local magnetic field gradient created by the magnetic nano-particles.
( au_D ): The diffusion time of water molecules around the nano-particles.
- ModelRelaxationEff_Triple()
- Return type:
Callable
[[array
],array
]- Parameters:
num_curves (int)
- ModelRelaxationEff_Double()
- Return type:
Callable
[[array
],array
]- Parameters:
num_curves (int)
- class SCAN
Bases:
object
- report_progress(total, step_time)
Reports the experiment progress to the frontend.
- Parameters:
step (
int
) – Current step of the experiment.total (
int
) – Total number of steps in the experiment.step_time (
float
|None
) – How much time the current step requires. Estimated if None. Default: None.
- Return type:
None
- no_finish_run()
A context manager to suppress the internal signals to finish an execution of an experiment.
Useful for executing nested or sequential sub-programs.
- Return type:
Generator
[None
,Any
,None
]
- pause_progress_bar()
A context manager to temporarily pause the advance of the UI progress bar.
- Return type:
Generator
[None
,Any
,None
]
- offset_progress_bar(total_offset)
A context manager to temporarily offset the UI progress bar.
- Return type:
Generator
[None
,Any
,None
]- Parameters:
step_offset (int)
total_offset (int)
- disable_progress_bar()
Disabled any updates to the UI progress bar.
- Return type:
Any
- enable_progress_bar()
Enables all updates to the UI progress bar. Counteracts
disable_progress_bar
.- Return type:
Any
- estimate_duration()
Estimates the duration of the sequence in float seconds.
- Parameters:
sequence (
list
[HardwareEvent
|list
[HardwareEvent
]]) – Sequence to estimate the duration of.- Return type:
float
- Returns:
Estimate of the sequence duration including the repetition delay.
- run_sequence(seq_null, phase_cycle, n_scans, report, dry_run)
Runs a sequence and calculates the signals and spectra.
Notes
If phase_cycle=True, the n_scans must be a multiple of 4.
- Parameters:
sequence (
list
[HardwareEvent
|list
[HardwareEvent
]]) – Sequence to execute.seq_null (
float
|None
) – Sequence null time point. Default: None.phase_cycle (
bool
) – Whether to enable phase cycle. Default: False.n_scans (
int
) – Number of scans to perform. Default: 1.report (
bool
) – Whether to report the progress to the frontend. Default: True.dry_run (
bool
) – Whether to suspend any other callbacks. Default: False.
- Return type:
tuple
[Signal
|list
[Signal
],NMRSpectrum
|list
[NMRSpectrum
]]- Returns:
A signal and it’s spectrum if n_scans=1, lists of such for each scan otherwise.
- class SEQ
Bases:
object
- Pulse(angle)
Hardware PULSE command.
- Parameters:
phase (
Literal
['x+'
,'y+'
,'x-'
,'y-'
]) – Phase of the pulse.angle (
Union
[Literal
[90
,180
,270
,360
],float
]) – Angle of the pulse. If not 90, 180, 270, or 360, treated as a duration of the pulse in us.
- Return type:
HardwareEvent
- ADC()
Hardware ADC command. Turns the ADC on for a specified amount of time.
- Parameters:
duration_us (
float
) – Duration of the recording in us.- Return type:
HardwareEvent
- Silence()
Hardware SILENCE command. “Sleeps” for the specified amount of time.
- Parameters:
duration_us (
float
|None
) – How long to sleep for in us. Uses the ringing time if None. Default: None.- Return type:
HardwareEvent
- Cycle(sub_sequence)
Hardware CYCLE command. Repeats a sub-sequence N times.
- Parameters:
n_repeats (
int
) – How many times to repeat.sub_sequence (
list
[HardwareEvent
]) – Sub-sequence to repeat.
- Return type:
list
[HardwareEvent
]
- Wobble(tau_2, tau_1)
Preset WOBBLE sub-sequence.
- Equivalent to:
Pulse(x+, 180) -> Silence(TAU_2) -> Pulse(x+, 90) -> Silence(TAU_1) -> ADC(acq_time) -> Silence(TAU_1).
- Parameters:
acq_time (
float
) – Acquisition time (ADC).tau_2 (
float
) – Silence time in us between the pulses.tau_1 (
float
|None
) – Silence time in us after the pulses and ADC. Uses the ringing time if None. Default: None.
- Return type:
list
[HardwareEvent
]
- scheduled_iter(duration_hours)
An iterator that executes subsequent iterations every N minutes for M hours.
Important: The interval doesn’t “add” N minutes after the last iteration, it will only start the next one not earlier than N minutes after the last one.
- Parameters:
interval_minutes (
float
) – Time spacing between iterations.duration_hours (
float
) – For how many hours to repeat. Doesn’t abrupt the last iteration.
- Return type:
Iterator
[float
]
- class UI
Bases:
object
- plot(kind, save_as_output)
Plots a signal/spectrum in the UI.
Notes
If kind=”auto”, the data must be of type Signal or NMRspectrum.
Otherwise the appropriate kind must be provided manually.
- Parameters:
data (
Signal
|NMRSpectrum
|ndarray
|tuple
[ndarray
,ndarray
]) – Signal or spectrum to plot.kind (
Literal
['signal'
,'spectrum'
,'auto'
]) – Whether the data should be treated as a signal or as a spectrum. Default: “auto”.save_as_output (
bool
) – Whether to push the plotted data to the respective stack. Default: True.
- Return type:
None
- annotate(name, kind)
Plots a signal/spectrum as an annotation.
Notes
If kind=”auto”, the data must be of type Signal or NMRspectrum.
Otherwise the appropriate kind must be provided manually.
- Parameters:
data (
Signal
|NMRSpectrum
|ndarray
|tuple
[ndarray
,ndarray
]) – Signal or spectrum to plot.name (
str
|None
) – Title of the annotation. Default: None.kind (
Literal
['signal'
,'spectrum'
,'auto'
]) – Whether the data should be treated as a signal or as a spectrum. Default: “auto”.
- Return type:
None
- clear_annotations()
Clears all annotations.
- Parameters:
scope (
Literal
['all'
,'signal'
,'spectrum'
]) – Whether to clean all, signal-only, or spectrum-only annotations.- Return type:
None
- user_get()
For the CUSTOM PAGE.
Retrieves a value from a custom UI input.
- Return type:
Any
- Parameters:
name (str)
- user_plot(data)
For the CUSTOM PAGE.
Plots a signal/spectrum in the custom page UI.
- Parameters:
id (
str
) – Identifier of the plot component to draw onto.data (
Signal
|NMRSpectrum
|ndarray
|tuple
[ndarray
,ndarray
]) – Signal or spectrum to plot.
- Return type:
None
Internal
- class DeviceSettings(p90_us=3.6, p180_us=6.8, p270_us=10, p360_us=14, ring_us=12, hahn_echo_tau=10000, echo_time=2000, frequency=19.218814, RD=200, phase_deg=90, null=0.0, tx1_gain=54, if1_analog_mhz=0.5, if1_digital_mhz=0.5, filter_val_mhz=0.1, window=120, dw_us=0.5, base=32768, dummy_shots=0, fir_type=<FIRFilterType.E_GaussType: 1>, fir_bypass=False, rx_gain=3, rx_phase=0, fft_zero_fill=-1, use_advanced_fft=True, use_apodization=False, use_phase_correction=True, use_baseline_correction=False, accumulation_mode='mean')
Bases:
UpdatableSettings
- Parameters:
p90_us (float)
p180_us (float)
p270_us (float)
p360_us (float)
ring_us (float)
hahn_echo_tau (float)
echo_time (float)
frequency (float)
RD (float)
phase_deg (float)
null (float)
tx1_gain (float)
if1_analog_mhz (float)
if1_digital_mhz (float)
filter_val_mhz (float)
window (int)
dw_us (float)
base (int)
dummy_shots (int)
fir_type (FIRFilterType)
fir_bypass (bool)
rx_gain (float)
rx_phase (float)
fft_zero_fill (int)
use_advanced_fft (bool)
use_apodization (bool)
use_phase_correction (bool)
use_baseline_correction (bool)
accumulation_mode (Literal['mean', 'sum'])
-
p90_us:
float
-
p180_us:
float
-
p270_us:
float
-
p360_us:
float
-
ring_us:
float
-
hahn_echo_tau:
float
-
echo_time:
float
-
frequency:
float
-
RD:
float
-
phase_deg:
float
-
null:
float
-
tx1_gain:
float
-
if1_analog_mhz:
float
-
if1_digital_mhz:
float
-
filter_val_mhz:
float
-
window:
int
-
dw_us:
float
-
base:
int
-
dummy_shots:
int
-
fir_type:
FIRFilterType
-
fir_bypass:
bool
-
rx_gain:
float
-
rx_phase:
float
-
fft_zero_fill:
int
-
use_advanced_fft:
bool
-
use_apodization:
bool
-
use_phase_correction:
bool
-
use_baseline_correction:
bool
-
accumulation_mode:
Literal
['mean'
,'sum'
]
- class SampleInfo(name='Dummy Sample', description='', project_name='Untitled', experiment_number_total=10, experiment_number_current=1, temperature_feature_number_total=10, temperature_feature_number_current=1, lab_feature_number_current=1, feature_temperature=35, feature_temperature_unit='°C', feature_laboratory_type='Concentration', feature_laboratory_value=20, feature_laboratory_unit='g/mol', total_mass=20, total_mass_unit='g', sample_height=120, sample_diameter=18, sample_sizes_unit='mm', temp_cur=25, temp_target=35, t1_info=<factory>, t2_info=<factory>, tune_freq=<factory>, tune_dead_time=<factory>, tune_phase=<factory>, tune_duration=<factory>, user_data=<factory>)
Bases:
UpdatableSettings
- Parameters:
name (str)
description (str)
project_name (str)
experiment_number_total (int)
experiment_number_current (int)
temperature_feature_number_total (int)
temperature_feature_number_current (int)
lab_feature_number_current (int)
feature_temperature (float)
feature_temperature_unit (str)
feature_laboratory_type (str)
feature_laboratory_value (float)
feature_laboratory_unit (str)
total_mass (float)
total_mass_unit (str)
sample_height (float)
sample_diameter (float)
sample_sizes_unit (str)
temp_cur (float)
temp_target (float)
t1_info (T1Info)
t2_info (T2Info)
tune_freq (FrequencyTuneInfo)
tune_dead_time (DeadTimeTuneInfo)
tune_phase (PhaseTuneInfo)
tune_duration (DurationTuneInfo)
user_data (dict[str, Any])
-
name:
str
-
description:
str
-
project_name:
str
-
experiment_number_total:
int
-
experiment_number_current:
int
-
temperature_feature_number_total:
int
-
temperature_feature_number_current:
int
-
lab_feature_number_current:
int
-
feature_temperature:
float
-
feature_temperature_unit:
str
-
feature_laboratory_type:
str
-
feature_laboratory_value:
float
-
feature_laboratory_unit:
str
-
total_mass:
float
-
total_mass_unit:
str
-
sample_height:
float
-
sample_diameter:
float
-
sample_sizes_unit:
str
-
temp_cur:
float
-
temp_target:
float
-
t1_info:
T1Info
-
t2_info:
T2Info
-
tune_freq:
FrequencyTuneInfo
-
tune_dead_time:
DeadTimeTuneInfo
-
tune_phase:
PhaseTuneInfo
-
tune_duration:
DurationTuneInfo
-
user_data:
dict
[str
,Any
]