procedure prevu(images) # # This script displays a series of images one by one # according the current display parameters # # mh 10/26/93 # # delete imagelist afterwards 9/2/94 # # Adds option to show GALAMAJ and GALAMIN if there # 14Jan01 mph # # Allow access either of ".imh" or ".fits" formats # 07Mar01 mph # Allow adjustment of maximum intensity # Adjust routine work best when display has zs-,zr- # 07Mar01 mph string images bool answer {no, prompt="Show GALAMAJ,GALAMIN if there?"} struct *imagelist begin real x1, y1, x2, y2 real x3, y3, x4, y4, remax, z1, z2 real mean, stddev, minval int len, wcs string image, imagefile, key, command, line, galfile, ftype string statfile bool zscale imagefile= mktemp("tmp$skysub") sections(images, option="fullname", > imagefile) imagelist=imagefile # # Start input image loop and display image # while (fscan(imagelist,image) != EOF) { len= strlen(image) ftype=".fit" if (substr(image, len-3, len) == ".fit") { image= substr(image, 1, len-4) ftype=".fit"} if (substr(image, len-4, len) == ".fits") { image= substr(image, 1, len-5) ftype=".fits"} print("...processing ", image//ftype) display(image//ftype, 1) useradjust: if (answer) { imgets(image//ftype, "galamaj") line= imgets.value if (line != "0") { x1= real(line) i=stridx(",", line)+1 len= strlen(line) line= substr(line, i, len) y1= real(line) i=stridx(",", line)+1 len= strlen(line) line= substr(line, i, len) x2= real(line) i=stridx(",", line)+1 len= strlen(line) line= substr(line, i, len) y2= real(line) imgets(image//ftype, "galamin") line= imgets.value x3= real(line) i=stridx(",", line)+1 len= strlen(line) line= substr(line, i, len) y3= real(line) i=stridx(",", line)+1 len= strlen(line) line= substr(line, i, len) x4= real(line) i=stridx(",", line)+1 len= strlen(line) line= substr(line, i, len) y4= real(line) galfile= mktemp("tmp$galfl") print(x1, y1, >> galfile) print(x2, y2, >> galfile) print(x3, y3, >> galfile) print(x4, y4, >> galfile) tvmark(1, galfile, mark="point", label=no, \ color=206, pointsize=7) delete(galfile,veri-) } } print(" Hit n to continue with next" print(" -- a to adjust zscale and display again") print(" -- r to display again with autoscaling") print(" -- q to quit") if (fscan(imcur, x, y, wcs, command ) == EOF ) break key = substr (command, 1, 1) if(key == "r") { display(image//ftype, 1, zr+,zs+) goto useradjust } if(key == "a"){ print(" Value to increase z2 ") print(" enter d= 300 e= 500 f= 1000") print(" g= 5000 h=10000 m=32000") if (fscan(imcur, x, y, wcs, command ) == EOF ) break key = substr (command, 1, 1) if(key == "d") remax=300 if(key == "e") remax=500 if(key == "f") remax=1000 if(key == "g") remax=5000 if(key == "h") remax=10000 if(key == "m") remax=32000 zscale= display.zscale z2 = display.z2 if(zscale) { statfile= mktemp("tmp$stat") minmax(image//ftype) minval=minmax.minval imstat(image//ftype,fields = "mean,stddev", format-, > statfile) list = statfile while (fscan (list, mean,stddev) != EOF) { z1=mean-stddev. if(z1 <= minval) z1=minval delete (statfile,verify=no, go_ahead=yes)} z2 = z1+remax display(image//ftype, 1, zr-,zs-,z1=z1,z2=z2) goto useradjust} else { display(image//ftype, 1, z2=remax) goto useradjust }} if(key == "q") break } delete(imagefile, verify=no) end