Skip to content

device#

Talk to the connected NMR instrument: read/set temperature, frequency, phase, pulses, and run sequences.

Methods that need hardware raise an error if no device is connected — guard with is_connected.

DEVICE_VENDOR Requires device #

DEVICE_VENDOR() -> str

Name of the connected instrument's vendor/provider (e.g. its make).

DWELL_TIME Requires device #

DWELL_TIME() -> float

Dwell time in seconds — the spacing between acquired sample points (relaxometer devices).

configure Requires device #

configure(config: object) -> bool

Push a settings bundle to the instrument in one call.

Args:
    config: A device configuration object holding the settings to apply.

Returns:
    ``True`` if the instrument accepted the configuration.

execute Requires device #

execute(
    sequence: Sequence[BaseOp],
    return_type: Literal[
        "signal", "spectrum", "both"
    ] = "spectrum",
    num_accum: int = 1,
    report: bool | Literal["auto"] = "auto",
    record: bool = True,
    plot: bool = True,
    manage_run: bool = True,
) -> (
    list[Signal1D | Signal2D]
    | list[Spectrum1D | Spectrum2D]
    | list[
        tuple[Signal1D, Spectrum1D]
        | tuple[Signal2D, Spectrum2D]
    ]
)

Run a pulse sequence on the instrument, accumulate scans, and return the result.

Args:
    return_type: ``"signal"`` (time-domain FID), ``"spectrum"``, or ``"both"``.
    report: ``"auto"`` reports unless inside a progress-tracked loop.
    manage_run: Set ``False`` only when managing the run yourself across several calls.

Returns:
    Results matching ``return_type`` in the acquired dimensionality (1D or 2D).

get_frequency Requires NMRRelaxometer #

get_frequency(
    return_unit: Literal["Hz", "KHz", "MHz", "GHz"] = "Hz",
) -> float

Read the instrument's current spectrometer (carrier) frequency.

Args:
    return_unit: Unit to report in — e.g. ``"Hz"``, ``"kHz"``, ``"MHz"``,
        ``"GHz"``.

Returns:
    The current frequency in ``return_unit``.

get_info Requires device #

get_info() -> DeviceState

Get a snapshot of the connected instrument.

Returns:
    A device-state object with ``connected`` (bool), ``vendor`` (str), and
    ``metadata`` (model/capability details).

get_pulse_duration Requires NMRRelaxometer #

get_pulse_duration(
    pulse_type: Literal[
        "90deg", "180deg", "270deg", "360deg"
    ]
    | Literal["ringing", "echo"]
    | NmrPulseDirection,
    return_unit: Literal[
        "ns", "us", "ms", "s", "m", "h", "d"
    ] = "us",
) -> float

Read the configured duration of a named pulse.

Args:
    pulse_type: Which pulse to read — a calibrated spec such as ``"90deg"``
        or ``"180deg"``, or a pulse direction.
    return_unit: Time unit to report in (e.g. ``"us"``, ``"ms"``).

Returns:
    The pulse duration in ``return_unit``.

get_settings #

get_settings() -> dict

Read all current instrument settings as a plain dictionary.

Returns:

Type Description
dict

The device settings as name→value pairs (empty if the device exposes

dict

none).

get_temperature Requires NMRRelaxometer #

get_temperature(
    return_unit: Literal["C", "F", "K"] = "C",
) -> tuple[float, float]

Read the instrument's current and target sample temperature.

Args:
    return_unit: Unit to report in — ``"C"``, ``"K"``, or ``"F"``.

Returns:
    A ``(current, target)`` tuple in ``return_unit``.

is_connected #

is_connected() -> bool

Check whether an instrument is connected and ready.

Returns:

Type Description
bool

True if a device is present and reports itself connected.

set_frequency Requires NMRRelaxometer #

set_frequency(
    frequency: float,
    unit: Literal["Hz", "KHz", "MHz", "GHz"] = "Hz",
) -> bool

Set the instrument's spectrometer (carrier) frequency.

Args:
    frequency: Target frequency value.
    unit: Unit of ``frequency`` — e.g. ``"Hz"``, ``"kHz"``, ``"MHz"``,
        ``"GHz"``.

Returns:
    ``True`` once the frequency has been sent.

set_phase Requires NMRRelaxometer #

set_phase(phase_deg: float) -> bool

Set the instrument's receiver/transmitter phase.

Args:
    phase_deg: Phase in degrees.

Returns:
    ``True`` once the phase has been sent.

set_pulse_duration Requires NMRRelaxometer #

set_pulse_duration(
    pulse_type: Literal[
        "90deg", "180deg", "270deg", "360deg"
    ]
    | Literal["ringing", "echo"]
    | NmrPulseDirection,
    duration: float,
    unit: Literal[
        "ns", "us", "ms", "s", "m", "h", "d"
    ] = "us",
) -> None

Set the duration of a named pulse on the instrument.

Args:
    pulse_type: Which pulse to set — a calibrated spec such as ``"90deg"``
        or ``"180deg"``, or a pulse direction.
    duration: New pulse length.
    unit: Unit of ``duration`` (e.g. ``"us"``, ``"ms"``).

set_temperature Requires NMRRelaxometer #

set_temperature(
    temperature: float, unit: Literal["C", "F", "K"] = "C"
) -> bool

Set the instrument's target sample temperature.

Args:
    temperature: Target temperature value.
    unit: Unit of ``temperature`` — ``"C"``, ``"K"``, or ``"F"``.

Returns:
    ``True`` once the setpoint has been sent.