procedure cleanimage (imagename,zeroname,flatname,details,answer) # # Bill Ryan 1/1/01 # # cleanimage.cl - bias corrects and flatfields image or imagelist # ------------- # # To create executable task, type: "task cleanimage=cleanimage.cl" # # input: # imagename - image or imagelist to correct. Current version # writes final (cleaned) image to same name (i.e., original destroyed). # zeroname - bias frame # flatname - flat field image # details - 'yes' to show explicit colbias and imarith steps # # Current version: # * hardwires colbias parameters. # * need to load packages noao->imred->bias manually before running file imagename {prompt="Images to process"} file zeroname {prompt="Bias (zero) frame"} file flatname {prompt="Flatfield frame"} bool details {prompt="Detailed output to screen?"} bool answer {prompt="Are you sure that you want to clean these images??"} begin # declarations string image,zeroframe,flatframe,sbias,strim,biaslog bool detail image = imagename zeroframe = zeroname flatframe = flatname detail = details biaslog = "" # check that bias package is loaded if (! defpac("bias")) { print ("\nPlease load package noao->imred->bias and rerun task.\n") bye } # confirm image list before original images are lost forever print ("\nImages to clean:\n") imhead (image) print (" ") # begin cleaning images if (answer) { print ("\nColumn bias . . .\n") # vatt default values for colbias sbias = "[1030:1042,2:1020]" strim = "[10:1010,2:1020]" print ("Using VATT biassec and trim values:\n") print (" BIASSEC = ",sbias) print (" TRIM = ",strim) if(detail) biaslog="STDOUT" colbias (input=image,output=image,bias=sbias,trim=strim,interact=no,logfile=biaslog) print ("\nSubtract master bias frame . . .\n") imarith (image,"-",zeroframe,image,verbose=detail) print ("\nDivide flat frame . . .\n") imarith (image,"/",flatframe,image,verbose=detail) print ("\nDone!!!\n") } else { print ("Exiting without cleaning images.") } end