\chapter Customization Instructions
%%1 Customization

\! This chapter gives instructions for customizing the Powder Suite package. 
For the package to operate it must know where to find various files, 
for example, where the JCPDS-ICDD files are located. In addition the 
package is written to support a wide range of terminals and graphics
devices and the program must be instructed what type of devices it
will use. This information is stored in VMS logical names beginning 
with |PS_| (VMS commands |$ DEFINE| and |$ ASSIGN| define logical 
names, command\<
|      $ SHOW LOGICAL PS_*    |\<
will show the definitions.
For convenience, the definitions are defined in one file, but users 
may override these definitions. 

The first time the PS command procedure (|PS.COM|) is used, and at any 
later time if the INIT option is used, the DCL procedure defines all of 
the symbols and logical names required by the package which are found 
in file |PS_EXE:PS_INIT.COM|. This file is located in the same directory 
as the executable versions of the programs, |[PS.EXE]| or |[dir.PS.EXE]|. 
When Powder Suite is installed, this file is updated to reflect the 
definitions need for the local computer environment (device names etc.).

In addition each user can have one or more customized |PS_LOCALINIT.COM| 
files. When the initialization is done (the first time |PS.COM| is called 
or when using the menu INIT option), after executing the commands 
in file |PS_EXE:PS_INIT.COM|, the following locations are searched
(in the order specified):
\TAB 
	(1) file |PS_LOCALINIT.COM| in the current default directory
\TAB 
	(2) file |PS_LOCALINIT.COM| in the current login directory (as 
		defined by logical name |SYS$LOGIN|)
\TAB 
	(3) file |PS_EXE:LOCAL.COM|

The first file to be found, if any, is the only one to be run. 

Thus, by placing |PS_LOCALINIT.COM| files in different 
locations, different sets of logical names may be used for
different purposes.

If the user does not supply a |PS_LOCALINIT.COM| file, and file 
|PS_EXE:LOCAL.COM| exists, this file will be run. This file can be 
used to supply local initialization options for the Powder Suite.

A ``news'' file, |PS_EXE:PSNEWS.INIT|, is displayed each time the 
package is initialized, if this file exists. This file is intended
to alert users to updates or other changes in the programs.

\subrub Local command file
%%2 Local_com_file

The person installing Powder Suite may create a command file,
|PS_EXE:LOCAL.COM|, to set the logical names used by the 
Powder Suite programs. If this file exists, and there is are no 
|PS_LOCALINIT.COM| files in a user's default or login directory, this
file may be used to establish a menu of options for defining these
logical names. A typical application for use of this file would be
to offer the user a choice of hard-copy graphics devices.

An example local command file is shown below. In this case the user 
is able to choose between a PostScript laser printer (on a remote 
computer) and a pen plotter attached to the local system. Additional
examples may be found in the |PS_EXE:| directory.

\par{\parskip 0pt
|      $   if F$TRNLNM("ps_hdev") .nes. "" then deass ps_hdev|\<
|      $   if F$TRNLNM("ps_hfile") .nes. "" then deass ps_hfile|\<
|      $   if F$TRNLNM("ps_hcom") .nes. "" then deass ps_hcom|\<
|      $   if F$TRNLNM("PGPLOT_HPGL_SPEED") .nes. "" then deass PGPLOT_HPGL_SPEED|\<
|      $   inquire ans "Use LASER plotter for graphics? (Y/[N])"|\<
|      $   if .not. ans then goto HP|\<
|      $   define ps_hfile plot.ps|\<
|      $   define ps_hdev ps|\<
|      $   define ps_hcom "@sys_com:lasersub ps_hf_last"|\<
|      $   exit|\<
|      $ HP:|\<
|      $   WRITE SYS$OUTPUT "Using HP plotter for graphics"|\<
|      $   define ps_hdev hpgl|\<
|      $   define ps_hfile hp_plotter:|\<
|      $   inquire ans "Use 11x17 inch paper (Y/[N])"|\<
|      $   DEFINE/NOLOG PGPLOT_HPGL_PAGE B|\<
|      $   if .not. ans then DEFINE/NOLOG PGPLOT_HPGL_PAGE A|\<
|      $   inquire ans "Enter pen speed in cm/sec (1-38) [default=max]"|\<
|      $   if ans .nes. "" then DEFINE/NOLOG PGPLOT_HPGL_SPEED 'ans'|\<
\parskip 0pt}

\subrub Local help file
%%2 Local_help

Entries with help information for local users can be included in the 
Powder Suite help library by creating file |LOCAL.HELP| in the |[.PS]|
directory. If this file is found when the |HELP.COM| procedure is
run, these help entries will be included in the help library.
The |LOCAL.HELP| file should have standard VMS format: use
a number in the first column followed by the help entry name; use 1
for a main entry, 2 for a sublevel entry and so on...

\par{\parskip 0pt
|	1 WHERE_IS_IT|\<
|	  Powder Suite is installed in DISK11:[PS]|\<
|	1 Problems|\<
|	  In case of problems read the manual, get a copy from...|\<
|	2 Serious_problems|\<
|	  Contact ...|\<
\parskip 0pt}

After modifying or creating the |LOCAL.HELP| file, run |@HELP| to create
a new copy of the help libraries accessed by the programs.

\subrub Interactive/Hardcopy devices
%%2 I/O_devices

The Powder Suite package can access up to four different I/O devices, 
none of which are required for operation. 

\TAB 
   (1) The interactive terminal is used for input of commands and output
of responses by the package. This will not exist for batch mode operation 
of the program.

\TAB 
   (2) The interactive graphics display device will usually be the same 
as the interactive terminal. It is possible (and perhaps optimum) that a
separate device be used for graphics, but allocating two terminals, one
for graphics and one for text, to the same login session requires 
system-level intervention and is rarely done; it will not be discussed here.

\TAB 
   (3) The hardcopy graphics output device, may be a laser printer,
plotter or any other supported graphics device. Output is typically
written to a file and a DCL command or command procedure is used to 
spool the file to the actual device. Output can be sent directly to a 
device, if desired.

\TAB 
   (4) The printer is used for hardcopy of text output from the programs.
Any 132 column printer may be used. Output is again typically written to
a file and then spooled.

It is likely that different users will choose to use different terminals,
printers and plotters. If so, users will desire to customize the setup 
of the program for their preferences. This is done by creating a
|PS_LOCALINIT.COM| file in either their default or login directory.

\subrub Logical names
%%2 Logical_names

The following logical assignments must be defined to use Powder Suite:

\HANG 
  |PS_EXE| is the location of the |.EXE|, the |.HLB| files, and the |.COM|
	files for the package. This will be determined by where the 
	package has been installed. (File |PS.COM| can be located anywhere 
	convenient, but be sure the definition of |PS_EXE| in the 
	|PS.COM| file is correct.)
	Include a disk assignment in the definition of PS_EXE, even if your
	system only has one disk.
\HANG 
  |PS_JCPDS| and |PS_BITMAP| are the locations of the PDF-1 
  	JCPDS-ICDD database files.

\HANG 
  |PS_PDF2_CDROM| or |PS_PDF2_DISK| and |PS_PDF2_INDEX| are the 
	locations of PDF-2 JCPDS-ICDD database files. The actual 
	devices will be determined by where the package is installed.

\HANG 
  |PS_TMP| is a device/directory for scratch files. Use the system
	scratch disk if one exists and it is regularly cleaned up.
	Otherwise define |PS_TMP| as |SYS$LOGIN| or |SYS$SCRATCH|.

\HANG 
  |PS_CRT| contains an integer value which defines the terminal type 
	and its graphics capability. The menu of choices is displayed 
	when the package is initialized, unless a definition is supplied
	within a |PS_LOCALINIT.COM| or a |PS_EXE:LOCAL.COM| file.

\HANG 
  |PGPLOT_FONT| and possibly |GRPCKG| are needed for the PGPLOT graphics 
	package. |PGPLOT_FONT| must be defined as the location of the PGPLOT 
	font file, |GRFONT.DAT|. If the PGPLOT shareable library has been 
	used to link the programs, |GRPCKG| must point to file |GRPSHR.EXE|.

The following definitions are not required, but their use is recommended:

\HANG 
  |PS_HDEV|, |PS_HFILE| and |PS_HCOM| determine the where hardcopy 
	graphics should be directed. |PS_HDEV| defines the type of
	graphics device, (as defined in PGPLOT); |PS_HFILE| defines
	the default plot file name and |PS_HCOM| defines a command 
	that can be used to process or queue the file (see the following 
	examples). Note that each time a graphics file is created, 
	logical name |PS_HF_LAST| is defined by the package as the 
	full name of the graphics file that was actually written.

\HANG 
  |PS_PFILE| and |PS_PCOM| define a file to be used for a hard copy printer
	and an optional command to process/queue the print file after 
	it has been written. They are used the same manner as |PS_HFILE| and 
	|PS_HCOM| (see the following examples).
	The logical name |PS_PR_LAST| is defined by the package as 
	the full name of the print file that is actually written.

The following definitions are not required, but can be used to 
tailor the package to an inividual user's preferences.

\HANG 
   |PS_WAVELENGTH| defines the default mode used in the programs, 
	for example, when displaying JCPDS-ICDD entries: d-space or
	\twotheta\ and in the latter case defines the wavelength that 
	for conversion. If this logical is not assigned, the default
	is d-space mode. To use a different default, this logical name 
	may be defined in a |LOGIN.COM| file or a user's |PS_LOCALINIT.COM| 
	file. 
	Once the wavelength setting is changed within a program, the 
	logical name will (re)assigned for the remainder of the login 
	session.
\HANG 
   |PS_DELETED| defines the default mode used in the programs for 
	processing of deleted patterns. Use command\<
	|       $ DEFINE PS_DELETED TRUE|\<
	to cause ``deleted'' patterns to be used by default.

\subrub Examples
%%2 Examples

Some typical examples for logical name definitions are given below,
along with explainations.


\subsubrub Terminal Type Definition
%%3 Terminal_Type

If a user will only access one type of terminal, it may be 
desireable to define the terminal type in the user's |PS_LOCALINIT.COM| 
file. Use command:\<
|      $ DEFINE PS_CRT "1"|\<
to define |PS_CRT|. Note that the number should be defined 
between quotation marks with no extra spaces following the last digit.

\subsubrub Graphics Device Type Definition
%%3 Graphics_Type

Commonly users will wish to override the default graphics device 
settings. For a list of the currently defined devices, see file
|CURRENT.DRIVERS| in the PGPLOT directory. Note that the "/" 
preceding the device name is omitted: |PS| for |/PS|. Some 
sample definitions are given below:

\TAB 
   (1) This example uses PostScript output and a locally defined
       command procedure to process the file after creation.
\par{\parskip 0pt
|      $ DEFINE  PS_HDEV   PS|\<
|      $ DEFINE  PS_HFILE   PLOT.PS|\<
|      $ DEFINE  PS_HCOM   "@local_dir:postprocess PS_HF_LAST"|\<
\parskip 0pt}

\TAB 
   (2) This example uses QUIC output for a QMS or Talaris laser 
       printer and then sends the output directly to the printer.
\par{\parskip 0pt
|      $ DEFINE  PS_HDEV   QMS|\<
|      $ DEFINE  PS_HCOM   "PRINT/QUE=LASER/DELETE PS_HF_LAST"|\<
\parskip 0pt}

\TAB 
   (3) This example sends HPGL code to an Hewlett Packard plotter.
       The output is sent to the plotter as it is created.
\par{\parskip 0pt
|      $ DEFINE  PS_HDEV   HPGL|\<
|      $ DEFINE  PS_HFILE   sys$plotter:|\<
\parskip 0pt}

\subsubrub Printer Device Definition
%%3 Printer_Location

\TAB 
   (1) This example uses the default file name, and prints it on
       the system printer. This example is typical for most users
       who may wish to change the |/FORM=| or add |/QUE=| or
       other similar qualifiers.		
\par{\parskip 0pt
|      $ DEFINE  PS_PCOM   "PRINT/FORM=132COL/DELETE PS_PR_LAST"|\<
\parskip 0pt}

\TAB 
   (2) In this example print files will be named |PS.PRINT| and will 
       be printed by command procedure |LOCAL_DIR:POSTPRINT.COM|.
\par{\parskip 0pt
|      $ DEFINE  PS_PFILE   PS.PRINT|\<
|      $ DEFINE  PS_PCOM   "@local_dir:postprint PS_PR_LAST"|\<
\parskip 0pt}


\subsubrub D-Space/\twotheta\ Mode Definition
%%3 Angle_mode

\TAB 
   (1) set mode to \twotheta\ angles with Cu \Kalpha1\ radiation 
       as the default\<
|      $ DEFINE  PS_WAVELENGTH  CU1|

\TAB 
   (2) set mode to \twotheta\ angles with wavelength = 1.23456\AA\<
|      $ DEFINE  PS_WAVELENGTH  1.23456|

\TAB 
   (3) set mode to d-space\<
|      $ DEFINE  PS_WAVELENGTH  0.0|

\subsubrub ``Deleted'' Pattern Mode Definition
%%3 Deleted_mode

\TAB 
   (1) set mode as using ``deleted'' patterns as the default mode on startup\<
|      $ DEFINE  PS_DELETED  TRUE|

\TAB 
   (2) set mode as not using ``deleted'' patterns as the default mode 
	on startup\<
|      $ DEFINE  PS_DELETED  FALSE|
