Input Examples.

2D Processing examples.

A 2D NMR data set is recorded on the AM-500 spectrometer and transferred to a MicroVAX 3400 using 1/2-inch tape. The following script file performs all necessary steps to Fourier transform the spectrum, and plot the whole spectrum on one page on a HP LaserJet series II:

#!/bin/csh
IOmfft <kdc02_1.inp
IOmfft <kdc02_2.inp
IOmreal /sgi320/nmr/bk/data/kdc02
IOmcnt <kdc02_3.inp
lp -dihplj -og kdc02.hpl

The two IOmfft statements perform the FFT in the two dimensions, respectively. The IOmcnt statement makes the contour plot. The IOmreal program strips off the imaginary part of the data points, thus halving the size of the data file. The last line sends the contour file to the laser printer. Processing is performed on the SGI machines.

The content of the input file to the first FFT (kdc02_1.inp) is as follows:

DATAFILE kdc02 1 1 sgi320 bk
NEWFILE 2048 2048
DIMENSION 0
LOAD /dia2/nmr/bk/ser/KDC02.ser
EM -12
GM 12
SINESIZE 2048
ZERO 2048
SETEXP 1024
PPM 0.0 4.81
PPFIX NOESY
PHASE 300 24
BFIX

The LOAD statement makes the program load the SER file directly from the VAX disk, via NFS. The NEWFILE statement reserves space for a 2048 x 2048 matrix. The SETEXP parameter defines the number of slices actually recorded. The number of complex points in dimension 1 will be half that number. If the experiment was stopped before all slices were recorded, this number must be lowered accordingly. The SINESIZE should be set to the actual number of complex points in dimension number 0.

The content of the input file to the second FFT (kdc02_2.inp) is as follows:

DATAFILE kdc02 1 1 sgi320 bk
DIMENSION 1
PHASE 90 41
PPM 0.0 4.81
SSINE 2.6
SINESIZE 512
ZERO 2048
NORMALIZE 85.0 1.00

A squared sinebell (SSINE), shifted pi/2.6 is used as a window function. The NORMALIZE statement scales the data so that 85 % of the data points numerically are below 1.0.

The content of the input file to the IOmcnt program (kdc02_3.inp) is as follows:

DEVICE HPLJSII kdc02.hpl
DATAFILE kdc02 1 1 sgi320 bk
TITLE BLUE
KDC02 2048 x 2048 points.
BORDER BLUE
GRID BLUE
LABELS BLUE
LEVELS 5
NLEVELS 5
LOW 2
NLOW -10
HIGH 10
NHIGH -2
COLOR BLACK
NCOLOR RED 1 5
NTICK 10
CHARSIZE 0.3
PEN NO
XDIM 0
YDIM 1
XRANGE -2 12
YRANGE -2 12
GO
QUIT

Ten contours are plotted, five for positive levels in the range 2 - 10, and five for the corresponding negative levels. The x-axis is the fast dimension, and the y-axis is the slow dimension. The positive levels will be plotted in solid lines, and the negative levels in 0.5 intensity lines. The color specifications for the border, labels, and grid are ignored on the laser printer; they will be plotted as solid lines. In this way the same input file can easily be changed to provide output to a pen plotter, simply replace the device name with HP7550 and change PEN NO to PEN YES. You will then get a plot with blue borders, grids and labels, black positive contours, and red negative contours.

Contouring on multiple pages.

It is often practical to contour the whole spectrum in a series of 1 x 1 ppm plots. This can be done using the following script and input files:

#!/bin/csh
@ ylow = - 2
while ( $ylow < 11)
  @ yhigh= $ylow + 1
  @ xlow= - 2
  while ( $xlow < 11)
    @ yhigh= $ylow + 1
    sed <cnt.inp -e s/ylow/$ylow/g \
    -e s/yhigh/$yhigh/g \
    -e s/xlow/$xlow/g \
    -e s/xhigh/$xhigh/g |IOmcnt|lp -dihplj -og
    @ xlow= $xhigh
  end
  @ ylow= $yhigh
end

The file cnt.inp contains the following statements:

DEVICE HPLJSII
DATAFILE kdc02 1 1 sgi320 bk
BORDER BLUE
GRID BLUE
LABELS BLUE
LEVELS 10
LOW 2.0
HIGH 10.0
CHARSIZE 0.5
PEN NO
XDIM 0
YDIM 0
XRANGE ylow xhigh
YRANGE ylow yhigh
EXTRAFRAME 0.05
COLOR BLACK
GO
QUIT

The script file contains two loops. The first loop increments the range in the y dimension (ylow to yhigh), the second loop increments the range in the x dimension (xlow to xhigh). The UNIX command sed replaces the text "xlow" with the value of the variable xlow, "xhigh" with xhigh, "ylow" with ylow, and "yhigh" with yhigh in the file cnt.inp, and pipes the result to the MCNT program. As no output has been specified in the DEVICE statement, the graphics output will be written to standard output, which in this case is sent to the printer queue with the UNIX command: lp. Normally, the contouring process will be faster than the laser printer, so you should make sure that all the graphics output (approx. 0.5 Mb per page) can fit on the disk where the printer spooling is performed. If the interface code is written in a special way (as on the UNIX machines at Carlsberg Laboratory, see the printer setup description on page 14), a special option can be set on the lp command: "-omcnt". This option will make the interface code pipe the file to be printed through the IOmcnt program. In this case you only need to submit the (short) input files for the MCNT program to the queue, and contouring will be performed while printing is done. Note, because EXTRAFRAME has been specified, the size of each plot will be 1.1 x 1.1 ppm, making it easier to locate peaks that otherwise would be located with half in one plot, and half in another plot.

Processing 3D data.

A 3D spectrum is recorded on the AMX-600 spectrometer, written on a 1/2-inch tape, and read into the Stardent 1500 machine. The following script file will do the three FFT's, baseline correction, and plot out two planes.

#!/bin/csh
TOmfft < vdc03_1.inp
TOmfft < vdc03_2.inp
TOmfft < vdc03_3.inp
TOmreal /vis/nmr/mk/data/vdc03
TOmbase vdc03 1 1 vis mk 0 3
TOmcnt <vdc03_4.inp
lp -dihplj -og vdc03p.hpl
TOmcnt <vdc03_5.inp
lp -dihplj -og vdc03q.hpl

The three TOmfft statements perform the FFT in the three dimensions, respectively. The TOmreal statement strips off the imaginary part of the slices. The TOmbase performs a baseline correction. The two TOmcnt statements plot out two selected planes.

The spectrum is recorded with 512 x 128 x 32 complex points, 1H is detected in the first dimensions, and 15N in the last dimension. The size of the ser file is thus 512x2x128x2x32x2x4 = 67108864 bytes.

The content of the first input file is as follows:

DATAFILE vdc03 1 1 vis mk
NEWFILE 384 256 128
DIMENSION 0
LOADTYPE 2 512 600.140774 8474.588
LOAD /vis/data/mk/nmr/vdc3d03/3/ser
EXTRACT 40 423
ZERO 1024
CCGM 200 400
SETEXP 256 64
PPM 0.0 4.75
FREQUENCY 600.140774
SWEEP 8474.588
BFIX
PPFIX RR
PHASE 30 0
NPROC 2

