.ec _
.ll 76
.ad b
.in 4
.\"====================================================================
.ti -4
1 Language WEEDS\ Package to analyze spectral surveys

Weeds is a CLASS extension to analyze spectral surveys or spectral lines
observations with large bandwidths. It provides several commands to
identify lines on a spectrum and to model it.

Available commands:
.in +4
.nf
LID       Identify lines on the current spectra
LFIND     Find lines from a species within a frequency range
LLIST     List lines from the line index
LGET      Get a line from the line index
LPLOT     Plot a line from the current line index
MODSOURCE Model the emission of a source assuming LTE
MODSHOW   Show the results of MODSOURCE
.fi
.in -4

For more information of each command, type 'help <command>'
.\"====================================================================  
.ti -4
1 LFIND
.ti +4
[WEEDS_\]LFIND [SPECIES [FMIN FMAX]] [/SORTBY ORDER] [/ENERGY ENERGY]
[/AIJ AMIN] [/ORIGIN OriginName]
  
Find the lines within a frequency range and create a line index. The
command looks for the lines between FMIN and FMAX (default is the
frequency range covered by the current R spectrum) in the database
selected with the USE IN command.

Arguments:
.in +13
.ti -9
SPECIES_ _ the name of the species. Default is "All".
.ti -9
FMIN_ _ _ _ _ the minimum frequency in MHz. Default is the current R
spectrum minimum limit.
.ti -9
FMAX_ _ _ _ _ the maximum frequency in MHz. Default is the current R
spectrum maximum limit.
.in -13

Options:
.in +14
.ti -10
/SORTBY_ _ _ sort the lines according to ORDER, which can be any
combination of "frequency", "energy" and "aeinstein", and all the
subsequent permutations.

.ti -10
/ENERGY_ _ _ refine the search to lines with upper level energy lower
than ENERGY, expressed in Kelvins.

.ti -10
/AIJ_ _ _ _ _ _ refine the search to lines with einstein A coefficient
greater than AMIN, expressed s-1.

.ti -10
/ORIGIN_ _ _ refine the search to lines originally from the named
database only.
.in -14

As an output, the structure LINES% will contain the content of the
current index. See HELP SELECT for details.
.\"====================================================================
.ti -4
1 LGET
.ti +4
[WEEDS_\]LGET [Key|Num] [/INDEX]
  
Get a line from the line index. The commands checks if the line
frequency is covered by the current observation. If yes, the
observation is modified so that its rest frequency corresponds to the
line frequency. The command works in a similar fashion than GET: for
example LGET F will get the first line in the line list, LGET N will
get the next one, etc. It is especially useful when one want to search
for lines of a given species. For example, one can list all methanol
lines in the 3 mm band, ordered by increasing upper level energy,
with:

.nf
  LAS> LLIST "CH3OH, vt=0,1" 80000 110000 /SORTBY e
.fi

and then examine each of the line candidates with:

.nf
  LAS> LGET F
  LAS> LPLOT
  LAS> LGET N
  LAS> LPLOT
  LAS> ...
.fi

Options:
.in +10
.ti -8
/INDEX_ _ search for the line in all the observations of the current
observation index. If this option is set, LGET begins by searching for
the first observation (from the last FIND command) that covers the
line frequency. It is useful when working with line surveys that
consists in several observations, each covering a different frequency
band.
.in -10

Argument: it can be either
.in +7
1) One of the following key letters:
.in +3
"f"_ _ _ get the first line of the index
.br
"l"_ _ _ get the last line of the index
.br
"p"_ _ _ get the previous line in the index
.br
"n"_ _ _ get the next line of the index
.in -3
2) An integer
.in -7
.\"====================================================================
.ti -4
1 LID
.ti +4
[WEEDS_\]LID [/SPECIES Name1 Name2 ...] [/ENERGY Value] [/AIJ Amin]
[[/DELTA Df] | [/FULL]] [/IMAGE] [/LOOP] [/COLOR Name] [/ANGLE Value]

Search for lines in the database around a central frequency and mark
them on the current spectra. By default, the central frequency is
selected with the mouse left button. The search is done in an interval
of width DFREQ around the selected frequency; alternatively, the /FULL
option may be used to search for lines over the entire frequency range
covered by the current spectra. The line database in which the search
is performed may be selected with the USE IN command.

Search options:
.in +14
.ti -10
/SPECIES_ _ refine the search to lines of one or more species. The
species name should match exactly that in the database. Wildcards '*'
are accepted. Default is "All".

.ti -10
/ENERGY_ _ _ refine the search to lines with upper level energy lower
than ENERGY, expressed in Kelvins.

.ti -10
/AIJ_ _ _ _ _ _ refine the search to lines with Einstein A coefficient greater
than AMIN, expressed in s-1.

