1 Language
                         SIC\ Command Language Summary

    ACCEPT        : Read variable in various format.
    BEGIN         : Begin a sub-procedure, help file or data file.
    BREAK         : Exit without error from a FOR-NEXT loop.
    COMPUTE       : Execute non-arithmetic operations on variables.
    CONTINUE      : Resume macro or loop execution after PAUSE.
    DEFINE Type V : Define new variables.
    DELETE        : Delete variables or symbols.
    EDIT [File]   : Edit a file or a dump of the Stack.
    ELSE [IF Log] : Alternate IF block directive.
    END           : End IF block structure or a sub-procedure.
    EXAMINE Var   : Type the current value of the specified variable.
    EXIT          : Exit from the program.
    FOR [/WHILE]  : Open a FOR-NEXT loop.
    HELP XX[\]    : Give an explanation of command XX or language XX\.
    IF Logical    : Start a conditional IF block.
    IMPORT Package: Dynamically import another package in current one.
    LET [/WHERE]  : Assign value to variable.
    MESSAGE       : Send a message to screen and/or message file.
    MFIT A=F(B,p) : Fit a formula into SIC variables.
    NEXT          : End FOR loop definition and activates the execution.
    ON ERROR COMM : Change the current error recovery action.
    PAUSE         : Set a break point in a Loop or a Macro.
    PYTHON        : Start/End intercommunication between SIC and PYTHON.
    QUIT          : Abort an execution interrupted by PAUSE.
    RECALL [Text] : Recall line from stack, and edit it if possible.
    RETURN        : Terminate procedure execution.
    SAY "text"    : Type a text or variable or expression value.
    SIC Arg ON    : Change some SIC internal status.
    SORT Key Vars : Sort variables according to another one.
    SYMBOL        : Define, list and delete symbols.
    SYSTEM        : Create or attach sub-processes, run system commands.
    TYPE [XX]     : List file XX or the stack.
    @ XX [P1 ...] : Read commands from macro XX and executes them.
1 ACCEPT
        [SIC\]ACCEPT Var_Name /ARRAY File_Name [/options]
        [SIC\]ACCEPT Var_Name /BINARY File_Name Offset
        [SIC\]ACCEPT Var_1 [Var_2 [...]] /COLUMN File_Name [Separator] [/op-
    tions]

    Read SIC variables from formatted or binary files. This  command  has  3
    major  modes:  /ARRAY  to read in a FORMATTED way a SINGLE n-dimensional
    variable, /BINARY to read in BINARY form a  SINGLE  n-dimensional  vari-
    able, and /COLUMN to read in a FORMATTED way SEVERAL 1-dimensional vari-
    ables.
2 /ARRAY
        [SIC\]ACCEPT Var_Name /ARRAY File_Name [/FORMAT String] [/LINE Begin
    End]

    Read  a  N-Dimensional  variable  of name Var_Name from a formatted file
    File_Name, using list-directed (free) format, or a user specified format
    if  /FORMAT option is present. The /LINE option can be used to skip some
    lines before starting reading. Not recommended for character arrays.
2 /BINARY
        [SIC\]ACCEPT Var_Name /BINARY File_Name [Skip]

    Read a N-Dimensional variable  of  name  Var_Name  from  a  binary  file
    File_Name.  The  optional Skip argument indicates how many BYTEs to skip
    before starting reading.
