%++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
%.COPYRIGHT  (c)  1990-2011 European Southern Observatory
%.IDENT      set_midas.hlq
%.AUTHOR     KB, IPG/ESO
%.KEYWORDS   MIDAS, help files, SET/MIDAS_SYS
%.PURPOSE    On-line help file for the command: SET/MIDAS_SYS
%.VERSION    1.0  01-DEC-1990 : Creation, KB
%.VERSION    1.3  02-JUN-1992 : More additions, KB
%.VERSION    1.4  07-OCT-1992 : add display of current status, KB
%----------------------------------------------------------------
\se
SECTION./MIDA
\es\co
SET/MIDAS_SYSTEM				     21-FEB-2011 KB
\oc\su
SET/MIDAS_SYSTEM option=value
	set different modes and options for Midas
\us\pu
Purpose:
          Set different modes and options (max. 8 per command line) for Midas.
\up\sy
Syntax:  
          SET/MIDAS_SYSTEM option=value
\ys\pa
          option =   CLOVERLAY,  COMMANDS,  DEBUGGER,  DPATH,     DQ,
		     DSCALLOC,   DSCCOPY,   DUMMY,     EDITOR,    ENVIRON,
		     EPATH,      ESO-DESCR, F_HEAD,    F_UPDATE,  INSERT,
		     KEYWORDS,   MAXTIME,   NEWFILES,  OUTPUT,    PATH,
		     PROMPT,     SELIDX,    SQUOTE,    USER_LEVEL 
		     WCS-FLAG    WORKENV    LONGSTRN

              for CLOVERLAY (1), value = YES (default) or NO to indicate if the
                  overlay channel should be cleared or not at the start of
                  commands like EXTRACT/TRACE, CENTER/GAUSS, ...
              for COMMANDS (2), value = comno,qualno;
                  with comno = no. of commands,
                       qualno = no. of qualifiers;
              for DEBUGGER (3), value = name of debugger to use with
                  command DEBUG/MODULE (only used for Unix)
              for DPATH (5), value = directory(ies) used in locating the Midas
                  data files - defaulted to current directory
              for DQ (6), value = YES or NO (default) to indicate if double
                  quotes (") enclosing a string are included or stripped off
                  in commands WRITE/KEY, WRITE/DESCR and WRITE/FILE
              for DSCALLOC (7), value = dno,dbytes
                  with dno = initial no. of descriptors,
                       dbytes = initial space in bytes for descriptors
                  used at file creation
              for DSCCOPY (8), value = YES (default) or NO to indicate if all
                  descriptors of an input frame should be copied to the result
                  frame in MIDAS commands;
              for DUMMY (11), value = SEPARATE or UNIFORM (default) to use
                  separate dummy files in a Midas session - see Notes
              for EDITOR (12), value = name of the preferred editor 
                  defaulted to `vi' for Unix and `EDT' for VMS
              for ENVIRONMENT (13), value = env_string;
                  with env_string = Host, Midas or MidHost
                  to move to the host system, Midas or a combination of both;
                  host system is the UNIX shell or VAX/VMS DCL environment 
              for EPATH (14), value = directory(ies) used in locating the Midas
                  executables (program modules) used with a Midas RUN command;
                  defaulted to current directory and then to MID_WORK
              for ESO-DESCR (24), value = YES (default) or NO, to read in 
                  all the hierarchical keywords "ESO.abc.xyz" of a FITS file
              for F_HEAD (9), value = 1 (default) or 2 for the mode of writing 
		  single, real descriptors into a FITS header
              for F_UPDATE (15), value = YES (default) or NO,
                  to en/disable the updating (data and/or descriptors) of
                  FITS frames
              for INSERT (16), value = YES or NO (default) to switch between
                  insert and add mode when editing (only for VMS)
              for KEYWORDS (17), value = glbno,locno
                  with glbno = no. of global keywords,
                       locno = no. of local keywords;
              for LONGSTRN (28), value = YES or NO (default) to use the
		  LONGSTRN option in FITS headers (with CONTINUE keywords),
		  else long char. strings are written to FITS using the ESO
		  HISTORY mechanism
              for MAXTIME (18), value = nosec[,level]
                  with nosec = no. of seconds after which any Midas
                               command will be stopped
                               defaulted to -1 (i.e. no timeout applied)
                       level = the procedure level for which (and all higher
                               ones) the timeout value is applied
                               if omitted, set to current level (and all
                               higher levels)
              for NEWFILES (19), value = format[,imatype,tbltype]
                  format indicates file format of newly created frames:
                         Midas or FITS, (defaulted to Midas)
                  imatype, tbltype are the types for FITS images and 
                         FITS tables, (defaulted to .fits and .fits)
                  for Midas format these are fixed to .bdf and .tbl
              for OUTPUT (20), value = YES (default), NO or LOGONLY,
                  to indicate if the output from MIDAS commands should be
                  displayed or not (or just logged); 
		  furthermore a color can be defined: = RED, BLUE, GREEN,
		  BLACK, WHITE, YELLOW, MAGENTA, CYAN, DEFAULT
              for PATH (21), value = directory(ies) used in locating the Midas
                  procedures for the @@ command 
                  defaulted to current directory and then to MID_WORK
              for PROMPT (22), value = prompt_string;
                  with prompt_string = a string of max. 16 characters
              for SELIDX (10), value = YES (default) or NO to create
                  the descriptor SELIDX with the SELECT/TABLE command
              for SQUOTE (25), value = YES (default) or NO to still use
                  single quotes (') as replacement characters like '{' and '}'
              for USER_LEVEL (23), value = level[,mode];
                  with level = NOVICE, for first-time users of MIDAS,
                             = USER,   for "normal" users,
                             = EXPERT, for experts of MIDAS,
                       mode  = PROMPT, for prompting for all parameters and
                               showing their defaults
                             = NOPROMPT, Midas only prompts for non-defaulted
                               parameters, the default.
              for WCS-FLAG (26) , value = 0 or 1 (default since 06SEP) or 2 
              for WORKENV (27), value = Midas or FITS
\ap\sa
See also:
          @a showmidas (HELP/APPLIC)
\as\no
Notes:   
          (1)  anything else but YES is interpreted as NO;
          (2)  Command data base will only be expanded if new values exceed the
               current ones. Use the command "SHOW/COM -X" to get the current
               values, there CMAX and QMAX show the max. no. of commands and
               qualifiers.
          (3)  for setting advanced debug flags/options see the help of the 
	       keyword MID$DEBUG
          (5)  the string defines the pathname for data frames and may be: 
               `dir_path|dir_path|...|dir_path' to set the different dir_specs
               or `+dir_path|dir_path|...|dir_path' to add more dir_specs to
               the currently set paths
               max. 4 directories may be specified 
               if `DPATH=' is entered all previously entered path names are
               cleared and only the current directory is used to find data
               DPATH=?? only updates the data path of the IDI server (needed
               for LOAD/IMAGE)
          (7)  descriptors can be added and extended, so these values are
               only used when a Midas frame is created and can improve the
               efficiency (for FITS files with outrageous FITS headers, like 
               the data files from the VIMOS instrument ...)
          (8)  by just copying the standard descriptors the efficiency can be
               improved for files with huge FITS headers
          (9)  in version 1 single, real descriptors are just
	       written out as primary FITS keywords to make them readable
	       by other FITS readers (the original mode),
	       via version 2 such single, real descriptors are saved in the
	       ESO-DESCRIPTOR special keyword of Midas (like real arrays)
	       so that Midas will read them back in as real and not as double
          (10) if set to YES, the no. of selections and all selected row
               numbers will be stored in integer descr. SELIDX of the table
               OJO: this descr. can become VERY BIG ...
          (11) for SEPARATE, &a -> middummXYa.bdf (if Midas unit = XY)
               else,         &a -> middumma.bdf
          (13) In the Host environment, all input is passed directly to the
                 host operating system. Except the command SET/MIDAS, which 
                 will bring you back to Midas.
                 The Midas prompt is terminated by `$'.
                 All Midas command editing facilities are still available.
               In the MidHost environment all commands which are not recognized
                 by Midas are passed on to the host system. Thus you can avoid
                 the `$' in front of many Unix commands like "more", "ls".
                 It also works for VMS (with commands like e.g. "DIRECTORY").
                 The Midas prompt is terminateby d `:'.
               Note, that this environment setting is only applicable to the
               interactive input, i.e. in procedures you must enter the `$'
               for a host command.
          (14) the string defines the pathname for executables and may be:
               `dir_path|dir_path|...|dir_path' to set the different dir_specs
               or `+dir_path|dir_path|...|dir_path' to add more dir_specs to
               the currently set paths
               max. 4 directories may be specified 
               if `EPATH=' is entered all previously entered path names are
                  cleared and directory $MID_WORK is used if executable not
                  found in current directory
          (17) Keyword data base will only be expanded if new values exceed
               current ones
          (18) if a Midas command timed out, keyword PROGSTAT(1) is set to 998
               and control returns to the user
          (19) all new frames will be created in the format given 
               e.g. after SET/MIDAS newfiles=FITS
               all new images/tables will be generated in FITS format instead
               of the native Midas format
               by specifying an image (table) as xyz.bdf (xyz.tbl) 
	       Midas binary format is always enforced (even if we work in a
               FITS working environment)
          (21) the string defines a pathname for Midas procedures and may be:
               `dir_path|dir_path|...|dir_path' to set the different dir_specs
               or `+dir_path|dir_path|...|dir_path' to add more dir_specs to
               the currently set paths
               max. 4 directories may be specified 
               To locate a procedure Midas always looks first in the current 
               directory and then into all other directories defined through 
               `PATH='. By default PATH is set to $MID_WORK, therefore, by
               default Midas looks in the current dir. and then into $MID_WORK
               to locate a procedure.
               OJO: if you do "Midas> set/midas path=$HOME" you set PATH to
               $HOME only and overwrite MID_WORK.
               Therefore, Midas will look in the current dir. and then into
               $HOME, not anymore into $MID_WORK!!
               If you want to keep MID_WORK you should do 
               "Midas> set/midas path=+$HOME"
               adding $HOME to PATH and Midas will look first in the current 
               dir., then in $MID_WORK and then in $HOME. After
               "Midas> set/midas path=$HOME|$MID_WORK"
               first directory $HOME and then $MID_WORK is used if the 
               procedure is not found in the current directory.
          (23) the user level affects the the following areas of the MIDAS
               system:
               1) length of error messages - NOVICE and USER will yield
                  exhaustive error messages; EXPERT will yield just a 
                  one-line message.
               2) In the prompt mode you will be prompted for each parameter
                  and the current default is displayed.
                  If default is '?' you must enter a value, otherwise just
                  hit RETURN if you want to use the defaults.
               3) only in EXPERT level can you overwrite existing Midas
                  commands
               the above is also the initial setting at startup
          (24) this flag can only be set, if F_UPDATE flag is not set - 
               else the updated FITS file would have lost all ESO eywords...
          (25) for backwards compatibility we still treat 'P1' like {P1},
	       but the usage of single quotes will be discontinued in 
	       a future release of Midas and is therefore discouraged
          (26) this flag controls the calculation of the stepsize of frames
	       when importing from FITS
	       0: use CDELTi when reading FITS header, if not found look for CDi_j
	       1: use CDi_j keywords when reading FITS header, ignore any CDELTi,
	       2: use CDi_j keywords when reading and writing FITS header, no 
                  reference anymore to CDELTi
	       for 0,1 the CDi_j data are not updated when exporting from
	       Midas to FITS
	       only for 2 also the CDi_j data are updated if necessary when
	       writing a FITS file
          (27) this option is just a short form of: 
               set/midas newfiles=midas 	
               or:
               set/midas newfiles=fits,fits,tfits f_update=yes
 
          If you enter option=? the current option/status is displayed;
          if applicable that value is also stored in keyword OUTPUTI 
          or OUTPUTC.
 
          Your private login.prg file in $MID_WORK is the right place for 
          storing all those SET/MIDAS_SYSTEM commands...
\on\exs
Examples:
\ex
          SET/MIDAS USER=EXPERT
            Declare yourself as a MIDAS expert.
\xe\ex
          Midas 045> SET/MIDAS PROMPT=Astro
            Then the next command line will prompt: Astro 046> 
\xe\ex
          SET/MIDAS us=exp pro=Astro
            Same as the two examples above.
\xe\ex
          SET/MIDAS key=?
            Display the current max. no. of global and local keywords which
            are also stored into keyword OUTPUTI(1,2).
\xe\ex
          SET/MIDAS output=no
            Suppress all output from MIDAS commands.
\xe\ex
          SET/MIDAS COMMANDS=300,500
            Expand command data base to hold 300 commands + 500 qualifiers,
            assuming these values are greater than the current ones.
\xe\ex
          SET/MIDAS PATH=+$HOME/test
            Add `$HOME/test' as a directory to search for procedures when
            executing the @@ command.
\xe\ex
          SET/MIDAS DPATH=$HOME/data/echelle
            Specify `$HOME/data/echelle' as directory to search for Midas data
            files if they are not found in the current working directory.
\xe\ex
          SET/MIDAS dschelp=no
            Ignore the descriptor help text, may speed up processing of
            frames with huge headers considerably.
\xe\ex
          SET/MIDAS debug=gdb
            Use GNU debugger instead of dbx (e.g. on Sun Solaris)
\xe\ex
          SET/MIDAS newfiles=FITS,fitz,tfitz 
            All new frames will be created on disk in FITS format and 
	    the filetype `.fitz' will be appended to filenames of 
	    images (.tfitz for tables).
\xe\sxe
