SUBROUTINE DATCAL (IA1, IA2, ISUBA, ICORID, TIME, TMINT, VIS, * DROP, IERR) C----------------------------------------------------------------------- C! Applies calibration to data C# Calibration C----------------------------------------------------------------------- C; Copyright (C) 1995-1999, 2007, 2009-2012, 2015 C; Associated Universities, Inc. Washington DC, USA. C; C; This program is free software; you can redistribute it and/or C; modify it under the terms of the GNU General Public License as C; published by the Free Software Foundation; either version 2 of C; the License, or (at your option) any later version. C; C; This program is distributed in the hope that it will be useful, C; but WITHOUT ANY WARRANTY; without even the implied warranty of C; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the C; GNU General Public License for more details. C; C; You should have received a copy of the GNU General Public C; License along with this program; if not, write to the Free C; Software Foundation, Inc., 675 Massachusetts Ave, Cambridge, C; MA 02139, USA. C; C; Correspondence concerning AIPS should be addressed as follows: C; Internet email: aipsmail@nrao.edu. C; Postal address: AIPS Project Office C; National Radio Astronomy Observatory C; 520 Edgemont Road C; Charlottesville, VA 22903-2475 USA C----------------------------------------------------------------------- C Applies calibration to data. C Inputs: C IA1 I First antenna number C IA2 I Second antenna number C ISUBA I Subarray number C ICORID I Correlation id. C TIME R Time of record (days) C TMINT R Integration time for current vis. rec. (days) C VIS R(*,*) Input visibility array (not yet converted to C output form. C Inputs from common /SELCAL/: C DOCAL L If true do antenna calibration. C DOBL L If true do baseline calibration. C DOWTCL L If true calibrate weights. C CURCAL R(*) Current calibration information. C Values in order: C By antenna (NUMANT) C By IF (EIF-BIF+1) C By Polarization (NUMPOL) C Real part, imaginary part, C cos(delta), sin(delta), rate C Where delta is the phase change between C channels and rate is the fringe rate in C radians/day C LCUCAL I Number of values in CURCAL per entry (5) C POLOFF I(4,2)Offsets from the beginning of an IF entry in C CURCAL for a given polarization. The first C dimension is the polarization pixel number and C the second is the antenna number of a baseline C (e.g. first or second = 1 or 2). C CALTIM R(3) Time of two cal. entries; third value is C current lowest upper time C LCALTM R Time of current calibration. C BLFAC R(*) Baseline dependent factors including GMMOD. C Indexing scheme: an entry defined by ant1