2 /COLUMN
        [SIC\]ACCEPT Var_1 [Var_2 [...] /COLUMN File_Name [Separator] [/FOR-
    MAT String] [/LINE L1 [L2]]

    Read  ONE or SEVERAL 1-Dimensional variables in a flexible format from a
    formatted file File_Name. Each variables can be of any  length,  from  0
    (scalar) to N. They are filled by reading each associated column, start-
    ing from first line. Data is read in as many lines as required.  If  end
    of file is reached in the meantime, an error is raised.

    Blank or commented lines (starting with a "!") are skipped. The starting
    line number can be selected with /LINE option.

    A * as an argument of the ACCEPT command indicates a dummy variable used
    to skip a column in the input file. For example, the command
        ACCEPT A * B C /COLUMN TEST.DAT
    reads A,B and C from columns 1,3 and 4 of file TEST.DAT, since the * in-
    dicates to skip the second column.

    By default, the format is the equivalent of  the  Fortran  list-directed
    (*)  format.  In this format, character strings must be included between
    simple quotes. The default can be changed by specifying a separator as a
    second  argument  of  option  /COLUMN.  The separator can be " " ( which
    gives a behaviour like the COLUMN command of GreG), or any other charac-
    ter.   For example, specifying "\;" as a separator can allow to read CSV
    files (e.g. Excel data files).

    Option /FORMAT can also be used to specify a fixed Fortran-like  format.
2 /FORMAT

        Specify  a  fortran format to read the input file for command ACCEPT
    /ARRAY or ACCEPT /COLUMN. Mixing CHARACTER and NUMERIC  (REAL,...)   ar-
    rays is not available yet, and only one character array can be read at a
    time. Blank or commented lines are not skipped.

    Example:
        SIC> TYPE cities.dat
          Toulouse          1.111    11.11111
          Bordeaux          2.222    22.22222
          Grenoble          3.333    33.33333
          Marseille         4.444    44.44444
        (truncated)
        SIC> DEFINE CHARACTER CITY*16[44]
        SIC> DEFINE REAL X[44] Y[44]
        SIC> ACCEPT X Y /COLUMN "cities.dat" /LINE 4 /FORMAT "20x,F8.3,1x,F8.3"
        SIC> ACCEPT CITY /COLUMN "cities.dat" /LINE 4 /FORMAT "2x,A16"

    This option is invalid with /BINARY.
2 /LINE
        [SIC\]ACCEPT Var_Name /LINE L1

    Indicate the first line to be read in the input file for command  ACCEPT
    /ARRAY or ACCEPT /COLUMN. Blank and commented lines have to be taken in-
    to account in L1.

    This option is invalid with /BINARY.
2 Excel

    Excel (TM) datafile may be readable by command ACCEPT. They must be con-
    verted  to  CSV  format  (Comma Separated Values). A suitable use of the
    dummy variables in ACCEPT command allows to skip the non-numeric fields.
    The proper separator must then be specified using the second argument of
    option /COLUMN: e.g.
    ACCEPT * Var1 Var2 /File Excel.csv ";" /LINES 2 20
    will read Var1 and Var2 from lines 2 to 20 of  the  corresponding  Excel
    file, from Excel columns "B" and "C" (second and third).

    To be documented: Can character variables also be read with numeric ones
    provided some adequate /FORMAT option ?
1 BEGIN
        [SIC\]BEGIN Procedure|Help|Data FileName

    Begin a new Procedure, Help file, or ASCII Data file.  All  lines  until
    the  corresponding END Procedure|Help|Data FileName command is found are
    considered to be the body of the new file. Such files are located in the
    directory designated by the logical name GAG_PROC:.
1 BREAK
        [SIC\]BREAK

    Terminate a loop execution. The two uses of command BREAK are usually
        ON ERROR BREAK
        FOR I 1 TO 3 BY 0.5
        ...
        NEXT
    or
        LET A = C               ! A is a known variable
        FOR I 1 TO 100 BY 1
        ...
        IF I+A.EQ.0
            BREAK
        END IF
        NEXT
    BREAK differs from QUIT because it does not transmit any error.
1 COMPUTE

        [SIC\]COMPUTE  OutVar  OPERATION  InVar [Parameters] [/BLANKING Bval
    [Eval]]

    Perform operations or transformations on variables that are not directly
    supported by the array capabilities of the SIC command interpretor. Out-
    Var is the output variable, InVar the input variable. Outvar must be de-
    fined beforehand.

    The  following operations are available on INTEGER, REAL and DOUBLE PRE-
    CISION arrays, regardless of their nature:
      - MAX     MIN     MEAN     RMS     SUM     PRODUCT    MEDIAN
        for which InVar is an array of rank 1 to 7 (a 1-D to 7-D array), and
        OutVar  must be an array of lesser rank (i.e., one or more dimension
        less than InVar, down to a number), AND of identical shape as  InVar
        for the dimensions in common.
        Example (if A[4,12,2,8] and B[4,12]):
                COMPUTE B MAX A
        Sections,  implicit transpositions, etc... permitted by SIC are sup-
        ported.
      - HISTOGRAM: see subtopic HISTOGRAM for details.
    Blanking values Bval and Eval allow to ignore values of the Invar  array
    if  at  Eval from Bval, for these operations only. At least Bval must be
    passed to option /BLANKING, and default is 0.0 for  Eval.   SET BLANKING
    has no effect here since it is a command of the GREG1\ language.
    In  case of no valid result, NaN is returned, or Bval if blanking is en-
    abled. This may occur in particular when all InVar values are blanked.

    The following transformations are available:
      - GATHER
        Return the list of different input values (see subtopic for details)
      - RANKORDER
        Return the ordering of the input values.
      - INTEGRAL or DERIVATIVE
        Integral or derivative of the input variable
      - FFT+ or FFT-
        Direct  or  Inverse Fast Fourier Transform: see subtopic FFT for de-
        tails.
      - FOURT+ or FOURT-
        Direct or Inverse Fast Fourier Transform: see subtopic FOURT for de-
        tails.
      - COMPLEX
        Populates  the  Real and (optionally) Imaginary part of OutVar (com-
        plex variable) with InVar (real) and (optionally) the Imaginary part
        by the following (real) variable name.
      - REAL
        OutVar = REAL part of InVar. OutVar is Real, InVar is Complex .
      - IMAG
        OutVar = IMAGE part of InVar. OutVar is Real, InVar is Complex.
      - ABS
        OutVar = AMPLITUDE (InVar). OutVar is Real, InVar is Complex.
      - PHASE
        OutVar = PHASE (InVar). OutVar is Real, InVar is Complex.
      - CMP*  operations  as  in  "COMPUTE OutVar CMPMUL InVar1 InVar2". All
        variables must be complex arrays of identical size.
          CMPADD: OutVar = InVar1 + InVar2.
          CMPSUB: OutVar = InVar1 - InVar2.
          CMPMUL: OutVar = InVar1 * InVar2.
          CMPDIV: OutVar = InVar1 / InVar2.

    Miscellaneous operations (see subtopics for details):
      - EXTRACT
      - DATE
      - DIMOF
      - GAG_DATE
      - LOCATION
      - BTEST Test bit values
2 EXTRACT
        [SIC\]COMPUTE OutString EXTRACT InString Start End

    Character string handling: extraction of a sub-string. Returns  in  Out-
    String the sub-string InString(Start:End) (in Fortran notation...)
2 DATE
        [SIC\]COMPUTE Modification_Date DATE Filename

    Return  the last modification date of the file Filename into the integer
    variable Modification_Date. Used in procedures to check  when  file  has
    last been changed.

    If the output variable is a 4-bytes integer (Fortran I*4), returned val-
    ue is in seconds since 01-jan-1970. If the variable is a 8-bytes integer
    (Fortran  I*8),  returned  value is in nanoseconds since 01-jan-1970. In
    the latter case, your system (e.g. Linux >= 2.5.48) AND filesystem (e.g.
    ext4) must support timestamp granularity below the second. If not, value
    precision is limited to 1 second.
2 DIMOF
        [SIC\]COMPUTE OutVar DIMOF InVar

    Return the shape of array InVar in OutVar[1:7], and  its  rank  in  Out-
    Var[8].  For  this purpose, OutVar must be an INTEGER array of dimension
    [8]. Undefined dimensions are set to 0.
2 FFT
        [SIC\]COMPUTE OutVar FFT+|FFT- InVar [REAL]

    FFT+ performs Direct Fast Fourier Transform, while FFT- performs Inverse
    Fast Fourier Transform.

    Command  accepts  REAL  or COMPLEX variables. OutVar is a 2-D array with
    second dimension equals 2, storing respectively the Real  and  Imaginary
    part  of  the  (complex)  output Fourier transform. By default, InVar is
    like OutVar, but if parameter REAL is specified InVar is a 1-D array.
2 FOURT
        [SIC\]COMPUTE OutVar FOURT+|FOURT- InVar

    FOURT+ performs Direct Fast Fourier Transform, while FOURT- performs In-
    verse Fast Fourier Transform.

    Operates on input and output on COMPLEX arrays of dimension [2,NX,NY].
2 GATHER
        [SIC\]COMPUTE OutArray GATHER InArray

    Returns in a NEW 1-D variable named OutArray the list of values found in
    the (existing) n-D variable InArray.  The output array must  not  exists
    and  is created by the program itself. It is of the same type as the in-
    put array.

    NaN and Blanked values are ignored.

2 GAG_DATE
        [SIC\]COMPUTE IntDate GAG_DATE "15-DEC-2035"
        [SIC\]COMPUTE StrDate GAG_DATE 4127

    GAG_DATE keyword converts a string date into a "radio Julian date"  (in-
    teger  value), or vice-versa. The kind of the output variable (resp. in-
    teger or character) rules the expected kind for  input  variable  (resp.
    character or integer). The output variable must be scalar and writeable,
    and the date string should be 11 characters at least.

    A "radio Julian date" (or "Jansky Julian date") starts as -2^15  on  the
    date of the first radio observation by Karl Jansky. It is thus the Modi-
    fied Julian date minus 60549. That choice was made to maximize the  time
    interval  over which radio astronomical data could be usefully stored in
    an integer*2, back when 2 bytes of header space per spectrum were a sig-
    nificant  consideration. This date has little meaning outside the rather
    sparse community of souls gathered around the CLASS program, however.
2 HISTOGRAM
        [SIC\]COMPUTE OutVar HISTOGRAM InVar [Hmin] [Hmax]  [/BLANKING  Bval
    [Eval]]

    Put  in variable OutVar (dimension [n,2]) the histogram of values of n-D
    variable InVar, eventually between the cuts  Hmin  and  Hmax,  and  with
    blanking  values  Bval  and Eval (that is, values of the Invar array are
    not taken in account for the histogram if at Eval from Bval). These  pa-
    rameters can be absent. One can use '*' to omit any of them.

    The  number of bins is dictated by the first dimension of the array Out-
    Var. In the absence of said cuts, the cuts used are the maximum and min-
    imum  values  of  the InVar array. The OutVar variable contains the his-
    togram in its first column (OutVar[1]) and the corresponding  bin  value
    in the second column (OutVar[2]).
2 LOCATION
        [SIC\]COMPUTE OutVar LOCATION InVar Value

    Search  for  Value  in the array InVar, and puts in OutVar the 2 nearest
    indices of InVar for which its values surrounds Value.  These  variables
    have some requirements:
      - InVar  must be a 1D-array of REAL or DOUBLE values,
      - Value  must be scalar numeric,
      - OutVar must be a 1D-array of 2 INTEGER values.
    InVar  is also intended to be ordered (ascending or descending), or else
    the result is unpredictable. Use SIC\SORT to sort arrays.
2 RANKORDER
        [SIC\]COMPUTE OutVar RANKORDER InVar

    Compute the order corresponding to the values in InVar.  InVar and  Out-
    Var are assumed to be 1-D variables. This can be used e.g. for statisti-
    cal non-parametric tests like the Spearman test.
2 INTEGRAL
        [SIC\]COMPUTE OutVar INTEGRAL InVar

    Compute the integral of the InVar variable, in the classical sense, i.e.
      OutVar[i] = InVar[1]+Invar[2]+...+Invar[i]
    InVar and OutVar are assumed to be 1-D variables
2 DERIVATIVE
        [SIC\]COMPUTE OutVar INTEGRAL InVar

    Compute  the  derivative  of the InVar variable, in the classical sense,
    i.e.
      OutVar[i] = InVar[i]-Invar[i-1]
    InVar and OutVar are assumed to be 1-D variables
2 BTEST
        [SIC\]COMPUTE OutVar BTEST InVar [Ibit]

    Bit-test one or several bit values of the  input  variable,  and  return
    true for each bit equal to 1.

    The  optional integer argument Ibit indicate which bit should be tested.
    The default is to check all the bits.

    If all the bits of (a single element of) InVar are tested,  OutVar  must
    be  an array with its first dimension equal to this number of bits, e.g.
    32 for INTEGERs, 64 for DOUBLEs, etc. InVar may be  a  multi-dimensional
    array, in which case OutVar must have the same extra-dimensions.

    In  details,  this tool is an overlay to the BTEST Fortran function (ex-
    cept that bit numbering starts at 1 here). Note that this hides the  ma-
    chine dependencies (IEEE, EEEI, etc) by using a unique integer model re-
    gardless of its physical layout. For more information, please  refer  to
    the Fortran documentation.

    Examples:

    SIC> define integer i
    SIC> let i 2
    SIC> define logical one
    SIC> compute one btest i 1  ! First bit value
    SIC> exa one
    ONE             = F                          ! Logical GLOBAL

    SIC> define logical all[32]
    SIC> compute all btest i  ! All bit values
    SIC> exa all
    ALL             is a logical Array     of dimensions  32
     F T F F F F F F F F F F F F F F F F F F F F F F
     F F F F F F F F

    SIC> define integer i2[3]
    SIC> let i2 1 2 3
    SIC> define logical one2[3]
    SIC> compute one2 btest i2 2  ! Second bit values of the 3 elements
    SIC> exa one2
    ONE2            is a logical Array     of dimensions  3
     F T T

    SIC> define logical all2[32,3]
    SIC> compute all2 btest i2  ! All bit values of all elements
    SIC> exa all2[1] all2[2] all2[3]
    ALL2[1]         is a logical Sub-Array of dimensions  32
     T F F F F F F F F F F F F F F F F F F F F F F F
     F F F F F F F F
    ALL2[2]         is a logical Sub-Array of dimensions  32
     F T F F F F F F F F F F F F F F F F F F F F F F
     F F F F F F F F
    ALL2[3]         is a logical Sub-Array of dimensions  32
     T T F F F F F F F F F F F F F F F F F F F F F F
     F F F F F F F F
1 CONTINUE
        [SIC\]CONTINUE     or     C

    Resume  loop  or macro execution after a PAUSE (explicit or caused by an
    error or a <^C>). Typing C instead of CONTINUE will  always  do  exactly
    the same thing. This is the only superior abbreviation installed in SIC.
1 DEFINE
        [SIC\]DEFINE Type Var1 [Keys...] [Var2  [Keys...]  [...]]  [/GLOBAL]
    [/LIKE VarLike]

    If  Type is FUNCTION, define a user-function. If Type is COMMAND or LAN-
    GUAGE, define a new user command or  language  respectively.  Otherwise,
    define new variables of the specified type. Type can then be REAL, INTE-
    GER, DOUBLE (for double precision real values), LOGICAL,  CHARACTER,  or
    TABLE, HEADER, IMAGE, UVTABLE, STRUCTURE, FITS or ALIAS. By default, new
    variables are LOCAL, i.e. valid only within the current  macro  and  all
    loops  or  interactive  levels  called  by  this macro. When the /GLOBAL
    switch is specified, the variables are valid at all levels. Local  vari-
    ables are examined before global variables.
2 ALIAS
        [SIC\]DEFINE ALIAS AliasName TargetVar [/GLOBAL]

    Define a new variable AliasName pointing towards (a subset of) an exist-
    ing variable. The new alias shares all the  properties  of  its  target:
    type, Local or Global status, Readonly attribute. The TargetVar can be a
    sub-array, but implicit transposition is not allowed.

    If the /GLOBAL option is present, the TargetVar must be a  Global  vari-
    able.

    Aliases can be deleted using the standard DELETE /VAR command: this does
    not delete the TargetVar variable. On  the  contrary,  when  a  standard
    variable  is deleted, all aliases attached to it are also deleted, since
    the variable content disappears.

    Structures cannot have aliases, but structure members can.
2 CHARACTER
        [SIC\]DEFINE CHARACTER Var1*Lvar1[DIM1] [...]
        [SIC\]DEFINE CHARACTER*Length Var1[DIM1] [...]

    CHARACTER variables can be scalar or multi-dimensional.  The  length  of
    CHARACTER  variable  is specified after an * either after CHARACTER key-
    word or after the name of the variable. When both are present, the  per-
    variable  length has precedence. The dimension field (same syntax as for
    other arrays) should follow the length declaration.  The CHARACTER  key-
    word can be abbreviated, i.e. this is a valid statement
        DEFIN CHAR*12 Var1  Var2*36 Var3[16]
2 COMMAND
        [SIC\]DEFINE COMMAND NAME "Equivalent command" [Help_File]

    Define a new user-defined SIC command.

    By  default,  the  new command will be part of the USER\ language. USER\
    language is implicitely created if required without invoking DEFINE LAN-
    GUAGE.  If  the command is prefixed by another user language, it will be
    part of it. Attempting to add a command of a program language is an  er-
    ror.

    Help_File  is an optional argument indicating the name of the associated
    help text to be used by the command HELP. The standard  rules  for  help
    syntax  applies  (see SIC documentation for details). If no help file is
    provided, the one of the parent language will be used.

    User defined commands are translated into their  equivalent  command  at
    execution  time.  They  appear in the list of command displayed by HELP,
    and can be abbreviated as normal "program-defined" commands. For example
        DEFINE COMMAND INPUT "@ input.greg" pr:input_greg.hlp
    define  a  new  command  USER\INPUT,  which  will  execute procedure in-
    put.greg.
2 DOUBLE
        [SIC\]DEFINE DOUBLE Var1[DIM1] [Var2[DIM2] [...]] [/GLOBAL]

    DOUBLE variables can be multi-dimensional. Up to  7  dimensions  can  be
    specified in the optional DIM field, with the following syntax:
        Var[n1] or Var[n1,n2] etc... up to Var[n1,n2,n3,n4,n5,n6,n7]
    where  Var  is  the  variable name and n1 to n7 are integer constants or
    variables.
2 FITS
        [SIC\]DEFINE  FITS  Var  File  [index|T|B]  [T|index|B]  [index|T|B]
    [/GLOBAL]

    Define  variables  associated  to  the keywords and data of a FITS file.
    The defined variables depend on the FITS file content. Both "basic" FITS
    files and FITS extension (XTENSION) are handled.

    An 'index' value may be added to read only the 'index'-th extension.

    With  'B'  code  (stands for Basic): define only the basic keywords, not
    proprietary keywords. In particular suppress HIERARCH keyword  structure
    present in ESO FITS headers.

    The  'T' code may be added to get all multidimensional arrays transposed
    (depending on how the FITS file was written, sometimes the dimensionali-
    ty  of  the  SIC variables created from the FITS structure is not handy.
    Using the transposition code can be a solution then).

    For basic FITS data, the following variables are defined

       VAR%NDIM       Integer        Number of dimensions
       VAR%DIM        Integer[4]     Dimensions
       VAR%CONVERT    Double[3,4]    Conversion formulae for the 4 axes:
                                     Reference pixel,
                                     Value at reference pixel,
                                     Increment
       VAR%DATA       Real           FITS data array
    The variables are defined as part of a structure.  GreG  command  LIMITS
    /RGDATA A recognizes such a basic FITS structure in much the same way as
    GILDAS images.

    The DEFINE FITS command tries to define a SIC structure  which  contains
    all  FITS  keywords,  as  well as all binary and ASCII tables located in
    FITS extensions.

    Support for Random groups (although this is an obsolescent  FITS  struc-
    ture, it is still widely used) is also available.

    DEFINE FITS only works to read FITS files, but not to create them.
2 FUNCTION
        [SIC\]DEFINE FUNCTION NAME(X,Y,Z) Expression(X,Y,Z)

    Define  an  arithmetic  user  function of several variables. The maximum
    number of variables is 4. The function definition can reference  any  of
    the  known  mathematic  operators and intrinsic or program defined func-
    tions, but not previously defined user  functions  (i.e.  user  function
    definition is not recursive).
2 HEADER
        [SIC\]DEFINE  HEADER Var1 File1 Key1 [Var2 File2 Key2 [...]] [/GLOB-
    AL]

    Define variables associated to the HEADER of the GILDAS  images  located
    in  the  specified  files. The Keyword must be either READ or WRITE. The
    following variables are defined:

       VAR%GENE       Integer        Length of general section
       VAR%NDIM       Integer        Number of dimensions (ReadOnly)
       VAR%DIM        Integer[4]     Dimensions           (ReadOnly)
       VAR%CONVERT    Double[3,4]    Conversion formulae for the 4 axes:
                                     Reference pixel,
                                     Value at reference pixel,
                                     Increment
       VAR%BLAN       Integer        Length of blanking section
       VAR%BLANK      Real[2]        Blanking and tolerance
       VAR%EXTREMA    Integer        Length of extrema section
       VAR%MAX        Real           Maximum
       VAR%MIN        Real           Minimum
       VAR%WHERE      Integer[4,2]   Position of max and min
       VAR%DESC       Integer        Length of units and coordinate system section
       VAR%UNIT       Char*12        Image unit
       VAR%UNIT1      Char*12        First axis type
       VAR%UNIT2      Char*12        Second axis type
       VAR%UNIT3      Char*12        Third axis type
       VAR%UNIT4      Char*12        Fourth axis type
       VAR%SYSTEM     Char*12        Coordinate system
       VAR%POSI       Integer        Length of position section
       VAR%SOURCE     Char*12        Source name
       VAR%RA         Double         Right Ascension
       VAR%DEC        Double         Declination
       VAR%LII        Double         Galactic longitude
       VAR%BII        Double         Galactic latitude
       VAR%EPOCH      Real           Epoch of coordinates
       VAR%PROJ       Integer        Length of projection section
       VAR%PTYPE      Integer        Projection type (code)
       VAR%A0         Double         First coordinate of projection center
       VAR%D0         Double         Second coordinate of projection center
       VAR%ANGLE      Double         Position angle of projection
       VAR%X_AXIS     Integer        First projected axis
       VAR%Y_AXIS     Integer        Second projected axis
       VAR%SPEC       Integer        Length of spectroscopy section
       VAR%LINE       Char*12        Line name
       VAR%FREQRES    Double         Frequency resolution
       VAR%FREQOFF    Double         Frequency offset
       VAR%RESTFRE    Double         Rest Frequency
       VAR%VELRES     Real           Velocity resolution
       VAR%VELOFF     Real           Velocity offset
       VAR%F_AXIS     Integer        Frequency/Velocity axis
       VAR%BEAM       Integer        Length of beam section
       VAR%MAJOR      Real           Major axis of beam
       VAR%MINOR      Real           Minor axis of beam
       VAR%PA         Real           Position angle of beam

    where VAR is the specified variable name for the header. VAR  becomes  a
    dummy variable of type header, which can only be referenced in a further
    DELETE /VARIABLE command. The VAR%item variables are ReadOnly  or  Read-
    Write  according to the keyword Key, except for the dimension variables,
    which cannot be modified.
2 IMAGE
        [SIC\]DEFINE IMAGE Var1 File1 Key1 [Var2 File2 Key2 [...]] [/GLOBAL]

    Define  variables  associated  to both the content and the header of the
    GILDAS images located in the files, if specified. This command acts as a
    combination  of DEFINE HEADER and DEFINE TABLE. It accepts the same key-
    words (KeyN) as DEFINE TABLE. If the keyword is READ, the  header  vari-
    ables are mapped ReadOnly, otherwise they are mapped ReadWrite.

    See  HELP DEFINE HEADER for a description of the individual header vari-
    ables.
2 INTEGER
        [SIC\]DEFINE INTEGER Var1[DIM1] [Var2[DIM2] [...]] [/GLOBAL]

    INTEGER variables can be multi-dimensional. Up to 7  dimensions  can  be
    specified in the optional DIM field, with the following syntax:
        Var[n1] or Var[n1,n2] etc... up to Var[n1,n2,n3,n4,n5,n6,n7]
    where  Var  is  the  variable name and n1 to n7 are integer constants or
    variables.
2 LANGUAGE
        [SIC\]DEFINE LANGUAGE Name [Help_File]

    Define a new user language. User languages can be filled with user  com-
    mands  with  DEFINE COMMAND. Their precedence against other languages is
    set by default to Automatic, use SIC PRIORITY afterwards to change it.

    If an help file is provided, the command HELP will look into  this  file
    for  the language help (see SIC documentation for details). Else it will
    display a summary of all the language commands and their translations.
2 LOGICAL
        [SIC\]DEFINE LOGICAL Var1[DIM1] Var2[DIM2] [...] [/GLOBAL]

    LOGICAL variables can be multi-dimensional. Up to 7  dimensions  can  be
    specified in the optional DIM field, with the following syntax:
        Var[n1] or Var[n1,n2] etc... up to Var[n1,n2,n3,n4,n5,n6,n7]
    where  Var  is  the  variable name and n1 to n7 are integer constants or
    variables.
2 REAL
        [SIC\]DEFINE REAL Var1[DIM1] [Var2[DIM2] [...]] [/GLOBAL]

    REAL variables can be multi-dimensional. Up to 7 dimensions can be spec-
    ified in the optional DIM field, with the following syntax:
        Var[n1] or Var[n1,n2] etc... up to Var[n1,n2,n3,n4,n5,n6,n7]
    where  Var  is  the  variable name and n1 to n7 are integer constants or
    variables.
2 STRUCTURE
        [SIC\]DEFINE STRUCTURE Str [/GLOBAL]

    Define a new structure name. Structure  naming  follows  the  Fortran-90
    convention, i.e. Str%SubStr%SubStrElement. Structure elements (including
    sub-structures if needed) can be defined using command
        DEFINE REAL Str%Element
    etc.

    An entire structure and all its associated members is deleted by a  sin-
    gle command DELETE Str /VARIABLE.
2 TABLE
        [SIC\]DEFINE TABLE Var1 File1 Key1 [Var2 File2 Key2 [...]] [/GLOBAL]

    Define variables associated to GILDAS images located in  the  files,  if
    specified. The variable type and dimensions are derived according to the
    value of the keyword Key and the file content:
      - READ or WRITE: use the type and dimensions from the file,  and  con-
        nect  the  image  in Readonly or ReadWrite access. The variable name
        must not include any dimension field.
      - DOUBLE, INTEGER or REAL: create a new table of the  specified  type.
        The  dimensions must then be specified in the dimension field of the
        variable name, as for a standard variable. The  associated  file  is
        created, unless a star ('*') is used as file name.
      - EXTEND: take type and first dimensions from the file, but extend the
        last dimension to the value specified in the  dimension  field.  The
        full syntax in this case is thus
                DEFINE TABLE Var[Ldim] File EXTEND
        where Ldim is the new value for the last dimension.

    DEFINE TABLE  does  not  create  any  additional variables for the image
    header. See DEFINE IMAGE and DEFINE HEADER for this information.
2 UVTABLE
        [SIC\]DEFINE UVTABLE Var1 File1 Key1 [Var2 File2 Key2 [...]] [/GLOB-
    AL]

    Define  variables  associated  to both the content and the header of the
    GILDAS UV Table located in the specified files. The files must be UV Ta-
    bles,  a version of 2-D tables with some conventions for the interpreta-
    tion of columns and an image-like header.

    See HELP DEFINE HEADER for a description of the individual header  vari-
    ables.
2 /GLOBAL
        [SIC\]DEFINE Type Var1 [Var2 [...]] /GLOBAL

    The  /GLOBAL  option specifies that the variables are global, instead of
    being local to the current procedure. Local  variables  have  precedence
    over global variables.

    The  /GLOBAL option is incompatible with DEFINE FUNCTION and DEFINE COM-
    MAND.
2 /LIKE
        [SIC\]DEFINE Type Var1 [Var2 [...]] /LIKE VarLike
        [SIC\]DEFINE IMAGE Var1 File1 Key1 [...]] /LIKE VarLike
        [SIC\]DEFINE STRUCTURE Struct1 [Struct2 [...]] /LIKE StructLike

    The /LIKE option allows definition of Type REAL, LOGICAL, DOUBLE or  IN-
    TEGER  arrays  with dimensions identical to those of the (existing) Var-
    Like array. IMAGEs and TABLEs can also be defined in this way.  The  di-
    mension  field  must  not be specified in such a case. /LIKE can also be
    used in structures context: the new structure will be filled with a tree
    identical to the StructLike one.

    The  /LIKE  option is incompatible with DEFINE FUNCTION, DEFINE COMMAND,
    as well as DEFINE HEADER and DEFINE FITS.
