Skip to content

striqt.sensor.specs

schema for the specification of calibration and sweeps

Sweeps and captures

Spec structs for sweeps, actions, capture settings, and the loops that expand one capture into several.

ActionSpec

Bases: SpecBase, Generic[SS, SP, SA]

the top-level spec that an action runs.

An instance is decoded from a file against the tagged class of a sensor binding or constructed in code. The source, peripherals, and sink blocks name the resources that every action opens. source and peripherals are the spec types of the binding named by the sensor_binding tag.

check_schema classmethod

check_schema(schema: Any) -> None

raise if the spec types of schema cannot configure this action.

The base implementation accepts every schema.

Parameters:

  • schema (Any) –

    the Schema of the binding

Raises:

  • TypeError –

    if a spec type of schema lacks a field the action requires

BurstOptions

Bases: SpecBase

the bursts block of a Source: the policy for the segments of a capture burst.

A capture with burst above 1 is acquired as that many back-to-back segments with the stream left enabled, and the segments are sample-contiguous. The hardware clock syncs once per burst. Acquisition of a capture with burst 1 blocks until a buffer slot is free and is never dropped.

on_gap class-attribute instance-attribute

on_gap: one of ['skip', 'except'] = 'skip'

the response to a timing gap in a burst: 'skip' drops a segment when the queue is full and resumes after a stream overflow; 'except' raises on a full queue and restarts the burst after a stream overflow

buffers class-attribute instance-attribute

buffers: int = 1

maximum number of acquisitions queued ahead of analysis (Constraints: >= 1)

trigger_on class-attribute instance-attribute

trigger_on: one of ['first', 'all'] = 'first'

'first' runs the signal trigger on the first delivered segment of a burst and applies that lag to the rest; 'all' runs the trigger on every segment

CapturePlan

Bases: ActionSpec[SS, SP, SA], Generic[SS, SP, SC, SA]

an ActionSpec with the captures, loops, and adjust_captures blocks.

The loops are expanded over captures into the sequence of captures that the action runs, and the adjust_captures remaps for the open source are applied to each expanded capture. Construction rejects a repeat loop that is not the outermost entry, two loops over one field, and a loop over a field that the listed captures set to different values.

adjust_captures class-attribute instance-attribute

adjust_captures: dict[str | one of ['defaults'], dict[str, CaptureRemap | float | int | str | bool | None]] = msgspec.field(default_factory=dict)

Remaps of capture fields by source id (or 'defaults'), keyed by the value of another capture field; lookup keys are converted to the type of the keyed field

CaptureRemap

Bases: SpecBase

an entry of the adjust_captures block: a capture field set by lookup from the value of other capture fields.

The key names one or more fields of the capture after the loop point is applied, and the lookup maps each key value (a tuple, or its JSON array string in YAML, for several key fields) to the value of the adjusted field. A key value absent from the lookup takes the default when one is set; otherwise the field is left unset for an optional remap, and the spec is rejected for a required one.

CellChannel

Bases: SpecBase

one 5G NR channel of the cell_channels table of a Cellular5GNRSweep.

A capture with the center_frequency of the channel is acquired at the sample rate that striqt.waveform.comms_5gnr.nr_sample_rate derives from channel_bandwidth and subcarrier_spacing, at or above min_sample_rate, with analysis_bandwidth equal to channel_bandwidth. The cellular measurement parameters are set from the remaining fields through the adjust_analysis of the capture, with ssb_case None selecting the TS 38.213 §4.1 case for the spacing ('c' at 30 kHz). Only a subcarrier_spacing of 30 kHz is accepted, and tdd_frame_slots is 1 character per slot of the 10 ms frame or 1 character for every slot.

center_frequency instance-attribute

center_frequency: float

RF center frequency (Constraints: > 0, units: Hz)

channel_bandwidth instance-attribute

channel_bandwidth: float

nominal 5G NR channel bandwidth (3GPP TS 38.104 §5.3) (Constraints: > 0, units: Hz)

subcarrier_spacing class-attribute instance-attribute

