procedure crplusbpmask_s(image) ### modified combinemasks.cl ### L. Storrie-Lombardi 4 May 2001 ### Modified by Roy Gal for Palomar LFC reductions 21 Apr 2004 ### Enter a list of the image numbers, e.g. ### 175 ### 176 ### 177 ### Assume BPM directories are bpm_XXX ### Images lfc_XXXs.fits[1-6] ### BPM mask bpm_XXX/bpm_lfc0.pl (0-5) ### CR mask crmask_XXX_1.pl (1-6) ### new mask bpm_XXX/bpmcr_lfc0.pl (0-5) ### NOTE HOW NUMBERING OF CCDs and BPMs differs!! string image {prompt="Input image(s)"} struct *inimglist begin string imglist # equals image string infile # temporary list for files string img # image name from fscan string mask1,mask2 # input file names string maskout # output file name string hfile # header file string express # expression for imexpr int i # counter express="max(a,b)" # Get query parameter imglist = image # Expand file lists into temporary files. infile = mktemp("tmp$mask") sections (imglist,option="root",>infile) inimglist = infile # Loop through images while (fscan(inimglist,img) != EOF) { print("processing: lfc_"//img," . . .") for (i=1; i < 7; i+=1) { hfile="lfc_"//img//"s.fits["//i//"]" print hfile mask1="crmask_"//img//"_"//i//".pl" mask2="bpm_"//img//"/bpm_lfc"//i-1//".pl" maskout="bpm_"//img//"/bpmcr_lfc"//i-1//".pl" imexpr(express,maskout,mask1,mask2) hedit(hfile,"BPM",maskout,add-,delete-,ver-,show+,update+) hedit(maskout,"BPM",maskout,add-,delete-,ver-,show+,update+) } } end