Difference between revisions of "Fid2pipe.m"

From Spinach Documentation Wiki
Jump to: navigation, search
(new page for Spinach main f053e432: documents fid2pipe.m from the source header and implementation)
 
(version fragment to 2.13 per IK 2026-08-30)
 
Line 40: Line 40:
 
[[fid2ascii.m]], [[s2json.m]], [[hz2ppm.m]], [[Import, export, and visualisation]]
 
[[fid2ascii.m]], [[s2json.m]], [[hz2ppm.m]], [[Import, export, and visualisation]]
  
−
''Version 2.11, authors: [[Ilya Kuprov]]''
+
''Version 2.13, authors: [[Ilya Kuprov]]''

Latest revision as of 10:11, 30 August 2026

Exports phase-sensitive 2D Spinach free induction decays into native NMRPipe time-domain files. The function first points the NMRPipe runtime environment at the installation supplied by the caller: the nmrbin.linux212_64 and com directories are prepended to PATH, the library path is extended with the NMRPipe library directory, and TCLPATH, TCL_LIBRARY, TK_LIBRARY, BLT_LIBRARY, NMRBASE, NMRBIN, and NMRTXT are set; OPENWINHOME is set as well when the openwin directory is present.

Observation frequencies for the two dimensions are computed in MHz from the magnetogyric ratios of the isotopes named in parameters.spins and the magnet field in spin_system.inter.magnet, and the carriers are converted into signed ppm by hz2ppm.m function. Each of the two components of the free induction decay is then written into a temporary text file, one point per line with the direct-dimension index, the indirect-dimension index, the real part, and the imaginary part, and converted into the NMRPipe format by the txt2pipe.tcl script with complex States acquisition in both dimensions. The temporary text file is deleted after each conversion, and a non-zero exit status from the conversion raises an error carrying the NMRPipe output.

Syntax

    fid2pipe(spin_system,file_root,fid,parameters,nmrpipe_root)

Parameters

    spin_system  - Spinach spin system structure

    file_root    - output file name root without shell metacharacters;
                   the function writes <file_root>_pos.fid and
                   <file_root>_neg.fid

    fid          - structure with fid.pos and fid.neg complex matrices;
                   rows are direct-dimension points, and columns are
                   indirect-dimension points

    parameters   - pulse sequence parameters structure with fields
                   sweep, npoints, offset, and spins

    nmrpipe_root - NMRPipe installation root containing com/txt2pipe.tcl
                   and nmrbin.linux212_64

Outputs

    this function writes two NMRPipe files

Notes

Note: the exported files preserve the two Spinach echo/anti-echo components; recombination is done in the accompanying NMRPipe processing script after the direct-dimension Fourier transform.

parameters.sweep and parameters.offset are ordered [F1 F2], and parameters.npoints is checked against the dimensions of fid.pos and fid.neg: parameters.npoints(1) must equal the number of columns and parameters.npoints(2) the number of rows.

Both file_root and nmrpipe_root are restricted to alphanumeric characters and the /_.- set, and must contain no whitespace, because they are passed to a shell command.

See also

fid2ascii.m, s2json.m, hz2ppm.m, Import, export, and visualisation

Version 2.13, authors: Ilya Kuprov