III. 3. D. Running allstar twice: stetson3.cl



Source code for stetson.cl may be obtained here.

The script stetson.cl beings by running allstar. Next it runs daofind on the subtracted frame, using a high threshold (8 sigma). It then runs phot on the newly found stars (aperture=3.5, same as before), and pconcat's that mag file to the original *.mag.1 file. It then makes a second allstar pass. Some experiments resulted in our determining that fitting the sky was a good thing for our application.


# Written by Phil Massey, Lowell Obs.
#Modified to fit the sky in allstar
        procedure stetson (img)
        string img {prompt="Images for allstaring"}

        begin

        string s1, s2, s3, s4, s5, s6, s7

	real fwhmv,sigpv,datanv,dataxv

# Get parameters
	s1=img
#Assumes that the following are in the headers:
	imgets(s1,"DATAMI")
	datanv=real(imgets.value)
	imgets(s1,"DATAMA")
	dataxv=real(imgets.value)
	imgets(s1,"fwhm")
	fwhmv=real(imgets.value)
	imgets(s1,"sigma")
	sigpv=real(imgets.value)
	imgets(s1,"fname")
	s6=imgets.value
	imgets(s1,"timestamp")
	s7=imgets.value
	print("Image:",(s1)," datamin:",(datanv), "datamax:",(dataxv)," fwhm:",(fwhmv)," sigma:",(sigpv), "key words", (s6), (s7))
# Delete subtracted image, if it already exists:
	imdelete(s1//".sub.*.imh")
#Delete allstar output, if it already exists
 	delete(s1//".als.*")
	print("Running allstar on: ",(s1))
daopars.maxnstar.p_maximum = 100000
	allstar(s1,"default","default","default","default","default",datamin=datanv,datamax=dataxv,verify-,verbose-,fitsky+,groupsk+,sannulu=3,filter=s6,obstime=s7,maxnstar=100000)

#Now run daofind on the subtracted image:
	s2=s1//".sub.1.imh"
	s3=s1//"extra.coo.1"
	s4=s1//"extra.mag.1"
	delete(s3)
	delete(s4)
daofind(s2,s3,datamin=datanv,datamax=dataxv,fwhmpsf=fwhmv,sigma=sigpv,threshold=8.,interact-,verify-,verbose-,filter=s6,obstime=s7)

phot(s1,s3,s4,datamin=datanv,datamax=dataxv,interact-,verify-,verbose-,filter=s6,obstime=s7,apert=3.5,calgori="none",annulu=12,dannu=8)
#Now append the two mag files:
	s5=s1//".mag.1,"//s4
	delete(s1//".mag.2")
	pconcat(s5,s1//".mag.2")
#Now run allstar again:
	print("Running allstar 2nd pass: ",(s1))
print("s1=",(s1),"datanv=",(datanv),"dataxv=",(dataxv),"s6=",(s6),"s7=",(s7))
#flpr
	allstar(s1,"default","default","default","default","default",datamin=datanv,datamax=dataxv,verify-,verbose-,fitsky+,groupsk+,sannulu=3,filter=s6,obstime=s7,maxnstar=100000)
end