1 DELETE
        [SIC\]DELETE /VARIABLE|/SYMBOL|/FUNCTION Name1 [Name2 [...]]

    Delete specified variables, symbols or functions. For  IMAGE  variables,
    also frees the corresponding file.
1 EDIT
        [SIC\]EDIT [File_Name]

    Without  argument,  EDIT  dumps  the  Stack on a file named STACK.DEFEXT
    where DEFEXT is the default macro extension specified by the program  or
    by  the user using command SIC\SIC EXTENSION, and then calls a text edi-
    tor to edit this file. If a file name is given, the  specified  file  is
    edited.

    The  editor  to be chosen is defined by the logical name GAG_EDIT, which
    you can define in your $HOME/.gag.dico file. Command SIC EDIT  NewEditor
    can also be used to re-define the choice of the editor.
1 ELSE
        [SIC\]ELSE [IF Logical_expression [THEN]]

    Conditional directive in an IF-END IF block. Similar to Fortran ELSE and
    ELSEIF statements, but note that here the space between ELSE and  IF  is
    compulsory,  while the THEN keyword is optional. If the compulsory space
    bothers you, just define the following symbol
        SYMBOL ELSEIF "SIC\ELSE IF"
1 END
        [SIC\]END Procedure|Help|Data|If

        [SIC\]END IF

    Mark the end of an IF block. Normal execution resumes. The symbol  ENDIF
    is defined as an abbreviation of SIC\END IF.

        [SIC\]END Procedure|Help|Data

    Terminate  the  definition  of a new Procedure, Help file, or Data file.
    See command BEGIN for details.
1 EXAMINE
        [SIC\]EXAMINE [Name1] [Name2] [...]  [NameN]  [/GLOBAL]  [/FUNCTION]
    [/HEADER] [/ADDRESS] [/ALIAS]

    List variables or functions.

    If  the  /FUNCTION option is not present, EXAMINE without argument gives
    the list of known variables with their respective types.  Each  variable
    name  is  followed  by  its definition and the keywords "GBL" for GLOBAL
    (interpreter level 0) variables, LCL(lev) for LOCAL variables at  inter-
    pretor  level "lev" (viz., in a procedure), WR for READ/WRITE variables,
    RD for READONLY variables.

    With one or more arguments, EXAMINE will usually type the content of the
    specified variables (local variables have priority). But:
      - If the argument ends by the % character, it is assumed to indicate a
        structure or an image header, and all  associated  header  variables
        are listed.
      - Wildcarding  is  permitted: if the argument contains one or more "*"
        character, all compatible variables names are listed.
      - In any case, typing an ambiguous variable name will generate a  list
        of choices.
    With  the /FUNCTION option, lists the definition of the specified or all
    (no command argument) user-defined functions.

    With the /GLOBAL option, lists only the GLOBAL variables, as opposed  to
    LOCAL variables (i.e, in a loop or a macro)

    With  the  /HEADER option, lists only the variables having an associated
    header (i.e., the known images).

    With the /ALIAS option, lists only the Aliases and their association.

    The /ADDRESS option is used for debugging. It gives the  internal  vari-
    able descriptor.
