; HLPEDIPC
;---------------------------------------------------------------
;! Interactive PC table editor PCEDT - run-time help
;# TASK TABLE CALIBRATION INTERACTIVE TV-APPL OOP UV EDITING VLBI
;-----------------------------------------------------------------------
;;  Copyright (C) 2016, 2018, 2020
;;  Associated Universities, Inc. Washington DC, USA.
;;
;;  This program is free software; you can redistribute it and/or
;;  modify it under the terms of the GNU General Public License as
;;  published by the Free Software Foundation; either version 2 of
;;  the License, or (at your option) any later version.
;;
;;  This program is distributed in the hope that it will be useful,
;;  but WITHOUT ANY WARRANTY; without even the implied warranty of
;;  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
;;  GNU General Public License for more details.
;;
;;  You should have received a copy of the GNU General Public
;;  License along with this program; if not, write to the Free
;;  Software Foundation, Inc., 675 Massachusetts Ave, Cambridge,
;;  MA 02139, USA.
;;
;;  Correspondence concerning AIPS should be addressed as follows:
;;         Internet email: aipsmail@nrao.edu.
;;         Postal address: AIPS Project Office
;;                         National Radio Astronomy Observatory
;;                         520 Edgemont Road
;;                         Charlottesville, VA 22903-2475 USA
;-----------------------------------------------------------------------
C-----------------------------------------------------------------------
FLAG CHANNEL
This option allows you to flag (delete) the data for a specific channel.
Move the cursor to the channel you wish to flag.  The vertical line will
follow it while the channel/IF and value of the pulse-cal datum nearest
the cursor will be displayed in the top left corner of the TV.  Once on
the desired channel, hit button A or B to flag that channel and loop
for more, hit button C to flag the channel and return to the menu, and
hit button D to return to the menu with no further flagging.  As you
flag a point, it is changed in color in the editing and secondary area
displays and may also be changed in color in the plots of other
baselines if those data are also flagged.  Data for other polarizations
and antennas may also be flagged depending on the setting of the ALL
vs ONE POLARIZ and ALL vs ONE ANTENNA flags (shown at the bottom left
of the display).  Writes one FC table command in one FC table record
for each channel marked.  Note that, if the display is so crowded that
more than one channel is plotted at the indicated cursor position (in
the horizontal direction only), then a range of channels is actually
flagged.
C-----------------------------------------------------------------------
FLAG CHAN RANGE
This option allows you to flag (delete) the data from a range of
channels.  Move the cursor to the start or end channel of the range you
wish to flag.  The vertical line will follow while the channel/IF of
the pulse-cal data within the channel range and nearest to the cursor
will be displayed in the top left corner of the TV.  Hit button A to
switch to setting the other end of the channel range.  Move the cursor
to the end point of the desired channel range; the second line and
data value display will follow.  Hit button A to switch between the
begin and end channels; hit button B to flag the data in the specified
range and loop to set another channel range; hit button C to flag the
data and return to the menu; or hit button D to return to the menu
with no further flagging.  Data for other polarizations and antennas
may also be flagged depending on the setting of the All vs ONE
POLARIZ and ALL vs ONE ANTENNA flags (shown at the bottom left of the
display).  Writes one FC table command in one FC table record for each
channel range marked.
C-----------------------------------------------------------------------
FLAG BELOW
This option allows you to flag (delete) the data having value below a
cutoff level.  Move the cursor to the lowest level you believe in your
data.  The horizontal line will follow while the value of the point
under the cursor will be displayed in the top left corner of the TV.
Hit button A or B to flag all data below the chosen level and loop to do
it again, hit button C to flag all data below the chosen level and
return to the menu; or hit button D to return to the menu with no
further flagging.  Data for other polarizations and antennas may also
be flagged depending on the setting of the ALL vs ONE POLARIZ and ALL
vs ONE ANTENNA flags (shown at the bottom left of the display).  Note
that the flagging is done on the basis of the values of the selected
observable (ampl, phase) of each polarization, IF, and baseline
individually.  Writes one FC table command in one or more FC table
records for each value range marked.  This option makes a detailed
list of value-independent flag commands based on the currently plotted
values whether currently good or previously flagged.  It is this
detailed list that can be undone or redone.
C-----------------------------------------------------------------------
FLAG ABOVE
This option allows you to flag (delete) the data having value above a
cutoff level.  Move the cursor to the highest level you believe in your
data.  The horizontal line will follow while the value of the point
under the cursor will be displayed in the top left corner of the TV.
Hit button A or B to flag all data above the chosen level and loop to do
it again, hit button C to flag all data above the chosen level and
return to the menu; or hit button D to return to the menu with no
further flagging.  Data for other polarizations and antennas may also
be flagged depending on the setting of the All vs ONE POLARIZ and ALL
vs ONE ANTENNA flags (shown at the bottom left of the display).  Note
that the flagging is done on the basis of the values of the selected
observable (ampl, phase) of each polarization, IF, and baseline
individually.  Writes one FC table command in one or more FC table
records for each value range marked.  This option makes a detailed
list of value-independent flag commands based on the currently plotted
values whether currently good or previously flagged.  It is this
detailed list that can be undone or redone.
C-----------------------------------------------------------------------
FLAG AREA
This option allows you to flag (delete) the data from a range of
channels and a range of data values.  Move the cursor to one corner
of the area you wish to flag.  The box outline will follow while the
channel/IF of the data sample nearest the cursor within the box channel
range and the value corresponding to the cursor vertical position will
be displayed in the top left corner of the TV.  Hit button A to switch
to setting the opposite corner of the area.  Hit button A to switch
between the two opposite corners; hit button B to flag the data in the
specified area and loop to set another area; hit button C to flag the
data and return to the menu; or hit button D to return to the menu
with no further flagging.  Data for other polarizations and antennas
may also be flagged depending on the setting of the ALL vs ONE POLARIZ
and ALL vs ONE ANTENNA flags (shown at the bottom left of the
display).  Note that this flag command is based solely on the data
values in the polarization, IF, and baseline displayed in the edit
area.  When other polarizations and baselines are also flagged, it is
simply the same channels as those selected within the box in the edit
area.  Writes one FC table command in one or more FC table records for
each area marked.  This option makes a detailed list of
value-independent flag commands based on the currently plotted values
whether currently good or previously flagged.  It is this detailed
list that can beundone or redone.
C-----------------------------------------------------------------------
FLAG POINT
This option allows you to flag (delete) data samples one at a time by
moving the cursor to the sample and hitting buttons A or B.  If you hit
button C, the current point is deleted and the program returns to the
menu.  Button D returns to the menu with no further deletion.  Data for
other polarizations and antennas may also be flagged depending on the
setting of the ALL vs ONE POLARIZ and ALL vs ONE ANTENNA flags (shown
at the bottom left of the display).  When other polarizations and
baselines are also flagged it is simply the same channel as that
selected by the cursor in the edit area.  The cursor needs to be
within 5 screen pixels of the data sample and will take the nearest
sample if there is more than one within this radius.  This mode is
useful for isolated outliers in a crowded display but is more accurate
in complex areas when used within a smaller frame.  Writes one FC
table command in one FC table record for each point marked.
C-----------------------------------------------------------------------
FLAG QUICKLY
This option allows you to flag (delete) data samples one at a time by
moving the cursor to the sample (carefully keeping the left mouse button
untouched, i.e. up) and then clicking the left mouse button.  If you hit
buttons A, B, or C, the current point is deleted and the program returns
to the menu.  Button D returns to the menu with no further deletion.
Data for other polarizations and antennas may also be flagged
depending on the setting of the ALL vs ONE POLARIZ and ALL vs ONE
ANTENNA flags (shown at the bottom left of the display).  When other
polarizations and baselines are also flagged it is simply the same
channel as that selected by the cursor in the edit area.  The cursor
needs to be within 5 screen pixels of the data sample and will take
the nearest sample if there is more than one within this radius.  This
mode is useful for isolated outliers in a crowded display but is more
accurate in complex areas when used within a smaller frame.  This mode
is very quick but requires you to be very careful in your use of the
mouse and left mouse button.  Writes one FC table command in one FC
table record for each point marked.  This command flags only the
selected point even if multiple polarizations and/or IFs are displayed.
C-----------------------------------------------------------------------
ENTER AMPL RNG
This option allows you to type on the terminal (main AIPS window) the
range of gain amplitudes that will be plotted.  It asks you for two
numbers, the lower limit and the upper.  If the upper limit is > the
lower limit, every plot of amplitude will cover this range, leaving out
any points outside the range (so be careful).  If you type 0 x, where
x <  0, then the  minimum of each plot will be 0 and the maximum will
be self-scaling.  If you enter one or no numbers or if the second
number is <= the first (but not the 0 x, x < 0), each amplitude plot
will be self-scaling.  The new amplitude range, if selected, is
displayed immediately on the TV unless the HOLD TV LOAD option was
selected.  In that case, the status code LOAD PENDING is shown and the
DO TV LOAD option is displayed and must be selected to see the new data.
C-----------------------------------------------------------------------
ENTER PHASE RNG
This option allows you to type on the terminal (main AIPS window) the
range of gain phases that will be plotted.  It asks you for two numbers,
the lower limit and the upper.  If the upper limit is > the lower limit,
every plot of phase will cover this range, leaving out any points
outside the range (so be careful).  Otherwise, each phase plot will be
self-scaling.  The new phase range, if selected, is displayed
immediately on the TV unless the HOLD TV LOAD option was selected.  In
that case, the status code LOAD PENDING is shown and the DO TV LOAD
option is displayed and must be selected to see the new data.
If you enter one or no numbers, phase plots will be self-scaling.
C-----------------------------------------------------------------------
ENTER RESID RNG
This option allows you to type on the terminal (main AIPS window) the
range of residual phases that will be plotted.  It asks you for two
numbers, the lower limit and the upper.  If the upper limit is > the
lower limit, every plot of residual phase will cover this range,
leaving out any points outside the range (so be careful).  Otherwise,
each residual phase plot will be self-scaling.  The new residual phase
range, if selected, is displayed immediately on the TV unless the HOLD
TV LOAD option was selected.  In that case, the status code LOAD
PENDING is shown and the DO TV LOAD option is displayed and must be
selected to see the new data.  If you enter one or no numbers,
residual plots will be self-scaling.
C-----------------------------------------------------------------------
LIST FLAGS
This option will display all Flag Commands currently in the FC table.
These are a summary of the flagging commands which will be applied to
the uv data upon exit. Each command is labeled by a "flag" number which
may be used to specify any flags that you may wish to undo.
C-----------------------------------------------------------------------
UNDO FLAGS
This option allows you to undo one or more of the current flagging
commands in the FC table.  You are prompted for the range of consecutive
flag numbers to be undone (use LIST FLAGS to determine this).  If you
enter only one number, that flag command alone will be undone.  The
specified flagging commands are removed from the FC table (deleting one
or more records) and the pulse-cal data are un-flagged.  The Flag
Commands are renumbered by this operation, so use lIST FLAGS before
deleting others.  When undoing FLAG AREA, FLAG ABOVE, and FLAG
BELOWoperations, it is the detailed value-independent commands which
were based on the values current when the operation was done which are
undone.  Current values are ignored.  After the UNDO operation, PCEDT
does a REDO FLAGS followed by a REPLOT making those two functions no
longer so useful.
C-----------------------------------------------------------------------
REDO FLAGS
This option allows you to correct for having undone a flag command that
overlapped with another flag command.  If two separate commands would
both flag a point, undoing one of them will make the point appear
un-flagged.  REDO FLAGS goes through the full FC table and flags any
points not currently flagged by the commands in the table.  If only one
IF's data fits in memory, REDO FLAGS is run automatically when an IF is
reloaded from disk.  When redoing FLAG AREA, FLAG ABOVE, and FLAG BELOW
operations, it is the detailed value-independent commands which were
based on the values current when the operation was done which are
redone.  Since flags were generated for both data that were then good
and for data that were then flagged, REDO FLAGS should recover the full
intent of the previous flag operation.
C-----------------------------------------------------------------------
REDO DELAYS
This option allows you to have the pulse-cal data fit for delay and
phase and the residual phase spectra re-computed.  The residual phase
spectra are computed as the PC table is read in initially.  They are
not recomputed automatically when you flag some of the PC data values.
Use this option after doing some flagging to see if it changes the
delays and phases in any significant way.
C-----------------------------------------------------------------------
TV ZOOM
This option allows you to set the zoom factor and center to blow up the
data plot for more accurate cursor positioning.  The display is actually
shown in zoom only during flagging operations (where zoom may help you
point more accurately) and during the setting of the zoom.  The cursor
position controls the zoom center, buttons A and B increment the zoom,
button C decrements the zoom, and button D ends the zoom setting and
returns to the menu.  Instructions appear on the terminal.  Note that
selecting a small frame is more accurate than simply blowing up a
crowded display.
C-----------------------------------------------------------------------
OFF ZOOM
This option resets any zoom factors and zoom center.  The display is
actually shown in zoom only during flagging operations (where zoom may
help you point more accurately) and during the setting of the zoom.
C-----------------------------------------------------------------------
DO TV LOAD
This option will cause the TV display to be updated completely.  It is
only displayed if you have previously selected the HOLD TV LOAD option.
The reason to do this is to delay the screen update while you change
more than one of its parameters, i.e., the data type, display range,
antenna to edit, and/or secondary antennas.  The status code LOAD
PENDING is shown as soon as you have made a change which has not been
displayed.  When you select the DO TVLOAD option, it is replaced with
the HOLD TV LOAD option.
C-----------------------------------------------------------------------
HOLD TV LOAD
This option will cause the TV display to remain unchanged until the DO
TV LOAD option is selected.  The DO TV LOAD option is displayed if you
have previously selected the HOLD TV LOAD option.  The reason to do this
is to delay the screen update while you change more than one of its
parameters, i.e., the data type, display range, antenna to edit, and/or
secondary antennas.  When you select this option, it is replaced with
the DO TV LOAD option.
C-----------------------------------------------------------------------
REPLOT
This option will redo the full TV plot.  It may be of use if the plot
has not updated as expected.
C-----------------------------------------------------------------------
EXIT
This option is used to exit the program.  The Flag Command table will be
translated into entries in a uv flag (FG) table.
C-----------------------------------------------------------------------
ABORT
This option is used to exit the program.  The Flag Command table will be
destroyed.  Use this option if you have made no editing commands or if
you distrust the commands you have made.
C-----------------------------------------------------------------------
SWITCH POLARIZ
If there are two polarizations in the PC table, this option lets you
switch between them to select the data to be displayed and used in
editing.  If CROWDED was true, then the display of both polarizations
at once is also selected by this SWITCH.  The data for the new
polarization are displayed immediately on the TV unless the HOLD TV
LOAD option was selected.  In that case, the status code LOAD PENDING
is shown and the DO TV LOAD option is displayed and must be selected
to see the new data.
C-----------------------------------------------------------------------
SWITCH ALL POL
This option lets you toggle between having the following flag commands
apply to both polarizations and having them apply only to the current
polarization.  The status lines on the bottom left of the TV screen
reflect the current value of this option.
C-----------------------------------------------------------------------
SWITCH ALL TIME
This option lets you toggle between having the following FLAG commands
apply to all times and having them apply only to the time displayed in
the current edit window.
C-----------------------------------------------------------------------
SWITCH ALL SOURC
This option lets you toggle between having the following flag commands
apply to all sources and having them apply only to the selected sources.
C-----------------------------------------------------------------------
SWITCH ALL ANT
This option lets you toggle between having the following flag commands
apply to all antennas and having them apply only to the current antenna.
The status lines on the bottom left of the TV screen reflect the current
value of this option.
C-----------------------------------------------------------------------
ENTER ANTENNA
This option allows you to type on the terminal (main AIPS window) the
number of the antenna to be used for the main display and for editing.
The data for the new antenna are immediately displayed on the TV unless
the HOLD TV LOAD option was selected.  In that case, the status code
LOAD PENDING is shown and the DO TV LOAD option is displayed and must be
selected to see the new data.  The data of this primary antenna are
displayed over the current channel frame in the editing and secondary
display areas..
C-----------------------------------------------------------------------
ENTER OTHER ANT
This option allows you to type on the terminal (main AIPS window) the
numbers of up to ten other antennas to be displayed above the display
of the main editing and secondary windows.  These comparison displays
use the same channel frame and parameter type as the editing window.  To
display fewer than ten other antennas, simply hit Enter after listing
those that yo do want.  You may have no comparison windows if you want
to see the largest possible display of the main editing window (hit
Enter with no non-zero values for this option). The data for the new
secondary antennas are immediately displayed on the TV unless the
HOLD TV LOAD option was selected.  In that case, the status code
LOAD PENDING is shown and the DO TV LOAD option is displayed and must
be selected to see the new data
C-----------------------------------------------------------------------
NEXT ANTENNA
This option lets you change to the next antenna in PCEDT's internal list
for your primary antenna.  The list of other antennas is not changed
unless the new antenna occurs there.  In that case, the new antenna is
removed from the list and a new higher numbered antenna is added at the
end of the list.  The edit and secondary viewing areas will now contain
data from the new primary antenna.  The data for the new antennas are
immediately displayed on the TV unless the HOLD TV LOAD option was
selected.  In that case, the status code LOAD PENDING is shown and the
DO TV LOAD option is displayed and must be selected to see the new data.
C-----------------------------------------------------------------------
PLOT ALL CHANNEL
This option allows you to select the full channel/IF range of the data
as the range to be displayed in all windows.  The data for the new
channel range are immediately displayed on the TV unless the HOLD TV
LOAD option was selected.  In that case, the status code LOAD PENDING
is shown and the DO TV LOAD option is displayed and must be selected to
see the new data.
C-----------------------------------------------------------------------
SELECT FRAME
This option allows you to select the channel/IF range in the data to be
displayed in all windows using the TV cursor.  The data are first
re-displayed using the full channel range in the data (unless the full
channel range was already displayed).  Move the cursor to one end of the
desired channel range.  Hit button A or B to switch to setting the other
channel limit.  Note that you are allowed to make the channel range as
large or small as you want.  Displays that have more than one channel
plotted in a single horizontal TV pixel are harder to edit accurately
but will be quicker than having to do multiple frames when accuracy is
less essential.  Hit buttons A or B to switch to the other limit, hit
buttons C or D to select the frame and return to the menu.  The screen
is updated immediately, unless the HOLD TV LOAD option was selected.
In that case, the status code LOAD PENDING is shown and the DO TV LOAD
option is displayed and must be selected to see the new data.
C-----------------------------------------------------------------------
NEXT FRAME
This option causes the current frame to change to the next higher
channel range.  The "frame" is that channel range in the data
available for editing in the edit window.  The width of the frame is not
changed.  The screen is updated immediately, unless the HOLD TV LOAD
option was selected.  In that case, the DO TV LOAD option is displayed
and must be selected to see the new data.
C-----------------------------------------------------------------------
PREVIOUS FRAME
This option causes the current frame to change to the next lower channel
range.  The "frame" is that time range in the data available for
editing in the edit window.  The width of the frame is not changed.  The
screen is updated immediately, unless the HOLD TV LOAD option was
selected.  In that case, the status code LOAD PENDING is shown and the
DO TV LOAD option is displayed and must be selected to see the new data.
C-----------------------------------------------------------------------
SELECT IF
If you included more than one IF with adverbs BIF and EIF, this option
lets you select which one will be displayed and used in editing.  It is
simply a way of selecting a "frame" that is exactly a single IF.  If
there are more than two IFs you will be prompted to type the number of
the desired IF.  If there are just two IFs, the program simply switches
to the other one.  If all IFs were not read into memory at the start
of the job (due to lack of space), then the new IF is read from disk
into memory, replacing the current one.  If there are commands in the
FC table which apply to the IF just re-read the program will run a
REDO FLAGS operation automatically.  The new data are immediately
displayed on the TV unless the HOLD TV LOAD option was selected.  In
that case, the status code LOAD PENDING is shown and the DO TV LOAD
option is displayed and must be selected to see the new data.
C-----------------------------------------------------------------------
NEXT IF
This selects the next IF as the new current "frame'.    The new data are
immediately displayed on the TV unless the HOLD TV LOAD option was
selected.  In that case, the status code LOAD PENDING is shown and the
DO TV LOAD option is displayed and must be selected to see the new data.
C-----------------------------------------------------------------------
LAST IF
This selects the previous IF as the new current "frame'.    The new data
are immediately displayed on the TV unless the HOLD TV LOAD option was
selected.  In that case, the status code LOAD PENDING is shown and the
DO TV LOAD option is displayed and must be selected to see the new data.
C-----------------------------------------------------------------------
NEXT TIME
This option specifies that the pulse-cal data from the next time (if
any) be displayed and used in editing.  If CROWDED was true, then the
display of all times at once is also selected by this option.  The
screen is updated immediately, unless the HOLD TV LOAD option was
selected.  In that case, the status code LOAD PENDING is shown and the
DO TV LOAD option is displayed and must be selected to see the new
data.  The time of the pulse-cal data currently displayed and used in
editing is shown in the lower left corner of the screen along with the
other status flags.
C-----------------------------------------------------------------------
LAST TIME
This option specifies that the pulse-cal data from the previous time
be displayed and used in editing.  If CROWDED was true, then the
display of all times at once is also selected by this option.  The
screen is updated immediately, unless the HOLD TV LOAD option was
selected.  In that case, the status code LOAD PENDING is shown and the
DO TV LOAD option is displayed and must be selected to see the new
data.  The time of the pulse-cal data currently displayed and used in
editing is shown in the lower left corner of the screen along with the
other status flags.
C-----------------------------------------------------------------------
SHOW AMPLITUDE
This option specifies that pulse-cal amplitudes are to be displayed on
the TV and used in the editing.  The screen is updated immediately,
unless the HOLD TV LOAD option was selected.  In that case, the status
code LOAD PENDING is shown and the DO TV LOAD option is displayed and
must be selected to see the new data.
C-----------------------------------------------------------------------
SHOW PHASE
This option specifies that pulse-cal phases are to be displayed on the
TV and used in the editing.  The screen is updated immediately, unless
the HOLD TV LOAD option was selected.  In that case, the status code
LOAD PENDING is shown and the DO TV LOAD option is displayed and must
be selected to see the new data.
C-----------------------------------------------------------------------
SHOW RESID
This option specifies that pulse-cal residual phases are to be displayed
on the TV and used in the editing.  The screen is updated immediately,
unless  the HOLD TV LOAD option was selected.  In that case, the status
code LOAD PENDING is shown and the DO TV LOAD option is displayed and
must be selected to see the new data.
C-----------------------------------------------------------------------
SHOW ALSO AMP
This option specifies that pulse-cal amplitudes are to be displayed on
the TV in the secondary window.  The screen is updated immediately,
unless the HOLD TV LOAD option was selected.  In that case, the status
code LOAD PENDING is shown and the DO TV LOAD option is displayed and
must be selected to see the new data.
C-----------------------------------------------------------------------
SHOW ALSO PHASE
This option specifies that pulse-cal phases are to be displayed on the
TV in the secondary window.  The screen is updated immediately, unless
the HOLD TV LOAD option was selected.  In that case, the status code
LOAD PENDING is shown and the DO TV LOAD option is displayed and must
be selected to see the new data.
C-----------------------------------------------------------------------
SHOW ALSO RESID
This option specifies that pulse-cal residual phases are to be displayed
on the TV in the secondary window.  The screen is updated immediately,
unless  the HOLD TV LOAD option was selected.  In that case, the status
code LOAD PENDING is shown and the DO TV LOAD option is displayed and
must be selected to see the new data.
C-----------------------------------------------------------------------

