.ec _
.ll 76
.ad b
.in 4

.ti -4
1 NOEMAOFFLINE_\
.ti +20
NOEMAOFFLINE_\ Language summary
 
.nf
BASEBANDS : Select basebands (4GHz wide) and assign them a correlator mode
LIST      : Lists the defined spectral windows
NEWVEL	  : Compare SPW coverage for different sources (ment to be used by SMS)
PLOT      : Plot the current state of the receiver and backend setup
PROPOSAL  : Write a sequence of ASTRO commands to define the receiver/backend configuration
RESET     : Remove spectral windows
SETUP     : Write a sequence of OBS commands to define the receiver/backend configuration
SPW       : Configure and plot the backend units
TSYS      : Create the NOEMA Tsys table
TUNING    : Define and plot the frequency coverage of NOEMA receivers
.fi

.\"====================================================================
.ti -4
1 BASEBANDS
.ti +4
[NOEMAOFFLINE_\] BASEBANDS [SelectionCode] [Mode] [/RESET]

After a receiver TUNING, select a number of 4GHz basebands and assign
them a correlator mode. Forthcoming SPW commands will concern only the
selected basebands.  The selection is done through 0 to 5 character codes
to indicate the band (2 characters), polarization, sideband and baseband
(1 character each). Any of these elements can be omitted to make no
particular selection on the corresponding, but if present, the above
order must be preserved.

Examples:
.nf
BASEBAND	: will select all the basebands 
BASEBAND B1HUO  : will select only the outer baseband of the upper 
		  sideband in polar H for the Band 1 tuning. 
		  (Band is not mandatory when only 1 receiver band is tuned)
.fi

The correlator mode selection is done using the most discriminating
frequency resolution (given in kHz). The only available mode right now
is 62.5kHz. The correlator mode "OFF" can be used to switch off a
whole baseband.
.\"--------------------------------------------------------------------
.ti -4
2 /RESET

[NOEMAOFFLINE_\]BASEBANDS [SelectionCode] /RESET

Reset the configuration of the correlator for the selected
baseband. All corresponding spectral windows are removed.
.\"====================================================================
.ti -4
1 LIST [/CONFLICT] [/INDEX]

[NOEMAOFFLINE_\]LIST [Spw1 Spw2] [/CONFLICT] [/INDEX]

List the defined spectral windows. If present Spw1 and Spw2 define the
range of listed spectral windows. 
They are sorted according to resolution (low resolution
first), then RF frequency and finally polarization (order different
from the index one, which follows the true order at the observatory)
.\"--------------------------------------------------------------------
.ti -4
2 /CONFLICT

[NOEMAOFFLINE_\]LIST [/CONFLICT]

The list contains only the spectral windows in conflict (i.e. when
several SPW use the same chunk, or when more chunks than possible are
configured).
.\"--------------------------------------------------------------------
.ti -4
2 /INDEX

[NOEMAOFFLINE_\]LIST [/INDEX]

The displayed list is ordered according to their index (resolution -
low resolution first, polarization - H first, then frequency).
.\"====================================================================
.ti -4
1 NEWVEL 

[NOEMAOFFLINE_\]NEWVEL VType Value [Tolerance] [/FIXED_FREQ] [/SETUP] 

Applies the current backend configuration to a source at different LSR
velocity or redshift to compare the frequency coverage of high
resolution spectral windows. With Vtype LSR (resp. REDSHIFT), Value
should be the LSR velocity in km/s (resp. the redshift) for which the
comparison is desired. The shift in REST frequency coverage between
the two sources is computed and compared to a tolerance (in MHz) that
can be given as third argument (0 is the default value).

With the option /FIXED_FREQ, the tuning for the new redshift or
velocity will not be adapted to match the optimized tuning grid (as a
result, the frequency coverage offset is null)

.\"--------------------------------------------------------------------
.ti -4
2 /SETUP

[NOEMAOFFLINE_\]NEWVEL VType Value [Tolerance] /SETUP LineName RepFreq [Resolution] [/LINES]

The \SETUP option is used as output the commands in ONLINE syntax that
are needed to configure the system as they should appear in the
observing setup file.  It is ment to be used by the Setup Management
System when preparing the observing procedures of accepted proposals.
If the shift between the coverages at the two considered LSR
velocities or Redshift is larger than the tolerance, then the ONLINE
commands are not printed.

/SETUP option requires at least 2 arguments: the line name as it will
appear in the NOEMAONLINE\LINE command, and the representative
frequency of the setup (see Proposal Management System), in GHz.  The
desired spectral resolution (in kHz) can be given as third argument.
Some information about the frequency coverage (e.g. number of
polarization covering the representative frequency, USB and LSB
coverage limits, continuum bandwidth,...) is given in output.

