#This task removes the Zero. # task $y4kzero=/home/massey/survey/y4kzero.cl delete("zeros") hselect("Ty*.fits","$I","imgtype='BIAS'",>"zeros") hselect("Ty*.fits","$I","imgtype='ZERO'",>>"zeros") # count("zeros") | scan (x) if(x<3) { !pwd !pwd >> "../ERRORLOG" print("No biases!") print("No biases!",>>"../ERRORLOG") } else { imdelete("Zero.fits") #Make the bias frame imcombine("@zeros","Zero.fits",combine="median",reject="none",scale="none") delete("flatsobjs") #Identify flats and objects hselect("%T%%y*.fits","$I","imgtype='FLAT'",>"flatsobjs") hselect("%T%%y*.fits","$I","imgtype='OBJECT'",>>"flatsobjs") #Do the bias subtraction: #First, get rid of the images if they already exist: imdelete("Z//@flatsobjs") imarith("T//@flatsobjs","-","Zero","Z//@flatsobjs",verbose+) #Do a little cleaning: delete("zeros") delete("flatsobjs") }