setup

To use Topdrawer it may be necessary to set it up. To do this: $ SETUP TOPDRAWER If you wish to use the previous old version: $ SETUP TOPDRAWER.OLD If you wish to use the version currently being tested: $ SETUP TOPDRAWER.TEST

introduction

TOPDRAWER is fairly easy to use if you confine yourself to simple plots. First invoke TOPDRAWER by typing: $ TOPDRAWER You are then prompted: TD: You first enter your data as a set of X,Y,DX,DY values. The DX,DY may be omitted if no error bars are needed. Each data point is specified on a separate line. For example a line going from 0,0 to 1,1 is specified as: TD:0,0 TD:1,1 Then the data may be plotted as a set of points with error bars (if DX,DY are not zero) by typing the command: TD:PLOT

If you wish to produce a histogram use the command: TD:HISTOGRAM On the other hand if you wish to plot a smooth curve type: TD:JOIN For series of straight lines connecting the points: TD:JOIN 1 (1 segment per interval) To put a title at the top: TD:TITLE TOP 'This is my title' To put a title at the bottom: TD:TITLE BOTTOM 'This is the X axis' To put a title on the left: TD:TITLE LEFT 'This is the Y axis'

If you are done, you then type: TD:EXIT

Now you liked the plot, but you wish to change a few things. The commands you typed are in file TD.TDJ. You may edit this file to correct any mistakes you made. You also should rename it: $ RENAME TD.TDJ MYPLOT.TOP and invoke TOPDRAWER again. Now instead of typing all the commands in, just type: SET FILE IN 'MYPLOT' TOPDRAWER will re-execute the commands in the file. Now you wish to get the plots out on the Postscript printer. so you type: TD:SET DEVICE POSTSCR Then replot the data by typing: TD:SET FILE IN 'MYPLOT' Finally type: TD:EXIT

Now the plot is printed on the Talaris by: PRINT MYPLOT.PS

More plots may be added to the first plot by entering more data, and then either PLOT, HISTOGRAM, or JOIN. Each command may be modified by extra commands to make the plot more pleasing. For example if you type: TD:HISTOGRAM DOTS RED Then the histogram will be formed with red dotted lines. This is useful to differentiate it from other previously plotted histograms.

philosophy

TOPDRAWER is designed to plot and manipulate data. It assumes that data consists of X vs Y with errors DX, DY. It may be X,Y vs Z with errors DX,DY,DZ. You may also specify NDX,NDY or NDZ the negative part of the error bars separately from DX,DY or DZ. The data may be a histogram in which case DX would be the bin width, or it may be a set of discrete points with unrelated errors. You may plot the data accordingly.

There is also an auxiliary set of coordinates, that may be used for data manipulation, but not plotting. They are U,DU,NDU,V,DV,NDV,W,DW,NDW To plot the data in these coordinates they must be moved to X,Y,Z coordinates. This is easily done with the SWAP command.

The basic plotting operations are: 1. PLOT plots the data with optional error bars. 2. JOIN joins the data points with line segments. 3. HISTOGRAM plot the data as a histogram. 4. BAR plots the data as a bar chart (similar to a histogram)

operation

The following command invokes TOPDRAWER: $ TOPDRAWER [filename [device1 [device2...]]] [/options] If the filename is omitted you are prompted with TD:

You then start typing in commands to TOPDRAWER.

If you start TOPDRAWER from a batch stream, the commands follow the $ TOPDRAWER command.

