MERGE Program MERGE takes the output disk datasets from PHASOR and sorts them into a standard "MERGE" format accepted by the later programs (VISPLOT, VLBEDIT, LIST etc.). The program sorts the data into temporal order, so that data from all baselines at a given time are adjacent, and then calculates the closure phases. The output dataset consists of a Header, followed by data records; each data record contains all the amplitudes, phases and closure phases from one UT, together with their errors. The input files for MERGE may be either PHASOR output datasets or MERGE-format files or a mixture of the two. MERGEing MERGE-format files allows one to change the station order or to remove or add stations. To run the program use the command MERGE (defined in VLB:LOGIN.COM): $ MERGE The program asks for 1. Output file name, for the new MERGE file (eg 3C84.MRG). 2. Control parameters: free-format, ended with /. The important parameters are SOURCE, STATIONS and TITLE (see below). Other data-selection parameters are FREQUENCY, BANDWIDTH, and CHANNEL. 3. Input file name(s): one or more PHASOR- or MERGE-format files. The list of file names may include wild-card constructions according to normal VMS rules; eg [TJP]*.FPR finds all files with file type .FPR in directory [TJP]. MERGE determines whether each file is a Phasor- or Merge-format file, and ignores those which are neither. The list of file names is terminated by a blank line or end of file (control-Z); in a command procedure it is terminated by a line with a $ sign in column 1. Note that the order of the files is important if the same data were processed twice; if MERGE finds data for the exactly the same time and baseline in two different files, it takes the data it finds last. When wild cards are used, the files are processed in alphabetical order. The parameters are: SOURCE = "source name" : tells the program which source to select; others are ignored. The name must be exactly the same as that used on the Processor, unless ALIAS is specified. If no source name is specified, the first source found in the input files is processed, and all other sources are ignored. For SOURCE="ALL", see the notes below. ALIAS = "alias name" : useful if the same source was processed with MERGE Page 2 two different names, eg SOURCE="3C371" ALIAS "3C 371". STAT[IONS] = "station1","station2",... : selects specified stations (up to 15). The station names MUST be specified. NEWSTAT[IONS] = "station1","station2",... : a list of new station names to be used in the output file in place of those named in the input file; specify NEWSTATIONS only if you want to change station names. If you only want to change one or two names, use subscripts, eg NEWSTATION(3) = "HAYSTACK" would provide a new name for the third station specified in the STATIONS list. TITLE = "arbitrary title for new dataset" : optional. FLUX = number : (Jy) This is not needed for MERGE but may be needed by later programs (eg CAL). CLOSE = "NONE" or "ORIGINAL" or "CALCULATE" : indicates what should be done with closure phases. IF "NONE" is specified, the output file will contain no closure phases; if "CALCULATE" is specified, the closure phases will be calculated from the input visibility phases; if "ORIGINAL" is specified, the closure phases will be copied from the input files. "ORIGINAL" is only applicable to input MERGE files. The default is "CALCULATE". The value may be abbreviated to "N", "C", or "O". FRINGE-RATES : extract fringe-frequencies instead of amplitudes. FREQ[UENCY] = freq (MHz) : this is a selection parameter for input phasor files: only files with a central frequency within +/- BANDWIDTH (see below) of the specified frequency will be merged. The default is the frequency in the first file read. BAND[WIDTH] = tolerance (MHz) : this is the error allowed in FREQUENCY; the default is 10 MHz. CHAN[NEL] = channel-number : select data from the specified frequency channel (pair-model) of the input phasor files. The default is 1; numbers 1-8 are allowed. Usually files contain only one frequency channel. The following is an example of the MERGE dialog: $ MERGE MERGE extracts visibility data for one source from concatenated PHASOR files (Version 5.3 - 1982 December 21) Output (MERGE) file name: 3C84.MRG Control parameters (SOURCE, STATIONS, TITLE, etc): * SOURCE="3C84" ALIAS "0316+413" * STATIONS "BONN","HSTK","NRAO","FDVS","OVRO","HCRK" * TITLE "Experiment P16 1981 May 5-8" MERGE Page 3 * FREQ = 5010 * CLOSE = "C" * / List input file names - wild cards accepted. End list with blank line or ^Z. Input file: [TJP.MAY81]*.FPR Input file: [TJP.MAY81]SPECIAL.MRG Input file: ^Z Notes: 1. It is usually convenient to run MERGE from a command file generated by the program AUTOMERGE (q.v.) rather than directly from a terminal. AUTOMERGE scans the phasor files to find the source and station names, which saves some typing. 2. It is possible to recover from a processing error in which no source name was specified in the Processor load blocks. If you have this problem, specify the correct source name as the SOURCE parameter and for ALIAS specify "@@@@@@@@@@@@": a string of 12 characters which are not @-signs but ASCII null characters (control-@); you may need to use a clever text editor to insert these into the command file! 3. If SOURCE="ALL" is specified, all the data in the input files is merged, regardless of source name. This is not usually useful, but can be used, say, to prepare a Visplot plot showing source and calibrators on the same graph. Program history: Version 1: 1979 May 1 Version 2: 1980 Sep 2 Version 3.0: 1981 June 9 15 stations Wild-card input Version 3.1: 1981 July 21 Correct bug in IGNORE Version 4.0: 1981 December 8 Merge MERGE-format files Version 4.1: 1982 Feb 26 New closure-phase options Version 4.2: 1982 Jul 5 Correct bug in MRGMAP (arrays dimensioned 0) Version 5.0: 1982 Sep 12 Add parameter CHANNEL for channel selection Version 5.1: 1982 Sep 27 (D.L. Meier) Add parameters FREQUENCY and BANDWIDTH for frequency selection. Version 5.2: 1982 Oct 7 (D.L. Meier) Add parameter NEWSTATIONS to allow possible renaming of stations. Correct bug in checking 16-character station names. Version 5.3: 1982 Dec 21 Eliminate need for /MERGE, /PHASOR qualifiers; increase array MERGE Page 4 size; add SOURCE="ALL" option. T.J. Pearson, 1982 December 21