topo

Version 2.01 August, 1997

David L. Windt

windt@bell-labs.com

Copyright (c) 1997, David L. Windt, Bell Laboratories, Lucent Technologies. All rights reserved


The topo library is a set of IDL routines for analyzing 1D or 2D surface topography (i.e., surface roughness) data. I originally wrote these routines in order to analyze WYKO and AFM data of optical surfaces, but the routines are general, and can be used to analyze any type of 1D or 2D topography data.

The available routines are listed below. In particular, the routines xanlz_prof and xanlz_surf are point-and-click (widget) applications for 1D and 2D analysis, respectively.

References

My understanding of surface roughness is based largely on the material contained in these two references:

1. J. M. Bennett and L. Mattsson, 'Introduction to Surface Roughness and Scattering' (Optical Society of America, Washington, D. C. 1989)

2. E. L. Church, 'Fractal surface finish', Applied Optics, 27 (8) 1518-1526 (1988)


Getting Started

See the README file in the topo directory for installation instructions.

Note: To use the topo library, you must be running IDL V4.01b or higher.

To load the topo library, at the IDL prompt type .run topostart:

IDL> .run topostart

Once the library has been loaded, you can use these routines as you would any IDL procedures and functions.

For instance, you might make up some 2D data like this:

IDL> x=vector(0.,100.,256)

IDL> y=x

IDL> z=randomn(seed,256,256)

and then try:

IDL> xanlz_surf,x,y,z

I've also included some sample WYKO data to play around with, called (oddly enough) 'wyko_example.dat'; you can read this file using the RD_WYKO function:

IDL> rd_wyko,x,y,z,file='wyko_example.dat'


NOTE: On Windows platforms, use the SWAP_ENDIAN keyword in the call to RD_WYKO when reading the 'wyko_example.dat' file:

IDL> rd_wyko,x,y,z,file='wyko_example.dat',/swap_endian


and then:

IDL> xanlz_surf,x,y,z


List of Routines

Last Updated: 14-August-1997


Routine Descriptions

ANGLE2WAVES

[Next Routine] [List of Routines]

 NAME:

        ANGLE2WAVES

 PURPOSE:

        Procedure to compute (and optionally plot) the spatial
        wavelengths corresponding to scattering for incidence angle
        ALPHA, wavelength LAMBDA, into scattering angles
        ALPHA+/-DELTA(0) to ALPHA+/-DELTA(1)

 CATEGORY:

        Topographic analysis

 CALLING SEQUENCE:

        ANGLE2WAVES,ALPHA,LAMBDA,DELTA,WAVES=WAVES
 
 INPUTS:

        ALPHA - A scalar or 1D array of incidence angles.

        LAMBDA - Scalar specifying the incidence wavelength.

        DELTA - 2-element array specifying the min and max scattering
                angles to consider.

 KEYWORD PARAMETERS:

        WAVES - Output array of spatial wavelengths, having
                dimensions [2,N_ELEMENTS(ALPHA)].  Units
                are the same as for LAMBDA.

        The following keywords only have an effect when ALPHA is an
        array:

        NOPLOT - Set to inhibit plotting the results.

        All IDL PLOT graphics keywords.

 PROCEDURE:

         WAVES=FLTARR(2,N_ELEMENTS(ALPHA))
         
         WAVES(0,*)=LAMBDA/2./SIN(DELTA(0)/2.*!DTOR)/
                    COS((ALPHA-DELTA(0)/2.)*!DTOR)
                    
         WAVES(1,*)=LAMBDA/2./SIN(DELTA(1)/2.*!DTOR)/
                    COS((ALPHA-DELTA(1)/2.)*!DTOR)

 EXAMPLE:

     Compute the range of spatial wavelengths (in angstroms)
     corresponding to scattering for 30 degree incidence, with
     scattering angles from 1 to 60 degrees (i.e., 30+/-1 to
     30+/-60), for a photon wavelength of 100 angstroms:
 
     ANGLE2WAVES,30.,100.,[1.,60.]

 MODIFICATION HISTORY:

      David L. Windt, Bell Laboratories, May 1997
      windt@bell-labs.com

(See ./angle2waves.pro)


ANLZ_PROF

[Previous Routine] [Next Routine] [List of Routines]

 NAME:

        ANLZ_PROF

 PURPOSE:

        Perform 2D analysis of X,Y profile data.  This procedure
        combines the functionality of several TOPO routines, and
        displays the results in a single composite plot, using the
        PLOT_PROF, PLOT_H_DIST, PLOT_S_DIST, PLOT_AUTOCOV, and
        PLOT_PSD routines.

        This routines is called by the XANLZ_PROF widget application.

 CATEGORY:

        Topographic analysis

 CALLING SEQUENCE:

        ANLZ_PROF,X,Y        
 
 INPUTS:

        X - 1D array of (equally spaced) lengths in angstroms.

        Y - 1D array of heights in angstroms.

 KEYWORD PARAMETERS:

        XREGION - 1D array of subscripts for X, specifying a
                  region-of-interest.
        
        SUB_TILT - Set to subtract tilt, using SUB_TILT
        
        HEIGHTS - Output array of heights (see HEIGHT_DIST), in units
                  determined by the value of TOPO.YUNITS_PTR (see
                  PROCEDURE below.)
        
        HEIGHT_HIST - Output array of height histogram values (See
                      HEIGHT_DIST)
        
        N_HEIGHTS - Number of heights to be used for HEIGHT_DIST
        
        NOFIT_HEIGHT - Set to inhibit fitting the height histogram
                       with a gaussian.
        
        SLOPES - Output array of slopes in degrees (See HEIGHT_DIST.)
        
        SLOPE_HIST - Output array of slope histogram values (See
                     HEIGHT_DIST)
        
        N_SLOPES - Number of slopes to be used for HEIGHT_DIST
        
        NOFIT_SLOPE - Set to inhibit fitting the height histogram
                      with a gaussian.
        
        TAU - Output array of lag lengths, in units determined by the
              value of TOPO.XUNITS_PTR (see PROCEDURE below.)
        
        AUTOCOV - Output array of autocovariance values, in units
                  determined by the value of TOPO.YUNITS_PTR (see
                  PROCEDURE below.)  For example, if TOPO.YUNITS_PTR=1,
                  then the AUTOCOV units will be nm^2.
        
        FIT_AUTOCOV - Same as FIT_TYPE keyword to PLOT_AUTOCOV.
        
        FREQ - Output array of spatial frequencies, in units
               determined by the value of TOPO.XUNITS_PTR (see
               PROCEDURE below.)  For example, if TOPO.XUNITS_PTR=1,
               then the FREQ units will be 1/nm.
        
        PSD - Output array of power-spectral-density values, in units
              determined by the value of TOPO.YUNITS_PTR (see
              PROCEDURE below.)  For example, if TOPO.YUNITS_PTR=1,
              then the PSD units will be nm^3.
        
        ZERO_PAD - See PROF2PSD
        
        HANNING - See PROF2PSD
        
        KAISER - See PROF2PSD
        
        RANGE - See PROF2PSD
        
        FIT_PSD - Same as FIT_TYPE keyword to PLOT_PSD
        
        PRSTYLE - 5-element array specifying
                  [COLOR,LINESTYLE,THICK,PSYM,SYMSIZE] keywords for
                  profile plot. (except that PSYM and SYMSIZE are
                  ignored!)
        
        HSTYLE - 5-element array specifying
                 [COLOR,LINESTYLE,THICK,PSYM,SYMSIZE] keywords for
                 height-histogram plot. (except that PSYM and SYMSIZE
                 are ignored!)
        
        SSTYLE - 5-element array specifying
                 [COLOR,LINESTYLE,THICK,PSYM,SYMSIZE] keywords for
                 slope-histogram plot. (except that PSYM and SYMSIZE
                 are ignored!)
        
        ASTYLE - 5-element array specifying
                 [COLOR,LINESTYLE,THICK,PSYM,SYMSIZE] keywords for
                 autocovariance plot.
        
        PSTYLE - 5-element array specifying
                 [COLOR,LINESTYLE,THICK,PSYM,SYMSIZE] keywords for
                 PSD plot.
        
        PRXAXIS - 4-element array specifyin
                  [XTYPE,XRANGE(0),XRANGE(1),XSTYLE] keywords for
                  profile plot.
        
        AXAXIS - 4-element array specifyin
                 [XTYPE,XRANGE(0),XRANGE(1),XSTYLE] keywords for
                 autocovariance plot.
        
        PXAXIS - 4-element array specifyin
                 [XTYPE,XRANGE(0),XRANGE(1),XSTYLE] keywords for
                 PSD plot.
        
        PRYAXIS - 4-element array specifyin
                  [YTYPE,YRANGE(0),YRANGE(1),YSTYLE] keywords for
                  profile plot.
        
        AYAXIS - 4-element array specifyin
                 [YTYPE,YRANGE(0),YRANGE(1),YSTYLE] keywords for
                 autocovariance plot.
        
        PYAXIS - 4-element array specifyin
                 [YTYPE,YRANGE(0),YRANGE(1),YSTYLE] keywords for PSD
                 plot.

 RESTRICTIONS:

       The X values must be equally spaced.
      
       X and Y must be in angstroms.

 PROCEDURE:

        Although X and Y must be in angstroms, the units for
        displayed (and returned keyword) variables are determined by
        the values of the relevant tags of the common block variable
        TOPO.
      
        That is, set TOPO.XUNITS_PTR to 0 for angstroms, 1 for nm, 2
        for microns, and 3 for mm.  Same goes for TOPO.YUNITS_PTR.

        The precision of the fit parameters that are labelled on the
        plots is determined by the values of the variables
        TOPO.XPRECISION for length-related parameters (e.g.,
        correlation length), TOPO.YPRECISION for height-related
        parameters (e.g., rms roughness), and TOPO.SPRECISION for
        slope-related parameters (e.g., rms slope.)  For example, if
        TOPO.XPRECISION=3, then three places to the right of the
        decimal will be displayed.
        
 MODIFICATION HISTORY:

      David L. Windt, Bell Laboratories, May 1997
      windt@bell-labs.com

