As of Mon Jan 22 7:26:36 2018

DOVLAMP: Procedure to produce ANTAB-style file for phased-VLA


ASDMFILE                           Full path name to ASDM dir.
CONFIG            0.0              Select this "configuration"
INNAME                             In/output file name
INCLASS                            In/output file class
INSEQ                              In/output file sequence num
INDISK                             Disk # for in/output file
BIF               0.0      100.0   Lowest IF number 0=>all
EIF               0.0      100.0   Highest IF number 0=>all
CALSOUR                            FOR FLUX CALIBRATOR ONLY
REFANT                             Reference antenna
OUTTEXT                            Directory to put output file


Type: Procedure
Use: This procedure us usually used by NRAO operations to make
phased-VLA VLBI amplitude calibration files and is not intended for
general usage.  However people with phased-VLA data might want to
improve on their amplitude calibration by, for example, flagging the
switched power before running this procedure.

This procedure optionally loads a SDM (VLA) file and then makes
amplitude calibration information for the phased Jansky VLA (observed
after February 2011) when it is used as a VLBI element.  The procedure
processes the VLA only data from WIDAR and using the switched power
and optional primary amplitude calibrator to produce a text file that
can be loaded into the TY and GC table of the VLBI data with ANTAB.

      Type RUN DOVLAMP to define the DOVLAMP procedure.

  ASDMFILE...To load the data automatically from disk, set this.
             The full path name to and including the top directory of
             the ASDM/BDF data.  Two 64-character strings may be used
             for long names.  The ASDMFILE(2) will be appended to the
             non-blank portion of ASDMFILE(1) to generate the name
             used.  The code will also manage when ASDMFILE(1) begins
             with either '$xxxx/' or 'xxxx:' where xxxx is a logical
             (environment) variable.  The filename sent to OBIT will
             be the translation of $xxxx followed by a '/' followed by
             an remaining non-blank characters in ASDMFILE(1) followed
             by ASDMFILE(2).
             If ASDMFILE is set then CONFIG, INNAME, INCLASS and INSEQ
             must be set.
             If ASDMFILE is set and INCLASS='TYAPL' it is assumed that
             the data is loaded and ASDMFILE will be ignored.
  CONFIG.....ASDM files often contain more than one "configuration"
             numbered from 0 to N.  Configurations may differ in
             observing band, number of spectral windows, number of
             spectral channels in the spectral windows, etc.  Use
             BDFLIST to see what configurations are in your data set.
             DOVLAMP can load only one configuration at a time.
  INNAME.....The name of the file to be processed.  If ASDMFILE is set
             then this will be the output name.
  INCLASS....The class of the file to be processed.  If ASDMFILE is set
             then this will be the output class.  If INCLASS='TYAPL'
             then it is assumed that the data has already been loaded
             and TYAPL has been run so the data will not be loaded
             even if ASDMFILE is set, and TYAPL will not run it again.
  INSEQ......The sequence number of the file to be processed. Zero
             defaults to the highest sequence number of a file
             matching INNAME, INCLASS, and INDISK.   If ASDMFILE is
             set then this will be the output sequence.
  INDISK.....The disk drive number of the file to be corrected.
  BIF........First IF to copy with UVCOP then process. 0=>all.
  EIF........Highest IF to copy. 0=>all higher than BIF
  CALSOUR....Primary flux calibrator, if present in observations, if
             left blank a primary flux calibrator will be searched for
             in the SU table.  If CALSOUR(1)='NOCAL', then a
             calibrator will  not be searched for.
  REFANT.....Reference antenna.
  OUTTEXT....Directory to put output file.  Path or environmental
             variable will work.  The name of the output file is
             automatically generated.  The path must be shorter than
             27 characters (including final /).


DOVLAMP:            Procedure to create a-priori calibration for the
                       phased VLA
Documentor:         Amy Mioduszewski

This procedure is intended to produce the amplitude calibration for
the phased VLA (after February 2011) when it is used as a VLBI
element.  The VLA data can be loaded from disk, if needed.  It
produces a text file that can be loaded with ANTAB.

The main task used in DOVLAMP is VLAMP, which takes the switched power
converts that to the system temperature (Tsys) and then takes the
harmonic sum of the Tsys over all the antennas multiplied by the
amplitude in the first CL table.  The amplitude in the first CL table
has the gain curve polynomial in it.  The "Gain" (which really isn't
the gain because some of that is folded into the harmonic sum of the
Tsys) is the sum of the sensitivities of the antennas in the GC table.
Then VLAMP makes the ANTAB style text file that can be loaded into the
VLBI data.

DOVLAMP adds some steps in order to improve the calibration.  If a
primary amplitude calibrator was observed (3C286, 3C48, 3C147, 3C138
or 3C295) then it will be used to improve the calibration.  This
calibrator can either be specified in CALSOUR or, if CALSOUR is blank,
will be found automatically in the SU table.

If INCLASS='TYAPL' then it is assumed that TYAPL has been run and the
procedure will not run it again.  This is useful if there has been an
problem later in the procedure since the run of TYAPL is usually the
longest part of the procedure.

Basic steps of procedure:

0) Perform basic checks on inputs

1) Determine if file needs to be loaded (i.e., is ASDMFILE set)
   --Yes, run BFD2AIPS, user INNAME, INCLASS and INSEQ as output name
   --No, run rest of script on file set in INNAME, INCLASS and INSEQ

2) If BIF and/or EIF are not equal to 0 then
   --run UVCOP to copy BIF-EIF and proceed with UVCOPed file

3) If INCLASS is *not* TYAPL then
   --run TYSMO to clip bad points in SY table
   --run TYAPL

From now on everything is done to the TYAPL file:
4) If CALSOUR is not set, search for standard VLA flux calibrator
   (3C48, 3C138, 3C147, 3C286 or 3C295) in the SU table.

5) If flux calibrator exists in data then:
   --Load model for flux calibrator is one exists in the data
   --run SETJY on flux calibrator
   --run CALIB on flux calibrator
   --zero phases on CALIB solutions (want amp only)
   --run CLCAL to apply amp corrections to first CL table

6)  Run VLAMP to create ANTAB style file.