The NEWFILE statement defines the final size of the spectrum as 384 x 256 x 128 points, requiring 100 Mb before stripping off the imaginary part. The LOADTYPE is set to 2, as the file has been recorded on an AMX machine (or recorded on an AM machine, transferred to an X-32 workstation, and then transferred to the Stardent 1500 machine, either by tape or by TCP/IP (the tape being the safest way). Only the ser file is consulted by the program, so you must supply all parameters (number of dimensions, spectrometer frequency, sweep width, and number of points in all dimensions). The slices are zerofilled to 1024 complex points before FFT, and only the 384 points starting from point number 40 are stored in the data file. The BFIX statement is used because the real and imaginary parts of the points in the fastest dimension have been sampled alternatingly.

The input file for the second dimension is as follows:

DATAFILE vdc03 1 1 vis mk
DIMENSION 1
FREQUENCY 600.140774
SWEEP 8474.58
ZERO 512
EXTRACT 0 255
SINESIZE 128
CCGM 140 200
PPM 0.0 4.75
REDFIELD
PPFIX RR
BFIX
PHASE 0 180
NPROC 2

The FID in this dimension contains 128 points, hence the SINESIZE of 128. This is extended to 512 points, FFT'ed, and the first 256 points are stored in the data file. The REDFIELD and BFIX are necessary because TPPI has been used in this dimension.

The input file for the FFT in the last dimension looks like this:

DATAFILE vdc03 1 1 vis mk
DIMENSION 2
FREQUENCY 60.818672
SWEEP 2500.00
ZERO 128
SINESIZE 128
CCGM 50 100
PPM 0.0 0.0
NORMALIZE 85.0 1.0
REDFIELD
BFIX
PHASE 0 180
NPROC 2

REDFIELD and BFIX again have been used because TPPI has been used to obtain pure phase in the dimension as well. The frequency has been set differently for this dimension, because 15N has been detected instead of 1H.

The input file for the first contouring looks like:

DEVICE HPLJSII vdc03p.hpl
DATAFILE vdc03 1 1 vis mk
VIEWPORT 3 97 3 97
TITLE BLUE
VDC03 (30,0)(0,180)(0,180)
BORDER BLUE
GRID BLUE
LABELS BLUE
LEVELS 10
NLEVELS 10
LOW 1
HIGH 5
NCOLOR RED 1 5
NLOW -5
NHIGH -1
NTICK 10
CHARSIZE 0.3
PEN NO
XDIM 0
YDIM 1
PLANE 2 82
XRANGE 6 8
YRANGE 6 8
COLOR BLACK
GO
QUIT

The 82nd 15N plane is plotted (counting from 0 to 127), the x axis being the range 6 to 8 ppm in dimension 0, and the y axis the range 6 to 8 in dimension 1.

Input to the second contouring is:

DEVICE HPLJSII vdc03q.hpl
DATAFILE vdc03 1 1 vis mk
VIEWPORT 3 97 3 97
TITLE BLUE
VDC03 (30,0)(0,180)(0,180)
BORDER BLUE
GRID BLUE
LABELS BLUE
LEVELS 10
NLEVELS 10
LOW 1
HIGH 5
NCOLOR RED 1 5
NLOW -5
NHIGH -1
NTICK 10
CHARSIZE 0.3
PEN NO
XDIM 1
YDIM 2
PLANE 0 310
XRANGE 6 8
YRANGE -10 10
ASPECT NO
COLOR BLACK
GO
QUIT

Plane number 310 (counting from 0 to 383) in the fastest dimension is plotted. The range in the x-axis is from 6 to 8 ppm in dimension 1, and the y-axis is from -10 to 10 in dimension 2, the 15N dimension. Because the x- and y-dimensions contain ppm axes corresponding to different nuclei, ASPECT is set to NO to avoid a very distorted display.

Contouring 3D data.

Planes in a 3D spectrum normally contain only a few peaks. It is therefor possible to contour the whole range in dimension 0 and 1 for each 15N plane. This can be set up using a loop in a script file as follows:

#!/bin/csh
@ planeno = 0
while ( $planeno < 128)
  sed <cnt3d.inp -e s/planeno/$planeno/g | TOmcnt | lp -dihplj -og
  @ planeno= $planeno + 1
end

The file cnt3d.inp contains the following statements:

DEVICE HPLJSII
DATAFILE vdc03 1 1 vis mk
VIEWPORT 3 97 3 97
TITLE BLUE
VDC03 PLANE NUMBER: planeno
BORDER BLUE
GRID BLUE
LABELS BLUE
LEVELS 10
NLEVELS 10
LOW 1
HIGH 5
NCOLOR RED 1 5
NLOW -5
NHIGH -1
NTICK 10
CHARSIZE 0.3
PEN NO
XDIM 0
YDIM 1
PLANE 2 planeno
XRANGE 5 10
YRANGE 5 10
COLOR BLACK
GO
QUIT

The text: "planeno" is replaced twice with the variable planeno: First for the title text, and then in the PLANE statement that selects the actual plane. The output will be 128 contour plots in the printer queue, each requiring approximately 0.5 Mb of disk space. See the text for mcnt how to reduce the disk space used by the printer spooler.



Last updated: 18-Mar-1998
Questions/comments: mk@crc.dk