(See ./anlz_prof.pro)


AUTOCOV2PARS

[Previous Routine] [Next Routine] [List of Routines]

 NAME:

        AUTOCOV2PARS

 PURPOSE:

        Procedure to compute the rms roughness SIGMA and correlation
        length L from the the autocovariance function, C(TAU).

 CATEGORY:

        Topographic analysis

 CALLING SEQUENCE:

        AUTOCOV2PARS,TAU,C,SIGMA,L
 
 INPUTS:

        TAU - 1D array of lag lengths.

        C - 1D array of autocovariance values.

 OUTPUTS:

        SIGMA - Rms roughness, in units determined by the units of C.
                For example, if [C]=nm^2, then [SIGMA]=nm.

        L - Correlation length, in same units as TAU.

 PROCEDURE:

        SIGMA=SQRT(C)

        L = 2/SIGMA^4 * Integral(C^2)

 MODIFICATION HISTORY:

      David L. Windt, Bell Laboratories, May 1997
      windt@bell-labs.com

(See ./autocov2pars.pro)


AUTOCOV2PSD

[Previous Routine] [Next Routine] [List of Routines]

 NAME:

        AUTOCOV2PSD

 PURPOSE:

        Function to compute the power-spectral-density function S(F)
        from the the autocovariance function, C(TAU).

 CATEGORY:

        Topographic analysis

 CALLING SEQUENCE:

        S=AUTOCOV2PSD(TAUX[,TAUY],C)
 
 INPUTS:

        TAUX - 1D array of lag lengths along X direction.

        TAUY - Optional 1D array of lag lengths along Y direction.

        C - 1D or 2D array of autocovariance values.

 OUTPUTS:

        S - 1D or 2D array of power-spectral-density values.

 KEYWORD PARAMETERS:

        FX - 1D output array of spatial frequencies along X
             direction.

        FY - 1D output array of spatial frequencies along Y
             direction.

        POSITIVE_ONLY - Set to only compute S(F) for positive spatial
                        frequencies.

        HANNING - Set to use a Hanning window function.

        RANGE - 2-element array specifying the min and max spatial
                frequency values to be considered.

 MODIFICATION HISTORY:

      David L. Windt, Bell Laboratories, May 1997
      windt@bell-labs.com

(See ./autocov2psd.pro)


AUTOCOV_FIT

[Previous Routine] [Next Routine] [List of Routines]

 NAME:

        AUTOCOV_FIT

 PURPOSE:

        Function to fit the autocovariance function with either a
        gaussian, and exponential, or a gaussian plus an exponential.

 CATEGORY:

        Topographic analysis

 CALLING SEQUENCE:

        Result=AUTOCOV_FIT(TAU,C,PARS,FIT=FIT)
 
 INPUTS:

        TAU - 1D array of lag lengths.

        C - 1D array of autocovariance values.

        FIT - Set to 0 to fit to a gaussian.  Set to 1 to fit to an
              exponential. Set to 2 to fit to a gaussian+exponential.

 OUTPUTS:

       Result - Fit function.

       PARS - 1-D array of fit parameters.

 PROCEDURE:

       The autocovariance function is fit using either the GAUSS_FIT,
       the EXPO_FIT, or the GAUSSEXPO_FIT functions.  See the
       documentation for these functions (in the windt library) for a
       desciption of the elements of PARS.

 MODIFICATION HISTORY:

      David L. Windt, Bell Laboratories, May 1997
      windt@bell-labs.com

(See ./autocov_fit.pro)


HEIGHT_DIST

[Previous Routine] [Next Routine] [List of Routines]

 NAME:

        HEIGHT_DIST

 PURPOSE:

        Function to compute the height histogram from X,Y profile
        data.  The function can also be used to compute the slope
        histogram, in conjunction with the PROF2SLOPE function.

 CATEGORY:

        Topographic analysis

 CALLING SEQUENCE:

        Result=HEIGHT_DIST(X,Y[,HEIGHTS])
 
 INPUTS:

        X - 1D array of (equally spaced) lengths.

        Y - 1D array of heights.

 KEYWORD PARAMETERS:

        N_HTS - Integer specifying the number of bins to be used in
                conjunction with the HISTOGRAM function.

        RANGE - 2-element array specifying the min and max height
                values to consider.

 OUTPUTS:

        Result - 1D array of density values. (See the HISTOGRAM
                 function.)

 OPTIONAL OUTPUTS:

        HEIGHTS - 1D array of height values; the i'th element of
                  Result is the density of heights in the i'th bin of
                  HEIGHTS.

 PROCEDURE:

        The HISTOGRAM function is used.

 MODIFICATION HISTORY:

      David L. Windt, Bell Laboratories, May 1997
      windt@bell-labs.com

