2.36                      ******************
                                  * CTOUR WRITE-UP *
                                  ******************
 
       
           CTOUR is a program to create contoured plots of electron density
        maps which can then be displayed or printed. The program accepts an
        input map which is prepared by FSFOUR in the default orientation
        (NORN=0), along with limit, direction and contouring information. 
        The output consists of one or more generic metafiles which can be
        converted to the format needed for a given display by the appropriate
        driver program, several of which are provided. Multiple plots can be
        created within a single run, with each plot consisting of either an
        individual map section, a mono projection over multiple sections, or a
        stereo projection over multiple sections. Any map region may be
        selected and viewed down either a direct cell axis or a reciprocal
        cell axis (the latter used for projections). The metafiles created
        will have the names plt001.plt, plt002.plt etc and can be viewed
        via the driver programs VIEWPLT or VIEWPLT_X (on SGI or X-window
        supporting workstations), by PLTTEK (on terminals supporting TEKTRONIX
        4010 graphics) or converted to PostScript for subsequent printing
        by MKPOST. Note that in general program MAPVIEW (or MAPVIEW_X) would
        be preferred to examine contoured plots, since it allows the 
        interactive selection (and modification) of orientation, region and
        contouring intervals. In some instances CTOUR has advantages however,
        as it facilitates creation of hard copies for examination away from the
        terminal or workstation, for creation of minimaps, and for stereo 
        plots. CTOUR is very useful for examination of difference Patterson
        maps, where for example, all of the Harker sections can be generated
        and then displayed simultaneously with the program VIEWPLT (or
        VIEWPLT_X). It is recommended that one first examine the plots with
        VIEWPLT or VIEWPLT_X before converting to PostScript as this can
        be done extremely rapidly, whereas printing and even simply
        displaying PostScript files can be much more time consuming. 


   
                            INPUT DATA  (UNIT 5)

        
        CARD I       MAPFIL       (free format)
        
                     MAPFIL = Input map file (from FSFOUR, in default
                              orientation i.e. NORN=0)
        
        
                                                           
        CARD II      CMIN,CMAX,CSTEP,IGRID,PSIZE,VDIS,RSCALE   (free format)
        
                     CMIN  =
                              Minimum, maximum and increment for contour
                     CMAX  =
                              levels, on the scale set by RSCALE (see below)
                     CSTEP =


                     IGRID = 0 To include labels and border on plots

                           = 1 To include labels, border and grid lines on
                               plots (facilitates coordinate measurment for
                               Pattersons)

                           = 2 To eliminate labels, grid lines and border on
                               plots


                     PSIZE = Plot size in inches (usually 10. if hard copy 
                             is to be produced).

                     

                     VDIS  = View distance in inches (usually 30., used
                             only for stereo plots. Decreasing it increases
                             the stereo effect).

                   
                    RSCALE = Sets density scale for contours. If 0., then 
                             density is scaled such that the largest value
                             in the unit cell is 999. If > 0., then the
                             density is on an absolute scale (minus the
                             F000/V term) when the F's used in map creation
                             are related to an absolute scale by the
                             factor RSCALE, i.e when F(abs)=RSCALE*F(input).
                             Regardless of the choice, the min, max and
                             sigma for the map on the chosen scale will be
                             listed on the output, and can be used to set
                             contour levels for a subsequent run.      
        
       
      **** The following card can be repeated as many times as desired ****
 
        CARDS III    NSEC,XMN,XMX,YMN,YMX,ZMN,ZMX,NORN      (free format)
        
       
                     NSEC  = 0 for individual sections, one plot per
                               section

                           = 1 for mono projection, one plot for entire
                               range

                           = 2 for stereo projection, one plot for
                               entire range


                      XMN  = 
        
                      XMX  = 
       
                      YMN  =  Minimum, maximum coordinates (fractional)
                              in a, b and c directions defining map     
                      YMX  =  volume to be contoured.

                      ZMN  =
                 
                      ZMX  =


                      NORN = 1 view as YZ sections (look down a or a*)

                           = 2 view as XZ sections (look down b or b*)

                           = 3 view as XY sections (look down c or c*)



                        ************** EXAMPLES **************

         1) The following script will compute a Patterson map and contour
            three Harker sections. Three generic plot files (having the
            names pltNNN.plt where NNN is a three digit number) will be
            created. We start contouring at about 3% of the origin peak
            height, which will be scaled to 999. and increase in steps
            of 1% of the origin peak. We request that labels and a grid
            are included to facilitate coordinate measurement. Finally,
            we convert the generic plot files to Postscript. The
            corresponding PostScript files will have the names pltNNN.pst


            #compute the difference Patterson map
            #
            fsfour << eod > fsfour.l
            seb.pam
            Difference Patterson, 3A 
            0 48 72 80 5 0 20 0 0 0 0.
            patt.ref
            patt.map
            eod
            #
            #now contour three Harker sections
            #
            ctour << eod2 > ctour.l
            patt.map
            30. 999. 10. 1 10. 30. 0.
            0  0.5 0.5  0.0 1.0  0.0 1.0  1
            0  0.0 1.0  0.5 0.5  0.0 1.0  2
            0  0.0 1.0  0.0 1.0  0.5 0.5  3
            eod2
            #
            #now convert all generic plot files to PostScript
            #
            mkpost *.plt
            #

         2) The following script will compute an MIR map and generate
            a series of plots. First a small mono projection down the b*
            axis is created. Then a minimap is made, contouring
            individual sections. We start contouring at one sigma
            and increase to the maximum in steps of sigma. Min, max
            and sigma values were obtained from the log from a prior
            short run which contoured only a single section. Labels
            and a border are requested, but no grid lines. Finally,
            all generic plot files are created to PostScript.


            #compute the solvent flattened MIR map
            #
            fsfour << eod > fsfour.l
            pdc.pam
            PDC MIR MAP, 3A 
            0 144 80 120 1 0 20 0 0 0 0.
            phi16cy.31
            mir.map
            eod
            #
            #now contour both a projection and individual sections
            #
            ctour << eod2 > ctour.l
            mir.map
            146. 999. 146. 0 10. 30. 0.
            1  -.5 .5  -.05 .05  -.5 .5 2
            0  -.42 .45  -.45 .42  -.08 .56 2
            eod2
            #
            #now convert all generic plot files to PostScript
            #
            mkpost *.plt
            #