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.

Visual Verification: FID Loader and Processing Pipeline

Goal: Visually verify the strict 1D-to-ND Bruker memory reshaping, physical coordinate calculation, and the newly refactored xmris processing pipeline. We will explicitly use xarray’s native plotting to ensure units and axis names are automatically and correctly resolved.

<xarray.core.options.set_options at 0x7fa7ca4643d0>

1. Data Loading and Reshaping

Raw Bruker data is read as a continuous 1D array. To make it useful, we must reshape it into an N-dimensional C-contiguous array based on the acquisition parameters, and then wrap it in an xarray.DataArray with the correct physical coordinates.

Reshaped Bruker data to dims: [ time | average ]
Constructed FID Shape: (2048, 5)
Assigned Attributes: ['reference_frequency', 'carrier_ppm', 'group_delay', 'units']

2. Inspecting the Time Domain (FID)

To simplify our visual inspection, we will select the first repetition, channel, or average if the data is multi-dimensional. We then plot the Free Induction Decay (FID) to verify signal decay shape, complex quadrature, and the absence of truncation artifacts.

<Figure size 1500x600 with 1 Axes>

Removing the Digital Filter

Bruker spectrometers utilize digital filters that introduce a group delay at the beginning of the FID. build_fid already stored that value in the FID’s metadata (group_delay), so the default remove_digital_filter() reads it automatically — no need to pass the delay by hand. If the header value is unreliable, pass group_delay="measure" instead to estimate the true delay from the data (see The Digital Filter Group Delay).

<Figure size 1500x600 with 1 Axes>

3. The xmris Spectral Pipeline

With the FID corrected, we can pass it through the xmris processing pipeline. Here, we apply an exponential apodization to smooth the signal, transform it to the frequency domain, and automatically correct the phase.

Loading...

Visualizing the Frequency Domain

We can visualize the resulting spectrum. Note how xarray automatically handles the coordinate labels. We invert the x-axis to adhere to standard NMR/MRI conventions.

<Figure size 1500x1500 with 2 Axes>

4. Chemical Shift Conversion

For chemical analysis, viewing the spectrum in parts per million (ppm) is more useful than raw Hertz. The .xmr.to_ppm() accessor handles this conversion automatically using the spectrometer frequency metadata.

<Figure size 1500x1500 with 2 Axes>

5. Reverse Transformation

The xmris accessors preserve metadata and coordinates perfectly, allowing seamless reverse transformations. We can convert our processed spectrum back into the time domain using .xmr.to_fid().

<Figure size 1500x600 with 1 Axes>
<Figure size 1650x1050 with 4 Axes>
<Figure size 1650x1050 with 4 Axes>