(See ./height_dist.pro)


PARS2AUTOCOV

[Previous Routine] [Next Routine] [List of Routines]

 NAME:

        PARS2AUTOCOV

 PURPOSE:

        Function to generate an autocovariance function from an array
        of parameters describing the function.  This function is a
        sort of inverse of the AUTOCOV_FIT routine.

 CATEGORY:

        Topographic analysis

 CALLING SEQUENCE:

        C=PARS2AUTOCOV(TAUX[,TAUY],P,TYPE=TYPE)
 
 INPUTS:

        TAUX - 1D array of lag lengths along X direction.

        TAUY - Optional 1D array of lag lengths along Y direction.

        P - Array of parameters describing the function.  The number
            of elements of P required depends on the value of the
            TYPE keyword:

        TYPE - Keyword specifying the functional form for C: 0 for
               gaussian, 1 for exponential, 2 for
               gaussian+exponential.

 OUTPUTS:

        C - 1D or 2D array of autocovariance values.

 PROCEDURE:

        TYPE=0 - Gaussian:
          
                  C=P(0)^2*EXP(-(TAU/P(1))^2)+P(2)

        TYPE=1 - Exponential:
        
                  C=P(0)^2*EXP(-ABS(TAU)/P(1))+P(2)

        TYPE=2 - Gaussian+Exponential:

                  C=P(0)^2*EXP(-(TAU/P(1))^2)+P(2)^2*EXP(-ABS(TAU)/P(3))+P(4)

 MODIFICATION HISTORY:

      David L. Windt, Bell Laboratories, May 1997
      windt@bell-labs.com

(See ./pars2autocov.pro)


PARS2PSD

[Previous Routine] [Next Routine] [List of Routines]

 NAME:

        PARS2PSD

 PURPOSE:

        Function to generate a power-law power-spectral-density
        function from an array of parameters describing the function.
        This function is a sort of inverse of the PSD_FIT routine.

 CATEGORY:

        Topographic analysis

 CALLING SEQUENCE:

        S=PARS2PSD(FX[,FY],P)
 
 INPUTS:

        FX - 1D output array of spatial frequencies along X
             direction.

        FY - 1D output array of spatial frequencies along Y
             direction.

        P - 2-element array of parameters describing the power-law
            function.  P(0)= K_n, P(1)=n.

 OUTPUTS:

        S - 1D or 2D array of power-spectral-density values.

 PROCEDURE:

        For a 1D PSD function,

           S=P(0)/(ABS(F)^P(1))

        For a 2D PSD function,
        
           S=GAMMA((P(1)+1)/2)/2./GAMMA(.5)/GAMMA(P(1)/2.)* $
             P(0)/(ABS(F)^(P(1)+1)) 

 MODIFICATION HISTORY:

      David L. Windt, Bell Laboratories, May 1997
      windt@bell-labs.com

(See ./pars2psd.pro)


PLOT_AUTOCOV

[Previous Routine] [Next Routine] [List of Routines]

 NAME:

        PLOT_AUTOCOV

 PURPOSE:

        Procedure to plot and optionally fit the autocovariance
        function.

 CATEGORY:

        Topographic analysis

 CALLING SEQUENCE:

        PLOT_AUTOCOV,TAUX[,TAUY],C
 
 INPUTS:

        TAUX - 1D array of lag lengths along X direction, in units
               corresponding to the value of TOPO.XUNITS_PTR.
        
        TAUY - 1D array of lag lengths along Y direction, in units
               corresponding to the value of TOPO.YUNITS_PTR.
        
        C - 1D array of autocovariance values, in units corresponding
            to the value of TOPO.YUNITS_PTR.

 KEYWORD PARAMETERS:

        SIGMA - Output rms roughness, computed from C using
                AUTOCOV2PARS, in units corresponding to the value of
                TOPO.YUNITS_PTR.
        
        CORR_LENGTH - Correlation length, computed from C using
                      AUTOCOV2PARS, in units corresponding to the
                      value of TOPO.XUNITS_PTR.
        
        FIT_TYPE - Set to -1 for no fit, 0 for gaussian fit, 1 for
                   exponential fit, 2 for gaussian+exponential fit.
                
        REGION - Set to interactively select a region-of-interest for
                 fitting, using GET_ROI.
        
        CFIT - Output fit dependent variable.
                
        TAUFIT - Output fit independent variable.
        
        FIT_PARS - Fit parameters.  (See AUTOCOV_FIT.)

        FIT_COLOR - IDL graphics keyword for fit function.
                 
        FIT_THICK - IDL graphics keyword for fit function.
        
        FIT_LINESTYLE - IDL graphics keyword for fit function.
        
        NOLABEL - Set to inhibit labelling the SIGMA, L and fit
                  parameters values.
                
        LABEL_POSITION - Integer specifying label position, as per
                         PLOT_TEXT.
        
        Plus most IDL PLOT graphics keywords.
        
 RESTRICTIONS:

      The units for TAU and C must correspond to the values of the
      relevant tags of the common block variable TOPO.  That is, set
      TOPO.XUNITS_PTR to 0 for TAU in angstroms, 1 for nm, 2 for
      microns, and 3 for mm.  Similarly, set TOPO.YUNITS_PTR to 0 for
      C in angstroms^2, 1 for nm^2, 2 for microns^2, and 3 for mm^2.

      The precision of the fit parameters that are labelled on the
      plot is determined by the values of the variables
      TOPO.XPRECISION for length-related parameters (e.g.,
      correlation length), and TOPO.YPRECISION for height-related
      parameters (e.g., rms roughness).  For example, if
      TOPO.XPRECISION=3, then three places to the right of the
      decimal will be displayed.
        
 MODIFICATION HISTORY:

      David L. Windt, Bell Laboratories, May 1997
      windt@bell-labs.com

(See ./plot_autocov.pro)


PLOT_H_DIST

[Previous Routine] [Next Routine] [List of Routines]

 NAME:

        PLOT_H_DIST

 PURPOSE:

        Procedure to compute, plot and optionally fit a height
        histogram function.

 CATEGORY:

        Topographic analysis

 CALLING SEQUENCE:

        PLOT_H_DIST,X,Y
 
 INPUTS:

        X - 1D array of lengths, in units corresponding to the value
            of TOPO.XUNITS_PTR.
        
        Y - 1D array of heights, in units corresponding to the value
            of TOPO.YUNITS_PTR.
        
 KEYWORD PARAMETERS:

        N_HEIGHTS - Integer specifying the number of bins to be used
                    in conjunction with the HISTOGRAM function.

        HIST - 1D ouput array of density values. (See the HISTOGRAM
               function.)

        HEIGHTS - 1D output array of height values; the i'th element
                  of HIST is the density of heights in the i'th bin
                  of HEIGHTS.

        NOLABEL - Set to inhibit labelling the SIGMA, and L values.
                
        LABEL_POSITION - Integer specifying label position, as per
                         PLOT_TEXT.
        
        Plus most IDL PLOT graphics keywords.
        
 RESTRICTIONS:

      The units for X and Y must correspond to the values of the
      relevant tags of the common block variable TOPO.  That is, set
      TOPO.XUNITS_PTR to 0 for X in angstroms, 1 for nm, 2 for
      microns, and 3 for mm.  Similarly, set TOPO.YUNITS_PTR to 0 for
      Y in angstroms, 1 for nm, 2 for microns, and 3 for mm.

      The precision of the fit parameters that are labelled on the
      plot is determined by the values of the variables
      TOPO.XPRECISION for length-related parameters (e.g.,
      correlation length), and TOPO.YPRECISION for height-related
      parameters (e.g., rms roughness).  For example, if
      TOPO.XPRECISION=3, then three places to the right of the
      decimal will be displayed.
        
 PROCEDURE:

        HEIGHT_DIST is used to compute the height histogram function.
        
 MODIFICATION HISTORY:

      David L. Windt, Bell Laboratories, May 1997
      windt@bell-labs.com