subcarrier_spacing: float = 30000.0

Subcarrier spacing (15e3, 30e3, 60e3, etc) (Constraints: units: Hz)

ssb_frequency_offset class-attribute instance-attribute

ssb_frequency_offset: float = 0.0

offset of the SSB center from the channel center frequency (Constraints: units: Hz)

ssb_case class-attribute instance-attribute

ssb_case: one of ['auto', 'a', 'b', 'c', 'd', 'e', 'f', 'g'] | tuple[int, ...] | None = None

index locations in the SSB, or a cell search case from 3GPP TS 38.213 Sec. 4.1)

channel_guard_bandwidths class-attribute instance-attribute

channel_guard_bandwidths: tuple[float, float] = (0.0, 0.0)

guard bandwidths excluded at the (low, high) edges of the channel (Constraints: units: Hz)

tdd_frame_slots class-attribute instance-attribute

tdd_frame_slots: str | None = None

string composed of ('d', 'u', 's') specifying the sequence of slots in 1 TDD cellular frame, or None to fill with downlink

tdd_special_symbols class-attribute instance-attribute

tdd_special_symbols: str | None = None

string composed of the characters ('d', 'u', 'f') indicating the sequence of symbol types (when 's' is in frame_slots)

min_sample_rate class-attribute instance-attribute

min_sample_rate: float | None = None

lower bound on the sample rate derived for the channel, or None for no bound (Constraints: > 0, units: S/s)

Cellular5GNRAnalysis

Bases: SpecBase

the per-measurement settings of a Cellular5GNRSweep.

Each field is named for a measurement, and None disables the measurement. A block enables the measurement and holds only the parameters that the channel does not fix. The remaining parameters are set from the cell_channels entry at the center frequency of the capture and from the subcarrier spacing, or stay at the measurement default.

Cellular5GNRSweep

Bases: CapturePlan[SS, SP, SC, SA]

the spec of a sweep over 5G NR channels.

Each entry of captures names a channel by center_frequency, and cell_channels maps a label to the CellChannel at that frequency. The sample_rate and analysis_bandwidth of a capture are left at the class defaults and set from the matched channel. A loop over center_frequency is rejected, two cell_channels entries must not share a center_frequency, and every channel in use must share one subcarrier spacing.

check_schema classmethod

check_schema(schema: Any) -> None

raise unless schema can configure a sweep over cell channels.

The capture type must have a center_frequency field, and schema.analysis must declare every field of Cellular5GNRAnalysis with the spec type of the BuiltinAnalyses field of that name.

Raises:

  • TypeError –

    if the capture type lacks center_frequency, or if schema.analysis lacks a field or declares a different spec type

CellularChannelPowerHistogramSpec

Bases: SpecBase

the settings of the ChannelPowerHistogram measurement in a Cellular5GNRSweep.

power_low instance-attribute

power_low: float

Minimum power bin (Constraints: units: dB power)

power_high instance-attribute

power_high: float

Maximum power bin (Constraints: units: dB power)

power_resolution instance-attribute

power_resolution: float

Power bin resolution (Constraints: units: dB)

detector_period class-attribute instance-attribute

detector_period: Fraction | None = None

Power detector bin duration, a whole multiple of the sample period (Constraints: units: s)

power_detectors class-attribute instance-attribute

power_detectors: tuple[str, ...] = ('rms', 'peak')

Power detectors evaluated in each bin: 'rms', 'peak', or both

CellularChannelPowerTimeSeriesSpec

Bases: SpecBase

the settings of the ChannelPowerTimeSeries measurement in a Cellular5GNRSweep.

detector_period class-attribute instance-attribute

detector_period: Fraction | None = None

Power detector bin duration, a whole multiple of the sample period (Constraints: units: s)

power_detectors class-attribute instance-attribute

power_detectors: tuple[str, ...] = ('rms', 'peak')

Power detectors evaluated in each bin: 'rms', 'peak', or both

CellularCyclicAutocorrelationSpec

Bases: SpecBase

