MRGSUB MRGSUB subtracts the contribution of a model from the visibility data in a MERGE-format file. The primary applications of this program are (a) plotting the difference between a dataset and a model (use VPLOT or VISPLOT on the output file); and (b) "difference mapping:" subtract a model after self-calibration but before making an image. Algorithm: The model visibility is computed at each (u,v) point specified in the input file. If OPCODE=VECTOR (the default) is specified, the complex visibility in the output file is the complex visibility from the input file minus the complex model visibility. If OPCODE=SCALAR is specified, the amplitude in the output file is the amplitude from the input file minus the model amplitude, and the phase in the output file is the phase from the input file minus the model phase (modulo 360 degrees). The closure phases in the input file are discarded; if you want to compute the difference closure phase, run program ADDCLO on the output from MRGSUB. For OPCODE=SCALAR, the errors on the data points are left unchanged. For OPCODE=VECTOR, the errors on the phases in the output file are computed as (amplitude error / new amplitude) [radians]. Example $ mrgsub INPUT = T1.MRG OUTPUT = T2.MRG MODFILE = T1.MOD OPCODE = V / Parameters Parameters INPUT, OUTPUT, and MODFILE must be specified; the others are optional. The parameters names can be abbreviated to uniqueness (minimum match). All the parameters are character strings, but they need not be enclosed in quotation marks unless they include commas or blank spaces. End the list of parameters with a slash (/). INPUT = "filename" : the name of the input merge-format file (e.g., INPUT = CITSCR:[TJP.B2]T1.MRG). This parameter must be specified; there is no default. OUTPUT = "filename" : a name for the output file created by MRGSUB. This parameter must be specified; there is no default. MODFILE = "filename" : the name of the input model file (e.g., a clean-compnents file from CLEAN or a model from MODELFIT). This parameter must be specified; there is no default. HISTORY = "text" : a character string to be written in the "history" MRGSUB Page 2 section of the output file; this is optional. OPCODE = "VECTOR" or "SCALAR" (minimum match, case-insensitive): specify VECTOR for vector subtraction of complex model visibility from complex input visibility; specify SCALAR for scalar subtraction of model amplitude from input amplitude and model phase from input phase. The default is VECTOR. Limitations 1. The maximum number of stations is 40. 2. Only MERGE format 1 files are acceptable (at present). 3. The difference closure phases are not computed (use ADDCLO). History Version 1.0: 1989 Mar 20 - new program (T.J. Pearson). Version 1.1: 1990 Nov 13: remove unused variables. Version 2.0: 1991 Jul 17: add OPCODE for vector/scalar subtraction. Version 2.1: 1993 Apr 1: accept all model component types; calculate new phase errors for OPCODE=VECTOR.