(See ./plot_h_dist.pro)


PLOT_PROF

[Previous Routine] [Next Routine] [List of Routines]

 NAME:

        PLOT_PROF

 PURPOSE:

        Procedure to plot a profile function.

 CATEGORY:

        Topographic analysis

 CALLING SEQUENCE:

        PLOT_PROF,X,Y
 
 INPUTS:

        X - 1D array of lengths, in units corresponding to the value
            of TOPO.XUNITS_PTR.
        
        Y - 1D array of heights, in units corresponding to the value
            of TOPO.YUNITS_PTR.
        
 KEYWORD PARAMETERS:

        OVERPLOT - Set for overplot.

        NOLABEL - Set to inhibit labelling the SIGMA, and L values.
                
        LABEL_POSITION - Integer specifying label position, as per
                         PLOT_TEXT.
        
        Plus most IDL PLOT graphics keywords.
        
 RESTRICTIONS:

      The units for X and Y must correspond to the values of the
      relevant tags of the common block variable TOPO.  That is, set
      TOPO.XUNITS_PTR to 0 for X in angstroms, 1 for nm, 2 for
      microns, and 3 for mm.  Similarly, set TOPO.YUNITS_PTR to 0 for
      Y in angstroms, 1 for nm, 2 for microns, and 3 for mm.

      The precision of the parameters that are labelled on the
      plot is determined by the values of the variables
      TOPO.XPRECISION for length-related parameters (e.g.,
      correlation length), and TOPO.YPRECISION for height-related
      parameters (e.g., rms roughness).  For example, if
      TOPO.XPRECISION=3, then three places to the right of the
      decimal will be displayed.
        
 MODIFICATION HISTORY:

      David L. Windt, Bell Laboratories, May 1997
      windt@bell-labs.com

(See ./plot_prof.pro)


PLOT_PSD

[Previous Routine] [Next Routine] [List of Routines]

 NAME:

        PLOT_PSD

 PURPOSE:

        Procedure to plot and optionally fit the
        power-spectral-density function.

 CATEGORY:

        Topographic analysis

 CALLING SEQUENCE:

        PLOT_PSD,FX[,FY],S
 
 INPUTS:

        FX - 1D array of spatial frequencies along X direction, in
             units corresponding to the value of TOPO.XUNITS_PTR.
             For example, if TOPO.XUNITS_PTR=1, then [FX]=1/nm.
        
        FY - 1D array of spatial frequencies along Y direction, in
             units corresponding to the value of TOPO.XUNITS_PTR.
             For example, if TOPO.XUNITS_PTR=1, then [FY]=1/nm.
        
        S - 1D array of power-spectral-density values, in units
            corresponding to the value of TOPO.YUNITS_PTR.  For
            example, if TOPO.YUNITS_PTR=1, then [S]=nm^3.

 KEYWORD PARAMETERS:

        OVERPLOT - Set for overplot.

        SIGMA - Rms roughness, computed from S using PSD2PARS.
        
        CORR_LENGTH - Correlation length, computed from S using
                      PSD2PARS.
        
        FIT_TYPE - Set to -1 for no fit, 0 for power-law fit.
                
        REGION - Set to interactively select a region-of-interest for
                 fitting, using GET_ROI.

        TWOD - Set to indicate that the 1D PSD being plotted is
               actually a slice from a 2D PSD function, so that the
               units are labelled properly.
        
        SFIT - Output fit dependent variable.
                
        FFIT - Output fit independent variable.

        FIT_PARS - Fit parameters.  (See AUTOCOV_FIT.)

        FIT_COLOR - IDL graphics keyword for fit function.
                 
        FIT_THICK - IDL graphics keyword for fit function.
        
        FIT_LINESTYLE - IDL graphics keyword for fit function.
        
        NOLABEL - Set to inhibit labelling the SIGMA, L and fit
                  parameters values.
                
        LABEL_POSITION - Integer specifying label position, as per
                         PLOT_TEXT.
        
        Plus most IDL PLOT graphics keywords.
        
 RESTRICTIONS:

      The units for F and S must correspond to the values of the
      relevant tags of the common block variable TOPO.  That is, set
      TOPO.XUNITS_PTR to 0 for F in angstroms, 1 for nm, 2 for
      microns, and 3 for mm.  Similarly, set TOPO.YUNITS_PTR to 0 for
      S in angstroms^3, 1 for nm^3, 2 for microns^3, and 3 for mm^3.

      The precision of the fit parameters that are labelled on the
      plot is determined by the values of the variables
      TOPO.XPRECISION for length-related parameters (e.g.,
      correlation length), and TOPO.YPRECISION for height-related
      parameters (e.g., rms roughness).  For example, if
      TOPO.XPRECISION=3, then three places to the right of the
      decimal will be displayed.
        
 MODIFICATION HISTORY:

      David L. Windt, Bell Laboratories, May 1997
      windt@bell-labs.com

(See ./plot_psd.pro)


PLOT_SLOPE

[Previous Routine] [Next Routine] [List of Routines]

 NAME:

        PLOT_SLOPE

 PURPOSE:

        Procedure to plot a slope function.

 CATEGORY:

        Topographic analysis

 CALLING SEQUENCE:

        PLOT_SLOPE,X,SLOPE
 
 INPUTS:

        X - 1D array of lengths, in units corresponding to the value
            of TOPO.XUNITS_PTR.
        
        SLOPE - 1D array of slope values, in degrees.
        
 KEYWORD PARAMETERS:

        OVERPLOT - Set for overplot.

        NOLABEL - Set to inhibit labelling the SIGMA, and L values.
                
        LABEL_POSITION - Integer specifying label position, as per
                         PLOT_TEXT.
        
        Plus most IDL PLOT graphics keywords.
        
 RESTRICTIONS:

      The units for X must correspond to the value of the relevant
      tag of the common block variable TOPO.  That is, set
      TOPO.XUNITS_PTR to 0 for X in angstroms, 1 for nm, 2 for
      microns, and 3 for mm.

      The precision of the rms slope parameter that is labelled on
      the plot is determined by the value of the variable
      TOPO.SPRECISION.  For example, if TOPO.SPRECISION=3, then three
      places to the right of the decimal will be displayed.
        
 MODIFICATION HISTORY:

      David L. Windt, Bell Laboratories, May 1997
      windt@bell-labs.com

(See ./plot_slope.pro)


PLOT_S_DIST

