Expand description
Readers for NMR data.
- Bruker TopSpin / XWIN-NMR experiment directories (
bruker-nmr): a directory<expno>/with JCAMP-DX-style parameter files (acqus,acqu2s, …), the time-domain samples (fidorser) and processed spectra underpdata/<procno>/. Notes and vocabulary:docs/formats/bruker-nmr.md; provenance:docs/provenance/bruker-nmr.md. - Varian/Agilent VnmrJ data directories (
varian-nmr): a<name>.fid/directory with the binaryfid(file header, block headers, int16/int32/float32 samples) and theprocparparameter text. Notes and vocabulary:docs/formats/varian-nmr.md; provenance:docs/provenance/varian-nmr.md. - JEOL Delta
.jdffiles (jeol-jdf): a binary header, a parameter section and 1D or 2D data sections. Notes and vocabulary:docs/formats/jeol-jdf.md; provenance:docs/provenance/jeol-jdf.md. - Magritek Spinsolve benchtop NMR experiment directories (
magritek-spinsolve):acqu.par/proc.parparameter text and Prospa.1d/.2ddata files (FID first). Notes and vocabulary:docs/formats/magritek-spinsolve.md; provenance:docs/provenance/magritek-spinsolve.md. - JCAMP-DX (
jcamp-dx): the IUPAC text format for spectra (NMR, IR, UV-Vis, MS), with ASDF-compressed tables, NTUPLES and compound (LINK) files. Notes and vocabulary:docs/formats/jcamp-dx.md; provenance:docs/provenance/jcamp-dx.md.
All five expose sampled data as core traces (TraceInfo / Dataset::read_trace).
export_jcamp writes any evenly sampled trace (an NMR FID or spectrum, a JCAMP-DX
spectrum, a chromatogram) as JCAMP-DX 5.01: ##XYDATA=(X++(Y..Y)) in DIFDUP (with Y-value
checks) or AFFN, NTUPLES pages for complex or multi-sweep data. The file is re-read with the
JCAMP-DX reader and verified before it is renamed into place.
§Example
Every reader implements openreadout_core::FormatReader: descriptor
says what it reads, sniff recognises a file from its first bytes, and open returns a
openreadout_core::Dataset with a header-only info() summary and lazy data
access.
use openreadout_core::FormatReader;
use openreadout_nmr::BrukerReader;
let format = BrukerReader.descriptor();
assert_eq!(format.id, openreadout_nmr::BRUKER_FORMAT_ID);
println!("{} ({}): .{}", format.name, format.family, format.extensions.join(", ."));Reading a file:
use std::path::Path;
use openreadout_core::FormatReader;
use openreadout_nmr::BrukerReader;
let mut dataset = BrukerReader.open(Path::new("experiment/1"))?;
let info = dataset.info()?; // headers only
let trace = &info.traces[0];
println!("{} sweep(s) at {} Hz, {} channel(s)", trace.sweep_count, trace.sample_rate_hz, trace.channels.len());
// The first 1000 samples of sweep 0, every channel, scaled to physical units.
let samples = dataset.read_trace(0, 0, 0, 1000)?;
for (channel, values) in trace.channels.iter().zip(&samples.channels) {
println!("{} ({}): {:?}", channel.name, channel.unit.as_deref().unwrap_or("?"), values.first());
}Applications that accept any instrument file usually register every reader in an
openreadout_core::Registry and let it detect the format; that is what the
openreadout command-line tool does.
§API stability
The supported API is what this page documents. The parser modules are public only so that tests and fuzz targets can reach them: they are hidden from this documentation and may change in any release.
Structs§
- Bruker
Reader - The Bruker TopSpin reader.
- Jcamp
Export Options - What to write.
- Jcamp
Export Report - Output of
export --format jcamp. - Jcamp
Reader - The JCAMP-DX reader.
- Jeol
Reader - The JEOL Delta
.jdfreader. - Spinsolve
Reader - The Magritek Spinsolve reader (experiment directories with
acqu.parand Prospa.1d/.2ddata files). - Varian
Reader - The Varian/Agilent VnmrJ reader (
<name>.fid/directories withfidandprocpar).
Enums§
- Jcamp
Encoding - How ordinates are written.
Constants§
- BRUKER_
FORMAT_ ID - Format id of Bruker TopSpin experiment directories.
- JCAMP_
FORMAT_ ID - Format id of JCAMP-DX files.
- JEOL_
FORMAT_ ID - Format id of JEOL Delta
.jdffiles. - SPINSOLVE_
FORMAT_ ID - Format id of Magritek Spinsolve experiment directories.
- VARIAN_
FORMAT_ ID - Format id of Varian/Agilent VnmrJ data directories.
Functions§
- default_
jcamp_ output - Default output path:
<stem>.jdx(<stem>.traceT.jdx,<stem>.sweepS.jdxwhen selected). - export_
jcamp - Export one trace of
dstooutputas JCAMP-DX.