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 [/options]

    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 [/FORMAT String]
    [/LINE Begin End]

    Read ONE or SEVERAL 1‐Dimensional variables in list‐directed (free) for‐
    mat  from  a formatted file File_Name. Mixing CHARACTER and NUMERIC (RE‐
    AL,...) arrays is not available yet, and only one character array can be
    read  at a time. The user can specify a format using the /FORMAT option,
    and select a line range using the /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.
2 /FORMAT

        Specify a fortran format to read the input file for  command  ACCEPT
    /ARRAY or ACCEPT /COLUMN. This option is invalid with /BINARY.

    Example:
        DEFINE CHARACTER CITY*16[44]
        DEFINE REAL X[44] Y[44]
        ACCEPT X Y /COLUMN "cities.dat" /LINE 4 / FORMAT "20x,F8.3,1x,F8.3"
        ACCEPT CITY /COLUMN "cities.dat" /LINE 4 / FORMAT "2x,A16"
2 /LINE

        Indicate the line range to be read in the input file for command AC‐
    CEPT/ARRAY or ACCEPT/COLUMN. This option is invalid with /BINARY.
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]

    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 REAL and DOUBLE PRECISION  ar‐
    rays, regardless of their nature:
      ‐ MAX     MIN     MEAN     RMS     SUM     PRODUCT    MEDIAN
        for which InVar is an array of rank 1 to 4 (a 1‐D to 4‐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.

    The following transformations are available:
      ‐ 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 part of OutVar (complex variable) with InVar (re‐
        al).
      ‐ 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.
      ‐ CMPMUL as in "COMPUTE OutVar CMPMUL InVar1 InVar2":
        OutVar = PRODUCT of InVar1 and InVar2. All complex arrays.

    Miscellaneous operations (see subtopics for details):
      ‐ DATE
      ‐ DIMOF
      ‐ GAG_DATE
      ‐ LOCATION
2 DATE
        [SIC\]COMPUTE Creation_Date DATE Filename

    Return the last modification date of the file Filename into the  integer
    variable  Creation_Date.  Used in procedures to check when file has been
    changed.
2 DIMOF
        [SIC\]COMPUTE OutVar DIMOF InVar

    Return the shape of array InVar in OutVar[1:4], and  its  rank  in  Out‐
    Var[5].  For  this purpose, OutVar must be an INTEGER array of dimension
    [5]. 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 GAG_DATE
        [SIC\]COMPUTE Idate GAG_DATE "15‐DEC‐2035"

    Store the date "15‐DEC‐2035" as a "radio Julian date" (or "Jansky Julian
    date"), which starts as ‐2^15 on the date of the first radio observation
    by  Karl  Jansky.  It is thus the Modified Julian date minus 60549. That
    choice was made to maximize the time interval over which radio astronom‐
    ical data could be usefully stored in an integer*2, back when 2 bytes of
    header space per spectrum were a significant  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] [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 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

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, define
    a new user command. Otherwise, define new  variables  of  the  specified
    type.  Type can then be REAL, INTEGER, DOUBLE (for double precision real
    values), LOGICAL, CHARACTER, or TABLE, HEADER,  IMAGE,  UVTABLE,  STRUC‐
    TURE, FITS or ALIAS. By default, new variables are LOCAL, i.e. valid on‐
    ly 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 variables are examined  before  global  vari‐
    ables.
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*N1[DIM1] [...]

    CHARACTER variables can be scalar or multi‐dimensional.  The  length  of
    CHARACTER  variable  is specified after an * after the name of the vari‐
    able. The dimension field (same syntax as for other arrays) should  fol‐
    low the length declaration.
2 COMMAND
        [SIC\]DEFINE COMMAND NAME "Equivalent command" [Help_File]

    Define a new SIC command. The new command will be part of the USER\ lan‐
    guage, and will be translated into its equivalent command  at  execution
    time. Help_File is an optional argument indicating the name of the asso‐
    ciated help text. The standard rules for help syntax  applies  (see  SIC
    documentation  for details). User defined commands appear in the list of
    command displayed by HELP, and can be abbreviated as normal "program‐de‐
    fined" 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  4  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]
    where  Var  is  the  variable name and n1 to n4 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 specified files. 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 4 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]
    where Var is the variable name and n1 to n4  are  integer  constants  or
    variables.
2 LOGICAL
        [SIC\]DEFINE LOGICAL Var1[DIM1] Var2[DIM2] [...] [/GLOBAL]

    LOGICAL  variables  can  be multi‐dimensional. Up to 4 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]
    where Var is the variable name and n1 to n4  are  integer  constants  or
    variables.