[Previous Routine] [Next Routine] [List of Routines]

 NAME:

        PLOT_S_DIST

 PURPOSE:

        Procedure to compute, plot and optionally fit a slope
        histogram function.

 CATEGORY:

        Topographic analysis

 CALLING SEQUENCE:

        PLOT_S_DIST,X,Y
 
 INPUTS:

        X - 1D array of lengths, in units corresponding to the value
            of TOPO.XUNITS_PTR.
        
        Y - 1D array of heights, in units corresponding to the value
            of TOPO.YUNITS_PTR.
        
 KEYWORD PARAMETERS:

        N_SLOPES - Integer specifying the number of bins to be used
                   in conjunction with the HISTOGRAM function.

        HIST - 1D ouput array of density values. (See the HISTOGRAM
               function.)

        SLOPES - 1D output array of slope values; the i'th element of
                 HIST is the density of slopes in the i'th bin of
                 SLOPES.

        NOLABEL - Set to inhibit labelling the SIGMA, and L values.
                
        LABEL_POSITION - Integer specifying label position, as per
                         PLOT_TEXT.
        
        Plus most IDL PLOT graphics keywords.

 RESTRICTIONS:

      The units for X and Y must correspond to the values of the
      relevant tags of the common block variable TOPO.  That is, set
      TOPO.XUNITS_PTR to 0 for X in angstroms, 1 for nm, 2 for
      microns, and 3 for mm.  Similarly, set TOPO.YUNITS_PTR to 0 for
      Y in angstroms, 1 for nm, 2 for microns, and 3 for mm.

      The precision of the fit parameter (i.e., rms slope) that is
      labelled on the plot is determined by the value of the variable
      TOPO.SPRECISION.  For example, if TOPO.SPRECISION=3, then three
      places to the right of the decimal will be displayed.
        
 PROCEDURE:

      PROF2SLOPE is used to compute the slope values; HEIGHT_DIST
      is used to compute the slope histogram function.
        
 MODIFICATION HISTORY:

      David L. Windt, Bell Laboratories, May 1997
      windt@bell-labs.com

(See ./plot_s_dist.pro)


PROF2AUTOCOV

[Previous Routine] [Next Routine] [List of Routines]

 NAME:

        PROF2AUTOCOV

 PURPOSE:

        Function to compute the autocovariance function from the
        profile data.

 CATEGORY:

        Topographic analysis

 CALLING SEQUENCE:

        C=PROF2AUTOCOV(X,Y,TAU=TAU)
 
 INPUTS:

        X - 1D array of (equally-spaced) lengths.

        Y - 1D array of heights.

 OUTPUTS:

        TAU - 1D array of lag lengths, in units of [X].
        
        C - 1D array of autocovariance values, in units of [Y]^2.

 KEYWORD PARAMETERS:

        POSITIVE_ONLY - Set to compute the autocovariance function
                        for positive lag lengths only.

 RESTRICTIONS:

        The X values must be equally spaced.
    
 MODIFICATION HISTORY:

      David L. Windt, Bell Laboratories, May 1997
      windt@bell-labs.com

(See ./prof2autocov.pro)


PROF2PSD

[Previous Routine] [Next Routine] [List of Routines]

 NAME:

        PROF2PSD

 PURPOSE:

        Function to compute the power-spectral-density function from
        the profile data.

 CATEGORY:

        Topographic analysis

 CALLING SEQUENCE:

        S=PROF2PSD(X,Y,F=F)
 
 INPUTS:

        X - 1D array of (equally-spaced) lengths.

        Y - 1D array of heights.

 OUTPUTS:

        F - 1D array of spatial frequencies, in units of 1/[X].

        S - 1D array of PSD values, in units of [Y]^3.

 KEYWORD PARAMETERS:

        POSITIVE_ONLY - Set to compute the psd function for positive
                        frequencies only.

        RANGE - 2-element array specifying the min and max spatial
                frequencies to be considered. Default is from
                1/(length) to 1/(2*interval) (i.e., the Nyquist
                frequency), where length is the length of the scan,
                and interval is the spacing between points.

        ZERO_PAD - Set this to an integer specifying the number of
                   zero-height points to add on either side of the
                   profile data.

        HANNING - Set this to use a Hanning window function.

        KAISER - Set this to use a Kaiser-Bessel window function

 RESTRICTIONS:

        The X values must be equally spaced.
    
 PROCEDURE

       S=Length*ABS(FFT(Y*Window),-1)^2
 
       Where Length is as described above, and Window is the value of
       the optional window function (Hanning or Kaiser-Bessel).

 MODIFICATION HISTORY:

      David L. Windt, Bell Laboratories, May 1997
      windt@bell-labs.com

(See ./prof2psd.pro)


PROF2SLOPE

[Previous Routine] [Next Routine] [List of Routines]

 NAME:

        PROF2SLOPE

 PURPOSE:

        Function to compute the slope from the profile data.

 CATEGORY:

        Topographic analysis

 CALLING SEQUENCE:

        Result=PROF2SLOPE(X,Y)
 
 INPUTS:

        X - 1D array of (equally-spaced) lengths.

        Y - 1D array of heights.

 OUTPUTS:

        Result - 1D array of slope values, in degrees.

 RESTRICTIONS:

       The X values must be equally spaced.

       X and Y must have the same units.

 MODIFICATION HISTORY:

      David L. Windt, Bell Laboratories, May 1997
      windt@bell-labs.com

(See ./prof2slope.pro)


PSD2AUTOCOV

[Previous Routine] [Next Routine] [List of Routines]

 NAME:

        PSD2AUTOCOV

 PURPOSE:

        Function to compute the autocovariance function, C(TAU), from
        the the power-spectral-density function S(F).

 CATEGORY:

        Topographic analysis

 CALLING SEQUENCE:

        C=PSD2AUTOCOV(FX[,FY],S)
 
 INPUTS:

        FX - 1D array of spatial frequencies along X
             direction.

        FY - Optional 1D array of spatial frequencies along Y
             direction.

        S - 1D or 2D array of power-spectral-density values.

 OUTPUTS:

        C - 1D or 2D array of autocovariance values.

 KEYWORD PARAMETERS:

        TAUX - 1D output array of lag lengths along X direction.

        TAUY - 1D output array of lag lengths along Y direction.

 MODIFICATION HISTORY:

      David L. Windt, Bell Laboratories, May 1997
      windt@bell-labs.com

(See ./psd2autocov.pro)


PSD2PARS

[Previous Routine] [Next Routine] [List of Routines]

 NAME:

        PSD2PARS

 PURPOSE:

        Procedure to compute the rms roughness SIGMA and correlation
        length L from the the power-spectral-density function S(F).

 CATEGORY:

        Topographic analysis

 CALLING SEQUENCE:

        PSD2PARS,F,S,SIGMA,L
 
 INPUTS:

        F - 1D array of spatial frequencies.

        S - 1D array of power-spectral-density values.

 OUTPUTS:

        SIGMA - Rms roughness, in units of [S]^(1/3)

        L - Correlation length, in units of 1/[F]

 PROCEDURE:

        SIGMA=SQRT(2*Integral(S))

        L = 1/2/SIGMA^4 * Integral(S^2)

 MODIFICATION HISTORY:

      David L. Windt, Bell Laboratories, May 1997
      windt@bell-labs.com

(See ./psd2pars.pro)


PSDPARS2SIGMA_L

[Previous Routine] [Next Routine] [List of Routines]

 NAME:

        PSDPARS2SIGMA_L

 PURPOSE:

        Procedure to compute the rms roughness SIGMA and correlation
        length L from the scan LENGTH and the power-law parameters
        K_N and N.

 CATEGORY:

        Topographic analysis

 CALLING SEQUENCE:

        PSDPARS2SIGMA_L,K_N,N,LENGTH,SIGMA,L
 
 INPUTS:

        K_N - Power-law scaling factor.

        N - Power-law exponent.

        LENGTH - Scan length.

 OUTPUTS:

        SIGMA - Rms roughness.

        L - Correlation length.

 PROCEDURE:

        SIGMA = SQRT(K_n*LENGTH^(N-1)/(N-1))

        L = (N-1)^2*LENGTH/2/(2*N-1)

 MODIFICATION HISTORY:

      David L. Windt, Bell Laboratories, May 1997
      windt@bell-labs.com