.ti -10
/DELTA_ _ _ _ search for lines within DFREQ, expressed in MHz, from
the cursor position. Default is 10 times the channel width.

.ti -10
/FULL_ _ _ _ _ search for lines in the full frequency range covered by
the current spectra.

.ti -10
/IMAGE_ _ _ _ search for lines in the image sideband. Note that this 
is the default if the spectra lower axis unit is I (image). 

.ti -10
/LOOP _ _ _ _ by default, the cursor is invoked only once, but
you can iterate indefinitely with the option /LOOP. Type 'E' to exit
the loop.
.in -14

Plot options:
.in +14
.ti -10
/COLOR_ _ _ _ customize the color of the line and its label. See PEN
/COLOUR ? or Menu > Demos > Greg > PENCIL color names for possible
colors. By default, the lines are plotted in red for signal band and
blue for image band.

.ti -10
/ANGLE_ _ _ _ customize the angle of the label (degrees). Default is 90.
.in -14
.\"====================================================================
.ti -4
1 LLIST
.ti +4
[WEEDS_\]LLIST
  
List the lines from the line index. The line index is built with the
LFIND command.
.\"====================================================================
.ti -4
1 LPLOT
.ti +4
[WEEDS_\]LPLOT [Nchan]
  
Plot the current line selected from the last call to LGET. A vertical
line is drawn at the rest frequency of the line.

An optional Nchan parameter may be given to define the frequency
interval to be plotted around the line, expressed in number of
channels (default 100).
.\"====================================================================
.ti -4
1 MODSHOW
.ti +4
[WEEDS_\]MODSHOW [/PEN Ipen] [/SCALE AUTO|KEEP]
  
Plot the results of MODSOURCE over the current spectrum.

The command ensures that the X-axis range and Y-axis range are fixed so
one can compare the predictions of the model with the observed spectrum.
The current Y scale is kept by default (/SCALE KEEP), but it can be
automatically recomputed if the model requires a larger range (/SCALE
AUTO).

The model is drawn with the pencil 1 by default (plain line, red color
at start), but this can be changed with the /PEN option.
.\"====================================================================
.ti -4
1 MODSOURCE
.ti +4
[WEEDS_\]MODSOURCE MODFILE ANTSIZE [/TCONT TCONT] [/OPACITY I] [/KEEPCONT] [/VERBOSE]
  
Model the emission of a source assuming local thermodynamic equilibrium
(LTE). The model paramaters (column density, kinetic temperature,
source size, line width and velocity offset for each species) are read
from MODFILE. The modeled brightness temperature is stored in the
TB__MODEL memory. For convenience the current spectrum is also stored
in a memory, OBS, so one can easily overplot the result of the model
on the observed spectrum. See the documentation manual for more details
on the computation.

Arguments:
.in +14
.ti -12
MODFILE_ _ _ _ _ the name of the file containing the parameters. The
file must have one line per species with at least six columns
containing respectively:

1) The species name
.br
2) The column density for this species in cm-2
.br
3) The excitation temperature in K
.br
4) The source size in arcsec
.br
5) The offset velocity from the source VLSR, in km/s
.br
6) The line FWHM in km/s

One additional column may be used to select a different origin for
each species:

.br
7) The origin of this species (e.g. JPL or CDMS). If empty, species
with any origin are selected.
.br

The following options may be used at the end of the line:

/ABSORPTION _ If this option is set, the component is assumed to be a
foreground layer.

/PARTFUNC Q _ Set the log10 of the partition function at the
excitation temperature to Q. If not set, the partition function values
(log-log interpolated/extrapolated at the excitation temperature)
from the selected database are used.

Lines that start with a "!" are treated as comments.

.ti -12
ANTSIZE_ _ _ _ _ the antenna size in meters
.in -14

Options:
.in +14
.ti -12
/TCONT_ _ _ _ _ _ set the continuum level to TCONT, in K. The value
can be scalar (one value for the whole frequency range) or an array
name (same size as RY, one value per channel). Default is 0.

.ti -12
/OPACITY I_ _ store the opacity of the Ith component in the TAU__MODEL
memory. Components are numbered in the same order as in MODFILE,
starting from 1.

.ti -12
/KEEPCONT_ _ _ do not remove the continuum from the final spectra.

.ti -12
/VERBOSE_ _ _ _ print partition function, line frequencies, upper
level energies and degeneracies, Einstein coefficients and opacities at
the line centers.
.in -14
.\"====================================================================
.ti -4
1 SCANFIND
.ti +4
[WEEDS_\]SCANFIND RESTFREQ
  
This function loops over the scan index until it finds one that covers
the given rest frequency. When the scan is found, it is loaded. Note
that if several scans covers the same frequency, the command will find
only the first one; other will be ignored.

Arguments:
.ti +4
RESTFREQ_ _ the rest frequency to search, in MHz.
.\"====================================================================
.ti -4
1 ENDOFHELP
