.ec _
.ll 76
.ad b
.in 4
.\"====================================================================
.ti -4
1 Language
.ti +10
LAS_\ Command Language Summary
.br

.nf
 ACCUMULATE         Add R and T observation.
 ASSOCIATE          Add an Associated Array to the R observation
 AVERAGE            Average all the observations of the current index.
 BASE [arg]         Subtract a baseline.
 BOX                Draw a frame for data.
 CATALOG            Load a line catalog
 CONSISTENCY        Check the consistency of the current index
 COPY               Write the current index into output file.
 DROP num [ver]     Take a scan out of the current index.
 DUMP               List some informations on the R spectrum.
 EXTRACT X1 X2 [U]  Extract a subsection of the R spectrum.
 FILE type name     Define the input/output files.
 FIND               Search the input file for observations.
 FITS               Write or read a fits file
 FOLD               Fold a Frequency Switched spectrum.
 GET [N]            Read a scan in the input file.
 HEADER             Display some header information on the R spectrum.
 IGNORE List        Ignore scans from the Input file.
 LIST [in|out]      List header information about an ensemble of scans.
 LOAD               Build a 2D set of spectra from INDEX
 MODIFY             Edit and change the scan header.
 MULTIPLY fact      Multiply the R spectrum by fact.
 NEW__DATA           Wait until new data present in input file.
 PLOT               Plot the observation in R, with box and title.
 SAVE [name]        Save the current parameters.
 SET                Enter a value for a parameter.
 SHOW Arg           Display some parameter.
 SPECTRUM           Plot the R observation or an associated array.
 SWAP               Exchange the contents of the R and T buffers.
 TAG Qual List      Change the quality of scans in the Output file.
 TITLE              Write a header above the plotted frame.
 UPDATE             Update R in the output file.
 WRITE [Obs]        Write R in the output file.
.fi
.\"====================================================================
.ti -4
1 ACCUMULATE
.ti +4
LAS_\ACCUMULATE [/RESAMPLE [NX Xref Xval Xinc Unit]] [/NOCHECK
Arg1 ... ArgN]] [/WEIGHT TIME|SIGMA|EQUAL|ASSOCIATED]

ACCUMULATE is used to add a pair of spectra together. The T spectrum
is added to the R spectrum using the specified (/WEIGHT) or current
(SET WEIGHT) weighting function (see HELP SET WEIGHT for details). To
stack more than 2 spectra, you should build an index and AVERAGE it in
a single step instead (this will prevent cumulative resamplings,
respect the respective weights, and preserve at best the noise
properties).

On return R contains the sum spectrum, and T the observation
previously in R. If /WEIGHT or SET WEIGHT is ASSOCIATED (see HELP SET
WEIGHT for details), the weight array of the sum spectrum is saved in
the associated array named W.

The spectra are stacked channel by channel by default, if
possible. Else the option /RESAMPLE must be invoked (see subtopic for
details).

For EQUAL weights, ACCUMULATE computes the sum of the two spectra,
allowing addition of an ensemble of spectra after division by the
total number of spectra. For other weightings, ACCUMULATE computes the
average of the two spectra.

ACCUMULATE also works on Continuum drift. The alignement may be
Channel or Position in this case.
.\"--------------------------------------------------------------------
.ti -4
2 /NOCHECK
.ti +4
LAS_\ACCUMULATE /NOCHECK [SOURCE|POSITION|LINE|SPECTROSCOPY|CALIBRATION|SWITCHING]

By default, ACCUMULATE checks the consistency between R and T. This is
a security to avoid mixing inconsistent data (e.g. spectra from
different sources). These checks can be individually (with one or more
names) or all (no name) disabled using the option /NOCHECK. See HELP
SET NOCHECK for details.

Note the key status of the SPECTROSCOPY check! ACCUMULATE uses this
check to detect if the spectra X axes are aligned or not, to help its
decision to enable resampling or not (see /RESAMPLE subtopic). Using
/NOCHECK SPECTROSCOPY enforces the spectra alignment status:

.in +4
.ti -4
ACCUMULATE /NOCHECK SPECTROSCOPY
.br
will assume R and T are aligned and will stack them channel by channel
(no resampling), while they are possibly not aligned.

.ti -4
ACCUMULATE /RESAMPLE /NOCHECK SPECTROSCOPY
.br
will assume R and T are not aligned and will always resample them
before stacking, even if not necessary (adds computation cost and
possible round off errors).
.in -4
.\"--------------------------------------------------------------------
.ti -4
2 /RESAMPLE
.ti +4
LAS_\ACCUMULATE /RESAMPLE [NX Xref Xval Xinc Unit]

.in +4
.ti -2
No /RESAMPLE
.br
Without this option, a consistency test checks that R and T have both
the same X axes, according to the current SET ALIGN mode. If yes, R
and T are stacked channel by channel (no resampling). If not, an error
is raised and /RESAMPLE is suggested.

.ti -2
/RESAMPLE (without arguments)
.br
The /RESAMPLE option is a request to allow the resampling, but it is
not enforced. A consistency test first checks if the spectra X axes
are identical or not, according to the current SET ALIGN mode. If yes,
R and T are stacked channel by channel (no resampling). If not, the X
axes are resampled according to the SET ALIGN mode. The X axis of the
output sum is automatically computed. In particular, the output
spectrum has the coarsest resolution of the two input spectra. Those
are then internally resampled and stacked on the output axis.

.ti -2
/RESAMPLE NX Xref Xval Xinc Unit
.br
A custom output X axis can be given with the syntax /RESAMPLE NX Xref
Xval Xinc Unit. In this case, the resampling is always performed. The
input spectra are internally resampled and stacked on this axis. See
HELP RESAMPLE for possible uses and caveats.
.in -4

Remember that if it is enabled, the resampling is time consuming and
has non trivial effects on the spectra noise.
.\"====================================================================
.ti -4
1 ASSOCIATE
.ti +4
LAS_\ASSOCIATE ReservedName Array
.ti +4
LAS_\ASSOCIATE FreeName Array /BAD BadValue [/UNIT UnitString]
.ti +4
LAS_\ASSOCIATE AnyName /DELETE

This commands adds or deletes an Associated Array to/from the R
observation.

The first form allows to add a reserved Associated Array. With such
arrays, the metadata like the bad value or the unit are restricted by
the Associated Arrays specifications: they can not be customized.

The second form allows to add a free (non-reserved) Associated
Array. In this case, the bad value is mandatory (no default). The unit
is optional and defaults to a blank string. The Associated Array name
is free, except that it must use symbols allowed in Sic variable names
(i.e. alphanumeric characters).

The input array type and kind will be reused as the Associated Array
type and kind. Its first dimension must be of size RY (i.e. same
number of channels as R). A second dimension is allowed. The array
argument can refer to a subset of a bigger array, as long as this
subset respects the above rules.

