!------------------------------------------------------------------------ ! SPECTRE.GRAPHIC ! Procedure to plot spectra in box for a spectral line data cube. ! Global variables defined in DEFINE.GRAPHIC ! Calls ! P_HEADER.GREG (to plot header information) ! P_LOAD.GREG (to load image) ! and P_BOX.GREG (to plot a box in the header with limits) ! S.Guilloteau 18-jun-1991 !---------------------------------------------------------------------- on error if (name.eq." ") then say "Please enter map file name (without extension) " let name endif if (type.eq." ") then say "Please enter map file extension " let type endif clear plot def real x2 dx y2 dy xpixel[3] ypixel[3] def double xmark ymark def integer m n ix jy def character cmark*24 ! @ p_load.greg spe @ p_header.greg spe on error ! if (spe%f_axis.ne.1) then say "Warning!... First axis of Image/Cube is not the Frequency Axis" say "Continuing...(may be image header is inaccurate?)" endif let m spe%dim[1] define real xspec[m] let xspec[i] (i-spe%convert[1,1])*spe%convert[3,1]+spe%convert[2,1] if (limits.eq." ") then limits (-spe%convert[1,1])*spe%convert[3,1]+spe%convert[2,1] (m+1-spe%convert[1,1])*spe%convert[3,1]+spe%convert[2,1] spe%min-0.05*(spe%max-spe%min) spe%max+0.05*(spe%max-spe%min) else symbol alimits 'limits' limits 'alimits' endif let x2 box_xmax let y2 box_ymax let xpixel xpix if (xpixel[3].eq.0) then let xpixel[1] 1 let xpixel[2] spe%dim[2] let xpixel[3] 1 else let xpixel[1] max(1,xpixel[1]) let xpixel[2] min(xpixel[2],spe%dim[2]) endif let n = int((xpixel[2]-xpixel[1])|xpixel[3])+1 let ypixel ypix if (ypixel[3].eq.0) then let ypixel[1] 1 let ypixel[2] spe%dim[3] let ypixel[3] 1 else let ypixel[1] max(1,ypixel[1]) let ypixel[2] min(ypixel[2],spe%dim[3]) endif let m = int((ypixel[2]-ypixel[1])|ypixel[3])+1 ! set expand min(6.0|(m+n),1.) let dx (x2-box_xmin)|n let dy (y2-box_ymin)|m for j 1 to m let jy ypixel[1]+(j-1)*ypixel[3] for i 1 to n let ix xpixel[1]+(i-1)*xpixel[3] set box x2+(i-n-1)*dx x2+(i-n)*dx y2+(j-m-1)*dy y2+(j-m)*dy box n n if (do_grey) then histo xspec spe[ix,jy] /base 0 /fill 11 if (do_contour) then histo xspec spe[ix,jy] endif else histo xspec spe[ix,jy] endif let xmark ((ix-spe%convert[1,2])*spe%convert[3,2]+spe%convert[2,2])|sec let ymark ((jy-spe%convert[1,3])*spe%convert[3,3]+spe%convert[2,3])|sec let xmark 0.1*nint(10*xmark) let ymark 0.1*nint(10*ymark) set coord box let cmark "("'xmark'","'ymark'")" dra text 0.1 -0.1 'cmark' 3 /box 7 next next ! on error set expand 0.6 if (page_x.gt.page_y) then let dx min((page_x-x2),0.15*page_y) let dy dx set box (page_x+x2)|2.-2*dx|5. (page_x+x2)|2.+3*dx|5. page_y*0.5-dy page_y*0.5 else let dx min((0.15*page_x),(page_y-y2)) let dy dx set box page_x*0.95-dx page_x*0.95 page_y*0.95-dy page_y*0.95 endif box label 'spe%unit1' /x label 'spe%unit' /y set expand 1.0