(See ./psdpars2sigma_l.pro)


PSDPARS_ANGLE2SIGMA_L

[Previous Routine] [Next Routine] [List of Routines]

 NAME:

        PSDPARS_ANGLE2SIGMA_L

 PURPOSE:

        Function to compute the rms roughness SIGMA and correlation
        length L from (a) the maximum spatial wavelength
        corresponding to scattering for incidence angle ALPHA,
        wavelength LAMBDA, into scattering angles ALPHA+/-DELTA(0) to
        ALPHA+/-DELTA(1), and (b) the power-law parameters K_N and N.

 CATEGORY:

        Topographic analysis

 CALLING SEQUENCE:

        PSDPARS_ANGLE2SIGMA_L,K_N,N,ALPHA,LAMBDA,DELTA,SIGMA,L
 
 INPUTS:

        K_N - Power-law scaling factor.

        N - Power-law exponent.

        ALPHA - A scalar or 1D array of incidence angles.

        LAMBDA - Scalar specifying the incidence wavelength.

        DELTA - 2-element array specifying the min and max scattering
                angles to consider.

 OUTPUTS:

        SIGMA - Rms roughness.

        L - Correlation length.

 PROCEDURE:

        The ANGLE2WAVES procedure is used to compute the range of
        spatial wavelengths corresponding to scattering at incidence
        angle ALPHA, wavelength LAMBDA, into scattering angles
        ALPHA+/-DELTA(i).  The maximum wavelength is then used along
        with the specified K_N and N to compute SIGMA and L, using
        the PSDPARS2SIGMA_L routine.

 MODIFICATION HISTORY:

      David L. Windt, Bell Laboratories, May 1997
      windt@bell-labs.com

(See ./psdpars_angle2sigma_l.pro)


PSD_FIT

[Previous Routine] [Next Routine] [List of Routines]

 NAME:

        PSD_FIT

 PURPOSE:

        Function to fit the power-spectral-density function with
        a power-law.

 CATEGORY:

        Topographic analysis

 CALLING SEQUENCE:

        Result=PSD_FIT(F,S,PARS)
 
 INPUTS:

        F - 1D array of spatial frequencies.

        S - 1D array of power-spectral-density values.

 OUTPUTS:

       Result - Fit function.

       PARS - 1-D array of fit parameters.

 PROCEDURE:

       The autocovariance function is fit to the function
       
           S=P(0)/(ABS(F)^P(1))

 MODIFICATION HISTORY:

      David L. Windt, Bell Laboratories, May 1997
      windt@bell-labs.com

(See ./psd_fit.pro)


RD_DIGITAL_AFM

[Previous Routine] [Next Routine] [List of Routines]

 NAME:

       RD_DIGITAL_AFM
       
 PURPOSE:

       Read a Digital Instruments Nanoscope III AFM image.
       
 CALLING SEQUENCE:
 
       RD_DIGITAL_AFM,X,Y,Z
    
 KEYWORD PARAMETERS:
 
       FILE -  name of Nanoscope III data file.
   
       SPHERE_SUB - set to subtract a 2nd order polynomial
                    background.
   
       HIST_EQUAL - set to perform histogram equalization of image.
   
 OUTPUTS:

       X - Vector of x-position values, in angstroms.

       Y - Vector of y-position values, in angstroms.

       Z - Array of height values, in angstroms.
 
 MODIFICATION HISTORY:
 
   David L. Windt, Bell Labs, 1992.
   windt@bell-labs.com
   

(See ./rd_digital_afm.pro)


RD_GRIFFITH_AFM

[Previous Routine] [Next Routine] [List of Routines]

 NAME:

      RD_GRIFFITH_AFM
      
 PURPOSE:
 
      Read a Joe Griffith AFM file.
   
 CALLING SEQUENCE:
 
      RD_GRIFFITH_AFM,X,Y,Z 
   
 KEYWORD PARAMETERS:
 
      FILE - name of AFM data file, without the .arr ending.  It is
             assumed that both the .arr and .hed files exist.

      TILT_SUB - set to subtract tilt.
   
      SPHERE_SUB - set to subtract a 2nd order polynomial background.
   
      HIST_EQUAL - set to perform histogram equalization.
   
 OUTPUTS:

      X - Vector of x-position values, in angstroms.

      Y - Vector of y-position values, in angstroms.

      Z - Array of height values, in angstroms.
 
 MODIFICATION HISTORY:
 
   David L. Windt, Bell Labs, 1991.
   windt@bell-labs.com

(See ./rd_griffith_afm.pro)


RD_WYKO

[Previous Routine] [Next Routine] [List of Routines]

 NAME:

        RD_WYKO
        
 PURPOSE:

       Read a WYKO TOPO-3D data file.
       
 CALLING SEQUENCE:
 
       RD_WYKO,FILE=FILE,X,Y,Z,HEADER=HEADER
        
 KEYWORD PARAMETERS:
 
       FILE -  name of WYKO data file.
   
       OFFSET - set to skipping an additional 512 bytes ; at the
                beginning of the data file.  This additional 512-byte
                header is introduced by BASIC/UX when the file is
                transferred from an LIF to an HFS disk.
        
       SPHERE_SUB - set to subtract a 2nd order polynomial background.
   
       HIST_EQUAL - set to perform histogram equalization of image.
       SWAP_ENDIAN - set to use the SWAP_ENDIAN function to convert
                     the data file from 'big endian' to 'little
                     endian', or visa-versa. Useful for reading on a
                     Windows platform WYKO data files originally
                     stored on Unix or Mac platforms, or visa-versa.

   
 OUTPUTS:

       X - Vector of x-position values, in angstroms.

       Y - Vector of y-position values, in angstroms.

       Z - Array of height values, in angstroms.
 
 OPTIONAL OUTPUT PARAMETERS:
 
       HEADER - structure value containing the raw header information.
   
 MODIFICATION HISTORY:
 
   David L. Windt, Bell Laboratories, March 1991.
   windt@bell-labs.com
   August, 1997: Added SWAP_ENDIAN keyword.

(See ./rd_wyko.pro)


SUB_TILT

[Previous Routine] [Next Routine] [List of Routines]

 NAME:

        SUB_TILT

 PURPOSE:

        Function to subtract tilt (i.e., a straight line) from
        profile data.

 CATEGORY:

        Topographic analysis

 CALLING SEQUENCE:

        Result=SUB_TILT(X,Y,CURVATURE=CURVATURE)
 
 INPUTS:

        X - 1D array of lengths.

        Y - 1D array of heights.

 KEYWORD PARAMETERS:

        CURVATURE - Set to subtract a 2nd order polynomial instead of
                    a straight line.

 OUTPUTS:

        Result - The new profile data.

 EXAMPLE:

       NewY=SUB_TILT(X,Y)

 MODIFICATION HISTORY:

      David L. Windt, Bell Laboratories, May 1997
      windt@bell-labs.com

(See ./sub_tilt.pro)


SURF2AVE_PSD