1 EXIT
        [SIC\]EXIT

    EXIT  always  ends SIC execution, at any level. In interactive sessions,
    <^D> has the same behaviour as EXIT.

    On the opposite <^Z> only ends the current level of execution,  so  that
    when  typed at the top level, <^Z> also ends the session. Note that <^Z>
    may be trapped when interactive editing is enabled.

    Note that end of SIC execution does not necessarily means end of program
    execution: SIC may be entered again later by the calling program.
1 FOR
        [SIC\]FOR Loop_Variable n1 n2 n3 TO n4 BY n5 n6 TO n7
        or
        [SIC\]FOR /WHILE Logical_Expression

    Open  a  FOR-NEXT  loop to be executed for values in the list (FOR Vari-
    able), or until a logical expression becomes false  (FOR  /WHILE).   The
    last  character of the prompt becomes a ':' instead of '>', and all sub-
    sequent commands typed in until NEXT are the body of  the  loop.  Up  to
    nine  loops may be nested in any way. The index of the loop will be sub-
    stituted to the loop variable Loop_Variable during loop  execution.  The
    substitution  occurs  also within character strings if the loop variable
    name is included between single quotes. Note that the index  values  may
    be real.

        [SIC\]FOR Loop_Variable n1 n2 n3 TO n4 BY n5 n6 TO n7

    The loop specified in this example will execute for the following values
    of the index :
            n1
            n2
            n3, n3 + n5, n3 + 2 n5, n3 + 3 n5, ... , n4
            n6, n6 + 1, n6 + 2, ... , n7
    (assuming that n4-n3 is a multiple of n5, n7-n6 an integer).  Loop vari-
    ables  are  undefined  outside  the loop, and must not be previously de-
    fined. Invalid ranges are ignored at execution time: e.g. in the  previ-
    ous  example,  the  loop  would  not  be  executed for n3 TO n4 BY n5 if
    n5*(n4-n3) < 0, but no error is signaled. Increments of 0 produce an er-
    ror.

    Conditional  loops  execute  until the logical expression becomes false.
    For example FOR /WHILE .TRUE. will execute forever.
1 HELP
        [SIC\]HELP Name[\] [Subtopic]

    Without an argument, HELP gives the list of available help.  If the  "\"
    character  is  present,  Name is assumed to be a language name, and HELP
    gives a one line description of all commands specific to this  language.
    If the "\" is not present, Name is a command, and HELP gives more infor-
    mation about it.

    Two levels of Help are available. The subtopic may be a  command  option
    (and a * to get information on all subtopics of the command).
1 IF
        [SIC\]IF Logical_Expression [THEN]
        [SIC\]IF Logical_Expression Command [Arguments]

    The first form starts a conditional IF block. The behaviour of IF blocks
    is similar to structured Fortran. The THEN keyword is optional.
    The second form defines a logical IF statement, i.e. it  uses  a  single
    line  with  no possibility of alternate execution (no ELSE choice). When
    the argument following the logical expression is not THEN, it is assumed
    to  be a command which will be interpreted, together with the next argu-
    ments, if the logical expression evaluates as true.

    This command can only be used within a procedure: interactive users  are
    expected to be able to make their decisions themselves.

    There must be no blanks within the logical expression, but composite ex-
    pressions are allowed. Two special logical functions can also be used:
      - EXIST(VarName) Returns .TRUE. if VarName is an existing variable
      - FILE("String") Returns .TRUE. if String is an existing file.  Double
          quotes  protect  the  case of the string. Syntax FILE("'VarName'")
          allows to check the string contained in a character variable.
1 IMPORT
        [SIC\]IMPORT Package

    Dynamically import a package (i.e. load its languages  and  perform  its
    initialization)  in  current  scope. This allows to load another package
    without closing (and loosing) the current session.

    This feature is currently only available for: ASTRO, CLASS and  MAPPING.
1 LET
        [SIC\]LET Variable [=] [Expression]
        [SIC\]LET Variable [=] Expression /NEW Type [Attr]
        [SIC\]LET Variable [=] Expression /WHERE Condition_mask
        [SIC\]LET Variable [=] Expression /PROMPT "Explanatory text"
        [SIC\]LET Variable [=] Expression /RANGE Min Max
        [SIC\]LET Variable [=] Expression /CHOICE Value_1 ... Value_n
        [SIC\]LET Variable [=] Expression /INDEX Value_1 ... Value_n
        [SIC\]LET Variable [=] Expression /FILE Filter
        [SIC\]LET Variable [=] Expression /SEXAGESIMAL
        [SIC\]LET Variable [=] Expression /LOWER
        [SIC\]LET Variable [=] Expression /UPPER
        [SIC\]LET Variable [=] Expression /FORMAT format_string
        [SIC\]LET Variable [=] Expression /FORMULA
        [SIC\]LET Variable [=] OldVariable /REPLACE
        [SIC\]LET Variable /STATUS Read|Write

    Assign  a value to a variable. The variable must already be defined (see
    DEFINE) unless the /NEW option is present.  Logical  expression  results
    cannot be assigned to non logical variables, and vice versa. All numeri-
    cal expression evaluations are done in double precision,  and  automati-
    cally converted to the type of (numerical) variable assigned.

    The  equal sign may be always omitted EXCEPT when using Free Syntax (see
    below).

    If no value is assigned to the Variable, the user will be  prompted  for
    the  variable value. The Prompt text can be defined with the /PROMPT Op-
    tion.

    VECTOR OPERATION:

    Operations are vectorial, i.e. a full array  is  computed  at  the  same
    time. The variable name can define a subset of an known array, such as:
        DEFINE REAL A[4,5,6] B[4]
        LET A[,,3]  = 1.0  ! or equivalently  LET A[3] = 1.0
        LET A[,2,2] = B    ! or equivalently  LET A[2,2] = B
    These  commands  assign the value 1.0 to A[i,j,3], with i running from 1
    to 4 and j from 1 to 5, and B[k] to A[k,2,2] for k from 1 to 4.  Implic-
    it  transposition  is  now  allowed, though still somewhat experimental:
    both A[,2,3] and A[2,,3] are valid. A range of indexes can be  specified
    rather than one index: for the above example A[3:5] is a valid 4x5x3 ar-
    ray, A[2:4,,] is a 3x5x6 array.

    IMPLICIT LOOPS:

    In addition to vector computing, it is possible to assign an array using
    "implicit loops", i.e. functions of the array indices such as
        DEFINE REAL A[4,5]
        LET A[I,J] = (I-J)**2
    Implicit loops cannot be mixed with variable index values.

    CONDITION MASK (/WHERE option):

    Vector  assignment  can be done only where a specified logical array (or
    logical array expression) is true, using the /WHERE option. See HELP LET
    /WHERE.

    FREE SYNTAX:

    The  LET  command may be omitted if no option is present, and is the SIC
    syntax is set to FREE. In case of conflict between a variable name and a
    (complete) command name, an error message is issued. See SIC command.

    GUI (Graphic-User-Interface) input mode:

    If  command  GUI\PANEL  has  been issued before, the LET command defines
    widgets in the master window defined by GUI\PANEL. The widget is a  sim-
    ple  prompt  when  option  /PROMPT  is set, a slider if option /RANGE is
    present, a list of choices if option /CHOICE or /INDEX is given,  and  a
    selection of files with the specified filter when option /FILE is speci-
    fied. If neither of these options is present, the LET command  works  in
    the usual way.

    The  widgets are created and activated by command GUI\GO. Standard input
    can be used, and pressing button GO will define  all  the  variables  as
    specified. If button ABORT is pressed instead, none of the variables are
    modified and an error is returned. Error handling is available.
2 /CHOICE
        [SIC\]LET Variable [= Expression] /CHOICE Value_1 Value_2  ...  Val-
    ue_n
                (GUI input mode)

    Activate  a  choice widget which will return a value among the specified
    list. The widget will be created by command GUI\GO. If the  last  speci-
    fied value is an asterisk, any value is also valid.
2 /FILE
        [SIC\]LET Variable [= Expression] /FILE Filter
                (GUI input mode)

    Activate  a  "file"  widget  to select a file according to the specified
    filter. The widget will be created by command GUI\GO.
2 /FORMAT
        [SIC\]LET Variable [=] Expression /FORMAT format_string

    Use the specified format to convert  the  expression  into  a  character
    string and assign it to the requested (character) variable. For example:
      define character c*6
      LET C acos(-1.0) /FORMAT F6.3
      exa c
      c = 3.142
2 /FORMULA
        [SIC\]LET Variable [=] Expression /FORMULA [/other_option]
                (GUI input mode)

    Use Expression as a formula in GUI input mode, rather than only the val-
    ue of the expression.
2 /INDEX
        [SIC\]LET Variable [= Expression] /INDEX Text_1 Text_2 ... Text_n
                (GUI input mode)

    Activate  a choice widget which will return an integer value correspond-
    ing to the index of the selected text among the specified list. The wid-
    get will be created by command GUI\GO.
2 /LOWER
        [SIC\]LET Variable [=] Expression /LOWER

    Convert the output to lower case prior to assignment. To convert a vari-
    able, use e.g. for variable C
       let c 'c' /lower
2 /NEW
        [SIC\]LET Variable [=] Expression /NEW Type [Attr]

    Define the variable and assign it at the same time. Type is the type  of
    the  variable  (REAL, INTEGER, DOUBLE for double precision, or LOGICAL).
    The Attr argument is used to specify whether the newly created  variable
    is LOCAL (default) or GLOBAL. See also the SIC\DEFINE command.
2 /PROMPT
        [SIC\]LET Variable [=] [Expression] /PROMPT "Explanatory text"
                (GUI input mode)

    Create  a  text  widget,  with  a specified prompt, to return a value or
    valid expression for the variable. The text  widget  can  be  pre-loaded
    with  an  expression  or value(s). Standard input will be available once
    the widget is created by command GUI\GO.
2 /RANGE
        [SIC\]LET Variable [=] [Expression] /RANGE Min Max
                (GUI input mode)

    Activate a slider widget to return a value within the  specified  range.
    The widget will be created by command GUI\GO.
2 /REPLACE
        [SIC\]LET NewVariable [=] OldVariable /REPLACE

    Replace  OldVariable  by  NewVariable.  The  content and location of the
    variable remains unchanged: only the name is modified.
2 /SEXAGESIMAL
        [SIC\]LET  Numeric  [=]  [+|-]DD[:MM[:SS.SS]]  /SEXAGESIMAL  [D|H|R]
    [D|H|R]
        [SIC\]LET String [=] Value /SEXAGESIMAL [D|H|R] [D|H|R]

    The /SEXAGESIMAL option allows to use sexagesimal expressions in assign-
    ments. This option is only valid for  scalar  variables.  Units  of  the
    operands  can  be  provided  by  optional characters chosen in D)egrees,
    H)ours or R)adians. The first unit is for the output, the second for the
    input.  Radians  are an invalid unit for the sexagesimal string. Degrees
    are assumed by default for both operands.

    The first form converts the sexagesimal expression into a numerical val-
    ue stored in the assigned variable. Mathematical expressions can be used
    for each elements, provided they are separated by a semicolon.

    The second form converts a numerical value into the sexagesimal notation
    stored in the assigned character variable.
