|
For hints on using DS9 without IRAF, check out Adam's DS9 tips page Instructions for dealing with IRAF errors on cosmosSince the changeover to the new cosmos server, your login.cl files may be incorrect. They currently have home defined as /raid/home/(username)/etc, but this is no longer correct; you will receive errors saying that iraf could not modify uparm$(taskname). You should change this by removing the /raid at the front of the path. This can be done using any editor: look for the line "set home = "/raid/home/..." and modify it.You can try to re-run mkiraf, which will create a new login.cl for you. If you had any settings saved in login.cl, it will overwrite them. You must also go on and change your imdir to "home$images/". Search for the line #set imtype "imh" and change it to read set imtype "fits" (remove the # at the beginning of the line). If you have trouble with .imh files showing up instead of .fits files:
IRAF quick tips-If you see errors that involve "uparm" or "unable to write...":-try to logout of the cl and log back in; make sure you're in the directory with your login.cl file -make sure your login.cl has been edited as per the directions above -If you have problems with imexam and cursor behavior: -restart DS9, try again -restart DS9, logout of the cl and log back in -get frustrated, call or e-mail Adam, see if he gets frustrated -Using IRAF graphics terminals: -q quits; a quit and re-enter solves most problems -? displays help in the terminal. Don't forget to quit out of the help when you're done -:(command) allows "colon commands" that can be quite powerful (see, e.g., "wcs" in imexam) -A syntax error in IRAF generally means you have not loaded the requisite package. -if you don't know what package that is, use the help command (e.g. help temden) Matching Guider Images to Science ImagesInstead of going through each individual file's header, I recommend using this command:imhead proc-*.fits[0] lo+ | grep -E "Pixel\ file\|UTTIME" in the ecam directory, and the command imhead e*.fits lo+ | grep -E "Pixel\ file\|UTC-OBS" in the science directory for the selected night in order to list the file names and exposure start times for each file. You can then write the output of these commands to a file by appening a redirect to the end of the command, e.g. imhead e*.fits lo+ | grep -E "Pixel\ file\|UTC-OBS" > filename.txt . Once you have found the necessary files, copy them to your directory. If you are using DIS instead of Echelle, replace e*.fits with d*.fits. If you're curious about what those commands mean, read on.You should already be familiar with the imhead command, which with the long option enabled prints the full header. The [0] appended to the end of the filename chooses the first extension in the fits image. A fits file is capable of holding many extensions, i.e. many images, in one file. In the case of the Echelle guider camera, the proc-[something].fits files have the slit superimposed on the sky image as the first extension, and the slit mask image as the second extension.The grep command outputs all lines containing a regular expression from its input. A regular expression is a special pattern matching expression. In this case, we have "Pixel\ file\|UTC-OBS", which means we are searching for lines with the string Pixel file or UTC-OBS. The backslash before the space escapes the space so that IRAF doesn't think you are giving it another command. Similarly, we must escape the or operator | (though I'm not entirely certain why - this is not standard behavior). The -E option tells grep that we are using an extended regular expression, which is what allows the use of the | symbol. Using @ Symbols in commandsMost IRAF commands only work on a single file at a time. To run a command on many files at once, you can make a list of files, and then run a command on that list. For example, !ls *.DARK.fits > darklist
imhead @darklist
For a more advanced usage, try something like this: !ls *.DARK.fits > darklist
imcombine @darklist darkcomb.fits
!ls ngc*.fits > sourcelist
!sed 's/\.fits/.darksub.fits/' sourcelist > darksublist
imarith @sourcelist - darkcomb.fits @darksublist
Detailed explanation of individual commandsimarith [file1] [operation] [file2 or number] [outputfile] performs the designated mathematical operation on the desired files flatcombine [filelist] output=[outfile] is a flat-specific version of imcombine. It defaults to "average" with "avsigclip", or average sigma clipping, to remove outliers from the set of images. text2mask text=[textfile] mask=[outfile] generates a bad pixel mask. In the case of the APO Echelle, they tell us exactly what bad pixel mask to use. ccdproc [filename] fixfile=[fixfilename] biassec=[range] trimsec=[range] order=[ordernum] niterate=[niter] Automated CCD processing package uses a bad pixel mask (fixfilename) to eliminate bad pixels and a bias segment to determine what the chip bias is and remove it. trimsec specifies a range to remove from the image. The ordernum and niterate parameters are for fitting the bias from the small "overscan" regions used to determine it. apall [filename] reference=[refspec] uses the reference spectrum specified to extract apertures from the 2D echelle image. With the parameters used here, it does not automatically find new apertures, but will recenter and (except for the quartz lamp) resize the apertures.Most of the parameters specified are used for tracing the aperture and are not strictle necessary, but are included here because they were suggested in the APO Echelle Reduction guide ecreidentify [filename] reference=[refspec] uses the reference spectrum with identified lines to identify the wavelengths of the extracted apertures. ecreidentify is only necessary here if ThAr lamps other than those provided are going to be used; in this example it is not used. magnify [filename] [outname] xmag=[nx] ymag=[ny] simply magnifies the image by some factor while conserving flux. This is used to reduce aliasing that results from the narrow apertures - see the echelle reduction guide. respectra [filename] reference=[refname] adds the reference spectrum to the header file of a target file. This step is necessary to use dispcor dispcor [in] [out] applies the dispersion correction specified in the reference spectrum, i.e. it changes units from pixels to wavelength scombine [in] [out] combine=[combtype] attempts to combine all of the individual spectral orders into a single spectrum using either sum, average, or median combine. However, what we REALLY want is a "max" combine that will take the maximum of the two spectra at each point, and I don't know how to do that yet. hedit [filename] [parameter] [value] add=[y/n] modifies the header of a fits file. It is a very simple process to do this, but hedit preserves the fits format (which affects how different programs - e.g. ds9 - read and display the file) when making edits and prevents you from overwriting key parameters. We use "DISPAXIS 1 add+" to say "change the value of DISPAXIS to 1, and add the parameter DISPAXIS if it does not exist". DISPAXIS=1 means the X axis. You can see in the echelle images that the x axis is the wavelength axis and the y axis is the "order" axis. ASTR3520 home Page written by Adam Ginsburg |