NOTES AND DOCUMENTATION ABOUT "EWIMH" TASK. ================================================================= 1) OVERVIEW: This code is built on a core written by Taft Armandroff in the mid- 1980s. It was improved by Andy Layden around 1990 to operate in the IRAF environment (ie, on spectra in *.imh format). It is conceptually simple: a file is read in that contains the low- and high-wavelength limits of a "feature band", along with the low- and high-wavelength limits of two "continuum bands" (one located to lower wavelengths, and one to higher wavelengths, of the feature of interest). The average flux within each continuum band is computed using a sigma-clipping algorithm (to ignore cosmic rays and bad pixels), and a line is drawn between the two average fluxes. This line defines the "upper" boundary (pseudo-continuum) of the area to be measured, while the "lower" boundary is defined by the spectrum, and the "left" and "right" boundaries are set by the low- and high-wavelength limits of the feature band. The area, or equivalent width (in Angstroms), is computed numerically. A more complicated procedure is available for measuring lines like Ca II K. See Layden (1993, Ph.D. thesis) for details. The input spectra are assumed to be continuum-normalized to a value of unity (eg, using IRAF's "continuum" task). The code runs as an IRAF script, and uses the IRAF/GRAPH facility to produce a plot for each spectral line in the input window file, EWIMH.WIN. It appends the new data to the end of the file EWIMH.LOG. ================================================================ 2) ORGANIZING AND COMPILING THE PROGRAM: I recommend setting up the program in the following directory structure. I have a directory where I keep all my commonly-used fortran programs: /b1/layden/PROGS In it, I make a subdirectory for the EWIMH programs and scripts mkdir /b1/layden/PROGS/EWIMH Put a copy of all the files here, including this .doc file, and a sample windows file (ewimh.win). Edit the script "ewimh_clip.cl" so that path to the program ewimh_clip.e is correct for you. The fortran program must be compiled from within IRAF, so it links to subroutines in the IRAF libraries that read *.imh files: cl> fc ewimh_clip.f You need to define "ewclp" as a task in your IRAF login.cl file. Change directories to your home directory, and using your favorite editor, add the following line to login.cl (change the path to suit your site!): task $ewclp = /b1/layden/PROGS/OLD/EWIMH/ewimh_clip.cl Logout of IRAF and reenter, so that the new script is recognized. ====================================================================== 3) RUNNING EWIMH: * Change directories to the place where your spectra (*.imh) reside. Copy the ewimh.win file to there: cp /b1/layden/PROGS/EWIMH/ewimh.win . * EWIMH uses image header keywords, ONE OF WHICH IS NONSTANDARD!! So, before running the EWCL, do the following to all images: hselect *.imh i_naxis[1] (to check the number of pixels in each file; probably it is the same in all) hedit *.imh np2 NNN add+ (to add the keyword np2, with the value NNN, derived from the previous line) If you get the following error, you probably forgot this step: mapunit: [124] too many open files logical unit 5, named 'stdin' lately: reading sequential list external IO part of last format: ext list io part of last data: |Segmentation fault * The logfile, EWIMH.LOG, is a dumb file... it doesn't record the wavelength feature file as EWIMH.FOR did. For a given application, you may want to do the following: cp ewimh.win ewimh.log emacs ewimh.log, and cut/paste in the column header: n feature line[A] rv[km/s] snr ew[A] {wav(AVC1) wav(AVC2)} This starts you off with a fresh file with this info included. When done, rename the EWIMH.LOG file to something else, so as not to write more stuff at the end the next time the program is run. The columns in EWIMH.LOG are: n = nth feature (spectral line) in the ewimh.win file feature = character string describing the feature line[A] = central wavelength of feature rv[km/s] = value of radial velocity you input (program shifts wavelengths of feature and continuum limits for this) snr = signal to noise ratio, computed from points in continuum bands ew[A] = the measured equivalent width, in Angstroms {wav(AVC1) = the averaged wavelength of the short-wavlength continuum band, when in moveable continuum band mode. wav(AVC2)} = the averaged wavelength of the long-wavlength continuum band, when in moveable continuum band mode. * OK, time to run EWIMH! At the IRAF prompt, type ewclp It may give you some errors the first time you run it: Warning: Attempt to delete a nonexistent file (tmp.1) Warning: Attempt to delete a nonexistent file (tmp.2) Warning: Attempt to delete a nonexistent file (tmp.3) Warning: Attempt to delete a nonexistent file (tmp.4) Warning: Attempt to delete a nonexistent file (tmp.5) EWIMH: opening feature window file `ewimh.win` EWIMH: appending to output logfile `ewimh.log` Enter image name (eg obj102f): mystar Enter the star`s radial velocity [km/s]: 32 Where mystar is the name of the image (eg mystar.imh), and 32 km/sec is the star's radial velocity. The program measures the equivalent width, spits it to the screen and to EWIMH.LOG, and presents you with a IRAF/GRAPH plot of the spectrum, continuum and feature bands, and pseudo-continuum for this feature. When you hit CR (carriage return), it measures and plots the next spectral feature in the list EWIMH.WIN. ==================================================================== HISTORY, PROCEDURAL NOTES, AND REASSURANCES (so Layden can track changes in program over time). I ran this version on a number for 93may4m spectra, and got EXACTLY the same EW, SNR and C1/C2 values as I got at Yale using EWIMH.FOR. ACL 27jul94 4) ADDITION: use a sigma-clipping algorithm on the continuum bands to remove CRs, cold pixls, etc. Iterates 5 times, throwing out pix more than 3-sigma from previous ave; 2-sigma for Ca lines where total Npix in a window is smaller (ie, 1-2 bad pix are a much larger fraction of the total Npix). /home/azalea3/layden/PROGS/ewcl_clip.f /home/azalea3/layden/PROGS/ewcl_clip.cl /home/azalea3/layden/PROGS/ewcl_clip2.f / .cl allows you to interactively select Nsigma (2, 3, 2.7...?), so if ewclip_cl.f doesn't do a good job, you can try to fudge a better fit by running this version. ACL 12mar96