2 /STATUS
        [SIC\]LET Variable /STATUS Read|Write

    Modify a variable status to/from ReadOnly from/to Writeable.
2 /UPPER
        [SIC\]LET Variable [=] Expression /UPPER

    Convert the output to upper case prior to assignment. To convert a vari-
    able, use e.g. for variable C
       let c 'c' /upper
2 /WHERE
        [SIC\]LET Variable = Expression /WHERE Condition_mask

    The LET command allows setting variables only where  a  given  condition
    mask  is  .TRUE.. The condition mask can be a logical array or a logical
    expression (of same dimension as the result  variable).  Implicit  loops
    can be used in conjunction to the /WHERE option.

    For example
       DEFINE REAL A[4,5] B[4,5]
       LET B[I,J] = I+J
       LET A[I,J] = (I-J)**2 /WHERE COS(I).GT.SIN(J)  ! 1
       LET A[I,J] = SIN(I+J) /WHERE B.GT.5            ! 2
    is  equivalent  (in terms of results, but about 500 times faster) to the
    loops
       DEFINE REAL A[4,5] B[4,5]
       LET B[I,J] = I+J
    ! 1
       FOR J 1 to 5
         FOR I 1 to 4
           IF (COS(I).GT.SIN(J)) THEN
             LET A[I,J] = (I-J)**2
           ENDIF
         NEXT
       NEXT
    ! 2
       FOR J 1 to 5
         FOR I 1 to 4
           IF (B[I,J].GT.5) THEN
             LET A[I,J] = SIN(I+J)
           ENDIF
         NEXT
       NEXT

    Note in the example above that implicit variables can be used.  However,
    the following syntax is non valid,
       LET A[I,J] = SIN(I+J) /WHERE B[I,J].GT.5
    because  implicit variables cannot appear as indexes to an operand array
    (B), but only as indexes to the result array (A) or as variables  as  in
    SIN(I+J). The correct syntax would be
       LET A[I,J] = SIN(I+J) /WHERE B.GT.5
    The following syntax is also non valid
       LET A = B /WHERE B[I,J].GT.LOG(I+J)
    because  implicit  variables  cannot be defined by an operand array (B),
    but only by the result array. The correct syntax would be
       LET A[I,J] = B /WHERE B.GT.LOG(I+J)
1 MESSAGE
        [SIC\]MESSAGE Severity ProcedureName "Message"
        [SIC\]MESSAGE Severity ProcedureName Arg1  Arg2  ...  ArgN  [/FORMAT
    Fmt1 Fmt2 ... FmtN]

    Print  a message using the same mechanism as the one used by Gildas pro-
    grams. In particular, it will be printed or not, to the terminal  and/or
    to  the  message  file, depending on the filters that currently apply to
    messages.
    - The severity must be a  single  letter  from  one  of  the  following:
      F)atal,  E)rror,  W)arning,  R)esult, I)nfo, D)ebug, T)race, C)ommand,
      U)nknown.
    - The procedure name is a free character string.
    - The message must have at least one component. Multiple remaining argu-
      ments  will be printed out spaced by a single space. Enclose with dou-
      ble-quote a character string if you want to use more than one space.
    - If /FORMAT option is invoked, each argument is displayed using its as-
      sociated format. Formats are Fortran ones (so may be slightly machine-
      dependent) like a10, i2, f5.2 and so on.

    Example:
    SIC> MESSAGE I FOO "Hello world!"
    I-FOO,  Hello world!

    For more information on message filters, see the HELP for  the  SIC MES-
    SAGE command.
1 MFIT
        [SIC\]MFIT Yvar=Func(Xvar,&A,&B,...) [/START A1 B1 ...] [/STEP A2 B2
    ...]  [/EPSILON e] [/WEIGHTS w] [/METHOD m] [/QUIET]
            or
        [SIC\]MFIT Filename [/START A1 B1 ...] [/STEP A2 B2  ...]  [/EPSILON
    e] [/WEIGHTS w] [/METHOD m] [/QUIET]

    Perform a least squares fit using the specified Method. The least square
    fit tries to adjust function Func of variable Xvar  and  parameters  &A,
    &B, ... to match variable Yvar.

    Any  function  or  combination  of  functions  known by SIC may be used.
    Blanks are supported in the formula. The '=' sign is required.

    Fit parameter DUMMY names are &A...&Z . Already  defined  SIC  variables
    may  be  used  in  the formula as long as they don't match the variables
    used by MFIT. The resulting parameters will be stored in  the  structure
    variable  MFIT%.  An array with weights may be given by option /WEIGHTS.
    It must match the dimension of the formula result (defaulted to  uniform
    weight).

    The  formula  can  also  be  provided  by a disk file (default extension
    .GRF), where lines beginning with an exclamation  mark  are  treated  as
    comments.  Inside the file, blanks can be used in the formula, which may
    be spread over several lines.

    The command MFIT defines the following global SIC variables to hold  its
    results:
        MFIT%PAR    : Fit parameters
        MFIT%ERRORS : The parameter errors, if they have been computed
        MFIT%MATH   : Text string containing the formula with replaced dummies
        MFIT%FIT    : Found approximation (the application of MFIT%MATH)
        MFIT%RES    : Residuals  (i.e. Yvar-MFIT%FIT)
        MFIT%STATUS : .FALSE. on successful completion.

    Suppose you read X,Y=f(X) and Z (errorbar on Y) in the 3 arrays X, Y and
    Z.  You could change Z into weights (for example SIC\LET Z 1|Z^2 ), then
    fit a cubic polynomial regression in variables X,Y by typing:
        MFIT Y=(&A*X^3+&B*X^2+&C*X+&D) /WEIGHTS Z
    The MFIT command will print the used formula:
        I-MFIT,  Formula (stored in variable MFIT%MATH) :
        (MFIT%PAR[01]*X^3+MFIT%PAR[02]*X^2+MFIT%PAR[03]*X+MFIT%PAR[04])
    The  array MFIT%PAR will contain MFIT%PAR[1]=value of '&A', and so on...
    to be used afterwards.
2 /EPSILON

        This option is used to specify the desired tolerance. Its  interpre-
    tation  is  method dependent. For SIMPLEX and POWELL, it means the rela-
    tive deviation of the mean squared difference of two fit iterations. For
    SLATEC,  which uses non-reduced chi-2, it is the absolute difference be-
    tween two iterations. For ANNEAL, its interpretation is totally  differ-
    ent.

    Use  default  value  0  to let the program guess. In subtle cases, or to
    gain speed in case a coarse result is desired, use  values  around  1D-5
    for  SIMPLEX  and POWELL, and of order 1 for SLATEC. For ANNEAL, see de-
    tails in the /METHOD option.

    Note that this is not the absolute error of the fit parameters.
2 /METHOD
      ANNEAL  Simulated annealing technique. This may require a  very  large
        number of function evaluation.
      POWELL  Gradient  using  the  Powell  method (see Press et al. for de-
        tails).
      SIMPLEX Classical Simplex amoeba search
      ROBUST  A combination of Simplex + Slatec, to be used with large  ini-
        tial steps.
      SLATEC  Modified  Levenberg  Marquardt  method with adaptive steps, as
        implement in the Slatec library.

    All methods require a proper choice of initial values and steps. The AN-
    NEAL method is much more robust against poor guesses, but may require 10
    to 100 times more function evaluations than any other.
2 /QUIET

        Require MFIT to be silent (useful to  avoid  too  many  messages  in
    loops).
2 /START
          [SIC\]MFIT Y=f(X,&a,...) /START A1 B1 ...

    A1  B1  ...  are  used to pass starting guesses for the parameters &A &B
    (defaulted to 1.0). The starting values should not be too far from a po-
    tential solution, otherwise the convergence may not be possible.
2 /STEP
          [SIC\]MFIT Y=f(X,&a,...) /STEP A2 B2 ...

    A2  B2  ... are used to pass the unity vectors (steps) for the iteration
    on parameters &A &B (defaulted to 0.1). Poor choice of initial steps may
    lead  to  non convergence. Too small steps will not help converging when
    one starts too far from the solution. Too large steps may lead to incor-
    rect evaluation of the parameter errors. The optimal step for the deter-
    mination of the errors is about the error bar, so  that  all  parameters
    become dimensionless.
1 NEXT
        [SIC\]NEXT

    Depending on the context, NEXT has one of two possible interpretations:
      - If typed during loop definition, NEXT indicates the end of the defi-
        nition and starts the execution.
      - If encountered during loop execution, NEXT will  skip  all  instruc-
        tions remaining in the Loop Buffer and resumes the Loop execution at
        its first line for the next value of the index. This  typically  oc-
        curs as an error recovery (ON ERROR NEXT).
    The  commands will be echoed to the terminal if the VERIFY switch is ON.
1 ON
        [SIC\]ON Status [Command]

    Perform the Command when Status in encoutered. Only the ON ERROR case is
    available. See subtopic ERROR for details.
2 ERROR
        [SIC\]ON ERROR [Command]

    This  command  changes  the current error recovery action. By default, a
    PAUSE is automatically generated by any error during execution.

    This can be changed and any other valid command line Command can be  ac-
    tivated  instead of PAUSE when an error occurs, using the command ON ER-
    ROR Command. A very useful error recovery command  for  loops  is  NEXT,
    which enables skipping the remaining commands of the loop when something
    went wrong, and resumes the loop at for the following index value.

    Note that the ON ERROR command does not affect  the  behaviour  on  <^C>
    trapping,  which  always  returns  a PAUSE. The ON ERROR command is only
    valid within the procedure which declared it.
1 PARSE
        [SIC\]PARSE [/OptionName1] ... [/OptionNameN]

    Parse the array PRO%ARG in order to mimic the options mechanism provided
    by a standard command.

    When a procedure is executed, the array PRO%ARG is filled with the argu-
    ments passed to the procedure. If you invoke the command PARSE with some
    option  names, it will parse the arguments to gather them by options and
    option arguments into the structure PRO%PARSE%.

    For example, if you invoke your procedure like this:

        SIC> @ myprocedure 123 /MYOPTION "ABC"

    the PRO%ARG array will contain
        SIC_3> EXA PRO%ARG
        PRO%ARG    is a character*256 Array of dimensions 3
        123
        /MYOPTION
        ABC

    Invoking the command PARSE in your procedure e.g.
        SIC_3> PARSE /MYOPTION /OTHEROPTION

    will gather the command and the 2 option arguments like this:
        SIC_3> EXA PRO%PARSE%
        PRO%PARSE%                                    ! Structure GLOBAL
        PRO%PARSE%COMMAND                             ! Structure GLOBAL
        PRO%PARSE%COMMAND%NARG =            1         ! Integer GLOBAL RO
        PRO%PARSE%COMMAND%ARG is a character*256 Array of dimensions 1
        PRO%PARSE%MYOPTION                            ! Structure GLOBAL
        PRO%PARSE%MYOPTION%NARG =            1        ! Integer GLOBAL RO
        PRO%PARSE%MYOPTION%ARG is a character*256 Array of dimensions 1
        PRO%PARSE%OTHEROPTION                         ! Structure GLOBAL
        PRO%PARSE%OTHEROPTION%NARG =           -1     ! Integer GLOBAL RO

    Namely: the command was passed 1 argument (available in  the  associated
    ARG  array),  the  option MYOPTION was passed 1 argument, and the option
    OTHEROPTION was absent (NARG=-1). An option is present if NARG>=0.