the settings of the CellularCyclicAutocorrelator measurement in a Cellular5GNRSweep.

The fields of CellularCyclicAutocorrelator absent here are set by the sweep from the cell channel.

CellularCyclicChannelPowerSpec

Bases: SpecBase

the settings of the CyclicChannelPower measurement in a Cellular5GNRSweep.

The fields of CyclicChannelPower absent here are set by the sweep from the cell channel.

power_detectors class-attribute instance-attribute

power_detectors: tuple[str, ...] = ('rms', 'peak')

Power detectors evaluated in each bin: 'rms', 'peak', or both

cyclic_statistics class-attribute instance-attribute

cyclic_statistics: tuple[str | float, ...] = (
    'min',
    'mean',
    'max',
)

Statistics evaluated across cycles at each cycle lag: 'min', 'mean', 'max', 'median', or a quantile in (0, 1)

CellularIQWaveformSpec

Bases: SpecBase

the IQWaveform settings that a Cellular5GNRSweep sets directly.

The remaining fields of IQWaveform are derived from the cell channel of the sweep.

CellularPowerSpectralDensitySpec

Bases: SpecBase

the settings of the PowerSpectralDensity measurement in a Cellular5GNRSweep.

The fields of PowerSpectralDensity absent here are set by the sweep from the cell channel.

window instance-attribute

window: str | tuple[str, float]

window function specification following scipy.signal.get_window

lo_bandstop class-attribute instance-attribute

lo_bandstop: float | None = None

mask with float("nan") at this bandwidth centered at baseband DC (Constraints: units: Hz)

CellularPSSCorrelationSpec

Bases: SpecBase

the settings of the Cellular5GNRPSSCorrelator measurement in a Cellular5GNRSweep.

The fields of Cellular5GNRPSSCorrelator absent here are set by the sweep from the cell channel.

CellularPSSSyncSpec

Bases: SpecBase

the settings of the Cellular5GNPSSSync measurement in a Cellular5GNRSweep.

The fields of Cellular5GNPSSSync absent here are set by the sweep from the cell channel.

per_port class-attribute instance-attribute

per_port: bool = False

whether to evaluate signal synchronization separately on each port

max_beams class-attribute instance-attribute

max_beams: int | None = None

limit the beam count in 5G sync evaluation (Constraints: > 0)

CellularResourcePowerHistogramSpec

Bases: SpecBase

the settings of the CellularResourcePowerHistogram measurement in a Cellular5GNRSweep.

The fields of CellularResourcePowerHistogram absent here are set by the sweep from the cell channel.

window instance-attribute

window: str | tuple[str, float]

window function specification following scipy.signal.get_window

power_low instance-attribute

power_low: float

Minimum power bin (Constraints: units: dB power)

power_high instance-attribute

power_high: float

Maximum power bin (Constraints: units: dB power)

power_resolution instance-attribute

power_resolution: float

Power bin resolution (Constraints: units: dB)

average_rbs class-attribute instance-attribute

average_rbs: bool | one of ['half'] = False

frequency resolution of the spectrogram: False for 1 subcarrier, True for 1 resource block (12 subcarriers), or 'half' for 6 subcarriers

average_slots class-attribute instance-attribute

average_slots: bool = False

True to coarsen spectrogram bins by averaging 1-symbol time resolution

cyclic_prefix class-attribute instance-attribute

cyclic_prefix: one of ['normal', 'extended'] = 'normal'

cyclic prefix length of the 3GPP numerology (TS 38.211 Table 4.2-1)

lo_bandstop class-attribute instance-attribute

lo_bandstop: float | None = None

mask with float("nan") at this bandwidth centered at baseband DC (Constraints: units: Hz)

CellularSpectrogramSpec

Bases: SpecBase

the settings of the Spectrogram measurement in a Cellular5GNRSweep.

The fields of Spectrogram absent here are set by the sweep from the cell channel.

window instance-attribute

window: str | tuple[str, float]

window function specification following scipy.signal.get_window

lo_bandstop class-attribute instance-attribute