[Previous Routine] [Next Routine] [List of Routines]

 NAME:

        SURF2AVE_PSD

 PURPOSE:

        Procedure to compute the average power-spectral-density
        functions along X and Y from surface data.

 CATEGORY:

        Topographic analysis

 CALLING SEQUENCE:

        SURF2AVE_PSD,X,Y,Z,XAVEPSD=XAVEPSD,YAVEPSD=YAVEPSD,
                           FX=FX,FY=FY,XPSD=XPSD,YPSD=YPSD
 
 INPUTS:

        X - 1D array of lengths along X direction.

        Y - 1D array of lengths along Y direction.

        Z - 2D array of heights.

 OUTPUTS:

        FX - 1D array of spatial frequencies along X direction, in
             units of 1/[X].

        FY - 1D array of spatial frequencies along Y direction, in
             units of 1/[Y].

        XAVEPSD - 1D array of PSD values = average of XPSD along Y
                  direction, in units of [Z]^4.

        YAVEPSD - 1D array of PSD values = average of YPSD along X
                  direction, in units of [Z]^4.

        XPSD - 2D array of PSD values computed along X direction, in
               units of [Z]^4.

        YPSD - 2D array of PSD values computed along Y direction, in
               units of [Z]^4.

 KEYWORD PARAMETERS:

        POSITIVE_ONLY - Set to compute the autocovariance function
                        for positive lag lengths only.

        RANGE - 2-element array specifying the min and max spatial
                frequencies to be considered. Default is from
                1/(length) to 1/(2*interval) (i.e., the Nyquist
                frequency), where length is the length of the scan,
                and interval is the spacing between points.

        ZERO_PAD - Set this to an integer specifying the number of
                   zero-height points to add on either side of the
                   profile data.

        HANNING - Set this to use a Hanning window function.

        KAISER - Set this to use a Kaiser-Bessel window function

 MODIFICATION HISTORY:

      David L. Windt, Bell Laboratories, May 1997
      windt@bell-labs.com

(See ./surf2ave_psd.pro)


SURF2PSD

[Previous Routine] [Next Routine] [List of Routines]

 NAME:

        SURF2PSD

 PURPOSE:

        Function to compute the 2D power-spectral-density function
        from surface data.

 CATEGORY:

        Topographic analysis

 CALLING SEQUENCE:

        S=SURF2PSD(X,Y,Z,FX=FX,FY=FY)
 
 INPUTS:

        X - 1D array of lengths along X direction.

        Y - 1D array of lengths along Y direction.

        Z - 2D array of heights.

 OUTPUTS:

        Result - 2D PSD function, in units of [Z]^4.

        FX - 1D array of spatial frequencies along X direction, in
             units of 1/[X].

        FY - 1D array of spatial frequencies along Y direction, in
             units of 1/[Y].

 KEYWORD PARAMETERS:

        POSITIVE_ONLY - Set to compute the autocovariance function
                        for positive lag lengths only.

        XRANGE - 2-element array specifying the min and max spatial
                 frequencies along X direction to be
                 considered. Default is from 1/(Xlength) to
                 1/(2*interval) (i.e., the Nyquist frequency), where
                 Xlength is the length of the scan along X, and
                 interval is the spacing between points.

        YRANGE - 2-element array specifying the min and max spatial
                 frequencies along Y direction to be
                 considered. Default is from 1/(Ylength) to
                 1/(2*interval) (i.e., the Nyquist frequency), where
                 Ylength is the length of the scan alogn Y, and
                 interval is the spacing between points.

        ZERO_PAD - Set this to an integer specifying the number of
                   zero-height points to add on either side of the
                   profile data.

        HANNING - Set this to use a Hanning window function.

        KAISER - Set this to use a Kaiser-Bessel window function

 PROCEDURE:

       S=XLength*YLength*ABS(FFT(Z*Window),-1)^2
 
       Where XLength and YLength are as described above, and Window
       is the value of the optional window function (Hanning or
       Kaiser-Bessel).

 MODIFICATION HISTORY:

      David L. Windt, Bell Laboratories, May 1997
      windt@bell-labs.com

(See ./surf2psd.pro)


TOPOSTART

[Previous Routine] [Next Routine] [List of Routines]

 NAME:

        TOPOSTART

 PURPOSE:

        The start procedure for the TOPO surface topography library.

 CATEGORY:

        Topographic analysis

 CALLING SEQUENCE:

        At the IDL command line, type ".run TOPOSTART".
 
 COMMON BLOCKS:

        COMMON TOPO,TOPOHOME,TOPO
        COMMON PLOT_PRINT,PRINTPARS (See PLOT_PRINT)

 PROCEDURE:

        The site-configuration file (topositeconfig.pro) is read,
        defining widget fonts, etc.  The topo save file is loaded
        into IDL, using the RESTORE command.

 RESTRICTIONS:
 
        UNITS and PRECISION:

        When using any of the topo plot procedures: PLOT_PROF,
        PLOT_SLOPE, PLOT_H_DIST, PLOT_S_DIST, PLOT_AUTOCOV, and
        PLOT_PSD; or the procedures ANLZ_PROF, XANLZ_PROF, and
        XANLZ_SURF, the data length (X for 1D, or X and Y for 2D) and
        height (Y for 1D, or Z for 2D) units MUST ALL BE IN
        ANGSTROMS.  However, the common block variable TOPO is used
        to control the units that are actually displayed.
        
        In particular, the variables TOPO.XUNITS_PTR and
        TOPO.YUNITS_PTR determine the units for lengths and heights,
        respectively; set TOPO.XUNITS_PTR to 0 for angstroms, 1 for
        nm, 2 for microns, or 3 for mm.  Same goes for
        TOPO.YUNITS_PTR.

        The precision of the fit parameters that are labelled on the
        plots is determined by the values of the variables
        TOPO.XPRECISION for length-related parameters (e.g.,
        correlation length), TOPO.YPRECISION for height-related
        parameters (e.g., rms roughness), and TOPO.SPRECISION for
        slope-related parameters (e.g., rms slope.)  For example, if
        TOPO.XPRECISION=3, then three places to the right of the
        decimal will be displayed.

        The TOPO.*UNITS_PTR and TOPO.*PRECISION variables can either
        be set explicitly before executing any of the aforementioned
        procedures, or they can be set transparently to the user be
        selecting the appropriate menu items when using the
        XANLZ_SURF or XANLZ_PROF procedure.

 MODIFICATION HISTORY:

      David L. Windt, Bell Laboratories, May 1997
      windt@bell-labs.com

(See ./topostart.pro)


TOPO_X_CONVERT

[Previous Routine] [Next Routine] [List of Routines]

 NAME:

        TOPO_X_CONVERT

 PURPOSE:

        Function to convert length variables according to the value
        of the common block variable TOPO.XUNITS_PTR.
        

 CATEGORY:

        Topographic analysis

 CALLING SEQUENCE:

        NewX=TOPO_X_CONVERT(X)

 INPUTS:

        X - 1D array of length values, in angstroms.

 OUTPUTS:

        Result - 1D array of length values, in units specified by
                 TOPO.XUNITS_PTR, i.e., 1 => angstroms, 2 => nm, 3 =>
                 microns, and 4 => mm.

 KEYWORD PARAMETERS:

        TO_ANGSTROMS - Set to convert an input X from the units
                       specified by TOPO.XUNITS_PTR to angstroms.
 
 COMMON BLOCKS:

        COMMON TOPO

 MODIFICATION HISTORY:

      David L. Windt, Bell Laboratories, May 1997
      windt@bell-labs.com