1 PAUSE
        [SIC\]PAUSE "Message"

    Set a break point in a Loop or a Macro. PAUSE returns  control  to  user
    when  executed  in a macro. The prompt is changed to indicate the execu-
    tion level. Any valid command can be executed while in  interrupt  mode.
    The execution can be resumed by typing CONTINUE, aborted by QUIT (or RE-
    TURN, depending whether an error status is desired). NEXT  may  also  be
    used for the Loop.

    If  PAUSE  is  followed  by an argument, this argument is typed when the
    pause occurs. When typed in interactive, PAUSE generates a traceback  of
    the levels of execution in SIC.

    A pause is generated after completion of the current command if you type
    <^C> on the keyboard. This allows you to interrupt any sequence of  com-
    mands (even if ON ERROR CONTINUE has been typed).
1 PYTHON
        [SIC\]PYTHON
        [SIC\]PYTHON PythonCommandLine
        [SIC\]PYTHON PythonScript.py

    Any  form of the PYTHON command starts the Python interpreter and inter-
    communication between SIC and Python at first call. Subsequent  call  do
    not repeat this initialization step.

    Three main interaction schemes are available:
      - Without argument, the user is exposed to the PYTHON prompt.

      -  With  a  Python  command line as argument (any string following the
        command), the command is transparently executed and the user recover
        the  SIC  prompt. Arguments starting with a slash (/) should be pro-
        tected by double-quotes: this avoids SIC to interpret it as  a  com-
        mand  option.  Remember  also  that Python is case sensitive and the
        string should take care of this. For example:
            SIC> PYTHON print "Hello world!"
            Hello world!
            SIC> PYTHON def f(x): return x*x
            SIC> PYTHON print f(2)
            4
            SIC>

      - With a PythonScript.py as first argument (i.e. ending  with  ".py"),
        the  Python  script  is  executed  and then the user recover the SIC
        prompt. Arguments following the script name can be recovered in  the
        sys.argv  Python list. These arguments are interpreted by SIC before
        being sent to the script. For example:
            SIC> TYPE show_args.py
            import sys
            for i in sys.argv:
              print i, type(i)
            SIC>
            SIC> PYTHON show_args.py PI 'PI' 1.234
            showrgs.py <type 'str'>
            PI <type 'str'>
            3.1415926535898 <type 'str'>
            1.234 <type 'str'>
            SIC>
1 QUIT
        [SIC\]QUIT [ALL]

    When typed after a pause, QUIT aborts the execution of  the  interrupted
    level. QUIT returns an error to the previous level to signal this anoma-
    lous end. The previous level is then also interrupted to  allow  a  com-
    plete  error  recovery. Note that this behaviour depends on the ON ERROR
    command. QUIT can also be used to abort FOR-NEXT loop compilation.

    If argument ALL is present, all nested procedures are aborted,  and  SIC
    goes back to base level.

    In interactive sessions, QUIT should be used instead of BREAK and RETURN
    because it allows extra decision at run time. QUIT used as the error re-
    covery command is equivalent to RETURN ERROR.
1 RECALL
        [SIC\]RECALL [Arg]

    This  command retrieves command lines from the stack. The retrieved line
    is edited if possible or immediately executed if not. If no argument  is
    present,  the  last command line is retrieved. If the argument is a num-
    ber, the specified command is retrieved. If it is  a  character  string,
    the first (most recently entered) command which begins by this string is
    recalled (in this case, the string may include a full language  name  or
    no language at all).

    When  line editing is possible, commands can also be retrieved using the
    Up arrow (or ^P) to recover the previous command, and Down arrow (or ^N)
    to recover the next command.

    If  no line editing is available, you are prompted whether to execute or
    not the recalled command.
1 RETURN
        [SIC\]RETURN [BASE|ERROR]

    End a procedure execution, transmitting or not an error if argument  ER-
    ROR is present.

    If  argument BASE is present, RETURN will end all nested procedures, and
    give back control to base level, without transmitting any error.
1 SAY
        [SIC\]SAY ["Text"] ['Expression'] ['Variable'] [/FORMAT ...]

    Display strings or character variable or implicitly formatted arithmetic
    (or  logical)  expressions  in  the shortest possible format, unless the
    /FORMAT option is used.  By default, SAY writes its output text both  on
    the current output and on the file opened by command SIC\SIC OUTPUT.

    In  GUI mode (see command GUI\PANEL), SAY writes the text in the current
    window. SAY without parameters inserts a separator.
2 /FORMAT
        [SIC\]SAY Arg1 Arg2 [... ArgN] /FORMAT fmt1 fmt2 [...fmtn]

    where fmt1 applies to Arg1, and so on. The format used is a Fortran for-
    mat (so it may be slightly machine-dependent). Use formats like a10, i2,
    f5.2, and so on.
1 SIC
        [SIC\]SIC Arg1 Arg2 [... ArgN]

    The SIC command has 3 categories of actions:

    (1) File Handling actions:
    These are used to manipulate files in a system independent ways from SIC
    procedures.
        SIC APPEND File FileAppended
        SIC COPY FileOld FileNew
        SIC DELETE File
        SIC DIRECTORY Directory
        SIC EXPAND Infilename Outfilename
        SIC FIND FileFilter
        SIC MKDIR New_Directory
        SIC MODIFIED FileName StrName
        SIC OUTPUT FileNew
        SIC RENAME FileOld FileNew
        SIC SAVE FileNew Command
        SIC SEARCH File  (Obsolescent)

    (2) SIC status actions:
    These  are  used to toggle some mode of the SIC monitor, or control some
    SIC monitor parameter. When called with no further argument, the  status
    of the item will be displayed.
        SIC EDIT
        SIC ERROR
        SIC EXTENSION MacroExtension
        SIC HELP HelpMode
        SIC INTEGER SHORT|LONG
        SIC LOGICAL LogName [Translation]
        SIC Language\ [Status]
        SIC MACRO MacroPath
        SIC MEMORY
        SIC MESSAGE
        SIC PRECISION
        SIC PRIORITY [Level Language]
        SIC RANDOM_SEED
        SIC SYNTAX
        SIC SYSTEM
        SIC TIMER
        SIC VERIFY
        SIC VERSION
        SIC WHICH
        SIC WINDOW

    (3) Miscellaneous actions:
    These execute some system actions, or return some system information.
        SIC BEEP [N]
        SIC CPU
        SIC DATE
        SIC DEBUG
        SIC LOCK LockFile
        SIC USER
        SIC WAIT Seconds
        SIC DELAY [Seconds]
        SIC FLUSH
2 APPEND
        [SIC\]SIC APPEND FirstFile FileAppended

    Append file "FirstFile" to file "FileAppended". It is equivalent to Unix
    command
            cat FirstFile >> FileAppended
    but system independent.
2 BEEP
        [SIC\]SIC BEEP [N]

    Will beep 1 or N times.
2 CPU
        [SIC\]SIC CPU

    Will return the User CPU and System CPU times in real variables USER and
    SYSTEM  resp.  These variables are holded by two structures SIC%CPU%RAW%
    and SIC%CPU%CUMUL% which record times since  last  and  first  calls  of
    SIC CPU  resp.  These  structures also provide elapsed time in variables
    ELAPSED.
2 DATE
        [SIC\]SIC DATE

    Will return the current date and time in symbol SYS_DATE.
2 DEBUG
        [SIC\]SIC DEBUG LUN [Number]
        [SIC\]SIC DEBUG IMAGE [Number]
        [SIC\]SIC DEBUG MEMALIGN
        [SIC\]SIC DEBUG MESSAGE
        [SIC\]SIC DEBUG GFORTRAN
        [SIC\]SIC DEBUG RESOURCES
        [SIC\]SIC DEBUG PYTHON
        [SIC\]SIC DEBUG VARIABLES

    Debugging command.

    The first two keywords LUN and IMAGE print the status of reserved  Logi-
    cal UNit numbers (LUN), or of allocated image slots (IMAGE).

    The  MEMALIGN  keyword  will  check if dynamically allocated buffers are
    aligned on 4, 8, 16 and 32 bytes. Some  applications  (e.g.  FFTW3)  are
    more or less faster dependending on the buffer alignment in memory.

    The  MESSAGE  keyword  swaps  ON or OFF the debugging mode for messages.
    When turning it ON, all messages to both screen and  message  files  are
    enabled. In this case it is a shortcut of the commands:
       SIC MESSAGE GLOBAL ON
       SIC MESSAGE GLOBAL A=FEWRIDTCU
    When turning it OFF, standard message filters (maybe customized by user)
    are re-enabled. It is a shortcut of the command:
       SIC MESSAGE GLOBAL OFF
    Default is debug mode turned OFF, unless a '-d' option has been provided
    when invoking the Gildas executable.

    The GFORTRAN keyword will check if the program is able to read and write
    correctly Gildas binary files. Some versions of  the  Gfortran  compiler
    have  an  issue  on this point, this command is intended to give a clear
    status to the user.

    The RESOURCES keyword will display current  resource  usage  and  limits
    (memory,  files, etc). See man pages for getrusage and getrlimit for de-
    tails (Linux only).

    The PYTHON keyword will display the Python version  which  was  used  to
    compile  Gildas against the one used at run time. If they are different,
    this probably means troubles.

    The VARIABLES keyword will display a technical list of the variables de-
    fined in Sic.
2 COPY
        [SIC\]SIC COPY FileOld FileNew

    Copy FileOld to FileNew. It is equivalent to Unix command
            cp FileOld FileNew
    but system independent.
2 DELAY
        [SIC\]SIC DELAY Seconds
        [SIC\]SIC DELAY

    Delay  the  execution  of  commands. SIC DELAY is used in two times. The
    first call is given a duration as argument. Added to  the  current  date
    and  time, this defines a virtual milestone in the future. The next call
    without argument will wait for this milestone if it has not been reached
    yet, or will return without waiting if the limit is already past. During
    the waiting time, CTRL-C can be used to exit the command.

    An application of SIC DELAY is to slow down the execution of loops which
    display  or  draw useful informations to the user. In the example below,
    we ensure that the loops are executed every second (or more), instead of
    depending on the CPU speed which varies over machines and epochs:
       FOR I 1 to 10
         SIC DELAY 1.0
         Do something
         SIC DELAY
       NEXT
2 DELETE
        [SIC\]SIC DELETE File

    Delete the specified file. It is equivalent to Unix command
            rm File
    but system independent.
2 DIRECTORY
        [SIC\]SIC DIRECTORY Directory

    Change  the working directory to the specified name. It is equivalent to
    Unix command
            cd Directory
    but system independent.
2 EDIT
        [SIC\]SIC EDIT [ON|OFF|EditorName]

    List or change the status of the command line editing mode, or  the  de-
    fault text editor used by command EDIT.
2 ERROR
        [SIC\]SIC ERROR

    List the current error recovery command, defined by command ON ERROR.
2 EXPAND
        [SIC\]SIC EXPAND InFileName OutFileName

    Add  the  language name before each command of the macro file InFileName
    and write the results into the new macro file OutFileName. This  command
    should  be used in a program where the InFileName macro does not produce
    any command name ambiguity. The resulting macro file will then be usable
    in any program.

    The symbols are not touched because some procedures may need to redefine
    symbols on the fly.

    Right now the SIC commands are not transformed because  it  would  cause
    trouble to the procedure structure if some commands like FOR, IF, etc...
    would be changed.
2 EXTENSION
        [SIC\]SIC EXTENSION [Extension1 ... ExtensionN]

    Without arguments, print the list of extensions used by commands  @  and
    EDIT,  with  precedence  given  from the left to the right. Defaults are
    program dependent: for all Gildas softwares, it  is  the  program  name,
    while  many  user created applications use the generic default extension
    ".pro".

    With one or more arguments, add the input extension(s) at the  beginning
    of  the  list,  i.e.  with  highest precedence. If extension was already
    known, SIC EXTENSION also brings it back at the beginning.