lo_bandstop: float | None = None

mask with float("nan") at this bandwidth centered at baseband DC (Constraints: units: Hz)

CellularSSBSpectrogramSpec

Bases: SpecBase

the settings of the Cellular5GNRSSBSpectrogram measurement in a Cellular5GNRSweep.

The fields of Cellular5GNRSSBSpectrogram absent here are set by the sweep from the cell channel.

window class-attribute instance-attribute

window: str | tuple[str, float] = 'blackmanharris'

window function specification following scipy.signal.get_window

lo_bandstop class-attribute instance-attribute

lo_bandstop: float | None = None

mask with float("nan") at this bandwidth centered at baseband DC (Constraints: units: Hz)

Description

Bases: SpecBase

the description block of an action spec: free-text metadata stored with the spec

DiracDeltaCapture

Bases: SensorCapture

the capture of a FunctionSource that generates one impulse in a field of zeros.

The impulse is at the sample nearest the time offset from the start of the capture, with an amplitude in dB relative to 1.

time class-attribute instance-attribute

time: float = 0

start time offset (Constraints: units: s)

power class-attribute instance-attribute

power: float = 0

peak power level (Constraints: units: dBm)

Extension

Bases: SpecBase

the extensions: block of an action spec.

import_path is inserted into sys.path and import_name is imported before the rest of the spec is decoded. The module may call bind_sensor for the sensor_binding that the spec names.

import_path class-attribute instance-attribute

import_path: str | None = None

path to append to sys.path before extension imports

import_name class-attribute instance-attribute

import_name: str | None = None

name of the extension module that calls bind_sensor

FileCapture

Bases: SensorCapture

Capture specification read from a file, with support for None sentinels

FrequencyBinRange

Bases: LoopBase

a loop over a field on a grid of equal steps symmetric about 0.

The points are spaced by step on a grid centered on 0 that spans ceil((stop - start) / step) steps, and a point outside start to stop at either end of the grid is dropped. Each point is a multiple of the step or of half the step.

List

Bases: LoopBase

a loop over an explicit list of values of a field, in the listed order.

values instance-attribute

values: tuple[dict[str | one of ['defaults'], dict[str, CaptureRemap | float | int | str | bool | None]] | str | float | int | bool | None, ...]

Source UUID string

LoopBase

Bases: SpecBase

the base of the entries in the loops block of a CapturePlan.

A loop names a field of either the capture or the analysis, and get_points returns the values that the field takes, one expanded capture per point. Loops are nested in declaration order, outermost first.

isin class-attribute instance-attribute

isin: one of ['capture', 'analysis'] = 'capture'

selects whether to loop a capture or analysis parameters

ManualYFactorCalibration

Bases: CapturePlan[SS, SP, SC, SA]

the spec of a Y-factor calibration with a hand-switched noise diode.

An analysis block is accepted, discarded, and reported with a DeprecationWarning. More than one capture is accepted only when calibration.implied_loops names the fields in which the captures differ. source.calibration must be None, and every capture must have burst equal to 1. A bound spec is rejected when the runner cannot derive the calibration sweep.

check_schema classmethod

check_schema(schema: Any) -> None

raise unless schema.analysis declares channel_power_time_series.

NoiseCapture

Bases: SensorCapture

the capture of a FunctionSource that generates circular white Gaussian noise.

The noise is drawn independently on each port, with a total power (mW) equal to the power spectral density times the source sample rate.

noise_psd class-attribute instance-attribute

noise_psd: float = 1e-17

noise total channel power (Constraints: >= 0, units: mW/Hz)

PlotOptions

Bases: SpecBase

the plot_hint block of a Sweep: the data subset, the facet layout, and the plot function arguments of each variable.

One figure is drawn per group of the data block for each variable entry.

Range

Bases: LoopBase

a loop over the values of a field from a start to a stop in equal steps.

The stop is included when the span is a whole number of steps, and the loop has one point when the start equals the stop.

Repeat

Bases: LoopBase

a loop that repeats the whole expanded capture sequence a number of times.

