# Int 2d.m

2D spectral integrator. Calls plot_2d.m and then launches either an interactive integration procedure (if no range file name is given) and records the range data into a file, or runs an automatic integ- ration if the range file name from a previous run is supplied. Syntax:

   int_2d(spin_system,spectrum,parameters,ncont,delta,k,ncol,...
m,signs,filename)


The following functions are used to compute contour levels:

 cont_levs_pos=delta(2)*xmax*linspace(0,1,ncont).^k+xmax*delta(1);
cont_levs_neg=delta(2)*xmin*linspace(0,1,ncont).^k+xmin*delta(1);


where:

   * xmax and xmin are calculated from the spectrum;

   * delta is the minimum and maximum elevation (as a fraction of total
intensity) of the contours above the baseline. A reasonable value
for most 2D spectra is [0.02 0.2 0.02 0.2]. The first pair of num-
bers refers to the positive contours and the second pair to the
negative ones.

* ncont is the number of contours, a reasonable value is 20.

   * k controls the curvature of the contour spacing function: k=1
corresponds to linear spacing and k>1 bends the spacing curve to
increase the sampling density near the baseline. A reasonable
value is 2;

   * ncol is a number of colors in the colormap (around 256 is fine);

   * m is the curvature of the colormap: m=1 corresponds to a linear
color ramp into the red for positive contours and into the blue
for negative contours. A reasonable value for high-contrast
plotting is 6.

   * signs can be set to 'positive', 'negative' or 'both' - this will
cause the corresponding contours to be plotted.

The following subfields are required inthe parameters structure:

   parameters.sweep              one or two sweep widths, Hz

   parameters.spins              cell array with one ot two character
strings specifying the working spins.

   parameters.offset             one or two transmitter offsets, Hz

   parameters.axis_units         axis units ('ppm','Hz','Gauss')