The option /LINES can be used to display the catalog lines. 
.\"--------------------------------------------------------------------
.ti -4
2 /TRACKSH

[NOEMAOFFLINE_\]NEWVEL VType Value [Tolerance] /TRACKSH Min Max

With this option, the frequency plot will show how the lines in the
sources with Min and Max velocity (or redshift) will be shifted with
respect to the doppler tracked frequency (defined by Value). This
option is ment to be used by SMS in case of track sharing projects,
where Value will be the mean velocity.

.\"====================================================================
.ti -4
1 PLOT [SelectionCode] [/RECEIVER] [/PROPOSAL [Freq [Resol]] [/LINES]]]

[NOEMAOFFLINE_\]PLOT [SelectionCode]

Displays the current state of the receiver and backend
configuration. A warning message is added to the plot when the current
setup is not technically feasible (chunk conflicts or unit overload).

With no arguments all the basebands are plotted.  A
subset of basebands can be selected using a character code to
indicate the band (2 characters), polarization, sideband and baseband
(1 character each). Any of these elements can be omitted to make no
particular selection on the corresponding, but if present, the above
order must be preserved.

Examples:
.nf
PLOT : will plot all the basebands 
PLOT B1HUO  : will plot only the outer baseband of the upper 
		  sideband in polar H for the Band 1 tuning. 
		  (Band is not mandatory when only 1 receiver band is tuned)
.fi
.\"--------------------------------------------------------------------
.ti -4
2 /RECEIVER

[NOEMAOFFLINE_\]PLOT [/RECEIVER]

Plot the current receiver and backend setup on a plot where the whole
receiver band is drawn at the center of the page with a zoom to the
Lower Side Band below it and a zoom to the Upper Side Band above.
.\"--------------------------------------------------------------------
.ti -4
2 /PROPOSAL

[NOEMAOFFLINE_\]PLOT [/PROPOSAL [Frequency] [/LINES]] 

This option is meant to be used through PMS to create very simple
summary plots.

Plot the current receiver and backend configuration in a single
horizontal plot. By default spectral lines from the current catalog
are not drawn. This can be changed using the /LINES option (global
behavior as defined by SET LINES is not affected). 

A representative frequency [GHz] can be indicated as argument of the
/PROPOSAL option. It will be indicated on the plot and the number of
polarizations covering this frequency (in all spectral resolution) is
computed. In addition a channel spacing [kHz] can be given as second
argument. In that case the number of polarizations covering the
representative frequency at the indicated channel spacing is also given. 
.\"====================================================================
.ti -4
1 PROPOSAL

[NOEMAOFFLINE_\]PROPOSAL [/FILE file.ext] [/TIME]

Write (to screen or in a file defined with /FILE option) a sequence of
commands to come back to the current state of receiver/backend
definitions. The commands are written in the language NOEMAOFFLINE,
and the output script can be updated to the Proposal Management
System during a proposal preparation session.

PROPOSAL will return an error if the configuration is not technically
feasible (chunk selected by more than 1 spectral window, or more
chunks needed than available in a correlator unit).

With the option /TIME, the time used for the computation of source
velocities will be added in the output script.

In addition to the commands, the output of PROPOSAL contains all the
spectral lines of the current catalog which fall in the observed
ranges. 

The command SETUP creates a similar script, but in the NOEMAONLINE
language (OBS syntax).
.\"====================================================================
.ti -4
1 RESET
.ti +4
[NOEMAOFFLINE_\]RESET [LAST|*|SpwList]

Reset spectral windows. Free the corresponding chunks of the
corresponding correlator unit. 
.nf 
-RESET = RESET LAST: reset the spectral windows created by the last SPW command.
-RESET *: reset all the flexible spectral windows.
-RESET SpwList: rest a list of SPW (SIC list format). 
		SPW are identified through their index as seen in LIST 
.fi
.\"====================================================================
.ti -4
1 SETUP
.ti +4
[NOEMAOFFLINE_\]SETUP [/FILE OutFile]

Write (to screen or in a file defined with /FILE option) a sequence of
commands to come back to the current state of receiver/backend
definitions. The commands are written in the language used at the
observatory to define the receiver and correlator setups.
This can be run in ASTRO after switching to NOEMA online mode:
OBSERVATORY NOEMA ONLINE


SETUP will return an error if the setup is not technically feasible
(chunk selected by more than 1 spectral window, ore more chunks needed
than available in a correlator unit).