A Repeat is accepted only as the first (outermost) loop, and names no field.

SawtoothCapture

Bases: SensorCapture

the capture of a FunctionSource that generates a real sawtooth ramp.

Each ramp rises from 0 toward the peak amplitude over one period, and the ramps reset at the start of the capture.

period class-attribute instance-attribute

period: float = 0.01

waveform period (Constraints: >= 0, units: s)

power class-attribute instance-attribute

power: float = 0

peak power level (Constraints: units: dBm)

Schema dataclass

Schema(
    source: type[SS],
    capture: type[SC],
    peripherals: type[SP],
    init_like: Callable[PS, Any],
    arm_like: Callable[PC, Any],
    action: type[ActionSpec[SS, SP, SA]] = Sweep,
    analysis: type[SA] = cast('type[SA]', BuiltinAnalyses),
)

Bases: Generic[SS, SP, SC, SA, PS, PC]

the spec types of a sensor binding.

source instance-attribute

source: type[SS]

the Source subclass of the binding

capture instance-attribute

capture: type[SC]

the SensorCapture subclass of the binding

peripherals instance-attribute

peripherals: type[SP]

the Peripherals subclass of the binding

init_like instance-attribute

init_like: Callable[PS, Any]

a callable with the keyword signature of source, read by the type checker alone

arm_like instance-attribute

arm_like: Callable[PC, Any]

a callable with the keyword signature of capture, read by the type checker alone

action class-attribute instance-attribute

action: type[ActionSpec[SS, SP, SA]] = structs.Sweep

the action spec type of the binding

analysis class-attribute instance-attribute

analysis: type[SA] = dataclasses.field(
    default=cast('type[SA]', sa.specs.BuiltinAnalyses)
)

the AnalysisGroup subclass of the analysis: block of a bound Sweep

SensorCapture

Bases: Capture

Capture specification for a generic waveform with resampling support

port instance-attribute

port: int | tuple[int, ...]

Input port indices (Constraints: >= 0)

lo_shift class-attribute instance-attribute

lo_shift: one of ['left', 'right', 'none'] = 'none'

LO shift direction

backend_sample_rate class-attribute instance-attribute

backend_sample_rate: float | None = None

Source sample rate (Constraints: > 0, units: S/s)

adjust_analysis class-attribute instance-attribute

adjust_analysis: dict[str, Any] = msgspec.field(
    default_factory=dict
)

changes to apply across each analysis for any matching parameter

external_lo_frequency class-attribute instance-attribute

external_lo_frequency: (
    float | None | tuple[float | None, ...]
) = None

LO frequency of external frequency converter

burst class-attribute instance-attribute

burst: int = 1

number of back-to-back acquisitions of the capture with the stream left enabled (Constraints: >= 1)

SingleToneCapture

Bases: SensorCapture

the capture of a FunctionSource that generates one unit-amplitude tone.

The tone is offset from the center frequency by a baseband frequency. White noise is added at the SNR below the tone power, and an SNR of None adds no noise.

frequency_offset class-attribute instance-attribute

frequency_offset: float = 0

Baseband frequency offset (Constraints: units: Hz)

snr class-attribute instance-attribute

snr: float | None = None

Add circular white gaussian noise to achieve this SNR (Constraints: units: dB)

SoapyCapture

Bases: SensorCapture

the capture of a SoapySDR source: a SensorCapture with a tuned frequency and gain.

Construction rejects a gain tuple when the port is a scalar, and a gain tuple with a length other than the port count.

center_frequency instance-attribute

center_frequency: float | tuple[float, ...]

Center frequency for each port (Constraints: units: Hz, > 0)

gain instance-attribute

gain: float | tuple[float, ...]

Gain setting for each channel (Constraints: units: dB)

SpecValidationError

SpecValidationError(
    message: str,
    path: tuple[str, ...] = (),
    locations: tuple[str, ...] = (),
)

Bases: ValidationError

a spec validation failure with a msgspec-style field path.

