.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
FEBE	  : Command to interact with the register of saved FrontEnd/BackEnd configurations (FEBE)
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
SPECSWEEP : Tool to prepare multiple tuning for optimized spectral coverage
TSYS      : Create the NOEMA Tsys tables
TUNING    : Define and plot the frequency coverage of NOEMA receivers
.fi

.\"====================================================================
.ti -4
1 BASEBANDS
.ti +4
[NOEMAOFFLINE_\] BASEBANDS [SelectionCode] [/MODE [df1 [df2]]|OFF] [/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 /MODE option.

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

[NOEMAOFFLINE_\]BASEBANDS [SelectionCode] /MODE df1 [df2]

Define the correlator mode to be used for the selected basebands. The
mode selection is done by giving the channel spacing value(s) in kHz:

.nf
2000 62.5 = Full baseband at 2MHz channel spacing + 16 HighRes Chunks (62.5kHz channel spacing)
250  	  = Full baseband at 250kHz channel spacing
.fi

If the keyword OFF is entered instead of the channel spacing, then no
correlator mode is assigned to the selected baseband(s), they will not
be used.

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

[NOEMAOFFLINE_\]BASEBANDS [SelectionCode] /RESET

Reset the configuration of the correlator for the selected
baseband. If High Resolution spectral windows were defined, they will
be removed. If combined with /MODE the current setup is reset and the
new mode is applied.

.\"====================================================================
.ti -4
1 FEBE
.ti +4
[NOEMAOFFLINE_\] FEBE [ADD|LIST|REMOVE|LOAD|SAVE|CLEAR]

In ASTRO a FEBE is a configuration of FrontEnd (=tuning) and BackEnd
(= correlator) configuration.  The TUNING, BASEBAND, SPW, PLOT command
work on a FEBE saved in the current memory.

In addition to this FEBE, a register of saved FEBE is implemented in
order to be able to save different FrontEnd/BackEnd configurations.
All the FEBE in the register are defined for the current astro SOURCE.
Any call to the SOURCE command will reset the register.

The main command to interact with the register is the FEBE command. It
is used in combination with keyword to define the required action:

With the ADD keyword, the current FEBE, as seen with PLOT command,
will be saved to the register.  After a new FEBE is defined (TUNING,
BASEBAND, SPW commands) it can also be added to the register, as long
as there is free space in the register.

The content of the register is displayed when using the LIST keyword.

A given FEBE can be loaded to the currnt one using the LOAD keyword.
After a FEBE was loaded, it can be modified and the new version can be
saved to the register (under same ID) using the SAVE keyword.

Individual FEBE can be removed from the register with the REMOVE
keyword, while the CLEAR keyword will empty the register.

A selection of the FEBE stored in the register can be converted into
as script that can be uploaded to the Proposal Management System using
the PROPOSAL /FEBE command

.\"====================================================================
.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] [/FEBE]

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. 

With the option /FEBE, PROPOSAL will create a script to define multi frequency observations (dual band, frequency cycling), by considering the FEBE saved in the register.

The command SETUP creates a similar script, but in the NOEMAONLINE
language (OBS syntax).
.\"--------------------------------------------------------------------
.ti -4
2 /FEBE

[NOEMAOFFLINE_\]PROPOSAL /FEBE [i j ...]

Write (to screen or in a file defined with /FILE option) a sequence of
commands to define a mulfifrequency observations (dual band or frequency cycling).

Without argument, all the FEBEs in the register will be inserted in
the output script.  A selection of the saved FEBEs can be given in
argument when not all the FEBEs have to be considered.
The command checks that the combination of FEBEs is technically feasible.

The output commands are written in the language NOEMAOFFLINE,
and the output script can be updated to the Proposal Management
System during a proposal preparation session.

.\"====================================================================
.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).  SPW can be
used only on Basebands defined with a correlator mode allowing for
the configuration of high resolution spectral windows. 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 SPECSWEEP
.ti +4
[NOEMAOFFLINE_\]SPECSWEEP ChannelSpacing [/RANGE Fmin Fmax [/BANDMAX]] [/NTUNING n Freq Align] [/ZOOM RANGE|RECEIVER] [/FILE 'basename'] [/ADD_FEBE]

Tool to find receiver tunings in order to prepare large frequency coverage projects.

The command argument is the Channel Spacing at which the observations will
be performed.  The correlator mode to be used will be defined
accordingly.

With option /RANGE the command proposes a combination of tunings that
cover at least the specidified range. See help SPECSWEEP /RANGE.

With option /NTUNING the users specifies the number of tuning he wants
to use together with a frequency and an alignement code in order to
place the tunings

The option /ZOOM can be used to select the frequency limits of the
plot: whole receiver band or covered frequency range only.

With the option /FILE name, the command will create as many astro
scripts as tunings defined by the command. They will be named
name-[1-n].astro. They can be entered individually entered in the
Proposal Management System to tranfer them into a proposal.

With the option /ADD_FEBE the created FrontEnd Backend configurations
(FEBE) will be saved to the register. The commande PROPOSAL /FEBE can
then be used to create a PMS script for multi frequency observations
(frequency cycling)

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

[NOEMAOFFLINE_\]SPECSWEEP ChannelSpacing [/RANGE Fmin Fmax [/BANDMAX]]

Fmin and Fmax (in GHz) are the limits of the required observations.  The
option /BANDMAX allows to chose between tuning overlap or extended
coverage when placing the tuning in the band.

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

[NOEMAOFFLINE_\]SPECSWEEP ChannelSpacing [/NTUNING n Freq Align]

n is the number of tuning required by the user.  The Align code
(MIN|CENTER|MAX) will define if the entered Freq (GHz) has to be
placed at the center or at one edge of the final coverage.

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

[NOEMAOFFLINE_\]SPECSWEEP ChannelSpacing [/NTUNING|/RANGE] /ADD_FEBE

The created FEBE (FrontEnd/BackEnd configurations) will be added to
the register of saved Febe.  Can be used to create a script to be
uploaded to PMS using the frequency cycling mode (using PROPOSAl /FEBE command).

.\"====================================================================
.ti -4
1 TSYS
.ti +4
[NOEMAOFFLINE_\]TSYS TableName [/CONTINUUM] [/DBR]

Create the Tsys binary table used by the NOEMA sensitivity
estimator. With the /DBR option, add the dichroic temperature to the
receiver one. None of the inputs can be customized at user
level. Contents are:

.nf
Code      C*4  [     ]  System code
Version   I*4  [     ]  Table version

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
Version   I*4  [     ]  Table version

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
