In order to make this practical, we've decided that autophot will be a "header driven" routine. So, the first step is to characterize the frame and put the important goodies in the header so that other scripts can then grab these numbers and use them.
What do we need, and how do we find them? The following are entered as parameters to character:
However, that's only a start. The character.cl script then figures out the following:
Note that the way sigma, and hence datami, are determined assumes that the image is a single
exposure. If you are working from a stacked image, the effective gain will be different.
You can fix sigma and datami in the headers using IRAF's hedit after the program has
calculated them. This is important later when
daofind uses n*sigma as the threshold for searching for stars.
PACKAGE = user TASK = character PACKAGE = user TASK = character img = Image gain = 3.1 ccdgain value rdnoise = 6. readnoise saturate= 30000. saturation fname = filter filter key word timestam= time-obs time key word (inlist = ) (mode = ql)
Here's the actual script: # Written by Phil Massey, Lowell Obs. March 21, 2002 procedure characterize (img,gain,rdnoise,saturate,fname,timestamp) string img {prompt="Image"} real gain {3.1,prompt="ccdgain value"} real rdnoise {6., prompt="readnoise"} real saturate {30000., prompt="saturation"} string fname {"filter", prompt="filter key word"} string timestamp {"time-obs", prompt="time key word"} string *inlist begin string s1, s2, s3, s4, s5, s6, s7 real fwhmv,gainv,rdnoisev,saturatev,f1,fd1,fd2,fd3,rms,bot,top # Get parameters s1=img gainv=gain rdnoisev=rdnoise saturatev=saturate s6=fname s7=timestamp hedit(s1,"gain",gainv,add+,verify-,show+) hedit(s1,"rdnoise",rdnoisev,add+,verify-,show+) hedit(s1,"saturate",saturatev,add+,verify-,show+) hedit(s1,"fname",s6,add+,verify-,show+) hedit(s1,"timestamp",s7,add+,verify-,show+) # Now find mode: delete("temp") imstat(s1,fields="mode",lower=INDEF,upper=20000,format-,>"temp") inlist="temp" i=fscan(inlist,f1) hedit(s1,"mode",f1,add+,verify-,show+) rms=sqrt(f1*gainv+rdnoisev**2)/gainv hedit(s1,"sigma",rms,add+,verify-,show+) bot=f1-max(10.*rms,30.) hedit(s1,"DATAMI",bot,add+,veri-,show+) top=saturatev-500. hedit(s1,"DATAMA",top,add+,veri-,show+) delete("tempxy") print("running daophot in character") daofind(s1,output="tempxy",sigma=rms,fwhm=4.0,thresh=20.0,datamin=bot,datamax=top,interact-,verify-,verbose-,filter=s6,obstime=s7) delete("temprad") print("running fitpsf in character:",(rms),(bot),(top)) fitpsf(s1,10,sigma=rms,coords="tempxy",output="temprad",datamin=bot,datamax=top,interact-,verify-,filter=s6,obstime=s7,fwhmpsf=3.0) print("done running fitpsf") delete("allrad") txdump("temprad",fields="rsigma",expr="rsigma!=INDEF",>"allrad") delete("tempfwhm") radmode inlist="tempfwhm" i=fscan(inlist,fwhmv) hedit(s1,"fwhm",fwhmv,add+,ver-,show+) end