(See ./topo_x_convert.pro)


TOPO_Y_CONVERT

[Previous Routine] [Next Routine] [List of Routines]

 NAME:

        TOPO_Y_CONVERT

 PURPOSE:

        Function to convert height variables according to the value
        of the common block variable TOPO.YUNITS_PTR.
        

 CATEGORY:

        Topographic analysis

 CALLING SEQUENCE:

        NewY=TOPO_Y_CONVERT(Y)

 INPUTS:

        Y - 1D array of height values, in angstroms.

 OUTPUTS:

        Result - 1D array of height values, in units specified by
                 TOPO.YUNITS_PTR, i.e., 1 => angstroms, 2 => nm, 3 =>
                 microns, and 4 => mm.

 KEYWORD PARAMETERS:

        TO_ANGSTROMS - Set to convert an input Y from the units
                       specified by TOPO.YUNITS_PTR to angstroms.
 
 COMMON BLOCKS:

        COMMON TOPO

 MODIFICATION HISTORY:

      David L. Windt, Bell Laboratories, May 1997
      windt@bell-labs.com

(See ./topo_y_convert.pro)


XANLZ_PROF

[Previous Routine] [Next Routine] [List of Routines]

 NAME:

        XANLZ_PROF

 PURPOSE:

        A widget application for 1D profile analysis.  This program
        is really a widget interface to the ANLZ_PROF routine.

 CATEGORY:

        Topographic analysis

 CALLING SEQUENCE:

        XANLZ_PROF[,X,Y,GROUP=GROUP]
 
 OPTIONAL INPUTS:

        X - 1D array of (equally-spaced) lengths, in angstroms.

        Y - 1D array of heights, in angstroms.

 KEYWORD PARAMETERS:

        GROUP - Widget GROUP_LEADER keyword to XMANAGER.

 COMMON BLOCKS:

        COMMON TOPO
        COMMON PLOT_PRINT

 RESTRICTIONS:

        The X values must be equally spaced.
      
        X and Y must be in angstroms.

 PROCEDURE:

        Although X and Y must be in angstroms, the units for
        displayed variables are determined by the values of the
        relevant tags of the common block variable TOPO.
      
        That is, set TOPO.XUNITS_PTR to 0 for angstroms, 1 for nm, 2
        for microns, and 3 for mm.  Same goes for TOPO.YUNITS_PTR.

        The precision of the fit parameters that are labelled on the
        plots is determined by the values of the variables
        TOPO.XPRECISION for length-related parameters (e.g.,
        correlation length), TOPO.YPRECISION for height-related
        parameters (e.g., rms roughness), and TOPO.SPRECISION for
        slope-related parameters (e.g., rms slope.)  For example, if
        TOPO.XPRECISION=3, then three places to the right of the
        decimal will be displayed.

        The TOPO.*UNITS_PTR and TOPO.*PRECISION variables can either
        be set explicitly before executing this procedure, or they
        can be set transparently to the user be selecting the
        appropriate menu items once the procedure is running.


        If no data are passed, the user is prompted to enter the IDL
        command string used to read in new data.  This command string
        *must explicitly define X and Y in angstroms*.  For example,
        if your data is in the form of a plain text (ASCII) file,
        consisting of two columns of data, X and Y, then you can use
        the EROM routine, as in

        EROM,X,Y,FILE='MyProfile.dat'

        If your data is not in this form then you will probably
        need to write your own IDL procedure to read in the data,
        with X and Y as explicit parameters, i.e.,

        MY_PROCEDURE,X,Y

        or

        Result=MY_FUNCTION(X,Y)

        Once the profile data are defined, this routine uses the
        ANLZ_PROF routine to compute the height distribution, the
        slope distribution, the autocovariance, and the
        power-spectral-density, with optional fitting, and displays
        the results in a composite plot that can be printed using
        PLOT_PRINT.  Various popup-widgets are used to adjust the
        computations, fits and plots to the users preference.

        No common blocks are used that prevent multiple instances
        of this routine from being used.
      
 MODIFICATION HISTORY:

      David L. Windt, Bell Laboratories, May 1997
      windt@bell-labs.com

(See ./xanlz_prof.pro)


XANLZ_SURF

[Previous Routine] [List of Routines]

 NAME:

        XANLZ_SURF

 PURPOSE:

        A widget application for 2D surface analysis.  

 CATEGORY:

        Topographic analysis

 CALLING SEQUENCE:

        XANLZ_SURF[,X,Y,Z]
 
 OPTIONAL INPUTS:

        X - 1D array of (equally-spaced) lengths along X direction,
            in angstroms.

        Y - 1D array of (equally-spaced) lengths along Y direction,
            in angstroms.

        Z - 2D array of heights, in angstroms.

 COMMON BLOCKS:

        COMMON TOPO
        COMMON PLOT_PRINT
        COMMON XANLZ_SURF

 RESTRICTIONS:

        The X and Y values must be equally spaced.
      
        X, Y and Z must be in angstroms.

 PROCEDURE:

        Although X, Y and Z must be in angstroms, the units for
        displayed variables are determined by the values of the
        relevant tags of the common block variable TOPO.
      
        That is, set TOPO.XUNITS_PTR to 0 for X and Y angstroms, 1
        for nm, 2 for microns, and 3 for mm.  Similarly, set
        TOPO.YUNITS_PTR to 0 for Z in angstroms, 1 for nm, 2 for
        microns, and 3 for mm.

        The precision of the fit parameters that are labelled on the
        plots is determined by the values of the variables
        TOPO.XPRECISION for length-related parameters (e.g.,
        correlation length), TOPO.YPRECISION for height-related
        parameters (e.g., rms roughness), and TOPO.SPRECISION for
        slope-related parameters (e.g., rms slope.)  For example, if
        TOPO.XPRECISION=3, then three places to the right of the
        decimal will be displayed.

        The TOPO.*UNITS_PTR and TOPO.*PRECISION variables can either
        be set explicitly before executing this procedure, or they
        can be set transparently to the user be selecting the
        appropriate menu items once the procedure is running.


        If no data are passed, the user is prompted to enter
        the IDL command string used to read in new data.  This
        command string *must explicitly define X and Y*.  For
        example, if you're reading in WYKO TOPO-3D data, you can
        use the RD_WYKO procedure, as in 

        RD_WYKO,X,Y,Z,FILE='MyProfile.dat'

        You might also try the RD_DIGITAL_AFM procedure for reading
        in data obtained with the Digital Instruments Nanoscope III
        atomic force microscope.

        If you cannot use RD_WYKO or RD_DIGITAL_AFM, then you will
        need to write your own IDL procedure to read in the data,
        with X, Y and Z as explicit parameters, i.e.,

        MY_PROCEDURE,X,Y,Z

        or

        Result=MY_FUNCTION(X,Y,Z)

        (The TOPO distribution includes some sample WYKO data, in a
        file called 'wyko_example.dat'.)

        Once the surface data are defined, the user can select
        interactively 1D profiles along X or Y.  These profiles are
        plotted, as are the corresponding PSD functions.  The user
        can also select X or Y profiles for more detailed analysis
        using the XANLZ_PROF routine, which can be called directly
        from XANLZ_SURF.

 MODIFICATION HISTORY:

      David L. Windt, Bell Laboratories, May 1997
      windt@bell-labs.com

(See ./xanlz_surf.pro)