2 REAL
        [SIC\]DEFINE REAL Var1[DIM1] [Var2[DIM2] [...]] [/GLOBAL]

    REAL variables can be multi‐dimensional. Up to 4 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]
    where Var is the variable name and n1 to n4  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  specified
    file. The variable type and dimensions are derived according to the val‐
    ue 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 image of the  specified  type.
        The  dimensions must then be specified in the dimension field of the
        variable name, as for a standard variable.
      ‐ 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

    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.

    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  [Name]  [/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  argument,  EXAMINE  will usually type the content of the specified
    variable (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.
      ‐ Partial wildcarding is permitted: if the argument begins or/and ends
        with the "*" 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]

    Start a conditional IF block. The behaviour of IF blocks is  similar  to
    structured  Fortran.  Any  text  following the logical expression is ig‐
    nored, but if this text is not THEN, an error message is produced.

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

    Within logical expressions, two special logical functions can be used:
         EXIST(Name)    Returns .TRUE. if Name is an existing variable
         FILE(Name)     Returns .TRUE. if Name is an existing file
    and composite expressions are allowed.
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 Variable [=] [+|‐]DD[:MM[:SS.SS]] /SEXAGESIMAL

    The /SEXAGESIMAL option allows to use sexagesimal expressions in assign‐
    ments. Mathematical expressions can be used for each elements,  provided
    they  are separated by a semicolon. This option is only valid for scalar
    variables.
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"

    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.

    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,... (comma‐separated list WITHOUT BLANKS) is used to pass starting
    guesses for the parameters &A &B (defaulted to 1.0). The starting values
    should  not  be too far from a potential solution, otherwise the conver‐
    gence may not be possible.
2 /STEP
          [SIC\]MFIT Y=f(X,&a,...) /STEP A2,B2,..

    A2,B2,...(comma‐separated list WITHOUT BLANKS) is 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 incorrect evaluation of the param‐
    eter  errors.  The  optimal  step for the determination 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 activated in‐
    stead of PAUSE when an error occurs, using the command ON ERROR Command.
    However, options cannot be present into the command line 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 re‐
    sumes 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 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 [PythonCommandLine|PythonProcedureName.py|/END]

    The  PYTHON  command  starts a PYTHON interpreter and intercommunication
    between SIC and PYTHON at first call. Subsequent call do not repeat this
    initialization step. Without argument, the user is exposed to the PYTHON
    prompt. With a PythonCommandLine, the PYTHON  command  is  transparently
    executed  and  the  user recover the SIC prompt. With a PythonProcedure‐
    Name.py, the PYTHON procedure is executed and the user recover  the  SIC
    prompt.  The /END option stops the PYTHON interpreter and associated in‐
    tercommunication between SIC and PYTHON.
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 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 LOGICAL LogName [Translation]
        SIC Language\ [Status]
        SIC MACRO MacroPath
        SIC MEMORY
        SIC MESSAGE
        SIC PRECISION
        SIC PRIORITY [Level Language]
        SIC SYNTAX
        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 USER
        SIC WAIT 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] | IMAGE [Number] ]

    Debugging command. Prints the status of reserved  Logical  Unit  numbers
    (LUN), or of allocated image slots (IMAGE).
2 COPY
        [SIC\]SIC COPY FileOld FileNew

    Copy FileOld to FileNew. It is equivalent to Unix command
            cp FileOld FileNew
    but system independent.
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 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 LOGICAL
        [SIC\]SIC LOGICAL [LogName [Translation]]

    Set or replace a logical name. SIC LOG LogName will give the translation
    of the logical name. SIC LOG without second argument will list all logi‐
    cal 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
        process.

    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 New_Directory
    but system independent.
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.  Un‐
    specified  languages  which were not previously set have an higher level
    than the highest specified level.

    A call to SIC PRIORITY without arguments prints the current  levels  for
    all languages.
2 RENAME
        [SIC\]SIC RENAME FileOld FileNew

    Rename an existing file. It is equivalent to Unix command
            mv FileOld FileNew
    but system independent.
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 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. On systems which support
    it, fraction of seconds can be specified. On other systems,  the  number
    will be rounded to the nearest integer, with a minimum of 1 second.
2 WHICH
        [SIC\]SIC WHICH Procedure

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

    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 mimick the behaviour of the (obsolete)
    GREG\SORT command, use
            SORT Key X Y Z
    where Key is any of X Y Z
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  prece‐
    dent symbol definition.

        SYMBOL X /INQUIRE "Prompt Text"   Inquires  the definition of a sym‐
    bol 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 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]

    TYPE lists the commands of the named macro. If no argument is given, the
    Stack is listed. The same search rules as for command SIC\@ apply.
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).

    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

























