procedure tflat (imageFile, normaliz, minim, imageRegion) string imageFile {prompt="Original image list (with no b extensions)"} real normaliz {INDEF, prompt="Normalization if not INDEF"} real minim {5000, prompt="Minimum data value to use in the FF."} string imageRegion {"[250:750,250:750]", prompt="Region to do stats on"} struct *flist # list-directed structure to go thru imageFile begin # Variable Declarations: int i # counter string subArray # sub-array to find mean counts over struct currentImage # image currently being converted to a FF string imageB # current (bias-subtracted) calibration image string imageF # filename of new flatfield (output) image flist = imageFile # putting the contents of the list contained in imageFile # to the list-directed structure *flist # Make sure the GENERIC package is loaded: if (! defpac ("generic")) { print("GENERIC package not loaded (under noao.imred)") bye } # Looping to form flat-fields: i=0 while ( fscan(flist, currentImage) != EOF) { # Getting rid of the ".imh" extension if present: j = strlen(currentImage) if (substr (currentImage, j-3, j) == ".imh") currentImage = substr (currentImage, 1, j-4) i=i+1 imageB=currentImage//"b" # Filename of flat-field image imageF=currentImage//"f" # Filename of flat-field image print(imageB) print(imageF) print("------") normflat (imageB,imageF,norm=normaliz, minflat=minim,sample_=imageRegion,keeplog=no) } end