The output commands are compatible with the online
software at the NOEMA observatory.  In detail SETUP will convert the
rest frequency to LSR frequency for sources defined with a redshift
and enter the source command with "LSR 0" instead of "RED zz.z".

In addition to the commands, the output of SETUP contains all the
spectral lines of the current catalog which fall in the observed
ranges. 

.\"====================================================================
.ti -4
1 SPW
.ti +4
[NOEMAOFFLINE_\]SPW  [/RANGE Fmin Fmax]  [/FREQUENCY Fcent dF] [/CHUNK ChunkList] [/LABEL Label]

Configure and visualize flexible spectral windows in Polyfix units.  A
receiver tuning must have been defined (RECEIVER command) and at least
a baseband must have been selected (BASEBAND command). A typical
sequence can be:

.nf
TUNING 230 LSB 7777    : Define the receiver tuning
BASEBANDS 62.5 HUO     : Select a baseband and assign a correlator mode
SPW /RANGE 227 227.3   : Configure and plot 1 spectral window 
                          (from <~227 to ~>227.3 GHz)
SPW /FREQUENCY 228 0.2 : Configure and plot a second spectral window 
                          of ~>200MHz around 228 GHz)	
SPW /CHUNK 6  30 to 40 : Configure 2 new spectral windows
.fi

The frequency inputs with /RANGE and /FREQUENCY options have to be
given in the current main frequency axis as defined with the SET
FREQUENCY command (REST by default).

Once configured, the spectral windows are ordered by resolution then
frequency then polarization. The configured spectral windows can be
listed with the LIST command. The RESET command can be used to remove
a spectral window.

Feasibility of the setup: SPW returns warnings if the current
definition of spectral windows is not technically feasible (i.e. if a
chunk is used by more than 1 spectral window or if the spectral windows
in a correlator unit require more chunks than available). The warnings
have to be removed in order to be able to create an observing script
(SETUP command, not yet implemented) or to make a summary plot of the
setup (PLOT command).
.\"--------------------------------------------------------------------
.ti -4
2 /RANGE

[NOEMAOFFLINE_\]SPW /RANGE Fmin Fmax

Define a spectral window from Fmin to Fmax (GHz) in the current
frequency frame (as defined with SET FREQUENCY command).  Fmin and
Fmax must be in the same baseband.
.\"--------------------------------------------------------------------
.ti -4
2 /FREQUENCY

[NOEMAOFFLINE_\]SPW /FREQUENCY Fcent dF

Define a spectral window from Fmin=Fcent-dF/2 to Famx=Fcent+dF/2 in
the current frequency frame (as defined with SET FREQUENCY command).
Fcent and dF must be in GHz.  Fmin and Fmax must be in the same
baseband.
.\"--------------------------------------------------------------------
.ti -4
2 /CHUNK

[NOEMAOFFLINE_\]SPW /CHUNK ChunkList

Define spectral windows by defining directly the chunks to be used by
their numbers. This mode is available only when a single Baseband
(eventually in dual polarization) is selected with the BASEBAND
command.

The ChunkList follows the SIC_\FOR list format. For example:
.nf
  SPW /CHUNK  1  5  10 TO 12
.fi
will add 3 more spectral windows:
.br
- one new spw with the chunk #1,
.br
- one new spw with the chunk #5,
.br
- one new spw with the chunks #10, 11, and 12.
.\"--------------------------------------------------------------------
.ti -4
2 /LABEL

[NOEMAOFFLINE_\]SPW [...] /LABEL Label

With the option /LABEL, a name can be attached to the defined spectral
windows.
.\"====================================================================
.ti -4
1 TSYS
.ti +4
[NOEMAOFFLINE_\]TSYS TableName

Create the Tsys binary table used by the NOEMA sensitivity
estimator. None of the inputs can be customized at user
level. Contents are:

.nf
Code      C*4  [     ]  System code

Pressure  R*4  [HPa  ]  Pressure at observatory altitude
Gaini     R*4  [     ]  Image band gain
IF        R*4  [GHZ  ]  Intermediate frequency

Nf        I*4  [     ]  Number of frequencies
Na        I*4  [     ]  Number of airmasses
Nw        I*4  [     ]  Number of precipitable water vapor amounts
Nt        I*4  [     ]  Number of temperatures

F[Nf]     R*4  [GHz  ]  Frequencies
A[Na]     R*4  [Neper]  Airmasses
W[Nw]     R*4  [mm   ]  Precipitable water vapor amounts
T[Nt]     R*4  [K    ]  Temperature values
Trec[Nf]  R*4  [K    ]  Receiver temperatures (per frequency)
Feff[Nf]  R*4  [     ]  Forward efficiencies (per frequency)