2 FIND
        [SIC\]SIC FIND [FileFilter [Directory]]

    Search for all files matching the specified FileFilter in the  specified
    Directory.  Matching  files  are returned in a SIC structure named DIR%.
    DIR%NFILE is the number of found files, and DIR%FILE[1:dirnfile] a char-
    acter array containing the filenames.

    The  FileFilter  can contain a directory name. In this case the returned
    file names will include it. On the contrary, if the FileFilter does  not
    contain  a  directory name, and a "Directory" argument is specified, the
    returned names will not contain the Directory name.

    The default file filter is *.*
2 FLUSH
        [SIC\]SIC FLUSH

    Flush message and log files buffers onto disk.
2 HELP
        [SIC\]SIC HELP [PAGE|SCROLL|INDEX|CONTENT|HTML]

    With no argument, print how the HELP command  behaves.  Otherwise,  con-
    trols  whether  it outputs the text page by page (PAGE), or continuously
    (SCROLL).

      - SIC HELP INDEX    indicates the HELP command should display the page
        referenced first in the index of the PostScript documentation.
      - SIC HELP CONTENT  indicates the HELP command should display the page
        referenced first in the table of contents from the PostScript  docu-
        mentation. The last two options use the GhostView facility on X-Win-
        dow terminals.
      - SIC HELP HTML     indicates the HELP command should refer  the  HTML
        version of the documentation and use the appropriate browser to dis-
        play it.
2 INTEGER
        [SIC\]SIC INTEGER [SHORT|LONG]

    Define the default SIC integer kind (i.e. used by DEFINE INTEGER). SHORT
    refers to Fortran's INTEGER*4 (with a limit value of 2**31-1) while LONG
    refers to INTEGER*8 (with a limit value of 2**63-1). Default is SHORT.

    Without argument, the command displays the current default  SIC  integer
    kind.
2 LANGUAGE
        [SIC\]SIC Language\ [ON|OFF]

    Place a language in the active scope, or removes it, or list its status.
    Languages not in active scope are not searched for their  commands,  un-
    less the language name is explicitly given.
2 LOCK
        [SIC\]SIC LOCK [LockFile]

    With  no  argument,  display the list of lock files owned by the current
    program session. With a file name as argument, create  this  file  as  a
    lock  file.  Attempting  to create a lock file which already exists is a
    fatal error. Lock files owned by the current  program  session  are  im-
    plicitely deleted when exiting.

    This command is intended to protect some user's resources, e.g. invoking
    it in a procedure ensures that this procedure can not be  run  twice  in
    the same or in another session.
2 LOGICAL
        [SIC\]SIC LOGICAL LogName Translation
        [SIC\]SIC LOGICAL LogName
        [SIC\]SIC LOGICAL [Pattern]

    The first syntax sets or replaces a logical name.

    SIC LOG LogName  will give the translation of that precise logical name.

    Finally, SIC LOG Pattern will search for all logical names matching  the
    pattern.  A wilcard '*' means 0 or more characters. Without second argu-
    ment the pattern '*' is used, i.e. it will list all the logical names.
2 MACRO
        [SIC\]SIC MACRO MacroPath

    Change the search path for the procedures. Procedures executed by @  are
    searched  in  a  path specified by the special logical name MACRO#DIR: .
    This command allows to list or change the content of MACRO#DIR: .
2 MEMORY
        [SIC\]SIC MEMORY [ON|OFF]

    Enable or disable automatic insertion of successful  commands  into  the
    stack.
2 MESSAGE
        [SIC\]SIC MESSAGE
        [SIC\]SIC MESSAGE Pack1 [[[S|L|A]-|=|+]F|E|W|R|I|D|T|C|U] [PackN...]
        [SIC\]SIC MESSAGE Global [[[S|L|A]-|=|+]F|E|W|R|I|D|T|C|U] [ON|OFF]
        [SIC\]SIC MESSAGE * [[[S|L|A]-|=|+]F|E|W|R|I|D|T|C|U] [PackN...]

    Modify and display the messaging filters for one or more packages.  Mes-
    sages  are  usually  printed  on  screen  and into a message file in the
    GAG_LOG: directory. Depending on its kind (from trace to fatal  errors),
    a  message may be printed or not to one of these outputs. Messaging fil-
    ters allow the user to fine tune the kinds of messages he wants to  see.
    Filters  are either global (i.e. all the messages are filtered whathever
    the package they belong to) or package-dependent (i.e. the messages  are
    filtered depending on the package they belong to).

    The command SIC MESSAGE,
      - without argument, outputs the messaging filters for all active pack-
        ages;
      - with one or more package name as arguments, displays the  associated
        filters, e.g. :
            GREG> SIC MESSAGE SIC GLOBAL
            sic    on-screen  active   filter: FEWRI---U
            sic    to-mesfile active   filter: FEWRIDTCU
            global on-screen  inactive filter: FE-------
            global to-mesfile inactive filter: FEWRIDTCU
        First  column  shows  the package name, second column the output de-
        vice, third column the filter status,  last  column  the  associated
        filter;
      - with  a  package  name followed by a messaging rule (see below), up-
        dates its the filter value and displays it. The filters  of  several
        packages  can  be changed on the same command line, e.g. SIC MESSAGE
        SIC S+D GREG L-W

    The package name can additionally have two special values:
      - * : all the package filters are modified according to a single input
        rule;
      - GLOBAL : set a global filter which can override all the package fil-
        ters without loosing them. This global behavior is activated and de-
        activated by the ON or OFF keyword.

    A  rule  to  change a filter is a single string composed of three parts,
    from left to right:
      - A, S and/or L as first argument to modify All,  Screen,  or  Logfile
        filters.  This must be unique but is optional, default is Screen on-
        ly.
      - +, - or = as second argument to add to,  remove  from,  or  redefine
        filter values. This operator must be unique, and it is optional: de-
        fault is +.
      - F, E, W, R, I, D, T, C and/or U as last argument(s)  to  modify  the
        filters  on  Fatal, Error, Warning, Result, Info, Debug, Trace, Com-
        mand and Unknown messages. This argument is mandatory, and the  let-
        ters may be associated.

    The message kinds are:
      F)atal:  Program  will  cleanly end now because a fatal error occured,
        e.g. a required initialization of the program could not occur or  an
        error  can  not be safely recovered or the program is in an unstable
        status and can not go on.
      E)rror: Command or action could not be executed to its end.  Such  er-
        rors can be recovered, and program can continue to run safely.
        - It  denotes  an  attempt to do something not allowed or not imple-
          mented in the command.
        - Command can not run to the end as it will not produce the expected
          result.
      W)arning: Command or action will go on executing without an error, but
        - the user must be warned about a strange behavior;
        - a result is produced, but user must be careful with its  interpre-
          tation.
      R)esult:  Information  directly requested by the user. It concerns all
        the results returned by active commands. This should  be  understand
        as:
          - "You asked for this, as a result, that happened"
          - "This was created/changed accordingly to your request"
          - "Here is what you asked for (some values,...) "
      I)nfo:  Additional  information not directly expected by the user when
        he runs the command. It gives secondary informations on current  ac-
        tions,  or  it concerns more or less the result and the processes to
        obtain it, but it is not the result itself.
      D)ebug: High level debugging, e.g. follow the steps of complex  compu-
        tation.  By default, it will not be printed. User can activate it if
        strange non-fatal behavior occurs.
      T)race: Low-level debugging, e.g. track the program execution.  By de-
        fault,  it  will  not be printed. User must use it wisely because it
        may produce thousands of messages in a row (for example, in  loops).
        User can activate it in case of unforeseen fatal behavior.
      C)ommand:  Each  command  typed  on  the  terminal is resolved and can
        printed back to terminal and to logfile. This is equivalent  to  the
        obsolescent SIC VERIFY ON behavior.
      U)nknow: It is reserved for the migration from the old message facili-
        ties to the new one, and to handle internal errors in messaging pro-
        cess.

    Simple examples:
        SIC> SIC MESSAGE
        sic     on-screen  active   filter: FEWRI---U
        sic     to-mesfile active   filter: FEWRIDTCU
        SIC> SIC MESSAGE SIC GLOBAL
        sic     on-screen  active   filter: FEWRI---U
        sic     to-mesfile active   filter: FEWRIDTCU
        global  on-screen  inactive filter: FE-------
        global  to-mesfile inactive filter: FEWRIDTCU
        SIC> SIC MESSAGE SIC S+D
        sic     on-screen  active   filter: FEWRID--U
        sic     to-mesfile active   filter: FEWRIDTCU
        SIC> SIC MESSAGE SIC L-DT
        sic     on-screen  active   filter: FEWRID--U
        sic     to-mesfile active   filter: FEWRI--CU
        SIC> SIC MESSAGE SIC A=FEWRI
        sic     on-screen  active   filter: FEWRI----
        sic     to-mesfile active   filter: FEWRI----
        SIC> SIC MESSAGE GLOBAL ON
        Turning ON global filtering rules
        SIC>

    Q: I've lost all messages, SIC MESSAGE is silent, what happens?
    A: Many  message  kinds  are  certainly  disabled, in particular Results
       printed to Screen. This is why SIC MESSAGE is also  silent.  Consider
       typing SIC MESSAGE SIC S+R and you should see back messaging filters.
2 MKDIR
        [SIC\]SIC MKDIR New_Directory

    Create a new directory. It is equivalent to Unix command
            mkdir -p New_Directory
    but system independent. No error is raised if the directory already  ex-
    ists.
2 MODIFIED
        [SIC\]SIC MODIFIED FileName StrName

    Check  if a "file" was modified since last call, and fill the Sic struc-
    ture named "StrName" accordingly. The file can be a regular  file  or  a
    directory. If file is a symbolic link, evaluation is made on its target.
    On first call, the structure is set up and the file is assumed modified.
    On  subsequent  calls, file and calling dates are compared and modifica-
    tion status is evaluated. In case of doubt (e.g. modification  time  un-
    changed at the file system precision), a modification is assumed.

    The output structure has the following (scalar) components:
      - StrName%FILE: the file name (character string),
      - StrName%MTIME: the file modification time (long integer, in
        nanoseconds since 01-jan-1970),
      - StrName%PTIME: last time a modification was proved (long integer, in
        nanoseconds),
      - StrName%MODIF: file was (or may have been) modified or not since
        last call (logical)
    The structure must be a user-defined, global, variable. If the structure
    or its elements are missing, they will be created at first call.
2 OUTPUT
        [SIC\]SIC OUTPUT [FileNew]

    Redirect  the  output  of the SIC\SAY command to the specified file. The
    file is erased if it was existing. If no argument is present,  any  cur-
    rently  opened output file will be closed, and the output of command SAY
    is re-directed to the terminal.
2 PRECISION
        [SIC\]SIC PRECISION [SINGLE|REAL|DOUBLE|AUTO]

    Select the precision of all computations using SIC variables.  Automatic
    precision will use the highest precision present in an expression.
2 PRIORITY
        [SIC\]SIC PRIORITY [Level1 Lang1 ... [LevelI LangN ...]]

    SIC PRIORITY  redefines  the languages precedence when an ambiguous com-
    mand (same name in several languages)  is  encountered:  the  lower  the
    precedence  level, the higher the priority. By default, they are all the
    same (level is set to 1), i.e. there is no automatic  ambiguity  resolu-
    tion.

    The priority levels can be changed for one, some, or all languages. Lev-
    elI is an integer, which must be followed by one or more languages:
      > 0: the level value is used directly, the lower level the higher pri-
           ority,
      = 0: the  level  value is Automatic, i.e. the priority comes after the
           languages with an explicit positive value  and  before  the  ones
           with a negative value,
      < 0: set the priority from the end of the list, e.g. -1 means that the
           language must have the lowest priority.

    Example:
      Level  Priority
       +1       1
       +2       2
       +4       3
        0       4
       -2       5
       -1       6
    Note that the priority list is compressed if the values  are  discontin-
    ued.

    A  call  to SIC PRIORITY without arguments prints the current levels for
    all languages.