The third form will delete the named array from the section (no error
if no such array). If there are no more arrays in the section, the
section is disabled.
.\"====================================================================
.ti -4
1 AVERAGE
.ti +4
LAS_\AVERAGE [/RESAMPLE [NX Xref Xval Xinc Unit]] [/NOCHECK
[Arg1 ... ArgN] [/WEIGHT TIME|SIGMA|EQUAL|ASSOCIATED]

Average all the spectra of the current index using the specified
(/WEIGHT) or current (SET WEIGHT) weighting function (see HELP SET
WEIGHT for details). The spectra are stacked channel by channel by
default, if possible. Else the option /RESAMPLE must be invoked (see
subtopic for details).

On return the R spectrum contains the average spectrum. If /WEIGHT or
SET WEIGHT is ASSOCIATED (see HELP SET WEIGHT for details), the weight
array of the average spectrum is saved in the associated array named
W.

Bad channels are handled according to SET BAD. A sum may be
interrupted by <^C_>, but the result is then undefined.

AVERAGE also works on Continuum drift. The alignement may be Channel
or Position in this case.
.\"--------------------------------------------------------------------
.ti -4
2 /NOCHECK
.ti +4
LAS_\AVERAGE /NOCHECK [SOURCE|POSITION|LINE|SPECTROSCOPY|CALIBRATION|SWITCHING]

By default, AVERAGE checks the consistency of all the input
spectra. This is a security to avoid mixing inconsistent data
(e.g. spectra from different sources). These checks can be
individually (with one or more names) or all (no name) disabled using
the option /NOCHECK. See HELP SET NOCHECK for details.

Note the key status of the SPECTROSCOPY check! AVERAGE uses this check
to detect if the spectra X axes are aligned or not, to help its
decision to enable resampling or not (see /RESAMPLE subtopic). Using
/NOCHECK SPECTROSCOPY enforces the spectra alignment status:

.in +4
.ti -4
AVERAGE /NOCHECK SPECTROSCOPY
.br
will assume the spectra are aligned and will stack them channel by
channel (no resampling), while they are possibly not aligned.

.ti -4
AVERAGE /RESAMPLE /NOCHECK SPECTROSCOPY
.br
will assume the spectra are not aligned and will always resample them
before stacking, even if not necessary (adds computation cost and
possible round off errors).
.in -4
.\"--------------------------------------------------------------------
.ti -4
2 /RESAMPLE
.ti +4
LAS_\AVERAGE /RESAMPLE [NX Xref Xval Xinc Unit]

.in +4
.ti -2
No /RESAMPLE
.br
Without this option, a consistency test checks that the spectra all
have the same X axes, according to the current SET ALIGN mode. If yes,
the spectra are stacked channel by channel (no resampling). If not, an
error is raised and /RESAMPLE is suggested.

.ti -2
/RESAMPLE (without arguments)
.br
The /RESAMPLE option is a request to allow the resampling, but it is
not enforced. A consistency test first checks if the spectra X axes
are identical or not, according to the current SET ALIGN mode. If yes,
the spectra are stacked channel by channel (no resampling). If not,
the X axes are resampled according to the SET ALIGN mode. The X axis
of the output sum is automatically computed. In particular, the output
spectrum has the coarsest resolution of the input spectra. Those are
then internally resampled and stacked on the output axis.

.ti -2
/RESAMPLE NX Xref Xval Xinc Unit
.br
A custom output X axis can be given with the syntax /RESAMPLE NX Xref
Xval Xinc Unit. In this case, the resampling is always performed. The
input spectra are internally resampled and stacked on this axis. See
HELP RESAMPLE for possible uses and caveats.
.in -4

Remember that if it is enabled, the resampling is time consuming and
has non trivial effects on the spectra noise.
.\"====================================================================
.ti -4
1 BASE
.ti +4
LAS_\BASE [Deg] [/PLOT [Ipen]] [/INDEX] [/OBS] [/CONTINUUM [Flux]]
.ti +4
LAS_\BASE SINUS Amplitude Period Phase [/PLOT [Ipen]]
.ti +4
LAS_\BASE LAST [/PLOT [Ipen]]

When working on single spectra, BASE copies R into T, then subtracts
from R a polynomial baseline of degree Deg, or a sinusoidal baseline
if the first argument is SINUS. Polynomial baseline degree must be in
range 0-100. Areas defined by the SET WINDOW command are not used to
fit the baseline. The T content may be recovered with SWAP.

.br
BASE SINUS Amplitude Period Phase
.br
(Phase is in the same unit as the period, usually km/s or MHz)
Subtract a sinusoid. Minimization will be done including also a linear
baseline in addition to the sinusoid.

.br
BASE LAST
.br
Use the last determined baseline instead of computing a new one. It
can be useful to find a baseline from one backend and apply it to
another. This also applies for sinusoidal baselines. 0th and 1st order
polynomials, and sinus fit are extrapolated if the R spectrum extends
beyond the LAST spectrum limits. 2nd order (and higher) polynomials
are not extrapolated and the edge values are used beyond the LAST
spectrum limits.

.br
BASE /PLOT
.br
Plot this baseline after the minimization, using the Ipen-th pen
properties. The pencil 2 (red at startup) is used by default.

.br
BASE /INDEX
.br
Subtracts a baseline to all records that have been loaded. This option
is not needed if SET ACTION INDEX. /PLOT and /INDEX options are
incompatibles.

.br
BASE /OBS
.br
indicate that the baseline is to be fitted to the current R buffer
observations. This option is not needed if the action level is OBS
(default). /OBS and /INDEX are incompatible.

.br
BASE /CONTINUUM [Flux]
.br

1) Divide the spectrum by the baseline (rather than subtracting it),
and then 2) multiply by the average flux. This is useful to keep the
continuum level, when continuum is present and variations of
atmospheric emission are properly subtracted out by fast enough
switching.  This is of course the case for correlation spectra
(e.g. coming from an interferometer). The continuum level will be
adjusted to the value of the argument `Flux', if present;
e.g. /CONTINUUM 1.0 will produce a spectrum of line-to-continuum
ratio. BASE /CONTINUUM does not work with BASE LAST or BASE SINUS.
.\"====================================================================
.ti -4
1 BOX
.ti +4
LAS_\BOX [Arg1] [Arg2] [Arg3] [Arg4] [/UNIT Type [LOWER|UPPER]]
[/INDEX] [/OBS]

BOX draws a frame suited for the current R spectrum or index in
memory. The units and limits are determined according to the options
of the SET command (SET MODE ; SET UNIT), and the box size governed by
SET BOX.

.nf
Arg1/Arg2 modify the labelling of the lower (left) axis
          = P for parallel   labels (default for X axis)
          = O for orthogonal labels (default for Y axis)
          = N for no labels
Arg3      indicates that the ticks are In or Out ofthe box
Arg4      controls the labelling of the upper X axis and
          may have the same values as Arg1 or 2 (P, O, N).
.fi

The default is BOX P O I.

/UNIT Type [LOWER|UPPER]
.in +4
If present, it modifies (with no permanent action) the unit of the X
axis (lower or upper according to the subsequent argument, default is
LOWER). Type may be any of the usual SET UNIT arguments. For Continuum
data, the /UNIT command has no effect, but the unit is controlled by
the SET ANGLE command. /INDEX produces a box suited for 2D color plot
with a wedge (the Y-left axis gives the number of spectra).
.in -4

/OBS
.in +4
Plot a box for a single spectrum.
.in -4

/INDEX
.in +4
Plot a box suited for 2D display: Y axis is the temperature scale, and
Z axis is the observation number. All three axis (X, Y and Z) may be
defined by using the SET MODE command.
.in -4
.\"====================================================================
.ti -4
1 CATALOG
.ti +4
LAS_\CATALOG [Filename] [/SORT NONE|FREQUENCY]

Read an ASCII file of lines (frequency in GHz and name) into the SIC
structure named CLASS%LINE. When the filename is missing, CATALOG uses
by default the ASTRO line catalog. Each row of the line file contains
the description of a line as follows:

.nf
   115.271204      12CO-1-0       
.fi

Comment lines start with the exclamation mark (!). By default the line
catalog is sorted by increasing frequency. This can be changed by
using the option /SORT.

The SIC structure containing the catalog has 3 members:
.nf
   CLASS%LINE%N        [     integer] number of lines read
   CLASS%LINE%FRES[N]  [      double] line frequency in MHz
   CLASS%LINE%NAME[N]  [character*12] line name
.fi
.\"====================================================================
.ti -4
2 /SORT
.ti +4
LAS_\CATALOG [Filename] /SORT NONE|FREQUENCY

Control the sorting of the output catalog. If the option is not given
the output catalog is sorted by ascending frequency. Currently only
two sorting options are available, NONE, which means the SIC structure
order is the same as that in the file, and FREQUENCY, which is the
same as the default behaviour.

.ti -4
1 CONSISTENCY
.ti +4
LAS_\CONSISTENCY [/NOCHECK [Keyword1] [Keyword2] ... ]

Check the consistency of the current index according to particular
header parameters. The attributes to be checked are ruled by SET
CHECK or NOCHECK (see HELP for details).

The consistency is implicitly tested with some commands: AVERAGE,
ACCUMULATE, STITCH, LOAD, TABLE.

/NOCHECK
.in +4
Without keyword, this option disables all the checks. With a keyword,
disable the named checks. Supported keywords are documented in HELP
SET NOCHECK.
.in -4
.\"====================================================================
.ti -4
1 COPY
.ti +4
LAS_\COPY [/SORTED]

Write all the observations in current index into output file. For
efficiency reasons, COPY refuses to copy a sorted index (SET SORT is
other than NONE), but user can enforce the copy with the /SORTED
option.
.\"====================================================================
.ti -4
1 DROP
.ti +4
LAS_\DROP Obs [Ver]

Removes an Observation from the current index. The version number must
be specified if it is not the last in the input file, even if it is
the last version in the current index.  This commands has an effect
only on the current index, i.e. until a new index is built with a
FIND.
.\"====================================================================
.ti -4
1 DUMP
.ti +4
LAS_\DUMP Argument [Buffer]
.ti +4
LAS_\DUMP /SECTION [Name] [R|T|P]

With no argument, lists the content of all present header sections of
the current R buffer. Arguments are:
.nf
  ADDRESSES    Lists addresses
  DATA [R|T|P] Lists in addition the data values of buffer R, T or P
  FILE         Lists information about the input and output files
  INDEX        Lists information about the current index
  MEMORY       Lists the memory usage of the Class buffers
  OTF          Lists OTF informations
  PLOT         Lists current plot definition
.fi

/SECTION [Name] [R|T|P]
.in +4
Lists parameters of a given section. Default is all for R buffer.
.in -4
.\"====================================================================
.ti -4
1 EXTRACT
.ti +4
LAS_\EXTRACT [X1 X2 [Unit]] [/INDEX]

In its default mode, EXTRACT copies R into T, extracts a subsection of
R, and save the result in R. If the option /INDEX is present, or if
SET ACTION is INDEX, a subsection of each observation in the index is
extracted and saved in the output file.

Without arguments, the cursor is invoked (if available) to define the
subsection range. If the arguments X1 and X2 are present, the
subsection is defined by this range, in the given Unit (if any) or by
default in the current X axis unit (SET UNIT). X2 can be indifferently
greater or lower than X1, and Unit is a single character in the four
C)hannel, V)elocity, F)requency or I)mage. Note that if Unit is F or
I, the number of extracted channels can vary for two similar
observations (same setup) because of different Doppler factors.

If the range overlaps the input spectrum limits, a warning is raised
and the missing data is filled with the blanking value. Requesting a
range off the input spectrum is an error. The command FIND /FREQUENCY
can help you to build an index with spectra overlapping one frequency
or one range of frequencies.

On return, the observation header is consistently updated: the
reference channel is shifted and number of channels updated. The PLOT
section (which remembers the previous plotting limits) is disabled
because it probably does not makes sense for the extracted data array.

Only regularly sampled X axes are supported.
.\"====================================================================
.ti -4
1 FILE
.ti +4
LAS_\FILE Mode Name [SINGLE|MULTIPLE] [/CONVERT] [/OVERWRITE]

Selects the input and output files.
.nf
  FILE IN Name        open an existing file as input
  FILE OUT Name       open an existing file as output
  FILE OUT Name Type  creates a new output file of the specified type
  FILE BOTH Name      select the same file for input and output.
  FILE UPDATE Name    open a file for Updates only.
.fi
See subtopics for details.

The default extension is .30m but can can be specified using command
SET EXTENSION.
.\"--------------------------------------------------------------------
.ti -4
2 IN
.ti +4
LAS_\FILE IN Name

Open an input file for reading.

The input file can be of 2 different forms:
.in +4
.ti -2
- the usual Class Data Format (.30m or other produced by several
telescopes, and by Class itself),
.ti -2
-_ a VLM (Velocity-Position-Position) cube in the Gildas Data
Format. LMV cubes must be transposed first to VLM before use.
.in -4
The usual Class commands (FIND, GET, etc) work transparently on both
kind of files.
.\"--------------------------------------------------------------------
.ti -4
2 OUT
.ti +4
LAS_\FILE OUT Name
.ti +4
LAS_\FILE OUT Name SINGLE|MULTIPLE [/OVERWRITE]

Open a Class file for writing.

The first form opens an old, already existing file, for appending new
observations into it.

The second form creates a new (empty) file. If a file with the same
name already exists, it is overwritten if the option /OVERWRITE is
present. An error is raised otherwise.
.br
A new ouput file can be of 2 different kinds:
.in +4
.ti -2
- the type MULTIPLE allows to have several version of the same
spectrum (same ObservationNumber). This type is the "historical" one
for CLASS. It can be opened in all modes.
.ti -2
- with the type SINGLE, the ObservationNumber is a unique identifier
of the spectrum: only one version exists. This type has been
introduced to simplify and speed up On-The-Fly processing, in
particular at the telescope. It can not be opened in BOTH mode.
.in -4
.\"--------------------------------------------------------------------
.ti -4
2 BOTH
.ti +4
LAS_\FILE BOTH Name

Open a Class file both for reading old observations and writing new
observations, or new versions of the old observations already in the
file.

This mode can be used only with MULTIPLE files (see FILE OUT), where
several versions of the same observation can be saved in the file. See
HELP WRITE for details.
.\"--------------------------------------------------------------------
.ti -4
2 UPDATE
.ti +4
LAS_\FILE UPDATE Name

Open a Class file for updating its observations.

In this mode, the spectra can be read, modified, and updated in place,
typically via a TAG or UPDATE command after a MODIFY. The command
WRITE (i.e. appending a new observation into the file) is not allowed.
.\"====================================================================
.ti -4
1 FIND
.ti +4
LAS_\FIND [APPEND|NEW__DATA|UPDATE] [Options]

FIND performs a search in the input file to build a new index,
according to selection criteria defined by the SET command. These
criteria may be temporarily modified by the following options.

.nf
Observation numbers:
  /ALL                  all versions of each observations are searched for
                        (if not present: only the last version)
  /NUMBER n1 n2         search for the specified range of observation numbers
  /ENTRY  n1 n2         search for the specified range of entry numbers

General information:
  /SCAN s1 s2           search for the specified range of scan numbers
  /SUBSCAN s1 s2        search for the specified range of subscan numbers
  /SWITCHING mode	search for the switching mode used
  /TELESCOPE name       search for the telescope used
  /OBSERVED d1 d2       search for these observation dates (JJ-MMM-YYYY)
  /REDUCED d1 d2        search for these reduction dates (JJ-MMM-YYYY)
  /QUALITY q            search for the data of quality better than Q
  /SECTION name         search for observations which have this section defined

Spectroscopic information:
  /LINE name            search by line name
  /FREQUENCY f1 f2      search by signal or image frequency value or range

Position information:
  /SOURCE name          search by source name
  /OFFSET a1 a2 [unit]  search for this position (within SET MATCH tolerance)
  /RANGE w e s n [unit] search for the specified range of offsets (plus SET MATCH tolerance)
  /POSITION a0 d0 sys   search for observations by absolute position
  /MASK File            search for observations in the mask

Drift information:
  /DRIFT angle          search by compatible drift angle (degrees) i.e. modulo 180
  /DIRECTION angle      search by identical drift angle (degrees) i.e. modulo 360
.fi

FIND does not return an error if the index is empty, but the variable
FOUND is set to 0. FOUND is always set to the number of observations
in the index.
.\"--------------------------------------------------------------------
.ti -4
2 APPEND
.ti +4
LAS_\FIND APPEND [/OPT1 ...]

FIND by default resets the current index. Found observations may be
appended to the current index by specifying the argument APPEND. A
compression occurs to avoid duplication of observations in the index.
.\"--------------------------------------------------------------------
.ti -4
2 NEW__DATA
.ti +4
LAS_\FIND NEW__DATA [/OPT1 ...]

Argument NEW__DATA can be used to find the new (and only new)
observations (if any) present in the input file. FIND options or
equivalent SET tunings apply. If no new observations are present, the
current index will be empty.

FIND NEW__DATA does not wait for new data, but you can use the command
NEW__DATA to do so.

This possibility is intended for sites where data acquisition is done
in CLASS format (Pico Veleta, Plateau de Bure) to use CLASS as an
automated quick look facility.
.\"--------------------------------------------------------------------
.ti -4
2 UPDATE
.ti +4
LAS_\FIND UPDATE [/OPT1 ...]

The input index will first be appended with the new observations (if
any) present in the input file. This saves time because a (much)
smaller part of the input file is actually read. The current index is
then reset and recomputed from the input index (i.e. with old and new
observations), as usual.

FIND UPDATE does not wait for new data, but you can use the command
NEW__DATA to do so.

This keyword can be omitted if the SET FIND mode is UPDATE.
.\"--------------------------------------------------------------------
.ti -4
2 /MASK
.ti +4
LAS_\FIND /MASK [FileName]

Select observations according the given mask.

The file name should refer to a GDF file providing a 2D
(position-position) mask with <=0 or blank values (not selected), or
>0 (selected) real values. The spectra from the input index are
selected according to their position (lamof, betof) on the
mask. Positions completely out of the mask are not selected. Note that
this command does not check the consistency of the projection center,
projection kind, and projection angle (only offsets are used).

This option is best suited for use with the weight file (.wei)
produced by the command XY__MAP, in which zero weights are put where
no data is available. Using this weight file with FIND /MASK will thus
ignore pixels/spectra with no data at all (all blank values).

Another possibility is to produce a custom mask from an image, e.g.
.nf
  G\IMAGE myimage.gdf  ! or mycube.lmv
  G\LIMITS /RG
  G\SET BOX MATCH
  G\PLOT
  G\BOX
  G\POLYGON                           ! Define with cursor
  G\MASK OUT                          ! Mask pixels OUT of the polygon
  LET RG +1 /WHERE RG.NE.BLANKING[1]  ! Select pixels IN the polygon
  G\WRITE IMAGE mymask.gdf            ! Save into file
.fi
In this example the cursor is used to define the mask, but one can use
his own recipe to define the in/out rules.

The default for FileName is the FILE IN VLM cube name if any, with the
extension replaced by ".wei". Else, there is no default.
.\"--------------------------------------------------------------------
.ti -4
2 /POSITION
.ti +4
LAS_\FIND /POSITION A0 D0 GALACTIC|EQUATORIAL [Equinox]

Select observations according to their absolute position. A0 and D0
are sexagesimal strings (degrees, or hour angle for A0 in case of
equatorial coordinates). The coordinate system (and its equinox for
equatorial system) must be provided as third (and fourth) argument to
the option.

In practice, the option converts (if they are different) the given
coordinates to the system used by the observation currently considered
(e.g. galactic to equatorial 2000). Then it translates the absolute
position to relative position. Finally, it compares the offset
position of the observation to this computed reference. SET MATCH is
used as tolerance (same as FIND /OFFSET). These operations are
repeated for all observations in the file.

Beware this option is less efficient than its equivalent FIND /OFFSET
(which uses only index elements). When considering absolute
coordinates, the whole position section must be read for each
observations. As the Class Data Format does not enforce consistency of
the reference positions of all the observations, all the conversions
described above must be repeated for all observations. But if you know
your file is consistent, FIND /OFFSET will always be faster for the
same result. For example, prefer FIND /OFFSET 0 0 instead of FIND
/POSITION to select the spectra near the reference position.
.\"--------------------------------------------------------------------
.ti -4
2 /SWITCHING
.ti +4
LAS_\FIND /SWITCHING Mode

Select observations according to their switching mode:
.in +4
.ti -2
- *: any defined or unknown switch
.ti -2
- POSITION: position switch
.ti -2
- FREQUENCY: unfolded frequency switch
.ti -2
- FOLDED: folded frequency switch
.ti -2
- WOBBLER: wobbler switch
.ti -2
- BEAM: beam switch
.ti -2
- MIXED: special code for mixed modes e.g. after averaging spectra
.ti -2
- UNKNOWN: if the switching information is missing or no switching
  performed (e.g. CALSKY).
.in -4

Note that evaluating the switching mode is unefficient since this
information is not saved in the CLASS index, and requires to read each
observation header one by one. Identifying observations by e.g. their
date and scan number is more efficient, either by proper bookkeeping
at the telescope, or with a once-for-all use of the /SWITCHING option.
.\"====================================================================
.ti -4
1 FITS
.ti +4
LAS_\FITS_ READ_ _ File[.fits]
.ti +4
LAS_\FITS_ WRITE_ File[.fits] /MODE SPECTRUM|INDEX [/BITS Nbits]
[/CHECK]

Read or write the File.fits FITS file to/from the CLASS Data Format.
.\"--------------------------------------------------------------------
.ti -4
2 READ
.ti +4
LAS_\FITS READ File[.fits]

Read the File.fits FITS file to the CLASS Data Format. If the FITS
file has been written (see HELP FITS WRITE) using:
.in +2
.ti -2
- the SPECTRUM mode, the (unique) spectrum is loaded in the R buffer
(memory only). If needed, you have to open an output file and WRITE it
in order to save it on disk.
.ti -2
- the INDEX mode, the (several) spectra are converted and implicitly
written to the current output file (it must have been opened
before). The previous contents of the Class file is preserved (spectra
are appended).
.in -2

This command can read 2 flavors of FITS files:
.in +2
.ti -2
-_ the CLASS-FITS format (i.e. the one written by FITS WRITE or by
some 3rd party softwares). See the CLASS programmer documentation for
details.
.ti -2
- the Herschel-HIFI FITS format. See the dedicated memo for details.
.in -2

FITS cubes can be converted to the Gildas (not CLASS) Data Format by
the command VECTOR\FITS, and then imported as a Class index by the
command ANALYSE\LMV. See HELP V\FITS and HELP LMV for details.
.\"--------------------------------------------------------------------
.ti -4
2 WRITE
.ti +4
LAS_\FITS WRITE File[.fits] /MODE SPECTRUM|INDEX [/BITS Nbits]
[/CHECK]

WRITE the File.fits FITS file from the CLASS Data Format. The
resulting FITS file is a binary table (BINTABLE) with columns of
parameters and channel intensities (dedicated CLASS-FITS format, see
CLASS documentation for details). In order to produce a data cube, the
commands TABLE and XY__MAP must be used first. Then the resulting GDF
cube can be exported with the command V\FITS.

/MODE is a mandatory option which can take the following values as
argument:
.in +9
.ti -9
SPECTRUM_ a simple FITS file is written from the current R spectrum in
memory is written. The number of bits per intensity value used when
writing the FITS file may be controlled through the /BITS optional
argument. It can be: 16 or I*2 (2 bytes integer), 32 or I*4 (4 bytes
integer) or -32 or R*4 (4 bytes real). Default is 32.
.ti -9
INDEX_ _ _ _ a FITS BINTABLE is written from all the spectra in
current index. The user MUST make sure that all index spectra are
consistent (same source, same line, same frequency setup, ...). The
intensity values (and irregularly sampled X axis values, if any) are
always written as 4 bytes real.
.in -9

The default mode and number of bits can also be specified through the
commands:
.ti +2
SET FITS MODE SPECTRUM|INDEX
.ti +2
SET FITS BITS Nbits
.br
The option /CHECK will print the FITS HEADER on the terminal.
.\"====================================================================
.ti -4
1 FOLD
.ti +4
LAS_\FOLD [/BOUNDARIES KEEP|DROP]

FOLD copies R into T, and folds a (not yet folded) frequency-switched
spectrum.

The behavior regarding blank values (contaminating or not the
resulting spectrum) is ruled by the SET BAD tuning (see HELP SET BAD
for details). If blank channels are located at the folded spectrum
boundaries, they can be kept (/BOUNDARIES KEEP) or implictly dropped
(/BOUNDARIES DROP). Default is KEEP.

Because of the frequency throw, there are frequencies which are not
covered by all phases (R%HEAD%FSW%NPHAS), typically 1 phase instead of
2. The resulting channels in the folded spectrum are located at the
spectrum boundaries. If SET ALIGN second argument is Intersect
(resp. Composite), those channels are rejected from (resp. included
in) the resulting R spectrum. Default is Intersect.
.\"====================================================================
.ti -4
1 GET
.ti +4
LAS_\GET [N [version]|FIRST|LAST|NEXT|PREVIOUS|ZERO]

GET copies R into T, and loads the Observation number N in R. The
current index initialized by FIND is first explored, then, if needed,
the whole input file. If N is absent, the previous (last read)
Observation is recovered.

Instead of an observation number, several keywords can also be used:
.in +14
.ti -12
-_ FIRST:_ _ _ _ the first Observation of the current index is loaded,
.ti -12
-_ LAST:_ _ _ _ _ the last Observation of the current index is loaded,
.ti -12
-_ NEXT:_ _ _ _ _ the next Observation in the current index is loaded,
.ti -12
-_ PREVIOUS: the previous Observation in the current index is loaded,
.ti -12
-_ ZERO:_ _ _ _ _ the internal Observation counter is reset to 0, so
that next GET NEXT will get the first observation. In this unique
case, R and T are not modified.
.in -14
.\"====================================================================
.ti -4
1 HEADER
.ti +4
LAS_\HEADER

Displays some header information on the R Observation. The FULL format
is used, with the informations selected in command SET FORMAT written.
The lines written contain (in output order, but not all lines are
necessarily present)
.nf
- General information line:
    Scan number and version
    Source name
    Line name
    Telescope name
    Date of observation
    Date of last reduction
- Position information line
    RA or l        right ascension or longitude (or azimuth)
    DEC or b       declination or latitude (or elevation)
    Equinox        if equatorial coordinates are used
    Offsets        (in current units)
    coordinate     Eq, Ga, Az
- Quality information line:
    Quality of calibration (as defined by a SET QUALITY)
    Tau      opacity at zenith
    Tsys     system temperature (outside atmosphere).
    Time     total integration time on source (minutes)
    El       elevation of source
- Spectral information lines (2):
    N        number of channel
    I0       reference channel (real)
    V0       velocity at reference channel
    Dv       velocity resolution (signed)
    F0       rest frequency at reference channel
    Df       frequency resolution (signed)
    Fi       image frequency at reference channel
- Calibration information line:
    B__ef    Beam efficiency of telescope
    F__ef    Forward efficiency of telescope
    G__im    Gain in image band
- Atmospheric information lines (2):
    H2O      millimeter of precipitable water vapor
    Pamb     ambient pressure
    Tamb     ambient (receiver cabin) temperature
    Tchop    Chopper temperature
    Tcold    Cold load temperature
    Tatm     Atmospheric temperature in the signal band
    Tau      Zenith opacity in the signal band
    Tatm__i  Atmospheric temperature in the image band
    Tau__i   Zenith opacity in the signal band
- Continuum Drift information lines (2) :
    N        Number of points
    I0       Reference point
    A0       Angle offset at reference point
    Da       Angular spacing between points (signed).
    F0       Observing frequency
    Df       Band pass
    Pos._ Ang._ : Position angle of the drift.
.fi
followed by the list of Scan numbers added in the observation.
.\"====================================================================
.ti -4
1 IGNORE
.ti +4
LAS_\IGNORE List__of__Observations [/SCAN iscan]

This command can be used to declared the specified list of
Observations (from the INPUT file) to be ignored in all FIND
operations.  They effectively become invisible to CLASS (except in a
LIST IN command), until a FILE IN command is typed again. The input
file is not physically modified however. The list of observation may
have the same format as the index list of a FOR command.

/SCAN iscan
.in +4
Ignore all observations with scan number 'iscan'.
.in -4
.\"====================================================================
.ti -4
1 LIST
.ti +4
LAS_\LIST [IN|OUT] [/BRIEF] [/LONG] [/SCAN] [/OUTPUT File] [/TOC]
[/VARIABLE VarName]

List header information about an ensemble of Observations.  LIST is
used for a quick look to Observation headers, in a more or less
detailed format. IN or OUT keyword specifies the file to be listed.
If absent, the current index is listed. A medium-sized format is used
by default.
.nf
LIST IN       List the whole input file (all versions, see FIND /ALL)
LIST OUT      List the whole output file (all versions)
/BRIEF        Brief format
/LONG         Long format
/SCAN         Scan based compact format
/SCAN /BRIEF  Scan numbers followed by the number of spectra in each scan
/TOC          Display the table of contents. See subtopic for details.
/OUTPUT File  Send the list to a file
.fi

.br
Some options are particularly well suited for large ensemble of
spectra: /SCAN displays the index on a scan number basis (defined by a
unique SOURCE, LINE, TELESCOPE and SCAN number), /SCAN /BRIEF gives
the list of scan numbers with their total number of spectra. /SCAN and
/LONG options are incompatible.
.\"--------------------------------------------------------------------
.ti -4
2 /TOC
.ti +4
LAS_\LIST [IN|OUT] /TOC [Attr1 Attr2 ... AttrN] [/VARIABLE VarName]

LIST /TOC displays the Table Of Contents of the current index, or of
the input (LIST IN) or output file (LIST OUT). A summary of the
different values of each attribute is made, plus a final summary of
all the combinations (setups). The attributes can be:
.in +4
- SOURCE
.br
- LINE
.br
- TELESCOPE
.br
- OFF1
.br
- OFF2
.br
- ENTRY
.br
- NUMBER
.br
- BLOCK
.br
- VERSION
.br
- KIND
.br
- QUALITY
.br
- OBSERVED
.br
- SCAN
.br
- SUBSCAN
.in -4
The following attributes are more relevant in the context of continuum
drifts:
.in +12
.ti -8
- DRIFT (compatible continuum drift position angles i.e. same angle
modulo 180 degrees within tolerance)
.ti -8
- DIRECTION (identical continuum drift position angles i.e. same angle
modulo 360 degrees within tolerance)
.ti -8
- FESB (based on telescope name but only same frontend+sideband)
.ti -8
- FRONTEND (based on telescope name but only same frontend)
.in -12

By default, SOURCE, LINE and TELESCOPE are used.

The table of contents is also saved in a SIC, user-defined structure
thanks to the option /VARIABLE (default is TOC%). The content of the
structure is updated after each call to the command LIST /TOC. One
must take care that subsequent calls to FIND can lead to values in
TOC% inconsistant with the current index.
.\"====================================================================
.ti -4
1 LOAD
.ti +4
LAS_\LOAD [/NOCHECK keyword1 [keyword2 [keyword3] ...]]

Pack the whole current index in a 2D array. By default, check the
consistency of the index (see CONSISTENCY). The option /NOCHECK allows
to ignore some inconsistency, according to the optional keywords.
.\"====================================================================
.ti -4
1 MERGE
.ti +4
LAS_\MERGE

Merge all the continuum drifts from the input index into a single
one. The resulting drift is saved in R.

The drifts are merged by concatenating and sorting the resulting RX
and RY values. The output observation is then flagged as "irregularly
sampled".
.\"====================================================================
.ti -4
1 MODIFY
.ti +4
LAS_\MODIFY Item [Values...]

This is a general purpose command to edit and change the current
observation header. Some actions are merely presentation "details",
others do affect the information in the observation. Among these,
RECENTER, WIDTH, IMAGE and SWITCH__MODE are typically used only when
the software did not agree with the hardware when the spectra was
taken (i.e. when the information in the observation header is
wrong). They should be used with caution.

MODIFY actions are limited. You should use the SIC_\ command LET to
modify header variables which are not available within the MODIFY
command (Caution: this is the rope to hang you).
.\"--------------------------------------------------------------------
.ti -4
2 BLANKING
.ti +4
LAS_\MODIFY BLANKING New__Blank

Change the blanking value (bad and NaN) in both header and data. This
may be required before you can build a consistent strip or cube,
specially if the spectra were initially loaded from a FITS tape.
.\"--------------------------------------------------------------------
.ti -4
2 BANDS
.ti +4
LAS_\MODIFY BANDS

Exchange signal and image bands. This allows line fitting on image
band for example. Currently, the spectrum is not rescaled even if the
band ratio is not 1.
.\"--------------------------------------------------------------------
.ti -4
2 BEAM__EFF
.ti +4
LAS_\MODIFY BEAM__EFF Value
.ti +4
LAS_\MODIFY BEAM__EFF /RUZE [B0 Sigma]

Change the beam efficiency.

The first syntax allows to define the new beam efficiency from a
single value for the whole spectrum. If the beam efficiency previously
had a non zero value, the spectrum intensities and affected header
parameters are rescaled according to the old and new
values. Otherwise, only the beam efficiency is set to the new value.

The second syntax allows to use the Ruze's equation, which is more
suitable for large band spectra:
.nf
    Beeff(lambda) = B0*exp(-(4*pi*Sigma/lambda)**2)
.fi
B0 is the scaling factor with no units (between 0 and 1), and Sigma
the width factor in microns. If the beam efficiency previously had a
non zero value, a rescale factor is evaluated for each channel and is
applied to the intensities, the new beam efficiency is set to the one
at the center of the spectrum, and the affected header parameters are
rescaled according to this new value. Otherwise, only the beam
efficiency is set to this new value.
.br
B0 and Sigma can be omitted for 30M observations after
01-APR-2009. Values measured at the 30M will be displayed and used in
this case.
.\"--------------------------------------------------------------------
.ti -4
2 DOPPLER
.ti +4
LAS_\MODIFY DOPPLER [SIGN|*|Value]

Change or recompute the Doppler factor according to the CLASS
convention (-V/c). With no argument, checks whether the header value
is consistent with the CLASS value computed according to the date and
observatory. The checking precision corresponds to 0.6 m/s in V. A
logical SIC variable, DOPPLER__PB, is set to true if the values
disagree. If an argument is present:

.in +9
.ti -7
SIGN_ _ _ change the sign of the Doppler factor but do not recompute
it,
.ti -7
*_ _ _ _ _ _ compute and update the Doppler factor according to the
observing date-time and the observatory position (this position can be
customized with SET OBSERVATORY). This is suited when the frequencies
in the Class header are described in the observatory frame. See also
undefined Doppler section below.
.ti -7
0_ _ _ _ _ _ force the Doppler factor to 0, i.e. the frequencies in
the Class header are already corrected for the Doppler factor
(described in the LSR frame).
.ti -7
Value_ _ set the Doppler factor to <Value>
.in -9


Undefined Doppler factor:
.in +2
.ti +2
If the Doppler factor is -1 (no physical meaning), it is considered
"undefined" by Class. In most of the cases, this happens when reading
old Class data files where the Doppler factor was not available in the
data format. Since then, telescopes are encouraged to use the newest
data format and write directly a valid Doppler factor value at the
time the Class files are created.

.ti +2
At read time (GET or other commands reading a spectrum), Class
considers the value -1 as a request to recompute automatically the
Doppler factor from the telescope position on Earth and from observing
date-time, assuming the frequencies in the spectrum header are
described in the observatory frame. In other words, Class tries to
apply implicitly the command MODIFY DOPPLER * on the spectrum.

.ti +2
The above automatic patch works if the observatory can be recognized
by Class from the telescope name (R%HEAD%GEN%TELES). If not, you will
encounter this error:
.nf
  E-COMPUTE__DOPPLER,  Telescope not understood from XXX
.fi
In this case, use the command SET OBSERVATORY beforehand.

.ti +2
Beware that the automatic patch makes sense if the frequencies are
described in the observatory frame. If they are described in the LSR
frame, the Doppler factor must be forced to 0.

.ti +2
Finally, if you have an old Class file without the Doppler factor, it
is advised to copy it to a newer Class Data Format. This will save the
computed Doppler value directly in the new file instead of recomputing
again and again this factor each time the spectrum is read from the
old file. If MODIDY DOPPLER * is what you want (frequencies in the
observatory frame), this will do the job:
.nf
  FILE IN old.30m
  FIND
  FILE OUT new.30m SINGLE ! Uses newest data format
  COPY                    ! Implicit MODIFY DOPPLER * on each spectrum
.fi
If you need a custom Doppler value (most probably 0), use:
.nf
  FILE IN old.30m
  FIND
  FILE OUT new.30m SINGLE ! Uses newest data format
  FOR I 1 TO FOUND
    GET NEXT
    MODIFY DOPPLER 0
    WRITE
  NEXT
.fi
.in -2
.\"--------------------------------------------------------------------
.ti -4
2 FREQUENCY
.ti +4
LAS_\MODIFY FREQUENCY Rfreq

Compute the velocity scale corresponding to a new rest frequency
Rfreq. The sky frequency scale is not modified. If present, the
resolution section is also updated.
.\"--------------------------------------------------------------------
.ti -4
2 ELEVATION__GAIN
.ti +4
LAS_\MODIFY ELEVATION__GAIN

Correct the spectrum for elevation gain losses as a function of
frequency and elevation. This is valid for point sources. For extended
sources, the correction is less, depending on the size of the source.

The rest frequency and elevation are taken from the spectrum header,
assuming that the gain stays constant over the entire bandpass of the
spectrum.

This correction is only implemented for 30M data. The formulae for the
gains are documented in Juan Penalver memo 16-Apr-2012. The gain is
the ratio of aperture efficiency at the elevation of the observation,
divided by the maximum aperture efficiency near 50 degrees.
.\"--------------------------------------------------------------------
.ti -4
2 IMAGE
.ti +4
LAS_\MODIFY IMAGE Rimage

Change the image frequency (in MHz).
.\"--------------------------------------------------------------------
.ti -4
2 LINENAME
.ti +4
LAS_\MODIFY LINENAME "New Name"

Modify the line name (for bookeeping).
.\"--------------------------------------------------------------------
.ti -4
2 OFFSETS
.ti +4
LAS_\MODIFY OFFSETS O1 O2 [Unit]

Force the offsets to new values. They should be expressed in the
current observation system and projection. Values are expressed in the
given unit if any (RAD, DEG, MIN, SEC, MAS), or current Class unit if
absent (current SET ANGLE).

This may be required when you average spectra from different offsets,
because the resulting "position" is meaningless (usually the position
of the first observation added).
.\"--------------------------------------------------------------------
.ti -4
2 PARALLACTIC__ANGLE
.ti +4
LAS_\MODIFY PARALLACTIC__ANGLE

Recompute the parallactic angle from the latitude of the observatory
and the azimuth and elevation found in the header.

The azimuth convention is assumed to be South at 180 degrees.
.\"--------------------------------------------------------------------
.ti -4
2 POSITION
.ti +4
LAS_\MODIFY POSITION Lambda Beta

Change the projection center to (Lambda,Beta). Units are degrees,
except Lambda in hour angle if coordinate system is
Equatorial. Sexagesimal strings or numeric real values can be used.

The offsets are also modified, as to be consistent with the
center. This is useful when different parts of one source are mapped
relative to several reference positions.

This command is a shortcut for:
.nf
  MODIFY PROJECTION  =  Lambda Beta  =
.fi
i.e. modify the projection center but preserve the projection kind and
angle.
.\"--------------------------------------------------------------------
.ti -4
2 PROJECTION
.ti +4
LAS_\MODIFY PROJECTION Type [A0 D0 [Angle [DEG|RAD]]]

Change the projection system of the current R observation, and
optionally the projection center and angle at the same time. Type
"MODIFY PROJECTION ?" for a list of supported projections.

A0 and D0 should be sexagesimal strings in degrees, except A0 in hour
angle if coordinate system is Equatorial. Angle is the desired
projection angle, with its unit given just after (default degrees).

If an argument is absent or equal sign "=", it is left unchanged. The
offsets are recomputed consistently according to the modified
parameters.
.\"--------------------------------------------------------------------
.ti -4
2 RECENTER
.ti +4
LAS_\MODIFY RECENTER Rrchan

Force the reference channel to a new value in order to change the
velocity, frequency and image frequency scales. The sky frequency
scale is also altered in this command.
.\"--------------------------------------------------------------------
.ti -4
2 SCALE
.ti +4
LAS_\MODIFY SCALE Unit

THIS COMMAND IS EXPERIMENTAL AND MAY EVOLVE IN THE FUTURE. NOTE THAT
THE DATA FORMAT DOES NOT REMEMBER YET WHAT IS THE CURRENT UNIT OF RY,
IT IS YOUR RESPONSIBILITY TO REMEMBER WHICH RESCALING YOU PREVIOUSLY
APPLIED.

Rescale RY from its former unit to the new unit. Recognized units are:
.ti +2
TA*
.ti +2
Tmb
.ti +2
Jy/beam
.ti +2
mJy/beam
.ti +2
Jy/sr
.ti +2
mJy/sr
.\"--------------------------------------------------------------------
.ti -4
2 SOURCE
.ti +4
LAS_\MODIFY SOURCE source__name

Modify the source name.
.\"--------------------------------------------------------------------
.ti -4
2 SYSTEM
.ti +4
LAS_\MODIFY SYSTEM System

Force the System in which the center of projection (central position
of the source) is defined. Valid systems are GALACTIC, EQUATORIAL,
HORIZONTAL and UNKNOWN. This command is typically used for "foreign"
data when the SYSTEM information has not been decoded correctly by the
conversion package. No correction is applied on spectrum position.
.\"--------------------------------------------------------------------
.ti -4
2 TELESCOPE
.ti +4
LAS_\MODIFY TELESCOPE Name

Change the telescope name, for instance from IRAM-30M to 30M-MRT.
.\"--------------------------------------------------------------------
.ti -4
2 VELOCITY
.ti +4
LAS_\MODIFY VELOCITY Rvoff

Compute the image and rest frequencies corresponding to a new velocity
(in km/s). The sky frequency scale is unchanged by this command.
.\"--------------------------------------------------------------------
.ti -4
2 WIDTH
.ti +4
LAS_\MODIFY WIDTH Rfres

Change the frequency resolution (in MHz).
.\"--------------------------------------------------------------------
.ti -4
2 SWITCH__MODE
.ti +4
LAS_\MODIFY SWITCH__MODE FSW Nphase Foff1 Time1 Weight1 ...
.ti +4
LAS_\MODIFY SWITCH__MODE PSW Nphase Loff1 Boff1 Time1 Weight1 ...

Change the description of the switching mode. This command is
typically used for "foreign" data when this information has not been
decoded correctly by the conversion package.

FSW stands for unfolded frequency switch. For each phase, one should
specify:
.in +4
.ti -2
- the offset for the phase (in MHz),
.ti -2
- the duration of the phase (in seconds),
.ti -2
- the weight given to phase (arbitrary units)
.in -4

PSW stands for position switch. For each phase, one should
specify:
.in +4
.ti -2
- the lambda offset for the phase (in current angular),
.ti -2
- the beta offset for the phase (in current angular),
.ti -2
- the duration of the phase (in seconds),
.ti -2
- the weight given to phase (arbitrary units)
.in -4
.\"====================================================================
.ti -4
1 MULTIPLY
.ti +4
LAS_\MULTIPLY Fact

Multiply the R Observation by Fact. MULTIPLY leaves the T Observation
unaffected. Note that Tsys is also multiplied by the same (absolute)
factor to keep proper weights. If only the data is to be multiplied,
use the SIC_\LET command on array RY:
.ti +4
SIC_\LET RY Fact*RY
.\"====================================================================
.ti -4
1 NEW__DATA
.ti +4
[LAS_\]NEW__DATA [Interval]

Waits until new observations have been written to the input file, and
then return. No modification of the input or current index is done. It
is then expected to use FIND NEW__DATA|UPDATE to rebuild the indexes
with these new observations (see corresponding HELP for details).

The waiting time between 2 check can be customized as first argument
(in seconds, default 5).
.\"====================================================================
.ti -4
1 PLOT
.ti +4
LAS_\PLOT [ArrayName] [/INDEX] [/OBS]

PLOT /OBS
.in +4
.br
Display the Observation in R. No argument or argument "Y" will plot
the spectrum Y intensities of the R buffer (RY), but an associated
array can be plotted instead given its name. It is equivalent to the
following sequence of commands:
.nf
    CLEAR DIRECTORY  ! i.e. clear only the current window
    BOX
    SPECTRUM [ArrayName]
    TITLE
.fi
The type of PLOT can be specified by SET PLOT. The limits for the X
and Y axes are set by SET MODE X and SET MODE Y.
.in -4

PLOT /INDEX
.in +4
Equivalent to the following sequence of commands:
.nf
    CLEAR DIRECTORY
    BOX /INDEX
    SPECTRUM /INDEX
    TITLE /INDEX
.fi
Plot a 2-dimensional image (built with the LOAD command) with
velocity/frequency for the X axis, index number for the Y-axis, and
intensity being rendered as grey/color scale. Use SET MODE Y to choose
the color lower and upper limits. Entering command POPUP after PLOT
/INDEX enables displaying a single spectrum, selected by clicking with
the middle button of the mouse. Use SET MODE Z to control the second
dimension of the plot (e.g. number of entries).
.in -4

Default is /OBS. The default can be modified with SET ACTION.
.\"====================================================================
.ti -4
1 SAVE
.ti +4
LAS_\SAVE Name

SAVE creates a procedure file of name "Name.CLASS", containing all the
current parameters of the program.  This file may be executed at any
time using the @ command: just type "@_ name" after the LAS> prompt,
or pass "@_ name" as a parameter when invoking CLASS (by typing
"CLASS_ @_ name").  This file is composed of standard CLASS commands,
and may be edited with any text editor.
.\"====================================================================
.ti -4
1 SET
.ti +4
LAS_\SET something [value1 [value2 [...]]] [/NOCURSOR]

This command is used to set a value for a CLASS parameter. If no
argument is given, the default value for the parameter will be
restored.
.\"--------------------------------------------------------------------
.ti -4
2 ACTION
.ti +4
LAS_\SET ACTION I[ndex] O[bservation]

Defines the default action level: current index or current observation
(R buffer). Default is OBServation.
.\"--------------------------------------------------------------------
.ti -4
2 ALIGN
.ti +4
LAS_\SET ALIGN Type Range

Defines the way the spectra to be averaged are aligned (Type) and
combined (Range). Possible combinations are:
.nf
  Type:  C[hannel]      for spectra and drift
         V[elocity]     for spectra only
         F[requency]    for spectra only
         P[osition]     for drift only
  Range: I[ntersect] or C[omposite]
.fi
Default is SET ALIGN C I.

Note: the default means that continuum drifts in opposite directions
are not properly stacked: ALIGN Position must be specified for that.
.\"--------------------------------------------------------------------
.ti -4
2 ANGLE
.ti +4
LAS_\SET ANGLE Unit

Specify the angle unit for offsets. Unit is one of: RAD[ian],
DEG[ree], MIN[ute of arc], SEC[ond of arc], MAS[milli second of arc].
Default is SECond. The ANGLE unit is also used to display Continuum
drifts.
.\"--------------------------------------------------------------------
.ti -4
2 BAD
.ti +4
LAS_\SET BAD AND|OR

Specify the way the commands which have to mix channels behave in the
case of bad channels. There are two families of such commands:
.in +4
.ti -2
-_ resampling (part of) commands: RESAMPLE, and optionally ACCUMULATE,
AVERAGE, and STITCH if resampling is needed,
.ti -2
-_ addition (part of) commands: ACCUMULATE, AVERAGE, and STITCH. FOLD
is also affected.
.in -4

Default is OR, i.e. the output channel is bad if any of the input
channels is bad. AND indicates to use all the non-bad channels (if
any) to compute the output channel.
.\"--------------------------------------------------------------------
.ti -4
2 BASELINE
.ti +4
LAS_\SET BASELINE arg

Specify the degree of polynomial baselines to be subtracted. Default
is 1.
.\"--------------------------------------------------------------------
.ti -4
2 BOX
.ti +4
LAS_\SET BOX L[andscape] P[ortrait] D[efault]

Calls the GREG1\SET PLOT and GREG1\SET VIEWPORT commands with default
values suited for CLASS plots. If no keyword, restore the default box:
SET VIEW 0.1 0.95 0.15 0.70. The box size can be modified using the
GREG1\ command directly as for instance
.br
.in +4
LAS> g\set view 0.2 0.3 0.2 0.3
.in -4
.\"--------------------------------------------------------------------
.ti -4
2 CALIBRATION
.ti +4
LAS_\SET CALIBRATION [Beam__Tol [Gain__Tol]] or OFF

Specify the tolerance on the Beam efficiency (Beam__Tol) and gain
image ratio (Gain__Tol), on turn or calibration checking. A value of 0
means no check. The default values are 0.02 and 0 respectively.

These values are used by the command CONSISTENCY (and the other
commands using it implicitely) to verify that the calibration is
consistant. They are also used by command WRITE which writes the
corresponding information in the output file only if Beam__Tol is non
zero. Note that because the beam efficiency is less than 1, you could
use Beam__Tol=1 to suppress the calibration checking but still write
the information.
.\"--------------------------------------------------------------------
.ti -4
2 CHECK
.ti +4
LAS_\SET CHECK [Arguments]

Enable checking all (no argument) or named attributes in the commands
performing a consistency check. See HELP SET NOCHECK for details.
.\"--------------------------------------------------------------------
.ti -4
2 DEFAULT
.ti +4
LAS_\SET DEFAULT

Restore all parameters to their default value. The default values for
individual parameters are documented under the corresponding subtopic.
.\"--------------------------------------------------------------------
.ti -4
2 ENTRY
.ti +4
LAS_\SET ENTRY e1 e2

FIND will build the current index from the other selectors, and then
from this index it will reduce the number of entries found to the
given range. This is useful for example to iterate the index by
consecutive ranges. Default is * *.
.\"--------------------------------------------------------------------
.ti -4
2 EXTENSION
.ti +4
LAS_\SET EXTENSION Ext

Defines the default extension for input and output files. Default
is '.30m'.
.\"--------------------------------------------------------------------
.ti -4
2 FIND
.ti +4
LAS_\SET FIND UPDATE|NOUPDATE

FIND will check or not for new entries in the input file (see FIND
UPDATE). Default is no implicit update (NOUPDATE).
.\"--------------------------------------------------------------------
.ti -4
2 FORMAT
.ti +4
LAS_\SET FORMAT Type

Set the format of the title of observations plotted. The same format
is used by the LIST command. The format may be BRIEF (Observation
number and version, Source name, Line name, Telescope name and
position offsets), LONG or FULL which is similar to the long format,
but also displays the list of original Scans. The default is
LONG. FULL format is always used for command HEADER.

Other keywords can be specified to indicate which type of information
should be written for the LONG and FULL formats. This is done by
command
.ti +4
LAS_\SET FORMAT Keyword [ON] [OFF]
(ON to write the information corresponding to the specified keyword,
OFF to ignore it). The keywords are
.in +4
.ti -2
- POSITION for position of the source, offsets, type of coordinates
and Equinox
.ti -2
- QUALITY for the Opacity, System temperature, Elevation, Integration
time.
.ti -2
- SPECTRAL for the number of channel, reference channel, velocity and
resolution, signal and image frequency and resolution.
.ti -2
- CALIBRATION for the beam and forward efficiencies and the gain image
ratio.
.ti -2
- ATMOSPHERE for the water vapor content, pressure, temperatures and
opacities in signal and image bands.
.ti -2
- CONTINUUM for continuum drift information
.ti -2
- ORIGIN for the list of added scans.
.in -4
The default is Position - Quality - Spectral for spectra, Position -
Quality - Continuum for drifts. A line of general information is
always written in any case.
.\"--------------------------------------------------------------------
.ti -4
2 FREQUENCY
.ti +4
LAS_\SET FREQUENCY Freq1|* [Freq2|*] [SIGNAL|IMAGE]

Add a selection by frequency for the command FIND. This criterion is
suited only for spectroscopic data.

.in +6
.ti -4
-_ SET FREQUENCY Freq1
.br
select all observations which frequency range intersects the given
frequency,
.ti -4
-_ SET FREQUENCY Freq1 Freq2
.br
select all observations which frequency range intersects at least
partially the given range,
.ti -4
-_ SET FREQUENCY * Freq2
.br
select all observations which frequency range is at least partially
under Freq2,
.ti -4
-_ SET FREQUENCY Freq1 *
.br
select all observations which frequency range is at least partially
above Freq1,
.ti -4
-_ SET FREQUENCY *
.br
select all observations i.e. disable the selection by frequency. This
is the default.
.in -6

An optional keyword can be added after the values to indicate whether
the selection should be performed by SIGNAL or IMAGE
frequencies. Default is SIGNAL.

Users should be aware that this selection criterion requires to read
more informations in the observation header, and thus has a
computation cost which can become important for large datasets.
.\"--------------------------------------------------------------------
.ti -4
2 LEVEL
.ti +4
LAS_\SET LEVEL interactive__min__value logfile__min__value

SET_ LEVEL IS OBSOLETE AND HAS NO EFFECT ANYMORE.
.br
It can be mimicked with the SIC_ MESSAGE command (see HELP for
details). To alter the verbosity of CLASS commands to terminal and to
message file, one should modify the message filters of the CLASS
package.

For example:
.br
.nf
   LAS90> SIC MESSAGE CLASS S=FEW ! Change the on-screen CLASS filter
   LAS90> SIC MESSAGE CLASS       ! Print the two CLASS filters
   class    on-screen  active   filter: FEW------
   class    to-mesfile active   filter: FEWRI--CU
.fi
This keeps only the most important messages (Fatal, Errors, and
Warnings) to the terminal, whereas Results, Informations and Commands
are also printed in the message file by default.
.\"--------------------------------------------------------------------
.ti -4
2 LINE
.ti +4
LAS_\SET LINE Name

FIND will select all observations according to the specified line
name. Default is *. Wildcards are accepted at any position in the line
name (e.g. NAM*, N*ME or N*M*): they match 0 or more characters.
.\"--------------------------------------------------------------------
.ti -4
2 MASK
.ti +4
LAS_\SET MASK [ml1 ml2 [...]] [/VAR array]

Defines a mask for the Gaussian fits by its boundaries. If available,
the cursor will be used to specify missing arguments, unless option
/NOCURSOR is present. When using the cursor, enter: N (or Left mouse
button) to enter a value, C (or Middle button) to cancel the last
entry, H for help, E (or Right button) for exit.  The boundaries are
in current unit. Default is no mask. The boundaries are in current
unit. See DRAW MASK to display the mask(s).

.br
SET MASK /VAR mask__array
.in +2
Define the masks from rank 1 array mask__array[1+2*NMASK]. The array
must be of the following form:
.in +2
.fi
.nf
mask__array[1]=NMASK      number of masks
mask__array[2*i:2*i+1]    boundaries of mask num. 'i'
.fi
.in -2
.in -2
.\"--------------------------------------------------------------------
.ti -4
2 MAP
.ti +4
LAS_\SET MAP [Clear|Normal]

Will Clear (or Not) the screen before processing a MAP
command. However, a "MAP Where" command does not clear the screen even
in a "LAS_\SET MAP Clear" mode.
.\"--------------------------------------------------------------------
.ti -4
2 MATCH
.ti +4
LAS_\SET MATCH [Tolerance [Unit]]

Turn on the checking of position-matching in CONSISTENCY (and the
other commands using it). This tolerance is also used in FIND, MAP and
a few other commands.

The Tolerance is the offset position tolerance expressed in the given
unit if any (RAD, DEG, MIN, SEC, MAS), or current Class unit if absent
(current SET ANGLE). If the Tolerance is absent, it resets to its
default (2 arc seconds).
.\"--------------------------------------------------------------------
.ti -4
2 MODE
.ti +4
LAS_\SET MODE  X | Y | Z | ALL  [mode]

Select the scale mode for axis X, Y or Z, or all. The mode can be:
.nf
  AUTO    : limits as found in the observation header (DEFAULT),
  TOTAL   : all data plotted,
  CURRENT : fix the current values in use (whatever if they were
            Automatic, Total, or already Fixed), so that the next
            spectra plotted will reuse the same
  [void]: i)  limits are entered explicitly by the user
                    LAS_\set mode x x1 x2
          ii) limits are entered interactively when no mode is
              given (if the cursor is available)
.fi

For 2D data (built with the LOAD command), SET MODE Y defines the
color range. The second dimension range (e.g. observation number) is
defined with SET MODE Z.
.\"--------------------------------------------------------------------
.ti -4
2 NOCHECK
.ti +4
LAS_\SET NOCHECK [Arg1] ... [ArgN]

Disable checking all (no argument) or named attributes in the commands
performing a consistency check (see HELP CONSISTENCY). Default is to
check everything.

Arguments can be:
.in +4
.ti -2
- SOURCE
.ti -2
- POSITION
.ti -2
- OFFSET. Offsets are effectively checked if position checking, offset
checking, and offset tolerance (SET MATCH) are enabled.
.ti -2
- LINE
.ti -2
- SPECTROSCOPY
.ti -2
-_ CALIBRATION. Calibration is effectively checked if calibration
checking and calibration tolerance (SET CALIBRATION) are enabled.
.ti -2
- SWITCHING
.in -4
.\"--------------------------------------------------------------------
.ti -4
2 NOMATCH
.ti +4
LAS_\SET NOMATCH

Turn off checking of position-matching in CONSISTENCY (and the other
commands using it). This does not change the tolerance for the other
functions like FIND and MAP.
.\"--------------------------------------------------------------------
.ti -4
2 NUMBER
.ti +4
LAS_\SET NUMBER n1 n2

FIND will select all Observations with numbers between n1 and
n2. Default is *_ *.
.\"--------------------------------------------------------------------
.ti -4
2 OBSERVATORY
.ti +4
LAS_\SET OBSERVATORY *
.ti +4
LAS_\SET OBSERVATORY Name
.ti +4
LAS_\SET OBSERVATORY Name Longitude Latitude Altitude

If OBSERVATORY is *, Class will guess the observatory from the
telescope name (R%HEAD%GEN%TELES). This is the default.

If an observatory name known by GILDAS/Astro is provided as first
argument, Class will use the known longitude, latitude and altitude
values independently of the telescope name.

If an observatory name is provided with its explicit longitude,
latitude (both sexagesimal strings) and altitude (in kilometers),
Class will use those values independently of the telescope name.

The two last syntaxes are useful for R%HEAD%GEN%TELES strings encoding
observatories unknown by Class.
.\"--------------------------------------------------------------------
.ti -4
2 OBSERVED
.ti +4
LAS_\SET OBSERVED d1 d2

FIND will select all Observations with observing dates between d1 and
d2.  Dates are specified as DD-MMM-YYYY (i.e. 14-JUL-1789). Default is
*_ *.
.\"--------------------------------------------------------------------
.ti -4
2 OFFSETS
.ti +4
LAS_\SET OFFSETS o1 o2 [Unit]

FIND will select all observations with offsets at this position,
within the specified tolerance (SET MATCH) around o1 and o2. Values
are expressed in the given unit if any (RAD, DEG, MIN, SEC, MAS), or
current Class unit if absent (current SET ANGLE).

Default is *_ * (select all offsets). See also SET RANGE.
.\"--------------------------------------------------------------------
.ti -4
2 PLOT
.ti +4
LAS_\SET PLOT Type

Set the plotting type for commands PLOT and SPECTRUM. Choices are:
.br
- N[ormal] (polyline connecting the points), or
.br
- H[istogram], or
.br
- P[oint] (disconnected points using the current Greg marker).

Normal is considered to be 50% faster plot than Histogram, but
Histogram gives a better reading of the channel positions and
values. Default is Histogram.
.\"--------------------------------------------------------------------
.ti -4
2 POSANGLE
.ti +4
LAS_\SET POSANGLE amin amax

Specify the position angle range (continnum drifts only) for
subsequent searches.
.\"--------------------------------------------------------------------
.ti -4
2 PROCESSING
.ti +4
The following SET Parameter commands control data processing options:
.nf
LAS_\SET ALIGN Type Range
LAS_\SET BAD Check
LAS_\SET BASE arg
LAS_\SET CALIBRATION [Beam__Tol [Gain__Tol]] or OFF
LAS_\SET MASK [ml1 ml2 [...]] [/VAR array]
LAS_\SET MATCH Tol
LAS_\SET NOMATCH
LAS_\SET TYPE CONTINUUM or LINE or SKYDIP
LAS_\SET VARIABLE Section__Name [Keyword]
LAS_\SET VELOCITY L[sr]H[eliocentric]A[utomatic]
LAS_\SET WEIGHT type
LAS_\SET WINDOW [wl1 wu1 [wl2 wu2 [...]]] -
               [/POLYGON [N] [filename1...filenameN] [/VAR array]]
.fi
.\"--------------------------------------------------------------------
.ti -4
2 QUALITY
.ti +4
LAS_\SET QUALITY q

FIND will select only observations of quality better than Q (i.e. less
than Q). When originally written, unless the real time acquisition
system detected a severe problem, all observations have quality 0, a
priori the best. The quality flag of an observation can be changed
using the TAG command. See HELP TAG for the recommended quality scale.
.\"--------------------------------------------------------------------
.ti -4
2 RANGE
.ti +4
LAS_\SET RANGE West East South North [Unit]

FIND will select all observations with offsets in the specified range,
plus the current SET MATCH tolerance (use SET MATCH 0 to find the
observations exactly in the defined ranges). Values are expressed in
the given unit if any (RAD, DEG, MIN, SEC, MAS), or current Class unit
if absent (current SET ANGLE).

Default is *_ *_ *_ * (i.e. select all offsets).
.\"--------------------------------------------------------------------
.ti -4
2 REDUCED
.ti +4
LAS_\SET REDUCED d1 d2

FIND will select all observations with reduction dates between d1 and
d2.  Dates are specified as DD-MMM-YYYY (i.e. 14-JUL-1789). Default is
*_ *.
.\"--------------------------------------------------------------------
.ti -4
2 SCALE
.ti +4
LAS_\SET SCALE Unit

THIS COMMAND IS EXPERIMENTAL AND MAY EVOLVE IN THE FUTURE. NOTE THAT
THE DATA FORMAT DOES NOT REMEMBER YET WHAT IS THE CURRENT UNIT OF RY,
IT IS YOUR RESPONSIBILITY TO REMEMBER WHICH RESCALING YOU PREVIOUSLY
APPLIED.

Specify the RY scale unit to be used by the current R observation and
next ones loaded in memory (GET, COPY, LMV, etc). Recognized units
are:
.ti +2
*
.ti +2
TA*
.ti +2
TMB
.ti +2
JY/BEAM
.ti +2
mJY/BEAM
.ti +2
JY/SR
.ti +2
mJY/SR

If SET SCALE is * (default), the intrinsic RY unit is not modified. If
SET SCALE is a valid unit, RY is rescaled from its former unit to this
new unit.
.\"--------------------------------------------------------------------
.ti -4
2 SCAN
.ti +4
LAS_\SET SCAN s1 s2

FIND will select all observations with Scan numbers between s1 and
s2. The Scan number, attributed by the on-line acquisition system may
be different from the observation number which is used by CLASS to
refer to the observations. Default is *_ *.
.\"--------------------------------------------------------------------
.ti -4
2 SELECTION
.ti +4
The following SET Parameter commands affect data selection in FIND:
.nf
LAS_\SET ANGLE Unit
LAS_\SET LINE Name
LAS_\SET FREQUENCY Freq
LAS_\SET MATCH Tol
LAS_\SET NOMATCH
LAS_\SET NUMBER n1 n2
LAS_\SET OBSERVED d1 d2
LAS_\SET OFFSETS o1 o2
LAS_\SET POSANGLE amin amax
LAS_\SET QUALITY q
LAS_\SET RANGE West East South North
LAS_\SET REDUCED d1 d2
LAS_\SET SCAN s1 s2
LAS_\SET SOURCE name
LAS_\SET SYSTEM Type [Equinox]
LAS_\SET TELESCOPE Name
LAS_\SET TYPE CONTINUUM or LINE or SKYDIP
.fi
.\"--------------------------------------------------------------------
.ti -4
2 SUBSCAN
.ti +4
LAS_\SET SUBSCAN s1 s2

FIND will select all observations with subscan numbers between s1 and
s2. The subscan number reflects the record number during an On-The-Fly
acquisition. Default is *_ *.
.\"--------------------------------------------------------------------
.ti -4
2 SORT
.ti +4
LAS_\SET SORT keyword

Defines the sorting when building the INDEX with FIND. The sorting is
in ascending order. Default sorting is recovered with SET SORT NONE.

Keyword is one of:
.in +6
BETA
KIND
LAMBDA
LINE
NUMBER
NONE
OBSERVED
QUALITY
SCAN
SUBSCAN
SOURCE
TELESCOPE
VERSION
.in -6
.\"--------------------------------------------------------------------
.ti -4
2 SOURCE
.ti +4
LAS_\SET SOURCE Name

FIND will select all scans according to the specified source name.
Default is *. Wildcards are accepted at any position in the source
name (e.g. NAM*, N*ME or N*M*): they match 0 or more characters.
.\"--------------------------------------------------------------------
.ti -4
2 SYSTEM
.ti +4
LAS_\SET SYSTEM Type [Equinox]

Specify the coordinate system to be used by the current R observation
and next ones loaded in memory. Type may be E[quatorial] followed by
an equinox, G[alactic], or A[utomatic]. Default is Auto, i.e. uses the
type found in the data file. If the equinox of Equatorial coordinates
is not specified, the previous value is used. The initial default is
2000.00. Coordinates and offsets are automatically converted to the
specified coordinate system and precessed to the specified equinox if
needed.
.\"--------------------------------------------------------------------
.ti -4
2 TELESCOPE
.ti +4
LAS_\SET TELESCOPE Name

FIND will select all scans according to the specified telescope name.
Default is *. Wildcards are accepted at any position in the telescope
name (e.g. NAM*, N*ME or N*M*): they match 0 or more characters.
.\"--------------------------------------------------------------------
.ti -4
2 TYPE
.ti +4
LAS_\SET TYPE CONTINUUM or LINE or SKYDIP

Defines on which type of data the program is working.
.in +4
.ti -2
- LINE (or SPECTROSCOPY)
(the default when entering LAS) selects Spectral Line data only, and
the program prompt is LAS_> (Line Analysis System).
.ti -2
- CONTINUUM selects
continuum drifts results only, and the program prompt changes to
CAS_> (Continuum Analysis System).
.ti -2
- SKYDIP selects only skydips, and the prompt changes to SAS_>
.in -4
In CONTINUUM mode, a continuum drift is treated as a spectrum would be
in LINE mode. You can add drifts, subtract baseline, make gauss fits,
change plotting scales etc... The current angular units is used in
plots. SKYDIP mode has very limited capabiblities: only command REDUCE
may be used to analyse the SKYDIP results.
.\"--------------------------------------------------------------------
.ti -4
2 UNIT
.ti +4
LAS_\SET UNIT Lower [Upper]

Specify the unit to be used for the lower and upper X axis. Allowed
units are C[hannel], F[requency], [Image] and V[elocity]. Default is
Velocity. For Continuum drifts, this unit is ignored, but the angular
unit specified by SET ANGLE is used.
.\"--------------------------------------------------------------------
.ti -4
2 VARIABLE
.ti +4
LAS_\SET VARIABLE Section__Name [READ|WRITE|OFF]

Change the read-write status of the SIC variables corresponding to the
section of the header of the R observation. The section names are:
.ti +2
SECTIONS (to enable edition of the R%HEAD%PRESEC array)
.ti +2
GENERAL
.ti +2
POSITION
.ti +2
SPECTRO
.ti +2
RESOLUTION
.ti +2
BASE
.ti +2
HISTORY
.ti +2
PLOT
.ti +2
SWITCH
.ti +2
CALIBRATION
.ti +2
SKYDIP
.ti +2
GAUSS
.ti +2
SHELL
.ti +2
NH3 (or HFS)
.ti +2
ABSORPTION
.ti +2
DRIFT
.ti +2
BEAM
.ti +2
CONTINUUM
.ti +2
ASSOCIATED
.ti +2
HERSCHEL
.ti +2
COMMENT
.ti +2
USER

The corresponding variables are read-only by default, but can be
changed to read-write with the keyword WRITE. They can always be found
under the R% structure.

Some stand-alone aliases are defined by default (e.g. LINE is an alias
of R%HEAD%SPE%LINE). These aliases can be deleted with the keyword
OFF.

The SIC variables have the name of the corresponding FORTRAN
variables. They are defined below:

.ce
SECTIONS_ Information about present sections
.nf
LOGICAL       R%HEAD%PRESEC[:]  [   ] List of present sections
.fi
Section codes can be found in CLASSCODES%SEC%.

.ce
GENERAL_ General parameters, always present:
.nf
INTEGER*8     R%HEAD%GEN%NUM    [     ] Observation number
INTEGER*4     R%HEAD%GEN%VER    [     ] Version number
CHARACTER*12  R%HEAD%GEN%TELES  [     ] Telescope name
CHARACTER*12  R%HEAD%GEN%CDOBS  [  day] Date of observation
CHARACTER*12  R%HEAD%GEN%CDRED  [  day] Date of reduction
INTEGER*4     R%HEAD%GEN%KIND   [ code] Type of data
INTEGER*4     R%HEAD%GEN%QUAL   [ code] Quality of data
INTEGER*8     R%HEAD%GEN%SCAN   [     ] Scan number
REAL*8        R%HEAD%GEN%UT     [  rad] UT of observation
REAL*8        R%HEAD%GEN%ST     [  rad] LST of observation
REAL*4        R%HEAD%GEN%AZ     [  rad] Azimuth
REAL*4        R%HEAD%GEN%EL     [  rad] Elevation
REAL*4        R%HEAD%GEN%TAU    [neper] Opacity
REAL*4        R%HEAD%GEN%TSYS   [    K] System temperature
REAL*4        R%HEAD%GEN%TIME   [    s] Integration time
REAL*8        R%HEAD%GEN%PARANG [  rad] Parallactic angle
INTEGER*4     R%HEAD%GEN%XUNIT  [ code] X unit, if X coordinate section is present
.fi
Codes for KIND, QUAL and XUNIT can be found in SIC%CODE%KIND%,
CLASSCODES%QUAL% and SIC%CODE%XUNIT% respectively.

.ce
POSITION_ Position information:
.nf
CHARACTER*12  R%HEAD%POS%SOURC    [    ] Source name
INTEGER*4     R%HEAD%POS%SYSTEM   [code] Coordinate system
REAL*4        R%HEAD%POS%EQUINOX  [year] Equinox of coordinates
INTEGER*4     R%HEAD%POS%PROJ     [code] Projection system
REAL*8        R%HEAD%POS%LAM      [ rad] Lambda of projection center
REAL*8        R%HEAD%POS%BET      [ rad] Beta of projection center
REAL*8        R%HEAD%POS%PROJANG  [ rad] Projection angle
REAL*4        R%HEAD%POS%LAMOF    [ rad] Offset in Lambda
REAL*4        R%HEAD%POS%BETOF    [ rad] Offset in Beta
.fi
Codes for SYSTEM and PROJ can be found in SIC%CODE%COORD% and SIC%CODE%PROJ%
respectively.

.ce
SPECTRO_ Spectroscopic information (for spectra)
.nf
CHARACTER*12  R%HEAD%SPE%LINE     [    ] Line name
INTEGER*4     R%HEAD%SPE%NCHAN    [    ] Number of channels
REAL*8        R%HEAD%SPE%RESTF    [ MHz] Rest frequency
REAL*8        R%HEAD%SPE%IMAGE    [ MHz] Image frequency
REAL*8        R%HEAD%SPE%DOPPLER  [    ] Doppler correction -V/c (CLASS convention)
REAL*8        R%HEAD%SPE%RCHAN    [    ] Reference channel
REAL*8        R%HEAD%SPE%FRES     [ MHz] Frequency resolution
REAL*8        R%HEAD%SPE%VRES     [km/s] Velocity resolution
REAL*8        R%HEAD%SPE%VOFF     [km/s] Velocity at reference channel
REAL*4        R%HEAD%SPE%BAD      [    ] Blanking value
INTEGER*4     R%HEAD%SPE%VTYPE    [code] Type of velocity
INTEGER*4     R%HEAD%SPE%VCONV    [code] Velocity convention
.fi
Codes for VTYPE and VCONV can be found in SIC%CODE%VELO% and
SIC%CODE%CONV% respectively.

.ce
RESOLUTION_ Resolution information
.nf
REAL*4        R%HEAD%RES%MAJOR    [ rad] Major axis
REAL*4        R%HEAD%RES%MINOR    [ rad] Minor axis
REAL*4        R%HEAD%RES%POSANG   [ rad] Position angle
.fi

.ce
BASE_ Baseline information (for spectra of drifts)
.nf
PARAMETER     MWIND=100
INTEGER*4     R%HEAD%BAS%DEG            [      ] Degree of last baseline
REAL*4        R%HEAD%BAS%SIGFI          [     K] Sigma
REAL*4        R%HEAD%BAS%AIRE           [K.km/s] Area under windows
INTEGER*4     R%HEAD%BAS%NWIND          [      ] Number of line windows
REAL*4        R%HEAD%BAS%W1(MWIND)      [  km/s] Lower limits of windows
REAL*4        R%HEAD%BAS%W2(MWIND)      [  km/s] Upper limits of windows
REAL*4        R%HEAD%BAS%SINUS(3)       [      ] Sinus baseline result
REAL*4        WINDOW(FOUND,1+2*RNWIND)  [  km/s] 2D plots: window for each record
.fi

.ce
HISTORY_ Scan numbers of initial observations
.nf
PARAMETER     MSEQ=100
INTEGER*4     R%HEAD%HIS%NSEQ         [   ] Number of sequences
INTEGER*4     R%HEAD%HIS%START(MSEQ)  [   ] Start scan number of seq.
INTEGER*4     R%HEAD%HIS%END(MSEQ)    [   ] End   scan number of seq.
.fi

.ce
PLOT_ Default plotting limits.
.nf
REAL*4        R%HEAD%PLO%AMIN   [   ] Min Y value plotted
REAL*4        R%HEAD%PLO%AMAX   [   ] Max Y value plotted
REAL*4        R%HEAD%PLO%VMIN   [   ] Min X value plotted
REAL*4        R%HEAD%PLO%VMAX   [   ] Max X value plotted
.fi

.ce
FSWITCH_ Frequency switching information (for spectra)
.nf
PARAMETER     MXPHAS=8
INTEGER*4     R%HEAD%FSW%NPHAS           [    ] Number of phases
INTEGER*4     R%HEAD%FSW%SWMOD           [code] Switching mode (frequency, position...)
REAL*8        R%HEAD%FSW%DECAL(MXPHAS)   [ MHz] Frequency offsets
REAL*4        R%HEAD%FSW%DUREE(MXPHAS)   [   s] Time per phase
REAL*4        R%HEAD%FSW%POIDS(MXPHAS)   [    ] Weight of each phase
REAL*4        R%HEAD%FSW%LDECAL(MXPHAS)  [ rad] Lambda offsets
REAL*4        R%HEAD%FSW%BDECAL(MXPHAS)  [ rad] Beta offsets of each phase
.fi
Codes for SWMOD can be found in SIC%CODE%SWITCH%.

.ce
CALIBRATION_ Calibration parameters
.nf
REAL*4        R%HEAD%CAL%BEEFF     [     ] Beam efficiency
REAL*4        R%HEAD%CAL%FOEFF     [     ] Forward efficiency
REAL*4        R%HEAD%CAL%GAINI     [     ] Image/Signal gain ratio
REAL*4        R%HEAD%CAL%H2OMM     [   mm] water vapor
REAL*4        R%HEAD%CAL%PAMB      [  hPa] Ambient pressure
REAL*4        R%HEAD%CAL%TAMB      [    K] Ambient temperature
REAL*4        R%HEAD%CAL%TATMS     [    K] Atmosphere temp. signal band
REAL*4        R%HEAD%CAL%TCHOP     [    K] Chopper temperature
REAL*4        R%HEAD%CAL%TCOLD     [    K] Cold load temperature
REAL*4        R%HEAD%CAL%TAUS      [neper] Opacity signal band
REAL*4        R%HEAD%CAL%TAUI      [neper] Opacity image band
REAL*4        R%HEAD%CAL%TATMI     [    K] Atmosphere temp. image band
REAL*4        R%HEAD%CAL%TREC      [    K] Receiver temperature
INTEGER*4     R%HEAD%CAL%CMODE     [ code] Calibration mode
REAL*4        R%HEAD%CAL%ATFAC     [    K] Applied calibration factor (Tcal)
REAL*4        R%HEAD%CAL%ALTI      [    m] Site elevation
REAL*4        R%HEAD%CAL%COUNT(3)  [count] Power of Atm., Chopp., Cold
REAL*4        R%HEAD%CAL%LCALOF    [  rad] Longitude offset for sky measurement
REAL*4        R%HEAD%CAL%BCALOF    [  rad] Latitude offset for sky measurement
REAL*8        R%HEAD%CAL%GEOLONG   [  rad] Geographic longitude of observatory
REAL*8        R%HEAD%CAL%GEOLAT    [  rad] Geographic latitude of observatory
.fi
Codes for CMODE can be found in CLASSCODES%CALIB%.

.ce
SKYDIP_ For Skydips observations. No associated data.
.nf
PARAMETER     MSKY=10
REAL*8        R%HEAD%SKY%SREST        [MHz] Rest frequency
REAL*8        R%HEAD%SKY%SIMAG        [MHz] Image frequency
INTEGER*4     R%HEAD%SKY%NSKY         [   ] Number of points on sky
INTEGER*4     R%HEAD%SKY%NCHOP        [   ]    -   -    -    -  chopper
INTEGER*4     R%HEAD%SKY%NCOLD        [   ]    -   -    -    -  cold load
REAL*4        R%HEAD%SKY%ELEV(MSKY)   [rad] Elevations
REAL*4        R%HEAD%SKY%EMISS(MSKY)  [  ?] Power on sky
REAL*4        R%HEAD%SKY%CHOPP(MSKY)  [  ?] Power on chopper
REAL*4        R%HEAD%SKY%COLD(MSKY)   [  ?] Power on cold load
.fi

.ce
GAUSS_ Gauss fit results (for spectra or drifts)
.nf
PARAMETER     MXGAUS=10                                   Maximum number of fitted components
INTEGER*4     R%HEAD%GAU%NLINE             [            ] Number of components
REAL*4        R%HEAD%GAU%RMS__BASE          [   Int. unit] Sigma on base
REAL*4        R%HEAD%GAU%RMS__LINE          [   Int. unit] Sigma on line
REAL*4        R%HEAD%GAU%RESULT(3*MXGAUS)  [area,v0,fwhm] Fit results
REAL*4        R%HEAD%GAU%ERROR(3*MXGAUS)   [area,v0,fwhm] Errors
.fi

.ce
SHELL_ "Stellar shell" profile fit results (for spectra)
.nf
PARAMETER     MXSHELL=10                          Maximum number of fitted components
INTEGER*4     R%HEAD%SHE%NLINE              [   ] Number of components
REAL*4        R%HEAD%SHE%RMS__BASE           [   ] Sigma on base
REAL*4        R%HEAD%SHE%RMS__LINE           [   ] Sigma on line
REAL*4        R%HEAD%SHE%RESULT(4*MXSHELL)  [   ] Fit results
REAL*4        R%HEAD%SHE%ERROR(4*MXSHELL)   [   ] Errors
.fi

.ce 2
HFS_ "Ammoniac and Hyperfine Structure" profile fit results
     (for spectra, ex: NH3, HCN)
.nf
PARAMETER     MXHFS=10                          Maximum number of fitted components
INTEGER*4     R%HEAD%HFS%NLINE            [   ] Number of components
REAL*4        R%HEAD%HFS%RMS__BASE         [   ] Sigma on base
REAL*4        R%HEAD%HFS%RMS__LINE         [   ] Sigma on line
REAL*4        R%HEAD%HFS%RESULT(4*MXHFS)  [   ] Fit results
REAL*4        R%HEAD%HFS%ERROR(4*MXHFS)   [   ] Errors
.fi

.ce 2
ABS_ "Hyperfine Structure" ABSORPTION profile fit results
      (for spectra, ex: NH3, HCN)
.nf
PARAMETER     MXABS=10                           Maximum number of fitted components
INTEGER*4     R%HEAD%ABS%NLINE              [   ] Number of components
REAL*4        R%HEAD%ABS%RMS__BASE           [   ] Sigma on base
REAL*4        R%HEAD%ABS%RMS__LINE           [   ] Sigma on line
REAL*4        R%HEAD%ABS%RESULT(1+3*MXABS)  [   ] Fit results
REAL*4        R%HEAD%ABS%ERROR(1+3*MXABS)   [   ] Errors
.fi

.ce
DRIFT_ Continuum drift description (for drifts)
.nf
REAL*8        R%HEAD%DRI%FREQ   [ MHz] Rest frequency
REAL*4        R%HEAD%DRI%WIDTH  [ MHz] Bandwidth
INTEGER*4     R%HEAD%DRI%NPOIN  [    ] Number of data points
REAL*4        R%HEAD%DRI%RPOIN  [    ] Reference point
REAL*4        R%HEAD%DRI%TREF   [   ?] Time at reference
REAL*4        R%HEAD%DRI%AREF   [rad?] Angular offset at ref.
REAL*4        R%HEAD%DRI%APOS   [rad?] Position angle of drift
REAL*4        R%HEAD%DRI%TRES   [   ?] Time resolution
REAL*4        R%HEAD%DRI%ARES   [rad?] Angular resolution
REAL*4        R%HEAD%DRI%CBAD   [    ] Blanking value
INTEGER*4     R%HEAD%DRI%CTYPE  [code] Type of offsets
REAL*8        R%HEAD%DRI%CIMAG  [ MHz] Image frequency
REAL*4        R%HEAD%DRI%COLLA  [    ] Collimation error Az
REAL*4        R%HEAD%DRI%COLLE  [    ] Collimation error El
.fi
Codes for CTYPE can be found in SIC%CODE%COORD%.

.ce
BEAM_ Beam-switching parameters (for spectra or drifts)
.nf
REAL*4        R%HEAD%BEA%CAZIM  [ rad] Azimuth of observation
REAL*4        R%HEAD%BEA%CELEV  [ rad] Elevation of observation
REAL*4        R%HEAD%BEA%SPACE  [ rad] Beam spacing
REAL*4        R%HEAD%BEA%BPOS   [ rad] Position angle of beams
INTEGER*4     R%HEAD%BEA%BTYPE  [code] System for angle
.fi
Codes for BTYPE can be found in SIC%CODE%COORD%.

.ce
CONTINUUM_ Double gaussian and baseline fit results (for drifts)
.nf
PARAMETER     MPOIFIT=8
INTEGER*4     R%HEAD%POI%LCONT           [   ] Number of components
REAL*4        R%HEAD%POI%BCONT           [   ] Sigma on base
REAL*4        R%HEAD%POI%RCONT           [   ] Sigma on line
REAL*4        R%HEAD%POI%NCONT(MPOIFIT)  [   ] Results
REAL*4        R%HEAD%POI%ECONT(MPOIFIT)  [   ] Errors
.fi

.ce
HERSCHEL_ Herschel-HIFI section
.nf
INTEGER*8     R%HEAD%HER%OBSID        [    ] Observation id
CHARACTER*8   R%HEAD%HER%INSTRUMENT   [str ] Instrument name
CHARACTER*24  R%HEAD%HER%PROPOSAL     [str ] Proposal name
CHARACTER*68  R%HEAD%HER%AOR          [str ] Astronomical Observation Request
INTEGER*4     R%HEAD%HER%OPERDAY      [day ] Operational day number
CHARACTER*28  R%HEAD%HER%DATEOBS      [str ] Start date (ISO date)
CHARACTER*28  R%HEAD%HER%DATEEND      [str ] End date (ISO date)
CHARACTER*40  R%HEAD%HER%OBSMODE      [str ] Observing mode
REAL*4        R%HEAD%HER%VINFO        [km/s] Informative source velocity in LSR frame
REAL*4        R%HEAD%HER%ZINFO        [    ] Informative target redshift
REAL*8        R%HEAD%HER%POSANGLE     [rad ] Spacecraft pointing position angle
REAL*8        R%HEAD%HER%REFLAM       [rad ] Sky reference (a.k.a. OFF), lambda coordinate
REAL*8        R%HEAD%HER%REFBET       [rad ] Sky reference (a.k.a. OFF), beta coordinate
REAL*8        R%HEAD%HER%HIFAVELAM    [rad ] ON average H and V coordinate (HIFI), lambda coordinate
REAL*8        R%HEAD%HER%HIFAVEBET    [rad ] ON average H and V coordinate (HIFI), beta coordinate
REAL*4        R%HEAD%HER%ETAMB        [    ] Main beam efficiency used when applying doAntennaTemp
REAL*4        R%HEAD%HER%ETAL         [    ] Forward efficiency used when applying doAntennaTemp
REAL*4        R%HEAD%HER%ETAA         [    ] Telescope aperture efficiency
REAL*4        R%HEAD%HER%HPBW         [rad ] Azimuthally-averaged half-power beam width
CHARACTER*8   R%HEAD%HER%TEMPSCAL     [str ] Temperature scale in use
REAL*8        R%HEAD%HER%LODOPAVE     [MHz ] Average LO frequency Doppler corrected to freqFrame (SPECSYS)
REAL*4        R%HEAD%HER%GIM0         [    ] Sideband gain polynomial coeff 0 applied
REAL*4        R%HEAD%HER%GIM1         [    ] Sideband gain polynomial coeff 1 applied
REAL*4        R%HEAD%HER%GIM2         [    ] Sideband gain polynomial coeff 2 applied
REAL*4        R%HEAD%HER%GIM3         [    ] Sideband gain polynomial coeff 3 applied
REAL*4        R%HEAD%HER%MIXERCURH    [mA  ] Calibrated mixer junction current, horizontal
REAL*4        R%HEAD%HER%MIXERCURV    [mA  ] Calibrated mixer junction current, vertical
CHARACTER*28  R%HEAD%HER%DATEHCSS     [str ] Processing date (ISO date)
CHARACTER*24  R%HEAD%HER%HCSSVER      [str ] HCSS version
CHARACTER*16  R%HEAD%HER%CALVER       [str ] Calibration version
REAL*4        R%HEAD%HER%LEVEL        [    ] Pipeline level
.fi
.\"--------------------------------------------------------------------
.ti -4
2 VELOCITY
.ti +4
LAS_\SET VELOCITY Mode

Specify the velocity kind to be used by the current R observation and
next ones loaded in memory. Mode can be
.in +2
-_ L[sr]   Forces the velocity axis values to Lsr values
.br
-_ H[elio] Forces the velocity axis values to Heliocentric values
.br
-_ A[uto]  The velocity type is taken from the header of the
spectrum
.in -2
Default mode is Auto.
.\"--------------------------------------------------------------------
.ti -4
2 WEIGHT
.ti +4
LAS_\SET WEIGHT Type

Define the weighting to be used in the averaging engine (AVERAGE,
ACCUMULATE, STITCH), in the command TABLE, and in the command
UV__TABLE. Choices are:
.nf
  T[ime],       for Time*abs(Fres)/(Tsys**2) (spectrum) or
                    Time*abs(Width)/(Tsys**2) (continuum),
  S[igma],      for 1/Sigma**2,
  E[qual],      for equal weights,
  A[ssociated], to use the Associated Array named "W" from each input
                spectrum. "W" provides one weight value per channel.
.fi

In case of a folded frequency switch spectrum, the spectrum is given
twice more weight (as if the integration time was twice longer).

The default is TIME. Sigma is not recommended unless you just made a
baseline fit before. Equal weight behaves differently in
AVERAGE/STITCH and ACCUMULATE (which produces the sum).
.\"--------------------------------------------------------------------
.ti -4
2 WINDOW
.ti +4
LAS_\SET WINDOW /DEFAULT
.ti +4
LAS_\SET WINDOW [/NOCURSOR]
.ti +4
LAS_\SET WINDOW NONE
.ti +4
LAS_\SET WINDOW wl1 wu1 ... wlN wuN
.ti +4
LAS_\SET WINDOW /VAR Array
.ti +4
LAS_\SET WINDOW /POLYGON [N Filename1 ... FilenameN]
.ti +4
LAS_\SET WINDOW /ASSOCIATED
.ti +4
LAS_\SET WINDOW AUTO

Defines one or several line windows to be avoided by BASE when fitting
a baseline. Window boundaries are expressed in current X unit (SET
UNIT). If current X unit is F (resp. I), the values are offset
frequencies from the rest frequency (resp. image frequency). There are
several ways to use this command:

.br
SET WINDOW /DEFAULT
.in +2
Undefine the current SET WINDOW method. Next calls to the command BASE
will raise an error. This is the default at startup.
.in -2

.br
SET WINDOW [/NOCURSOR]
.in +2
With this form without argument, the cursor is invoked to specify
missing arguments, unless option /NOCURSOR is present. When using the
cursor, enter: N (or Left mouse button) to enter a value, C (or Middle
button) to cancel the last entry, H for help, E (or Right button) for
exit. The boundaries are in current unit.
.in -2

.br
SET WINDOW NONE
.in +2
Set the number of windows to 0. This is valid e.g. if there is no
signal in the spectrum. BASE will exclude no channel during the
baselining.
.in -2

.br
SET WINDOW wl1 wu1 ... wlN wuN
.in +2
Define N windows with their lower-upper boundaries, expressed in the
current X unit.
.in -2

.br
SET WINDOW /VAR Array
.in +2
Define the window from rank 1 array win__array[1+2*NWIND]. The array
must be of the following form:
.in +2
.nf
win__array[1]=NWIND      number of windows
win__array[2*i:2*i+1]    boundaries of window number 'i'
.fi
.in -2
.in -2

.br
SET WINDOW /POLYGON [N [Filename1 ... FilenameN]]
.in +2
Define the spectral window(s) through polygon(s). N is the number of
polygons (default 1). If filenames are present, polygons are read from
these files. If not, they are defined interactively with the cursor,
and saved in files "window-"'i'".pol", where 'i' is the polygon
number. This option makes sense only if an index is loaded and plotted
(PLOT /INDEX).
.br
The resulting windows are visible in the array SET%WINDOW of size
[Nspec,1+2*Mwind], where:
.ti +2
-_ Mwind is the largest number of windows per spectrum over all the
index,
.ti +2
-_ SET%WINDOW[ispec,1] is the number of windows for i-th spectrum in
the index,
.ti +2
-_ SET%WINDOW[ispec,2*jwind] and SET%WINDOW[ispec,2*jwind+1] are the
min-max range of the j-th window.
.in -2

.br
SET WINDOW /ASSOCIATED
.in +2
Find the spectral windows in the Associated Array named LINE (must be
present in the R buffer). LINE is a flag array of 0 (channel out of a
line) and 1 (channel in a line).
.in -2

.br
SET WINDOW AUTO
.in +2
Reuse the spectral window(s) as found in the observation header
(Baseline section must be present). There are two possibilities:
.in +2
-_ if the Associated Array LINE was used, R%HEAD%BAS%NWIND is -1 and
BASE will rely again on this array, or
.br
-_ the spectral windows were saved in R%HEAD%BAS%NWIND, R%HEAD%BAS%W1,
and R%HEAD%BAS%W2 from a previous call to BASE, these windows will be
used again.
.in -2
.in -2
.\"====================================================================
.ti -4
1 SHOW
.ti +4
LAS_\SHOW Arg1 ... ArgN | ALL

Display some tuning(s) defined by SET. Arg can be "ALL" to display all
parameters specified by SET. See SET command for details.
.\"====================================================================
.ti -4
1 SPECTRUM
.ti +4
LAS_\SPECTRUM [ArrayName] [Yoff] [/INDEX] [/OBS] [/PEN Ipen]

/OBS
.in +4
Plot the spectrum in the R buffer in the units and scales defined by
SET UNIT and SET MODE. No argument or argument "Y" will plot the
spectrum Y intensities of the R buffer (RY), but an associated array
can be plotted instead given its name.

Yoff (default 0) is a constant Y-offset added to the plotted values
(useful to compare two spectra).

The option /PEN allows to use a i-th pen instead of the current one,
without modifying it in return.
.in -4

/INDEX
.in +4
Plots the 2D array from the last LOAD command.
.in -4

Without option, the behavior depends on SET ACTION (see PLOT). Default
is OBS.
.\"====================================================================
.ti -4
1 STITCH
.ti +4
LAS_\STITCH [/RESAMPLE NX Xref Xval Xinc Unit] [/NOCHECK
[Arg1 ... ArgN]] [/IMAGE] [/WEIGHT TIME|SIGMA|EQUAL|ASSOCIATED]

Stitch (i.e. make the union of) all the spectra of the current index
using the specified (/WEIGHT) or current (SET WEIGHT) weighting
function (see HELP SET WEIGHT for details). The command behaves like
AVERAGE /RESAMPLE except it ignores the SET ALIGN status and composes
the spectra on the signal frequency axis. Use the option /IMAGE to
compose them on the image frequency axis.

On return the R spectrum contains the average spectrum. If /WEIGHT or
SET WEIGHT is ASSOCIATED (see HELP SET WEIGHT for details), the weight
array of the average spectrum is saved in the associated array named
W.

Bad channels are handled according to SET BAD. A sum may be
interrupted by <^C_>, but the result is then undefined.
.\"--------------------------------------------------------------------
.ti -4
2 /NOCHECK
.ti +4
LAS_\STITCH /NOCHECK [SOURCE|POSITION|LINE|SPECTROSCOPY|CALIBRATION|SWITCHING]

By default, STITCH checks the consistency between all the input
spectra. This is a security to avoid mixing inconsistent data
(e.g. spectra from different sources). These checks can be
individually (with one or more names) or all (no name) disabled using
the option /NOCHECK. See HELP SET NOCHECK for details.

Note the key status of the SPECTROSCOPY check! STITCH uses this check
to detect if the spectra frequency axes are aligned or not, to help
its decision to enable resampling or not (see /RESAMPLE
subtopic). Using /NOCHECK SPECTROSCOPY enforces the spectra alignment
status:

.in +4
.ti -4
STITCH /NOCHECK SPECTROSCOPY
.br
will assume the spectra are aligned and will stack them channel by
channel (no resampling), while they are possibly not aligned.

.ti -4
STITCH /RESAMPLE /NOCHECK SPECTROSCOPY
.br
will assume the spectra are not aligned and will always resample them
before stacking, even if not necessary (adds computation cost and
possible round off errors).
.in -4
.\"--------------------------------------------------------------------
.ti -4
2 /RESAMPLE
.ti +4
LAS_\STITCH [/RESAMPLE NX Xref Xval Xinc Unit]

.in +4
.ti -2
No /RESAMPLE
.br
Without this option, STITCH behaves as AVERAGE /RESAMPLE, stitching
all the input frequency axes. The resampling is possible but not
enforced. A consistency test first checks if the spectra frequency
axes are identical or not. If yes, the spectra are stacked channel by
channel (no resampling). If not, the frequency axes are resampled. The
frequency axis of the output sum is automatically computed. In
particular, the output spectrum has the coarsest resolution of the
input spectra. Those are then internally resampled and stacked on the
output axis.

.ti -2
/RESAMPLE NX Xref Xval Xinc Unit
.br
A custom output X axis can be given with the syntax /RESAMPLE NX Xref
Xval Xinc Unit. In this case, the resampling is always performed. The
input spectra are internally resampled and stacked on this axis. See
HELP RESAMPLE for possible uses and caveats.
.in -4
.\"====================================================================
.ti -4
1 SWAP
.ti +4
LAS_\SWAP

Exchange the contents of the R and T buffers.
.\"====================================================================
.ti -4
1 TAG
.ti +4
LAS_\TAG Quality__Code List__of__Observations

Attributes a quality to a given list of Observations. Quality__Code is
an integer in the range 0-9, and the recommended quality scale is
.nf
      0 Unknown
      1	Excellent
      2	Good
      3 Fair
      4 Average
      5 Poor
      6 Bad
      7 Awful
      8 Should never exist
      9 Reserved for deleted Observations
.fi
The operation is immediate and occurs in the OUTPUT file for all
versions of all Observations specified in the list. If no list is
given, the R memory is attributed the specified quality. A FIND
operation will only select Observations of quality better than
(i.e. less or equal to) the quality specified by the SET QUALITY
command, or in the /QUALITY option.
.\"====================================================================
.ti -4
1 TITLE
.ti +4
LAS_\TITLE [/BRIEF] [/LONG] [/FULL] [/INDEX] [/OBS]

/OBS
.in +4
Writes the header of the Observation currently in R above the plotted
data.  The format used is the one selected by SET FORMAT, which may be
temporarily overridden by the options.
.in -4

/INDEX
.in +4
Writes the content of the loaded index in a compact form: Range of
scan numbers, of spectrum, of observing dates and of offsets. It may
be combined the other options (/LONG and /FULL give the same result).
.in -4

Without option, the behaviour is fixed by SET ACTION level. Default is
OBS.
.\"====================================================================
.ti -4
1 UPDATE
.ti +4
LAS_\UPDATE

Update the LAST version of the observation in the R buffer in the
output file. You can update only the last version. The update
OVERWRITES the observation. This command MUST BE USED WITH CAUTION; in
case of complex manipulations of observations, you may get confused
and erase precious data.

If more space is needed (e.g., the new version has more header
information), an error is returned. You MUST then WRITE the
observation to avoid loss of information.

The only typical case where it may be used is in the following
sequence:
.nf
    GET Number
    MINIMIZE or MODIFY
    UPDATE
.fi
.\"====================================================================
.ti -4
1 WRITE
.ti +4
LAS_\WRITE [ObsNum]

Writes the observation in the R buffer onto the output file. If a
version of this observation is already in the file, a new version of
the observation is created. A new observation number can be specified
as argument. If the implicit (R%HEAD%GEN%NUM) or explicit (argument
ObsNum) value is 0, automatic numbering is used i.e. a new (unused
yet) number is chosen (in pratice highest number in use plus one).

The behaviour depends on the "File Type" (see FILE command):
.in +2
.ti -2
-_ for files of type MULTIPLE, a new version of the spectrum is
written if the ObsNum already exists in the file.
.ti -2
-_ for files of type SINGLE, the ObservationNumber is automatically
set to the next one available in the file. If an ObsNum is specified
in the command, WRITE checks if it already exists. If so, it returns
an error; if not, it sets the specified ObsNum to the written
spectrum.
.ti -2
-_ for both, the version value (R%HEAD%GEN%VER) is always incremented,
assuming something has changed in R between the time it has been
loaded in memory (or last written) and the current write.
.in -2
On return of the command, R%HEAD%GEN%NUM and R%HEAD%GEN%VER are set to
the values which have been used.

The information written depends on the operations done on the
observation. Existing fit results are written. The calibration
information is written only if the calibration is checked (see SET
CALIBRATION command).

In the case of (old) on-the-fly data, WRITE automatically splits the
data into records with entry numbers starting at 1 unless the
observation number of the first record is given explicitly.
.\"====================================================================
.ti -4
1 ENDOFHELP
