MATCH and MASTER. MATCH accepts the names of photometry files created by DAOPHOT. Give it first the name of the ``best'' frame of the field --- the one for which the .FET file is defined. It will then seek your approval for the name of an output file. Once the name of the output file has been specified, it will ask for the names of the remaining files for that field, one by one. From each input file it will extract the 30 brightest stars, and attempt to cross-identify them with the 30 brightest stars from the first frame, by the method of matching triangles (see Stetson 1990, ``The Techniques of Least Squares and Stellar Photometry with CCDs,'' Chapter 5, and Groth 1986 AJ, 91, 1244). When it thinks it has cross-identified ``enough'' stars, it will type out a table containing the number of different triangles in which each star of frame n corresponds with a given star of frame 1, followed by the provisional transformation equations based on the stars it thinks it has cross-identifed. These equations are in the form x(1) = A + C*x(n) + D*y(n) y(1) = B + E*x(n) + F*y(n) Look at these equations and decide whether they look reasonable: for instance, if both frames were taken with the same telescope and the camera was not rotated in between, then C approx = F approx = 1 and D approx = E approx = 0. If they were taken with the same telescope and the camera was rotated then C approx = F and D approx = E, and C**2 + D**2 approx = 1. MATCH can match up frames from different filters, and frames from different telescopes (including some from prime foci with some from Cassegrain foci). The major restriction is that the program tends to fail if the brightest 30 stars between the two frames have fewer than 5 or 6 in common. That is, the overlap on the sky should be at least 25 or 30 percent, and the exposure times should not be such that the brightest stars in one frame are unmeasureable in the other. If these conditions are not met, then I suggest you generate the approximate transformation equations by measuring positions on your image display. I include L106_550.MCH --- a sample file generated by MATCH. MASTER solves two problems simultaneously. First, given the approximate transformation equations that relate positions in all the frames of a given field to the positions in the best frame, cross-identify all stars possible (not just the brightest 30, but every star in every frame). Second, given a set of provisional cross-identifications, refine the estimates of the transformation equations. MASTER solves these two problems iteratively, see-sawing back and forth from one to the other. When you run MASTER the first thing it asks you for is the name of the .MCH file which you have presumably just created with MATCH. MASTER then reads in the positions, magnitudes, and standard errors of all the stars in all the files, packs them as tightly as it can in computer memory, figures out how much space is left, and then tells you how big a final ``master list'' it has room for. It then asks for various constraints from you on when a star is to be regarded as ``real'' --- and kept --- or ``a false detection'' --- and discarded. 1. First, how many frames was the star detected in? You must enter three numbers, separated by commas or spaces, in the following order: a. Minimum number of frames. A star absolutely must be detected in at least so many frames, or it is discarded. If you are willing to keep detections that were seen only once, and did not appear in other frames of the same field, you may set this to 1. b. Minimum fraction of frames. Of those frames that a star may reasonably be expected to appear in (its average position, transformed to the coordinate system of this frame falls within this frame; its average magnitude, offset to the magnitude system of this frame is reasonably bright compared to the magnitude limit of this frame), it actually is found in at least this fraction of them. The fraction must be between 0.0 and 1.0, inclusive. c. Enough frames. Any star which appears in at least this many frames will be accepted, regardless of how many frames it could have been found in. Example: let's say you have 17 frames of some field. When MASTER asks you Minimum number, minimum fraction, enough frames: you answer 2, 0.6, 5. Then if the star OUGHT to be visible in 1 frame reject 2 frames accept if it's in both (2 > 1.2) 3 " accept if it's in at least 2 (2 > 1.8) 4 " accept if it's in at least 3 (3 > 2.4) 5 " accept if it's in at least 3 (3 = 3.0) 6 " accept if it's in at least 4 (4 > 3.6) 7-17 " accept if it's in at least 5 by suitable choices of these limits, you can do a reasonable job of defining ``real'' objects for most combinations of spatial and magnitude overlap among the frames. 2. Reject any star with too uncertain a magnitude. MASTER asks for Maximum sigma: and you type in a number. A star will be rejected if its mean instrumental magnitude, based on a weighted average of all available observerations corrected to the magnitude scale of the ``best'' frame is larger than the number you type in. 3. Then you specify how complicated a transformation you want. If your frames for this field were all taken one right after another on the same night with the same telescope, then you might answer "2" and MASTER will solve only for mean offsets A and B among the various frames. If you answer "4" MASTER will solve for the four constants in these equations: x(1) = A + C*x(2) -/+ D*y(2) y(1) = B + D*x(2) +/- C*y(2) which allow for arbitrary rotation angles and scale differences, as well as translations of the origin. The -/+ and +/- also allow for a flip, as when matching a frame from prime focus with one from a Cassegrain focus. If you answer "6" MASTER solves for all of A, ..., F in the equations above. 4. Finally you specify a match-up radius. After having transformed the stars in frame n to the coordinate system of the master frame, stars will be cross-identified only if their positions agree to within that tolerance. Furthermore, they will agree only if that is the closest otherwise unassigned star in frame n to that star in the master list, and only if that is the closest otherwise unassigned star in the master list to that star in frame n. Multiple cross-identifications of the same star in one list to different stars in the other are not allowed. In the beginning, the transformation equations from MATCH are only approximate (based on some small subset of 30 stars). So set the match up radius large ... maybe 5 or 10 pixels. MASTER will go through all the star lists and match as many stars as it can to stars appearing in the master list (initially equal to the list of stars found in frame 1); many of these provisional cross-identifications will be spurious, but legitimate cross-identifications will outnumber them. MASTER then uses robust techniques to estimate corrections to the transformation constants, and approximate magnitude offsets. At the same time it will have collected and cross-matched as many stars as many stars as possible from frames 2, ..., N that don't appear in frame one. It will then go through this enlarged star list and reject any stars that don't meet the acceptance criteria above. It will type out for each frame the rms residuals in x and y, the values of the transformation parameters, the approximate magnitude offset and its standard deviation, and the number of stars used. It will then type out the current number of stars in the master list and ask for a new limiting match-up radius. Because the transformations are (presumably) more accurate now than before, you specify a somewhat smaller match-up radius, and MASTER goes through the whole thing again. Keep an eye on the rms residuals of the x- and y-positions for each frame; keep reducing the size of the match-up radius iteration by iteration until you are specifying maybe something like 5 or 6 times the typical rms positional error (recalling that the positions of the faintest real stars will be much poorer than the positions of the ``average'' star). Keep entering this same radius for several more iterations, until the number of stars in the master list repeats itself. For instance, for the successive iterations you might specify radii of 5, 4, 3, 2, 1, 1, 1, 1. When the master list converges, enter 0 as the radius. MASTER now has a self-consistent list of legitimate cross-identifications (at least, legitimate according to the criteria you yourself have specified), plus the transformation equations that they imply and that imply them. MASTER now asks if you want the stars renumbered. If you answer ``Y'', it will sort the master list by mean magnitude, and renumber the stars from 1 to N. MASTER offers a variety of output options. 1. A file with mean magnitudes and scatter? If you answer ``y'' it will correct all observed magnitudes for each star to the system of frame 1, take a robust average, and write out to a disk file the resulting mean magnitude, standard error of the mean, the ratio of the magnitude scatter observed to that expected from the individual standard errors, and the root-mean-square chi value. 2. A file with corrected magnitudes? If you answer ``y'' it will correct all observed magnitudes for each star to the system of frame 1, and write them all out to a disk file. You can then search for variables (for instance), using your own algorithms. 3. A file with raw magnitudes and errors? If you answer ``y'' it will simply write out all the instrumental magnitudes observed for each star. 4. A file with the new transformations? If you answer ``y'' it will write out a new .MCH file with the latest set of transformation constants, plus the mean magnitude offsets. 5. A file with the transfer table? If you answer ``y'' it will write out a file which contains where each star in the master list appears in each of the input files: Star 1 in the master list is the 37th star in frame 1, it doesn't appear in frame 2, it is the 1193rd star in frame 3, ... You may do with this what you can. I'm not yet prepared to distribute my programs which use this file. 6. Individual .COO files? If you answer ``y'' it will invert the transformation equations and project each star in the master list to where it SHOULD have appeared in each of the CCD frames. It will then create new .COO files, so that if you want you can go through aperture and profile-fitting photometry with exactly the same star list for every frame. A star will not be written to a .COO file if it falls outside the actual area of that frame, however. 7. Simply transfer star IDs? If you answer ``y'' it will create verbatim copies of all of the input files with only the ID numbers changed, so that the same star has the same ID number in all frames. If you have not used the renumber option above, the ID number will be transferred from frame 1 to each of the other frames, except that stars in the master list that are not in frame 1 are given consecutive numbers starting with 50001. The new files are given the same filenames as the input files, with extensions .MTR. ================================================================================