2 RANDOM_SEED
        [SIC\]SIC RANDOM_SEED [DATETIME|URANDOM|Value]

    This command resets the Fortran random seed used to initialize  the  se-
    quence  of  pseudorandom  numbers  returned  by the functions RANDOM and
    NOISE. Several arguments are allowed:
      - DATETIME: compute a seed based on current date  and  time.  This  is
        portable but not highly random, e.g. 2 processes running at the same
        time can end with the same seed.
      - URANDOM: use the operating system special  file  /dev/urandom  as  a
        random  number  generator, if available. This is the best choice but
        it is not fully portable.
      - Value: the user can specify its own seed  (integer  value).  Reusing
        the same value will ensure the same sequence of pseudorandom numbers
        later on, which can be useful depending on the context.
    Note that this command affects the seed, i.e. the starting point of  the
    sequence  of pseudo-random numbers. It does not affect the randomness of
    those numbers (i.e. you can safely use the Value 1 if you want).

    The default at startup is DATETIME, i.e. the  sequence  will  always  be
    different  from one session to another. This default can be overriden by
    setting the Sic logical GILDAS_RANDOM_SEED to DATETIME, URANDOM,  or  an
    integer value in the file $HOME/.gag.dico

    Without  argument,  the command displays the current Fortran random seed
    in use. For debugging purpose.
2 RENAME
        [SIC\]SIC RENAME FileOld FileNew

    Rename an existing file. It is equivalent to Unix command
            mv FileOld FileNew
    but system independent.

2 SAVE
        [SIC\]SIC SAVE [FileName Symbol]

    This is a specific command (currently) used by  the  ALMA  simulator  to
    copy into an output file (a procedure) the name of any newly defined SIC
    variable, prefixed by whatever Symbol is given here.

    Without argument, just closes the current "save" file.

    Can be used whenever you need to apply different actions to the same set
    of  variables, or get two sets of variables with similar names (one pre-
    fixed, the other not) e.g. to store default values or last  values.  Re-
    defining  the Symbol and executing the created procedure will do the de-
    sired job on the list of variables defined when SIC SAVE was active...

       sic save define_all TOTO
       define a Bunch Of Variables Here /global ! Only global stuff, though...
       sic save
       !
       symbol TOTO "EXA &1 "   ! Examine the Variable name
       @ gag_proc:define_all   ! for all variables in this list...
       !
       sic output init_all.sic
       symbol TOTO "@ sicvar_init"   ! Look into gag_pro:clone_var.sic
       @ gag_proc:define_all         ! for further explanation
       sic output
       @ init_all.sic                ! Initialize them
       !
       define structure CLONE% /global
       sic output clone_all.sic
       symbol TOTO "@ sicvar_clone CLONE% "   ! Will actually create a
       @ gag_proc:define_all         ! copy of all variables into structure CLONE%
       sic output
       symbol TOTO continue
       @ clone_all.sic                ! Duplicate them into CLONE% structure
2 SEARCH
        [SIC\]SIC SEARCH FileName

    (Obsolescent).
    Search for the specified file, and set the logical SIC%EXIST to  YES  if
    the file exists, NO if not.

    This  is  an  obsolescent  feature.  The same functionality is available
    through the logical function FILE("FileName").
2 SYNTAX
        [SIC\]SIC SYNTAX [FIXED|FREE]

    control the syntax for mathematic operations. In FIXED syntax,  the  LET
    command is compulsory. In FREE syntax, commands lines like
           A[I,J] = SIN((2*I+J)/PI)
    where A is a known variable, are recognized as assignement and automati-
    cally expanded to the equivalent FIXED syntax
           LET A[I,J] SIN((2*I+J)/PI)
    Free syntax cannot be used for the LET /WHERE command. See  HELP SYNTAX\
    for details.
2 SYSTEM
        [SIC\]SIC SYSTEM [ERROR|NOERROR]

    Indicate  if the command SIC\SYSTEM can raise errors or not, i.e. if any
    error occuring when executing the string command should stop the Sic ex-
    ecution flow. Default is true.
2 TIMER
        [SIC\]SIC TIMER [Time [HOURS|MINUTES|SECONDS]]

    All  Gildas  programs are automatically closed (normal exit) after a de-
    fined period of inactivity at the prompt level. This period  is  defined
    by the Sic timer.

    With  a  Time argument, set the timer to the input value. Unit is a key-
    word which can be Hours, Minutes, or Seconds (default Hours). A null  or
    negative value disables the timer.

    Without argument, display the current value of the timer.

    The  timer  can  be customized in a Sic logical named SIC_TIMER (integer
    value, in hour unit). This value is evaluated once at startup  from  one
    of the Sic logical dictionaries. Later changes are ignored. Default is 3
    hours.
2 USER
        [SIC\]SIC USER

    Will return the user name (usually with host name) in symbol SYS_INFO.
2 VERIFY
        [SIC\]SIC VERIFY [ON|OFF]

    Control the listing of macros, loop or stack during execution.
2 VERSION
        [SIC\]SIC VERSION

    Return the version number and credits or copyrights for the languages or
    subprograms currently used.
2 WAIT
        [SIC\]SIC WAIT Seconds

    Will wait for the required number of seconds. Fraction of seconds can be
    specified.
2 WHICH
        [SIC\]SIC WHICH Procedure

    Return the full path of the procedure or macro which will be executed by
    "@ Procedure" or "TYPE Procedure" calls.

    See  HELP @  for  details on which directories procedures and macros are
    searched in.
2 WINDOW
        [SIC\]SIC WINDOW [ON|OFF]

    Allow or disallow use of GUI mode.
1 SORT
        [SIC\]SORT KeyVar [Var1 [... VarN]]

    Sort an ensemble of 1-D or 2-D SIC variables by increasing values of the
    (1-D  only) KeyVar variable. A standard use is to sort a complete GILDAS
    table, using
      DEFINE TABLE A MyFile WRITE
      SORT A[3] A
      DELETE /VAR A
    As shown in the example, the command handles the case where KeyVar is  a
    subset of any of the variables to be sorted. However, if there is alias-
    ing between any of the Var1 ... VarN variables,  the  result  is  unpre-
    dictable.

    The  command  can be useful for further use of the COMPUTE LOCATION com-
    mand, or plots using GreG. To mimic  the  behaviour  of  the  (obsolete)
    GREG\SORT command, use
            SIC\SORT Key Var2 Var3
    where Key is any of X Y Z, and Var2 and Var3 the two other ones.
1 SYMBOL
        [SIC\]SYMBOL [X ["Translation"]] [/INQUIRE "Prompt Text"]

    This commands defines, lists and deletes symbols.

      SYMBOL
        Lists the Symbol table

      SYMBOL X
        Gives the translation of the symbol X

      SYMBOL X "Translation"
        Defines a new symbol or update the precedent symbol definition.

      SYMBOL X /INQUIRE "Prompt Text"
        Inquires  the  definition of a symbol with the specified prompt (for
    interactive session only).

    A symbol is an abbreviation of any character string. The symbol transla-
    tions  are substituted to the corresponding symbols when found in a com-
    mand line. In a command line, symbol  TOTO  must  appear  inside  simple
    quotes  (like  'TOTO')  to  be translated, except for the line beginning
    where SIC assumes the first word might be a symbol. A symbol  definition
    may refer to another already defined symbol. The substitution occurs ev-
    erywhere, even within the character strings.

    Symbols in FOR-NEXT loops are substituted at compilation time (i.e. when
    the  command  line is written but not yet executed), using their current
    value. In a loop, redefining a symbol which is already  defined  out  of
    the  loop  has no effect since its occurences are substituted before the
    execution of all the commands.

    Symbols can be deleted when they are no longer  usefull,  using  command
    DELETE /SYMBOL.
1 SYNTAX\
        SYNTAX of SIC commands

    The SIC syntax is the following :
        [LANG\]COMM [Arg1 [Arg2 [...]]] [/OPT1 [p1 [...]] [/OPT2 [...]]
    where [] indicates optional fields.

    Language,  command  and  options  can be abbreviated. The language field
    (LANG\) is optional but may help resolve ambiguities.

    First, the line is stripped of duplicate separators  (spaces  or  tabs).
    Character  strings (entities included between double quotes) are not af-
    fected by this formatting.

    Then symbols (entities included between simple  quotes,  plus  the  lan-
    guage-command  field)  and  tokens  (macros  parameters 1 2 etc...)  are
    translated, even within character strings.

    Finally, the line is analysed for ambiguities and the language,  command
    and  option names are expanded. An option is a word beginning by a slash
    (e.g. /OPT1 is an option in the above example).

    All arguments can be character or mathematical variables or expressions,
    depending on the type required by the program. Character expressions can
    be concatenated with implicit formatting of variables  and  mathematical
    expressions, such as in
        "The real number PI is equal to "'ACOS(-1.0)'
    Variable  and expressions are not evaluated during the parsing, but only
    during the execution.  Character  variables  must  be  included  between
    quotes for translation, e.g.
        DEFINE CHARACTER C*6
        LET C 3.14159
        DEFINE REAL A
        LET A 'C'/PI
        EXAMINE A
        A       =    0.9999705
1 SYSTEM
        [SIC\]SYSTEM ["Command"]
        $ Command

    Execute a command from the operating system, or create a subshell. If no
    argument is given, start a subshell by running the default  user  shell.
    The  subshell  can  be terminated by typing 'exit' or 'bye' or 'logout',
    depending on system version, and controls return to SIC in this case.

    If an argument is given, executes the command in a subshell.

    Note that Unix environment variables cannot be defined in  such  a  way,
    since  it  is  a  subshell.  In particular, use command SIC DIRECTORY to
    change your working directory.

        $ Command
    System commands can also be executed directly from the SIC  level  using
    the  $  token. "Command" must be a valid operating system command in the
    default shell of the user.
1 TYPE
        [SIC\]TYPE [Macro_Name] [/OUTPUT OutFile]

    TYPE lists the commands of the named macro. The same search rules as for
    command  SIC\@  apply (see HELP @). The command SIC WHICH can be used if
    you have doubts on the TYPE'd macro.

    If no argument is given, the Stack is listed.

    The output of the command can be redirected to a  file  instead  of  the
    standard output (STDOUT) thanks to the option /OUTPUT.
1 @
        [SIC\]@ Macro_Name [Par1 [Par2 [...]]]

    Read  commands  from  macro (or procedure) Macro_Name and executes them.
    Up to 8 parameters can be given. These parameters will be substituted to
    the  tokens 1, 2, ..., 8 found in the body of the procedure, even within
    character strings (e.g. Par1 for token 1).

    Default file extension is program dependent (usually the  program  name,
    or .pro), and can be changed using command SIC EXTENSION. Procedures are
    searched for according to the following rules:
      - first in the directory designated by the logical name GAG_PROC:
      - then, in order, in all the directories in the path specified by  the
        logical name MACRO#DIR: (see command SIC MACRO).
    One  can use the command SIC WHICH to be sure of the macro which will be
    executed.

    All commands will be echoed to the terminal when executed if the  VERIFY
    switch is ON (see command SIC VERIFY).

    Macros (as any other text files) can be edited using a standard text ed-
    itor by typing command EDIT with the macro file name  as  argument  (see
    EDIT and SIC EDIT).
1 ENDOFHELP




















