path is the chain of field accesses from the document root, rendered as msgspec renders a path ($.analysis.spectrogram) ahead of message. locations are further roots at which the same failure is located, rendered as an at ... on ... trailer in the order given.

at

at(*locations: str) -> SpecValidationError

return a copy with locations prepended to the at ... on ... trailer

Sweep

Bases: CapturePlan[SS, SP, SC, SA]

the spec of a sweep.

analysis is an instance of the group that Schema.analysis names for the binding, and is evaluated on each expanded capture with the adjust_analysis of the capture applied on top. options selects the warmup, IQ reuse, and the loop_only_nyquist filter of the expansion. Construction validates each unique capture against the registered measurements and the conditioning signal path.

SweepOptions

Bases: SpecBase

the options block of a Sweep: IQ reuse, the Nyquist filter of the expansion, and the GPU warmup.

With IQ reuse, the IQ of the previous acquisition serves a capture with the same radio settings, and the Nyquist filter drops each expanded capture with a finite analysis bandwidth above the sample rate of the capture. The warmup runs the sweep once over empty buffers before the first acquisition when a GPU backend is in use.

skip_warmup class-attribute instance-attribute

skip_warmup: bool = True

if True, suppress empty buffer runs for GPU backends

Sources, sinks, and peripherals

Spec structs for IQ sources, data sinks, peripherals, and the acquisition metadata recorded with each capture.

AcquiredIQ dataclass

AcquiredIQ(
    x: Array,
    capture: Capture | None,
    power_units: PowerUnits,
    info: AcquisitionInfo,
    extra_data: dict[str, Any],
    source_spec: Source,
    resampler: ResamplerDesign,
    format_path: PathFormatter | None = None,
    voltage_scale: Array | float = 1,
    conjugate: tuple[bool, ...] | Literal[False] = False,
    signal_trigger: Trigger | None = None,
    overwrite_x: bool = False,
    trigger_shifts: Array | None = None,
    pending_extra_data: PendingExtraData | None = None,
)

Bases: AcquiredIQ

an acquisition from a sensor source with the metadata and conditioning of the capture.

x must not change after the first access of preprocess, except that the resampling stage replaces x with a ConsumedBuffer when overwrite_x is True.

conjugate class-attribute instance-attribute

conjugate: tuple[bool, ...] | Literal[False] = False

one flag per port, True to conjugate the IQ of that port, or the scalar False for no conjugation

signal_trigger class-attribute instance-attribute

signal_trigger: Trigger | None = None

the trigger run for alignment, or None to select info.signal_trigger

overwrite_x class-attribute instance-attribute

overwrite_x: bool = False

True permits the resampling stage to consume x, leaving a ConsumedBuffer in x when the stage returns another array

trigger_shifts class-attribute instance-attribute

trigger_shifts: Array | None = None

one shift per port, in samples at capture.sample_rate, applied in place of running the trigger, or None to run the trigger

pending_extra_data class-attribute instance-attribute

pending_extra_data: PendingExtraData | None = None

the peripheral read still running for the capture, or None when extra_data is complete

preprocess

preprocess() -> Preprocessor

return the Preprocessor that conditions x through the sensor signal path.

One Preprocessor is created per instance. A dataclasses.replace copy starts with a Preprocessor of its own and every stage empty.

AcquisitionInfo

Bases: Struct

the metadata of one acquisition

source_id class-attribute instance-attribute

source_id: str = ''

Source UUID string

replace

replace(**attrs) -> Self

returns a copy of self with changed attributes.

See also

Python standard library copy.replace

to_dict

to_dict() -> dict

return the fields of self as a dict

DataOptions

Bases: SpecBase

the data block of a plot hint: the subset of a dataset that one figure plots.

The dataset is narrowed by the sweep index, the query, and the selection, and is split by the grouping dimensions into one figure per group.

FileAcquisitionInfo

Bases: AcquisitionInfo

the AcquisitionInfo of a file source: the radio settings read from the file.

The center frequency, gain, port, and backend sample rate are read from the file header or coordinates, in place of the settings that a hardware source tunes.

