pro fibers2 ; program requires file fibers2.crd (fiber coordinates and corresponding row ; numbers) and a window/ps-device with axes ratio of y/x=3/2 ; reading in the spectra and their coordinates fname='' read,fname,prompt='Enter fits-image name: ' dpak=mrdfits(fname,0,head) read,lam1,prompt='Enter starting wavelength of region: ' read,lam2,prompt='Enter ending wavelength of region: ' openr,1,'fibers2.crd' dpcrd=fltarr(4,86) readf,1,dpcrd close,1 ; calculating the plot positions x=reform(dpcrd(0,*)) x1=(x+15.0)/40.0*0.764+0.2-0.0285 x2=(x+15.0)/40.0*0.764+0.2+0.0285 y=reform(dpcrd(1,*)) y1=(y+25.0)/55.0*0.7+0.2-0.019 y2=(y+25.0)/55.0*0.7+0.2+0.019 for i=0,(n_elements(head)-1) do begin dummy=str_sep(head(i),'=',/trim,/remove_all) if dummy(0) eq 'CRVAL1' then lam0=double(dummy(1)) if dummy(0) eq 'CDELT1' then wdisp=double(dummy(1)) endfor pxl1=round((lam1-lam0)/wdisp) pxl2=round((lam2-lam0)/wdisp) dprow=reform(dpcrd(3,*)-1) ; plotting axes and spectra title='' read,title,prompt='Enter plot title: ' plot,x,y,xtitle='Position (")',ytitle='Position (")',xrange=[-15,25],$ yrange=[-25,30],xstyle=1,ystyle=1,pos=[.2,.2,.964,.9],title=title,/nodata for i=0,85 do begin if i eq 0 then $ plot,dpak[pxl1:pxl2,dprow(i)],pos=[x1(i),y1(i),x2(i),y2(i)], $ xstyle=1,xcharsize=0.3,xticks=4, $ xtickname=[string(fix(lam1)),' ',' ',' ',string(fix(lam2))], $ yticks=4,ytickname=[' ',' ',' ',' ',' '], $ /noerase else $ plot,dpak[pxl1:pxl2,dprow(i)],pos=[x1(i),y1(i),x2(i),y2(i)], $ xstyle=1,xticks=4,xtickname=[' ',' ',' ',' ',' '], $ yticks=4,ytickname=[' ',' ',' ',' ',' '],/noerase endfor end