Additional Information on:

  • filename
  • devices
  • options
  • devices

    The device may be specified on the command line. Otherwise TD sets the output device according to the logical name PLOT_TERM or if it is not defined PLOT_DEVICE. If neither is defined the device is assumed to be a Talaris printer.

    Normally PLOT_TERM is automatically set when you log in. It is not defined for a batch job. This means that TD uses your terminal when in interactive mode, and the Talaris while in a batch stream. The login procedure defines PLOT_TERM by asking the terminal for its ANSWERBACK message. This message must be set properly inside the terminal. You need to know how to SET-UP the ANSWERBACK message. For more information see:COMMANDS SET DEVICE

    Additional Information on:

  • List_of_devices
  • input

    Normally TOPDRAWER gets primary input from either a batch file, or your terminal (SYS$INPUT). You may have secondary input files by using the command: TD:SET FILE INPUT filename

    If you run TOPDRAWER interactively, but from an indirect command file, the input will be from the file that invoked TOPDRAWER. If you wish to have input from the terminal, you may assign TT: to SYS$INPUT temporarily by: $ ASSIGN /USER TT: SYS$INPUT $ TOPDRAWER

    You should not do this in BATCH, as TT: is the default output for the graphics. You may get data from output files generated by histogram packages. For more information on this see:Command SET HISTOGRAM.

    Some input may be made via the cross hair cursor. For example SHOW CURSOR brings up the cursor on your terminal. Move the cursor to the location you desire, and press any key except "Return" The current location of the cursor will be typed and entered into the journal file as a comment. Some other commands that use the cursor are ARROW, BOX, CIRCLE, ELLIPSE, TITLE, SET WINDOW, and SET LIMITS.

    The input string may not be longer than 256 characters. If you need to omit columns or set up a special format for the commands: SET CARD and SET FORMAT.

    For more information see:TOPDRAWER DATA.

    output

    TD produces the following output: 1. Plot - This may be on your terminal, LPA0:, another terminal, or a file on disk. The plot data format and file is modified by the command: TD:SET DEVICE Plot output for a device other than your terminal is a file whose name matches the input file name, and whose type is assigned according to the device. If there is no input file name, the output file name is UGDEVICE. You can define logical name TOPDRAWER_OUTPUT to specify a name of your choice.

    File types are: CAL - Calcomp Microfiche HPGL - HPGL IMG - Imagen PS - Postscript PTX - Printronix Q - QMS REG - Regis, Gigi, etc. SIX - Sixels TEK - Tektronix VEP - Versatek XCL - Talarix EXCL

    2. Listing - This lists all TD commands you used in a session. This is normally TD.LIS, but the name may be changed by the command: TD:SET FILE OUTPUT 'newfilename' If you do not want a list file: TD:SET MODE LIST OFF or... TD:SET FILE OUTPUT NL: 3. Journal - This file contains all commands entered interactively. It is normally file TD.TDJ, but the name may be changed by the command: TD:SET FILE JOURNAL 'newfilename' You may temporarily turn off journaling by: TD:SET MODE JOURNAL OFF 4. Errors - A temporary file TOPDRAWER_ERRORS.DAT is used to save the error messages for the current plot. This file is only opened for interactive sessions. 5. Data - You may use the LIST command to output data sets suitable for input to TOPDRAWER. If you do not specify the output file it goes to the Listing (TD.LIS).

    set_up

    You may specify a setup file to initialize TOPDRAWER. This is done by specifying the logical name TOPDRAWER_INIT. TOPDRAWER_INIT should point to a file with TOPDRAWER commands to be executed when TD first starts. The default file name is TDINIT.TOP. If you have a setup file then then journal file and listing file are suppressed. You must start them in the setup file if you want them.

    example $ ASSIGN TDHBOOK TOPDRAWER_INIT

    The file TDHBOOK.TOP contains the commands: TD:SET HIST HBOOK FILE="hbook.dat" TD:DEFINE KEY PF3 "SET HIST TITLE PREV;NEW;HIST"/TERMINATE TD:DEFINE KEY PF4 "SET HIST TITLE NEXT;NEW;HIST"/TERMINATE TD:SET FILE JOURNAL HISTS.TDJ

    Now when you start TOPDRAWER your hbook histograms are already available, and keypad keys are defined to easily access them. Your journal file is HISTS.TDJ and you have no listing file.

    You assign: $ ASSIGN TOPDRAWER_INIT SYS$LOGIN The file TDINIT.TOP in your root default login directory is used as the TOPDRAWER initialization file.

    data

    TOPDRAWER accepts data in a variety of forms.

    Additional Information on:

  • expressions
  • order
  • Numbers
  • points
  • Symbols
  • Time-Angles-Dates
  • types
  • ON|OFF
  • examples
  • Coordinate_frame

    There are 2 different sets of frames used in creating plots. They are DATA and TEXT frames. TEXT is always specified in inches Unless modified by either a SET SIZE or SET UNITS command. The character and symbol sizes and are all specified in tenths of inches. Both of these may be changed by the SET UNITS command. The actual data is in the DATA frame, which is mapped to the physical (TEXT) frame at the time of plotting. The plots are all scaled automatically, unless you use the command SET LIMITS to specify the scale. All commands which plot "things" work in either the DATA or the TEXT frame. You may select the frame with the option DATA or TEXT. In addition if 3d coordinates are used the frame is automatically DATA.

    The DATA frame is not mapped to the TEXT frame until a plotting command or a command which uses the data frame is used. Plotting commands are JOIN, HISTOGRAM, PLOT and so on. Commands which use the data frame are ARROW DATA, BOX DATA, TITLE DATA and so on. If you wish to have TOPDRAWER automatically set the data frame, you should supply the data before any commands which reference the data frame.

    Several commands modify the data frame, once it has been defined: SET WINDOW SET LIMITS SET THREE SET SIZE SET SCALE These commands allow you to overlay different plots with different scales. Just reading in new data does not change the current data frame.

    Fonts

    There are several fonts available in the unified graphics. They are: EXTENDED and DUPLEX.

    The EXTENDED and DUPLEX support many sets of characters. The DUPLEX set is slow compared to the extended set, but it looks almost like printed characters if you use a high resolution device. The alternate character sets are determined by a character pair. The first character determines the actual character printer, the second one determines the case.

    Additional Information on:

  • list_of_fonts
  • Roman
  • Greek
  • Cyrillic
  • Punctuation
  • Math symbols
  • Theoretic
  • Arrows
  • Physics
  • Astronomical
  • Markers
  • Drawing
  • Movement
  • Subscript
  • Character_size
  • Position
  • examples
  • Setting_fonts
  • 3-Dimensional_plots

    TOPDRAWER will do a variety of 3-d plots. You can plot a series of separate graphs superimposed on a third axis, or you can enter an array of data to be plotted with hidden line removal. The array of data is entered by the READ MESH command. The mesh is then plotted by the HISTOGRAM ,JOIN or PLOT commands. 1. HISTOGRAM BLOCK produces a block or "Lego" plot of mesh data. 2. JOIN produces a mesh surface. 3. SET THREE OFF;PLOT produces a scatter plot of mesh data. 4. CONTOUR produces a contour plot.

    Axes are not automatically added to 3-d graphs so you must use the command PLOT AXES. You may turn each axis on separately using the SET AXIS command and then PLOT AXES X,Y,Z to place each axis in a convenient location.

    The command SET THREE is used to specify the "viewpoint" of a 3-d plot. SET SCALE is also used to specify the range and type of scale to use along each of the X,Y,Z axes.

    3-d plots may also be built from a series of 2-d plots. To do this you must provide z values and: TD:SET THREE ON Then either JOIN, HISTOGRAM or PLOT is used to plot the data. Normally Z is the dependent variable, and X,Y are the independent variables. If this rule is violated, 3-d histograms will not be correctly plotted. Your data may be moved with the SWAP command if you need to get it into the correct variables.

    Additional Information on:

  • Axes_example
  • Histograms

    TOPDRAWER can read files written by other histogram packages, and then plot them. Support is provided for the HBOOK histogram package. For more information see: SET HISTOGRAM

    COMMANDS

    Additional Information on:

  • format_of_commands
  • question_mark
  • list_of_commands
  • options
  • TITLE
  • WHITE...
  • ADD
  • SUBTRACT
  • ARROW
  • BARGRAPH
  • BIN
  • BOX
  • CASE
  • CIRCLE
  • CONTOUR
  • CONVOLUTE
  • CREATE
  • DATA
  • DELETE
  • DEFINE
  • DIAMOND
  • DIVIDE
  • DU
  • DV
  • DW
  • DX
  • DY
  • DZ
  • ELLIPSE
  • ELSE
  • ENDFILE
  • ENDIF
  • ENDREPEAT
  • CLEAR
  • FFT
  • FILL
  • FIT
  • FLUSH
  • FREQUENCY
  • HISTOGRAM
  • HELP
  • IF
  • INTERPOLATE
  • JOIN
  • LIST
  • MERGE
  • MONITOR
  • MORE
  • MULTIPLY
  • NEW_FRAME
  • NDU
  • NDV
  • NDW
  • NDX
  • NDY
  • NDZ
  • PAUSE
  • PLOT
  • PROJECT
  • READ
  • REPEAT
  • RESTORE
  • SAVE
  • SET
  • SHOW
  • SMOOTH
  • SORT
  • SPAWN
  • STOP
  • SWAP
  • SYMBOL
  • TITLE
  • TRANSFORM
  • TYPE
  • U
  • V
  • W
  • X
  • Y
  • Z
  • Lexical_values

    You have access to data via lexicals. For example you may access the sum, mean, standard deviation of your data set and put them into a title. See:Command TITLE. Quantities such as points, sum etc. are calculated by a SET STATISTICS or SHOW DATA command. If you do not use SET STATISTICS or SHOW DATA to generate them, they are automatically calculated from the entire data set. Whenever you modify the data set, you must use SET STATISTICS to set the statistics if you wish the lexicals to represent only a subset of the data. To use a lexical value you must use a symbol of the form: T_NAME, S_NAME, or V_NAME. The T_NAME inserts the value of the name into a title string. V_NAME or <NAME> is used to get the value as a number. S_NAME gets a value as a string. You may define lexical values by the command DEFINE VALUE or DEFINE STRING.

    The lexicals may be abbreviated to the shortest unique name. For convenience V_ may be omitted inside an expression. This will increase the time to parse an expression. For example <V_XVALUE> is the same as <XVALUE> or V_XV.

    Additional Information on:

  • list_of_names
  • values
  • REPEAT
  • examples
  • Examples

    There are several files that give examples of TOPDRAWER plots. Fonts + 2 dimensional graphics TOPDRAWER_ROOT:[EXAMPLES]TDINTRO.TOP 3 dimensional graphics TOPDRAWER_ROOT:[EXAMPLES]TD3D.TOP Character set TOPDRAWER_ROOT:[EXAMPLES]FONT_TABLE.TOP Color graphics on VT-240 or GIGI TOPDRAWER_ROOT:[EXAMPLES]COLORGRAPH.TOP Test routines TOPDRAWER_ROOT:[EXAMPLES]BENCH.TOP TOPDRAWER_ROOT:[EXAMPLES]RESOLUTION_TEST.TOP TOPDRAWER_ROOT:[EXAMPLES]FIT_TEST.TOP Test to make sure coefficients and errors are correct TOPDRAWER_ROOT:[EXAMPLES]FIT_GAUS_COEF_TEST.TOP TOPDRAWER_ROOT:[EXAMPLES]FIT_EXP_COEF_TEST.TOP TOPDRAWER_ROOT:[EXAMPLES]FIT_PARABOLA_COEF_TEST.TOP

    Subroutines

    The TOPDRAWER package is available as a collection of subroutines. You can call them to produce plots from any program. Each subroutine is the same as giving a TOPDRAWER command. They are available in library: TOPDRAWER_DIR:TOPDRAWER

    Additional Information on:

  • names
  • strings
  • unit_numbers
  • linking
  • Demo_program
  • List_of_Subroutines
  • CPUTIM
  • CPULIM
  • HELP
  • INTRAC
  • SPAWN
  • TRACE
  • READPR
  • DEFKEY
  • TDARRO
  • TDCRCL
  • TDEND
  • TDFLSH
  • TDGETV
  • TDHIST
  • TDJOIN
  • TDLIMS
  • TDNEW
  • TDNEWP
  • TDPLOT
  • TDPLT
  • TDSET
  • TDSETS
  • TDSHOW
  • TDTEXT
  • TDTITL
  • TDTSET
  • TD3JIN
  • TD3HST
  • TDVAX_PLOT
  • T2CURS
  • T2MAIN
  • T2UPCS
  • T2SQEZ
  • T2_TRAP
  • linking

    If you wish to link a program so that it may share HBOOK4 histograms with TOPDRAWER, you need to do the following:

    1. Insert the following lines of code into your main program. INTEGER HCREATEG PARAMETER IHSIZE=100000 COMMON /PAWC/MEMORY(IHSIZE) ...... ISTAT=HCREATEG('region_name',MEMORY,IHSIZE) IF (ISTAT .le. 0) STOP 'Can not create region' CALL HLIMIT(IHSIZE) You may adjust the IHSIZE to the proper value.

    2. When you link you must also include: TOPDRAWER_DIR:TD_GROUP/OPT To give users in your group only read access to your histograms. ISTAT=HCREATEG('region_name',MEMORY,-IHSIZE) or link using.... TOPDRAWER_DIR:TD/OPT TD_GROUP uses a modified version of HCREATEG rather than the standard CERN version. The modified one in addition to setting up group read/write protection on the section also prevents creation of the same global section by more than 1 person. It creates a new version instead. It will type out the name of the created global section. The modified version will create a read only section if -IHSIZE is passed to it.

    To create a global section HCREATEG must open a scratch file. The modified version attempts to do this on SYS$SCRATCH:. By reassigning the scratch device you may put this file on a disk with enough quota. $ DEFINE SYS$SCRATCH USR$SCRATCH:[name]

    For information about using the TD subroutines: SEE:SUBROUTINES

    Revisions

    The original sources were written by: Roger B. Chaffee Computation Research Group Stanford Linear Accelerator Center Stanford, California

    Modified: J. Clement All syntax has been "regularized" and extended for convenience.

    Additional Information on:

  • Obsolete_commands
  • 86
  • 87
  • 88
  • 89
  • 90
  • 91
  • Installation

    To install topdrawer on your system, copy the files in TOPDRAWERROOT:[*...] to a directory of your choice. Execute the SETUP.COM procedure to create the necessary local TOPDRAWER symbols and logics. On the FNAL cluster, the files are placed in LIB:[LIB.TOPDRAWER.version], and SETUP TOPDRAWER causes the SETUP.COM procedure to be run. The TOPDRAWER.HLP help library module has been placed in the LIB alternate help library.

    You may wish to rename and delete some of the executables, if your system lacks Xwindows or GKS. 1. TOPDRAWERMIN has neither Xwindows nor GKS support. 2. TOPDRAWER has Xwindows but not GKS. 3. TOPDRAWERGKS has both.

    Author

    This version is heavily modified from the original written by: Roger B. Chaffee Computation Research Group Stanford Linear Accelerator Center Stanford, California U.S.A.

    The original docuementation is: CGTM 178 - November 1980

    This version was written by: John Clement Bonner Nuclear Lab Rice University P.O. Box 1892 Houston, Tx, 77251 (713) 527-8101 x 2037 Internet: CLEMENT@PHYSICS.RICE.EDU Bitnet: CLEMENT@RICEVM1 Hepnet: FNBIT::RIPHYS::CLEMENT or... RIPHYS::CLEMENT