Re: varian2felix, screen blank

Neil E Jacobsen (neil@u.arizona.edu)
Mon, 8 Apr 1996 16:33:24 -0700 (MST)

On Mon, 8 Apr 1996, Marty Pagel wrote:

> To Varian Users:
>
> Have you been able to convert data sets collected with an Inova spectrometer
> to Felix format? I've tried the conversion programs in the gifts directory
> of Felix and the (same) programs in the Varian userlib, but the data is not
> in the correct Felix format. These programs work fine for converting data
> collected on our Unity spectrometer. I feel like I've overlooked the
> obvious. Any suggestions? Does Inova data format differ from Unity data???

I have never tried to convert data from an Inova, but I had numerous
problems converting data from a Unity 300. I got the source code for
vnmr2felix from Darrell Davis (davis@adenosine.pharm.utah.edu) and
modified it to address two problems:

1. Double precision data (dp='y') led to a segmentation fault

2. In single precision 2-D experiments with receiver gain set
near the digitizer limit, the Unity divides by two as many times as
necessary and puts the number of divisions in the block header before
each FID in the 2-D file "fid". VNMR has no problem processing the data,
but Felix fails to correct for the scale factor and gives t1
interferograms that are really messed up.

The modified code checks for single/double precision and acts
accordingly, and for single precision data corrects for the scale
factor. I have used it both on SGI and Sun workstations to convert data
from Unity to Felix. You might try it on your Inova data, and if it
doesn't work you need to find out what the data format is from Inova. I
have "cracked" the format for Unity, Bruker AM, and Bruker AMX data, so I
have some experience figuring these things out. Varian is not at all
helpful, because they consider Felix to be in competition with VNMR. The
Unity data format is:

File Header - 32 bytes

[
Block Header - 28 bytes
FID - 2 Byte signed integers: real, imag, real, imag
]

where [] is repeated nfids times (nfids = ni * 2 for states, ni for tppi)
The file size is ((np*2) + 28)*nfids + 32 bytes. For double precision,
use 4 byte signed integers for the data and multiply np by 4 in the
formula for file size.

The header formats are:

File Header: nblocks 4 byte integer (=nfids)
ntraces "
np "
ebytes "
tbytes " (data bytes per block)
bbytes " (total bytes per block)
transfer 2 byte integer
status "
spare1 4 byte integer

Block Header: scale 2 byte integer (# of div. by 2)
status "
index "
spare3 "
ctcount 4 byte integer (scans per FID)
lpval 4 byte float (left phase)
rpval " (right phase)
lvl " (level)
tlt " (tilt)

The Felix format is much simpler:

[
Block Header - 8 bytes
bbytes 4 byte integer (bytes per block - 8)
datsiz 4 byte integer (np / 2)
FID data - 4 byte float - real, imag, real, imag, ...
Block Tail - 4 bytes
bbytes 4 byte integer (bytes per block - 8)
]

repeat [] times nfids
Filesize = (np*4 + 12)*nfids in bytes

While we're at it, the Bruker AM format is:

File Header - 768 bytes

[
FID - 24-bit signed integers in reverse byte order - real, imag,
real, imag, ...
]

with [] repeated nfids times. Filesize = (SI * 3)*NE + 768

The Bruker AMX format is:

[
FID - 4 byte signed integers in normal byte order - real, imag,
real, imag, ...
]
with [] repeated nfids times. Filesize = (SI * 4)*NE

We have now fashioned a c program to convert AMX and AM data to
Felix format by modifying the vnmr2felix source code (the gift from
Felix/Biosym/MSI are fortran programs).

To sleuth the Varian format (Inova), use the octal dump feature of unix:

od -x <varian filename> | head -800 > test1

This converts the first part of the varian binary file to a listing of
byte values in hexadecimal and puts it in a text file 800 lines long. By
replacing -x with -i or -l you can get the text file in integer or long
integer format (check the manual page for od in your operating system,
these option flags vary: man od)
Get an independent list of the point-by-point intensities from
VNMR for comparison. Have fun!

>
> Marty Pagel mpagel@indiana.edu --- __o
> Department of Chemistry Phone: (812)-855-6492 --- \<,
> Indiana University Fax: (812)-855-8300 --- ()/ ()
> Bloomington, IN 47405-4001 http://nmrsg1.chem.indiana.edu/~mpagel
>
>
>
>
>

My apologies to anyone who actually knows something about c
programming, unix, or dat formats. I can supply anyone who wants them
with source code for the mentioned programs, provided I am not violating
any major laws here.

Neil E. Jacobsen
NMR Facility Manager
Dept. of Chemistry
University of Arizona
Tucson, AZ 85721
520-621-8146
Fax 520-621-8407