; BDF2AIPS
;---------------------------------------------------------------
;! script access to obit task BDFIn to translate EVLA data to AIPS
;# INFORMATION UV VLA
;-----------------------------------------------------------------------
;;  Copyright (C) 2010
;;  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
;-----------------------------------------------------------------------
BDF2AIPS  LLLLLLLLLLLLUUUUUUUUUUUU CCCCCCCCCCCCCCCCCCCCCCCCCCCCC
BDF2AIPS:  Stand-alone script to translate EVLA ASDM into AIPS
----------------------------------------------------------------
BDF2AIPS
Type: Stand-alone service program

Use:  BDF2AIPS is a script that will read an EVLA ASDM/BDF format data
      area and convert it to an AIPS disk file residing on one of the
      AIPS data areas of your current computer.  It does this by
      invoking a task in the obit software package written by Bill
      Cotton.  That package must be available on your system and the
      script ObitTalk must be in your path.  If you do not have obit,
      it may be obtained from www.nrao.edu and should install fairly
      easily.

      You should use BDFLIST first to list the contents of your
      ASDM/BDF format data.  It will provide information on
      "configuration number" which is essential in defining which data
      you wish to load.

      BDF2AIPS is a script that is run at the command line (i.e.,
      outside of AIPS).  It will ask you a few essential questions.
      They are:

      1. "BDF dir-path :"
            Give the full path name to the directory containing the
            ASDM and BDF data.  These data may be obtained from the
            NRAO archive.
      2. "AIPS usrnumb :"
            Give the AIPS user number you wish to use for these data.
      3. "AIPS outname :"
            Give the OUTNAME to be attached to the data file.
      4. "AIPS outdisk :"
            Give the disk number on which to write these data.
            OUTCLASS='UVEVLA'; OUTSEQ=0 will be used.
      5. "Only SpWs with this number of channels are selected, others
          ignored."
         "Default/blank is the #chans in 1st SpW. #chans select : "
            Enter 0 or just hit return and the number of spectral
            channels in the selected data will be those of the first
            data matching the other keywords.  This prompt will be
            needed when the number of channels is allowed to vary
            between spectral windows within a single "configuration".
      6. "ASDM array configuration to select : "
            Enter the "configuration number" >= 0 of the desired
            configuration (ASDMs often contain multiple sets of
            spectral windows of different size, frequency, etc.).
            Use BDFLIST to list the contents of your data to tell you
            which configuration number to select.
      7. "Only scans with this number of SpWs is selected, others
          ignored"
         "Default/blank is the #SpWs in 1st scan. #SpWs select : "
            This question is asked only if you answer question 6 with
            a simple carriage return.  Enter the number of spectral
            windows (IFs in AIPSpeak) of the data configuration you
            want to load.  0 or carriage return => any matching the
            other keywords.
      8. "Default band is the one in 1st PpW."
         "Recognized: 4,P,L,S,C,X,Ku,K,Ka,Q,W,blank"
         "Band select : "
            This question is asked only if you answer question 6 with
            a simple carriage return.  Enter the letter code for the
            desired band.  Note that bands overlap in the EVLA and the
            ASDM does not identify which receiver was used so there is
            some ambiguity.

       BDF2AIPS will make the output file including a number of
       standard AIPS extension files.  The CL table will have an
       interval of 15 sec and the data are not compressed.  The latter
       decision is made to avoid loss of dynamic range which could
       arise if there is significant RFI or a very strong spectral
       line.  Sources with identical names and coordinates but
       different CALCODEs will be treated as different.  This helps
       with calibration, but may cause difficulties when it comes time
       to run SPLIT.

       BDF2AIPS is a simple script and you may make a copy of it and
       modify any of the parameters in your private copy to suit
       yourself.  You may select output FITS format files instead
       (DataType) or change OUTCLASS (outClass), CL interval (calInt),
       compression (Compress), or source naming with CALCODEs
       (doCode).  If you select FITS output you must set x.outFile
       to the desired output path name.

       BDF2AIPS will write a log file and a run file in your /tmp area
       with the time included in the name.  This file is echoed to the
       screen as BDF2AIPS finishes and will remain in /tmp until it is
       automatically deleted by the operating system.
