PROCEDURE for getting PHOT of ASTROMETRY fields (updated 23 Mar 2023) You will need to have open: Linux terminal, iraf, and ds9. The goal is to get the photometry for ONE FIELD for use in the astrometry reductions. 1. Display a frame from the target's astrometry observations and note the layout of the field. Consider taking a screenshot. Open the setup page for the target, located here: /nfs/recons2/CTIOPI.setups/ Note the exposure-setting star (with a box around it). This is the brightest star you can use for the ref field. 2. Locate the nights on which photometry were done for this field. This can be done in a few ways, for example with grep: grep 'L424-030' catalog.phot.2020.0925 Look at the filenames (far left column) to get the dates. Only consider dates where all 3 filters (VRI) were reduced for this system. 3. If there are multiple nights with photometry, you must choose the best one. Choose a night and navigate to its location. Phot frames are located at: /nfs/recons3/phot.0.9m/ They are organized by observation date, and within each date there are folders 'standard' and 'science' to organize the targets. Astrometry targets will be under 'science'. CHOOSING THE BEST NIGHT: A good phot night satisfies these requirements (given in order of importance): - Same pointing/layout as the astrometry field (refer to your step 1 images). - Good signal-to-noise in most potential ref stars (>5000 counts). - No potential ref stars saturated or altered by cosmic rays on their PSFs. 3. Once you have selected your phot night, make a folder within that night's 'science' folder. Please name your folder after your target. Copy these things from the phot night's folder into your new target folder: - that target's V, R, and I frames - the file standard.coeff - the file science.cfg --- if this file is missing, copy this one: /nfs/recons3/phot.0.9m/default/science.cfg (* Now we are done with steps 1-4 in the original reduction manual *) 4. Go into your new target folder and prepare for photometry. Make a list of frames: ls *.o.fits > listfits 5. Display and imexam each frame and choose ONE set of ref stars that is reasonable in ALL 3 frames. Refer to the instructions on choosing a ref field. Label your ref stars with numbers in ds9 and print this labeled image to a file. Instructions for choosing refs are in steps 2-7 here: http://astro.gsu.edu/~vrijmoet/reductions.documentation/choosingrefs.txt YOU MAY NOT choose any refs with cosmic rays on their PSFs. (nearby is ok, as long as they are off the PSF itself) 6. With IRAF, repair any cosmic rays near your ref stars (within 17 px). (A) With epix: Aa. imexam the image and capture the cosmic ray in a contour plot, so you can get its pixel coordinates. Ab. epix the image and enter the cosmic ray's coordinates when prompted. Ac. Enter the MEDIAN value. Pay attention to the surrounding values to make sure you're entering a value that makes sense. If you get in trouble, exit with ctrl-c. (B) With crutil/cosmicray: (* WARNING-- EHV hasn't tested this *) Ba. Load task: crutil Bb. Load 'cosmicray' and enter the image as the input file. You can output to the same file. (* Now we are done with steps 1-7 in the original reduction manual *) 7. Once you have selected ref stars, identify any that will need an aperture correction. If a star has a neighbor so nearby that their PSFs overlap, it will need an aperture correction. This correction will estimate what the phot WOULD be without the near neighbor. If a neighbor is not overlapping but still within the 17 px aperture, you can probably use a smaller aperture with no correction. Stars with near neighbors are not advisable as astrometry refs, but sometimes they are better than nothing. You will need to do phot for these stars separately. You may find it helpful to mark these special-case stars with a different color in ds9. -------------------------------------------------- FOR THE STARS WITH NO APERTURE CORRECTIONS NEEDED: -------------------------------------------------- Label your ref stars now in ds9, if you haven't already! 8. IRAF: Run apercorr option 3. Verify that the aperture is 7 (arcseconds) using :e on the photpar field. Exit with ctrl-d. Tag your refs and the pi star. Remember to tag the pi star LAST. Use ctrl-z to move to the next frame. When you finish apercorr, it will tell you to do mknobsfile next. Ignore that! Go ahead and continue following these instructions instead. 9. IRAF: Run mkimsets. Tradition is to label the imsets output file as starname.imsets. For example: l424030.imsets In the 'field name' prompt, enter the expected short name for the system. For example, for L424-030 this short name is l424030. 10. IRAF: epar mknobsfile and make sure the aperture correction line is blank. Make sure the imsets line refers to the starname.imsets file you created in step 9. Then run mknobsfile. Tradition is to label the output file as starname.obs, for example: l424030.obs After this step, open the obs file and verify there are no INDEF lines. Sometimes a position shift between frames causes some stars in some frames to be listed as additional stars at the bottom, with many INDEF lines for the 'missing' frames (which in reality are already listed above). Use the coordinates given for each measurement to reconcile these 'additional' stars with their other frames above. Delete the INDEF lines. (EHV 2021.05.25 --- this explanation needs clarification/cleanup) 11. Reconcile your normal-aperture starname.obs and your aperture-corrected aperture.obs, if necessary. This is described in Step 19 below. If you did no aperture corrections, skip this step. (* Now we are done with steps 1-10 in the original reduction manual *) 12. IRAF: run evalfit. Make sure the imsets and obs files refer to the ones you created in steps 9 and 10. 13. Make the phot file using the evalfit output: cp evalfit.out l424030.phot Then edit the phot file to be in the expected format: 13a. delete the first 17 lines 13b. in column 1, add a space before any star numbered less than 10 13c. delete the error columns 13d. make sure there are exactly 2 spaces between each phot column Two example lines (pipe/line on left = edge of file): | LTT1234-9 14.218 14.083 13.921 |LTT1234-10 12.832 11.368 10.028 14. Copy the starname.phot file and setup ps file to the astrometry directory for this target. -------------------------------------------------- FOR THE APERTURE CORRECTION STARS: -------------------------------------------------- (EHV 2021.05.21 --- this section needs more details) 15. Make a new folder within your target folder, put the fits there. 16. Choose your smallap, then do apercorr op 1,2,3 (only on those stars that need it). 17. IRAF: run mkimsets as in step 9 above, or copy that starname.imsets here. 18. IRAF: epar mknobsfile and change the aperture correction line to point to file 'aperture.corr'. Then run mknobsfile as usual. 19. Edit the starname.obs file to correctly number the stars, and edit the starname.obs file in the upper folder to also correctly number the stars. When you're done, the star names in both *.obs folders should be DIFFERENT. If they're not, the next step will get confused. Then copy those stars' lines to the main obs file in the upper level folder. 20. Go back to the upper level folder and run evalfit.