Tsys[Nf,Na,Nw,Nt]  R*4  [K    ]  Tsys
.fi
.\"--------------------------------------------------------------------
.ti -4
2 /CONTINUUM

Create the binary table of CONTINUUM Tsys used by the NOEMA
sensitivity estimator. None of the inputs can be customized at user
level. Contents are:

.nf
Code      C*4  [     ]  System code

Pressure  R*4  [HPa  ]  Pressure at observatory altitude
Gaini     R*4  [     ]  Image band gain

Ne        I*4  [     ]  Number of elements (should be 3 = min,aver,max)
Nf        I*4  [     ]  Number of LO frequencies
Na        I*4  [     ]  Number of airmasses
Nw        I*4  [     ]  Number of precipitable water vapor amounts
Nt        I*4  [     ]  Number of temperatures

F[Nf]     R*4  [GHz  ]  LO Frequencies
A[Na]     R*4  [Neper]  Airmasses
W[Nw]     R*4  [mm   ]  Precipitable water vapor amounts
T[Nt]     R*4  [K    ]  Temperature values
Trec[Nf]  R*4  [K    ]  Receiver temperatures (per LO frequency)
Feff[Nf]  R*4  [     ]  Forward efficiencies (per LO frequency)

Tsys[Ne,Nf,Na,Nw,Nt]  R*4  [K    ]  Tsys
.fi

In its first dimensions, the Tsys table provides the triplet of values
[min, average, max] found from the two sidebands around the given LO
frequency.
.\"====================================================================
.ti -4
1 TUNING
.ti +4
[NOEMAOFFLINE_\]TUNING [Ftune(GHz) Sideband FIF(MHz)]  [/ZOOM Keyword] [/PAGEWIDTH] [/INFO] [/FIXED__FREQ]

Without arguments, the command displays the available bands of NOEMA
Receivers.  With the option /INFO several informations about the
receiver are displayed in the terminal.

Different ranges are colorized:
.nf
Black		: outside the receiver bands
Dark grey	: in the receiver bands, but not accessible with the present tuning
White		: in the receiver bands, accessible with the present tuning
.fi

With arguments, the command defines the tuning of one of the band and
represents it on the global view.  

Tuning syntax:
.nf
Ftune	: Frequency to tune (in GHz) 
SideBand: Sideband where to place Ftune (LSB or USB) 
FIF	: Position where Ftune will be placed in the IF band (in MHz)
.fi

Ftune must be in the current frequency main axis (REST by default, but
can be changed with SET FREQUENCY command)

If a source has been defined, its velocity (or redshift) is taken into
account to convert Ftune to RF frequency.

NOEMA observations are preferentially performed using a limited number
of LO frequencies for which receiver performances have been
optimized. Those frequencies are distributed all over the receiver
bands every 500MHz (the so-called tuning grid). The NOEMAOFFLINE_\TUNING
command takes this into account and shifts the IF center frequency FIF
if necesssary so that the LO tuning frequency matches the tuning grid.

The tuning frequency is computed using only the source LSR
velocity. With the Doppler tracking, the actual LO is slightly
different from the tuning frequency.  Both tuned and tracked LO
frequencies are given in output.
With the option /FIXED__FREQ, the command ignores the tuning grid.
.\"--------------------------------------------------------------------
.ti -4
2 /PAGEWIDTH

[NOEMAOFFLINE_\]TUNING [...] [/PAGEWIDTH]

When several receiver bands are plotted, this option forces their
width to match the plot page. The consequence is that the different
bands are displayed with different scaling in GHz/cm.
.\"--------------------------------------------------------------------
.ti -4
2 /FIXED__FREQ

[NOEMAOFFLINE_\]TUNING Ftune SideBand FIF /FIXED__FREQ

With this option, the command ignores the tuning grid: the input FIF
is used even if the corresponding LO frequency is not on the optimized
tuning grid.
.\"--------------------------------------------------------------------
.ti -4
2 /ZOOM

[NOEMAOFFLINE_\]TUNING [...] /ZOOM [Keyword] [Fmin Fmax]

Different zooming modes are implemented according to the entered
Keyword and the number of tuned bands.  Without /ZOOM option, all the
NOEMA receiver bands are plotted, and the tuning is identified (white
area) With the option /ZOOM and no argument, focus on the tuning, with
zoom on the two sidebands.  If a frequency range Fmin Fmax (in GHz) is
given as argument, zoom on this range.

.\"====================================================================
.ti -4
1 ENDOFHELP