center_frequency class-attribute instance-attribute

center_frequency: float | tuple[float, ...] = float('nan')

Center frequency for each port (Constraints: units: Hz, > 0)

backend_sample_rate instance-attribute

backend_sample_rate: float

Source sample rate (Constraints: > 0, units: S/s)

port class-attribute instance-attribute

port: int | tuple[int, ...] = 0

Input port indices (Constraints: >= 0)

gain class-attribute instance-attribute

gain: float | tuple[float, ...] = float('nan')

Gain setting for each channel (Constraints: units: dB)

source_id class-attribute instance-attribute

source_id: str = ''

Source UUID string

FunctionSource

Bases: Source

the source block of a sweep for a synthetic waveform generator.

The source generates the waveform of each capture at the declared port count, in complex64, and a squared magnitude of 1 is 1 mW.

ManualYFactorSpec

Bases: Peripherals

the calibration: block of a ManualYFactorCalibration.

detector_period None selects the one duration shared by the captures and loops as the bin of the generated channel_power_time_series analysis, and a bound spec with more than one duration is rejected.

enr instance-attribute

enr: float

Excess noise ratio, referred to a diode-off source temperature of 290 K (Constraints: units: dB)

ambient_temperature instance-attribute

ambient_temperature: float

Ambient temperature (Constraints: units: K)

implied_loops class-attribute instance-attribute

implied_loops: tuple[str, ...] = ()

List of looped fields embedded in the capture list

detector_period class-attribute instance-attribute

detector_period: Fraction | None = None

Power detector bin duration, a whole multiple of the sample period (Constraints: units: s)

MATSource

Bases: Source

the source block of a sweep that reads IQ from a MATLAB .mat file.

The file is opened when the source opens and each capture is read from the array at the declared key, in complex64, with the squared magnitude in the declared power units. The backend sample rate is read from the file, so a capture that sets one is rejected.

path instance-attribute

path: str

path to the waveform data file

file_format class-attribute instance-attribute

file_format: one of ['auto', 'mat', 'tdms'] = 'auto'

data format or auto to guess by extension

file_metadata class-attribute instance-attribute

file_metadata: dict[str, Any] | None = None

any capture fields not included in the file

loop class-attribute instance-attribute

loop: bool = False

whether to loop the file to create longer IQ waveforms

power_units class-attribute instance-attribute

power_units: one of ['mW', 'FS', 'a.u.'] = 'a.u.'

unit of the squared magnitude of the stored IQ: calibrated milliwatts, full scale, or arbitrary units

NoPeripherals

Bases: Peripherals

the peripherals block of a sensor binding without peripheral hardware, with no fields

NoSource

Bases: Source

the source block of a sweep that acquires empty buffers.

The number of buffer rows is the declared port count, so the buffers of a warmup sweep match those of the hardware sweep that follows.

PendingExtraData dataclass

PendingExtraData(
    peripherals: Future[dict[str, Any]],
    override: dict[str, Any],
)

a peripheral read of a capture that is still running when the acquisition is handed to analysis.

peripherals instance-attribute

peripherals: Future[dict[str, Any]]

the running peripheral read of the capture, resolving to one dict

override instance-attribute

override: dict[str, Any]

entries that replace the peripheral value of the same key

Peripherals

Bases: SpecBase

the base of the peripherals block of an action spec, with no fields of its own

SharedPlotOptions

Bases: SpecBase

the plotter block of a plot hint: the facet layout and the title and filename templates.

The column and row facets are distinct dataset dimensions, and the title, label, and filename templates are formatted from the coordinates of the plotted dataset.

Sink

Bases: SpecBase

the output block of every action spec.

path is the output location, with the {field} templates of paths.get_path_fields expanded, and None selects no output. log_path and log_level configure the log file independently of path.

SoapyAcquisitionInfo

Bases: AcquisitionInfo

extra coordinate information returned from an acquisition

sweep_start_time class-attribute instance-attribute

sweep_start_time: Timestamp | None = None

Capture acquisition start time

