; SCANTIME
;---------------------------------------------------------------
;! Returns time range for a given scan number
;# PROCEDURE UTILITY
;-----------------------------------------------------------------------
;;  Copyright (C) 2000-2001
;;  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
;-----------------------------------------------------------------------
;---------------------------------------------------------------
SCANTIME  LLLLLLLLLLLLUUUUUUUUUUUU CCCCCCCCCCCCCCCCCCCCCCCCCCCCC
SCANTIME: Procedure to return time range of a given scan.
USERID        -32000.0     32000.0 User ID.
                                     0 => current user
                                     32000 => any user
INNAME                             Name of data file
INCLASS                            Class of data file
INSEQ              0.0      9999.0 Sequence number of data file
INDISK             0.0        15.0 Disk number of data file

          Give the scan number as an immediate argument. For
          example, SCANTIME(3)

          SCANTIME is defined in the VLBAUTIL run file.
----------------------------------------------------------------
SCANTIME
Type: Procedure
Use:  SCANTIME returns the time range covered by a scan listed in an index
      table as an 8-element array value having the same form as TIMERANG.

      Type RUN VLBAUTIL before using ANTNUM for the first time

Adverbs
  USERID......User ID of owner of data.
                    0 => current user,
                32000 => any user.
  INNAME......The name of the data file. Wildcards allowed.
  INCLASS.....The class of the data file. Wildcards allowed.
  INSEQ.......The sequence number of the data file.
                0 => highest
  INDISK......The disk number of the disk that holds the data file
                0 => any
----------------------------------------------------------------
SCANTIME:         Procedure to look up scan time range.
Documentor:       Chris Flatters
Related Programs: LISTR, VLBAUTIL

SCANTIME returns the timerange covered by a scan defined by an index table.
It may be used to set the TIMERANG adverb for a single scan given a scan
number as shown by LISTR with OPTYPE = 'SCAN' as in the following example.

GETN 3
TIMERANG = SCANTIME(5)

To have SCANTIME print the scan time range to the terminal type, for the
3rd scan as an example:
TYPE SCANTIME(3)

The starting time of the scan is rounded up to the nearest second and the
ending time of the scan is rounded down to the nearest second so that time
returned time range is wholly contained within the scan.

If the argument specifies a scan that is not in the index table then the
returned value is all zeros.
