Skip to article frontmatterSkip to article content
Site not loading correctly?

This may be due to an incorrect BASE_URL configuration. See the MyST Documentation for reference.

vendor.bruker

vendor.bruker

Functions

NameDescription
build_fidConstruct a strict xmris FID DataArray from an N-dimensional numpy array.
remove_digital_filterRemove the hardware digital filter group delay from Bruker FID data.
reshape_bruker_rawReshape a flat Bruker rawdata.job0 array into a squeezed N-dimensional numpy array.

build_fid

vendor.bruker.build_fid(data, dims, pv_params)

Construct a strict xmris FID DataArray from an N-dimensional numpy array.

Expected Bruker Parameters in pv_params:

Parameters

NameTypeDescriptionDefault
datanp.ndarrayThe squeezed, N-dimensional complex data array.required
dimslist[str]The dimension names matching the data axes. Must contain DIMS.time.required
pv_paramsdictThe parsed Bruker parameter dictionary.required

Returns

NameTypeDescription
xr.DataArrayA fully compliant DataArray ready for the xmris processing pipeline.

remove_digital_filter

vendor.bruker.remove_digital_filter(
    da,
    group_delay,
    dim='time',
    keep_length=True,
)

Remove the hardware digital filter group delay from Bruker FID data.

Bruker consoles use a cascade of digital FIR filters during analog-to-digital conversion. Because these filters calculate a moving average, they require time to “wake up”, introducing a causality delay at the start of the Free Induction Decay (FID). This manifests as a time-shift, effectively prepending the actual signal with a specific number of filter transient points (often appearing as a flatline or wavy noise).

If left uncorrected, this time shift causes a massive, rolling first-order phase error in the frequency-domain spectrum.

This function realigns the signal to t=0 by:

  1. Truncating the integer portion of the delay.

  2. Applying a first-order phase correction to exactly compensate for the remaining fractional sub-point delay.

Parameters

NameTypeDescriptionDefault
daxr.DataArrayInput free induction decay (FID) data in the time domain.required
group_delayfloatThe exact delay value to remove. This should be read directly from the Bruker ACQ_RxFilterInfo parameter array (index 0: ‘groupDelay’)]. Typical values: - ~76.0 for standard high-resolution Spectroscopy. - ~0.0 to 16.0 for Fast Imaging or ZTE (where hardware pre-compensation or short filters are used).required
dimstrThe time dimension along which to apply the correction, by default “time”.'time'
keep_lengthboolIf True, appends pure zeros to the end of the FID to replace the truncated startup points. This ensures the returned DataArray maintains the exact same length as the input (critical for FFT radix sizes), avoiding the confusion of traditional spectral “zero-filling”. By default True.True

Returns

NameTypeDescription
xr.DataArrayThe corrected FID data with the filter transient stripped, phase aligned, and lineage metadata preserved.

reshape_bruker_raw

vendor.bruker.reshape_bruker_raw(raw_data_1d, pv_params)

Reshape a flat Bruker rawdata.job0 array into a squeezed N-dimensional numpy array.

Bruker stores multi-dimensional data sequentially. This function parses the method parameters to determine the shape, filters out empty dimensions, and reshapes the data to match xmris conventions.

Expected Bruker Parameters in pv_params:

Spatial encoding is currently unsupported, we assume:

n_slices = 1 # number of slices / slabs n_ph1 = 1 # phase encoding direction A n_ph2 = 1 # phase encoding direction B

Parameters

NameTypeDescriptionDefault
raw_data_1dnp.ndarrayThe flat, 1D complex numpy array loaded directly from the binary file.required
pv_paramsdictThe parsed Bruker parameter dictionary.required

Returns

NameTypeDescription
reshaped_datanp.ndarrayThe N-dimensional numpy array.
valid_dimslist[str]A list of dimension names matching the axes of reshaped_data.