start_time instance-attribute

start_time: Timestamp | None

Acquisition start time of the first capture

backend_sample_rate instance-attribute

backend_sample_rate: float | None

Source sample rate (Constraints: > 0, units: S/s)

source_id class-attribute instance-attribute

source_id: str = ''

Source UUID string

SoapySource

Bases: Source

the source block of a sweep for a SoapySDR device.

The time and clock sources, the time sync point, and the overload limits are set on the device when the source opens, and the IQ is in full-scale units unless a calibration path is set. Construction rejects a signal trigger that names no registered trigger or that enables more than one.

time_source class-attribute instance-attribute

time_source: one of ['host', 'internal', 'external', 'gps'] = 'host'

Hardware source for timestamps

time_sync_at class-attribute instance-attribute

time_sync_at: one of ['open', 'acquire'] = 'acquire'

when to sync the hardware clock: on connection, or before each capture

clock_source class-attribute instance-attribute

clock_source: one of ['internal', 'external', 'gps'] = 'internal'

Hardware source for the frequency reference

receive_retries class-attribute instance-attribute

receive_retries: int = 0

number of acquisition retry attempts on stream error (Constraints: >= 0)

adc_overload_limit class-attribute instance-attribute

adc_overload_limit: float | None = -1

dataset adc_overload=True when the peak ADC level exceeds this threshold (Constraints: <= 0, units: dBFS)

if_overload_limit class-attribute instance-attribute

if_overload_limit: float | None = None

the maximum level at maximum gain before IF/baseband overload (Constraints: units: dBFS)

Source

Bases: SpecBase

run-time characteristics of the radio that are left invariant during a sweep

master_clock_rate instance-attribute

master_clock_rate: float

Base sample rate used inside the source (Constraints: > 0, units: Hz)

array_backend class-attribute instance-attribute

array_backend: one of ['numpy', 'cupy'] = 'numpy'

array module to use to set compute device: numpy = cpu, cupy = gpu

SourceInfo

Bases: SpecBase

the capabilities of an open source, as returned by get_info.

With a port count of None, a port tuple of any length is accepted. The retry count is the receive retry setting in force during the probe.

TDMSSource

Bases: Source

a source of IQ from a TDMS file with int16 I and Q channels.

Full-scale int16 is scaled to the reference_level_dBm header of the file. The squared magnitude of the scaled IQ is in mW.

path instance-attribute

path: str

path to the waveform data file

power_units class-attribute instance-attribute

power_units: one of ['mW', 'FS', 'a.u.'] = 'mW'

unit of the squared magnitude of the stored IQ: calibrated milliwatts, full scale, or arbitrary units

ZarrIQSource

Bases: Source

the source block of a sweep that reads IQ from the iq_waveform variable of a zarr store.

The selection narrows the variable to a 2-D array of (port, iq_sample), and the center frequency, gain, port, and sample rate coordinates of the store are the radio settings of each acquisition. A selection that leaves another number of dimensions is rejected when the source opens.

path instance-attribute

path: str

path to the waveform data file

center_frequency instance-attribute

center_frequency: float | tuple[float, ...]

Center frequency for each port (Constraints: units: Hz, > 0)

select class-attribute instance-attribute

select: dict = msgspec.field(default_factory=dict)

dictionary to select in the data as .sel(**select)

ZarrSink

Bases: Sink

the output block of a Sweep: a zarr store with one row per port of each capture.

The store is allocated when the sink opens, and each capture is written as the chunks of the store fill.

store class-attribute instance-attribute

store: one of ['zip', 'directory'] = 'directory'

serialization output format of the sink

max_threads class-attribute instance-attribute

max_threads: int | None = None

Blosc compression thread count, or null for the numcodecs default

batched_write_count class-attribute instance-attribute

batched_write_count: int = 1

ignored, with no effect on the sink

max_chunk_bytes class-attribute instance-attribute

max_chunk_bytes: int = 10000000

Upper bound on the uncompressed size of one chunk of each variable (Constraints: > 0, units: B)