procedure extract_sky(in, sky, tmpsky,npix,nline,cx,cy,angle,maxx1,maxx2,mingood,maxgood,dtq,usedtq,dtqsky) # Allows the user to select region of the image to be added together to # generate an approzimate background spectrum pointer in int npix, nline, cx, cy, maxx1, maxx2 real mingood,maxgood real angle real sky[maxx1+maxx2,2], tmpsky[maxx1+maxx2,2] real dtq[npix,nline] int n, nrow, tnrow real wx1, wx2, wy1, wy2, temp int wcs, key char strval[SZ_LINE], title[SZ_LINE] pointer imgs2r() int x int usedtq char dtqsky[ARB] int junk, clgcur() begin # call printf("Extracting the background.\n") n=1 nrow=0 do x=1, (maxx1+maxx2) { sky[x,1]=0 sky[x,2]=x tmpsky[x,1]=0 tmpsky[x,2]=x } while(1==1) { call printf("Select region(%d) of sky\n") call pargi(n) call printf("Select 1st corner of region. Press the x key, r to restart, q to quit...\n") junk = clgcur ("imcur",wx1,wy1,wcs,key,strval,SZ_LINE) if (key == 'q') break if (key == 'r') { call printf("Restarting, zeroing sky estimate\n") do x=1, (maxx1+maxx2) { sky[x,1]=0 sky[x,2]=x } nrow = 0 n = 1 call sprintf(title,SZ_LINE,"Current background average (%d lines)") call pargi(n) call display_spec(sky,1.0,npix,"Sky",0) next } call printf("Select 2nd corner of region. Press the x key ...\n") junk = clgcur ("imcur",wx2,wy2,wcs,key,strval,SZ_LINE) if(key == 'q') break if(wy2