;---------------------------------------------------------------- ; String Functions function chopr, svalue, n if strlen(svalue) lt n then n = strlen(svalue) return, strmid(svalue, strlen(svalue)-n,n) end function tostr,value return, strcompress(string(long(value)),/remove_all) end function mklower, string temp = byte(string) loc = where((temp ge 65) and (temp le 90), count) if count ne 0 then temp(loc) = temp(loc)+32 return, string(temp) end ;---------------------------------------------------------------- ; Time Routines PRO c_r_to_a, timearray, timereal dayofmon = [31,28,31,30,31,30,31,31,30,31,30,31] timearray = intarr(6) speryear = double(31536000.0) sperday = double(86400.0) sperhour = double(3600.0) spermin = double(60.0) numofyears = floor(timereal/speryear) if (numofyears+65) mod 4 eq 0 then dayofmon(1) = dayofmon(1) + 1 numofdays = floor((timereal mod speryear)/sperday) numofleap = floor(numofyears / 4) numofdays = numofdays - numofleap if numofdays lt 0 then begin if (numofyears+65) mod 4 eq 0 then dayofmon(1) = dayofmon(1) - 1 numofyears = numofyears - 1 numofdays = numofdays + numofleap + 365 if (numofyears+65) mod 4 eq 0 then dayofmon(1) = dayofmon(1) + 1 numofleap = floor(numofyears / 4) numofdays = numofdays - numofleap endif numofhours = floor((timereal mod sperday)/sperhour) numofmin = floor((timereal mod sperhour)/spermin) numofsec = floor(timereal mod spermin) numofmon = 0 while numofdays ge dayofmon(numofmon) do begin numofdays = numofdays - dayofmon(numofmon) numofmon = numofmon + 1 endwhile timearray(0) = numofyears + 1965 timearray(1) = numofmon + 1 timearray(2) = numofdays + 1 timearray(3) = numofhours timearray(4) = numofmin timearray(5) = numofsec RETURN END pro c_a_to_s, timearray, strtime mon='JANFEBMARAPRMAYJUNJULAUGSEPOCTNOVDEC' sd = '0'+tostr(timearray(2)) sd = strmid(sd,strlen(sd)-2,2) sm = strmid(mon,(timearray(1)-1)*3,3) if timearray(0) lt 1900 then year = timearray(0) $ else year = timearray(0)-1900 if (year ge 100) then year = year - 100 sy = chopr('0'+tostr(year),2) sh = '0'+tostr(timearray(3)) sh = strmid(sh,strlen(sh)-2,2) si = '0'+tostr(timearray(4)) si = strmid(si,strlen(si)-2,2) ss = '0'+tostr(timearray(5)) ss = strmid(ss,strlen(ss)-2,2) strtime = sd+'-'+sm+'-'+sy+' '+sh+':'+si+':'+ss+'.000' RETURN END ;---------------------------------------------------------------- ; Position routines ;; pos_space ; ; Determines the size and multiplication factors for plotting perfect circles ; or squares. This routine is used to simply find the parameters, another ; procedure, get_position, is used to actually find the position of the ; circle or square. ; This routine maxamizes the area used by the plots, determinining the best ; positions for the number of plots that the user has selected. ; ; input parameters: ; nb - number of plots on a page ; space - amount of space in between each of the plots in normalized ; coordinates ; ; output parameters: ; bs - box size (size of the plotting region) ; nbx, nby - number of plots in the x and y directions ; xoff, yoff - x and y offsets for positions ; xf, yf - x and y multiplication factors for making perfect squares ; ; This has been adapted to allow the user to define how many objects ; are in the x and y direction on Jan 2, 1998 pro pos_space, nb, space, sizes, nx = nx, ny = ny sizes = {bs:0.0, nbx:0, nby:0, xoff:0.0, yoff:0.0, xf:0.0, yf:0.0} xsi = float(!d.x_size) ysi = float(!d.y_size) xs = xsi - 5.0*space*xsi ys = ysi - 5.0*space*ysi if nb eq 1 then begin sizes.nbx = 1 sizes.nby = 1 sizes.bs = 1.0 - space if xs gt ys then begin sizes.yf = 1.0 sizes.xf = ys/xs endif else begin sizes.xf = 1.0 sizes.yf = xs/ys endelse endif else begin if (n_elements(nx) gt 0) then begin sizes.nbx = nx(0) if n_elements(ny) eq 0 then sizes.nby = nb/nx(0) else sizes.nby = ny(0) endif else begin if (n_elements(ny) gt 0) then begin sizes.nby = ny(0) sizes.nbx = nb/ny(0) endif else begin if xs gt ys then begin sizes.nbx = round(sqrt(nb)) sizes.nby = fix(nb/sizes.nbx) endif else begin sizes.nby = round(sqrt(nb)) sizes.nbx = fix(nb/sizes.nby) endelse endelse endelse if xs gt ys then begin if (sizes.nbx*sizes.nby lt nb) then $ if (sizes.nbx le sizes.nby) then sizes.nbx = sizes.nbx + 1 $ else sizes.nby = sizes.nby + 1 $ else $ if (sizes.nbx lt sizes.nby) and $ (n_elements(nx) eq 0) and $ (n_elements(ny) eq 0) then begin temp = sizes.nby sizes.nby = sizes.nbx sizes.nbx = temp endif sizes.yf = 1.0 sizes.xf = ys/xs sizes.bs = ((1.0-space*(sizes.nbx-1))/sizes.nbx )/sizes.xf if sizes.nby*sizes.bs+space*(sizes.nby-1) gt 1.0 then $ sizes.bs = (1.0- space*(sizes.nby-1))/sizes.nby endif else begin if (sizes.nbx*sizes.nby lt nb) then $ if (sizes.nby le sizes.nbx) then sizes.nby = sizes.nby + 1 $ else sizes.nbx = sizes.nbx + 1 $ else $ if (sizes.nby lt sizes.nbx) and $ (n_elements(nx) eq 0) and $ (n_elements(ny) eq 0) then begin temp = sizes.nby sizes.nby = sizes.nbx sizes.nbx = temp endif sizes.xf = 1.0 sizes.yf = xs/ys sizes.bs = ((1.0 - space*(sizes.nby-1))/sizes.nby)/sizes.yf if sizes.nbx*sizes.bs+space*(sizes.nbx-1) gt 1.0 then $ sizes.bs = (1.0 - space*(sizes.nbx-1))/sizes.nbx endelse endelse sizes.xoff = (1.0 - sizes.xf*(sizes.bs*sizes.nbx + space*(sizes.nbx-1)))/2.0 sizes.yoff = (1.0 - sizes.yf*(sizes.bs*sizes.nby + space*(sizes.nby-1)))/2.0 RETURN END ; ; get_position ; ; used in conjunction with pos_space. Determines the position of the current ; plotting region, given the output parameters from pos_space. ; ; Input parameters: ; nb, space, bs, nbx, nby, xoff, yoff, xf, yf - Outputs from pos_space ; pos_num - the number of the plot, ranges from 0 : bs-1 ; ; Output parameters: ; ; pos - the position of the plot, used in the plot command ; ; modified to make rectangles on Jan 2, 1998 pro get_position, nb, space, sizes, pos_num, pos, rect = rect, $ xmargin = xmargin, ymargin = ymargin xipos = fix(pos_num) mod sizes.nbx yipos = fix(pos_num)/sizes.nbx yf2 = sizes.yf yf = sizes.yf*(1.0-space) xf2 = sizes.xf xf = sizes.xf*(1.0-space) if n_elements(rect) gt 0 then begin if n_elements(xmargin) gt 0 then xmar = xmargin(0) $ else xmar = space/2.0 if n_elements(ymargin) gt 0 then ymar = ymargin(0) $ else ymar = space/2.0 xtotal = 1.0 - (space*float(sizes.nbx-1) + xmar + xf2*space/2.0) xbs = xtotal/(float(sizes.nbx)*xf) xoff = xmar - xf2*space/2.0 ytotal = 1.0 - (space*float(sizes.nby-1) + ymar + yf2*space/2.0) ybs = ytotal/(float(sizes.nby)*yf) yoff = 0.0 endif else begin xbs = sizes.bs xoff = sizes.xoff ybs = sizes.bs yoff = sizes.yoff endelse xpos0 = float(xipos) * (xbs+space)*xf + xoff + xf2*space/2.0 xpos1 = float(xipos) * (xbs+space)*xf + xoff + xf2*space/2.0 + xbs*xf ypos0 = (1.0-yf2*space/2) - (yipos * (ybs+space)*yf + ybs*yf) - yoff ypos1 = (1.0-yf2*space/2) - (yipos * (ybs+space)*yf) - yoff pos= [xpos0,ypos0,xpos1,ypos1] RETURN END ;---------------------------------------------------------------- ; plotting circles pro plotmlt, maxran, white = white, black = black, $ no00 = no00, no06 = no06, no12 = no12, no18 = no18, $ longs = longs if n_elements(white) gt 0 then color = 255 if n_elements(black) gt 0 then color = 0 if n_elements(color) eq 0 then begin if !d.name eq 'PS' then color = 0 else color = 255 endif if n_elements(no00) eq 0 then no00 = 0 if n_elements(no06) eq 0 then no06 = 0 if n_elements(no12) eq 0 then no12 = 0 if n_elements(no18) eq 0 then no18 = 0 if n_elements(longs) eq 0 then begin p00 = '00' p06 = '06' p12 = '12' p18 = '18' endif else begin p00 = '00' p06 = '90' p12 = '180' p18 = '270' endelse t = findgen(182.0)*2.0*!pi/180.0 xp = cos(t) yp = sin(t) plots, maxran*xp, maxran*yp, color = color for i=10,maxran, 10 do $ oplot, float(i)*xp, float(i)*yp,linestyle=1, color = color oplot, [-maxran,maxran],[0.0,0.0], linestyle =1, color = color oplot, [0.0,0.0], [-maxran,maxran], linestyle = 1, color = color xs = float(!d.x_size) ys = float(!d.y_size) pos = float(!p.clip(0:3)) pos([0,2]) = pos([0,2])/xs pos([1,3]) = pos([1,3])/ys mid_x = (pos(2) + pos(0))/2.0 mid_y = (pos(3) + pos(1))/2.0 ch = 0.8 y_ch = ch*float(!d.y_ch_size)/ys x_ch = ch*float(!d.x_ch_size)/xs if no00 eq 0 then $ xyouts, mid_x, pos(1) - y_ch*1.1, p00, alignment=0.5, $ charsize=ch, /norm if no06 eq 0 then $ xyouts, pos(2)+x_ch*0.15, mid_y - y_ch/2.0, p06, $ charsize=ch, /norm if no12 eq 0 then $ xyouts, mid_x, pos(3) + y_ch*0.15, p12, alignment=0.5, $ charsize=ch, /norm if no18 eq 0 then $ xyouts, pos(0)-x_ch*0.15, mid_y - y_ch/2.0, p18, $ charsize=ch, /norm, alignment = 1.0 return end ;---------------------------------------------------------------- ; color tables pro makect, color common colors, r_orig, g_orig, b_orig, r_curr, g_curr, b_curr ; Get number of colors n=!d.table_size if n lt 10 or n gt 256 then n=256 r = fltarr(n) g = fltarr(n) b = fltarr(n) if not keyword_set(color) then begin print,'red - white to red' print,'wyr - white to red' print,'blue - white to blue' print,'rwb - red white blue' print,'bwr - blue white red' print,'bw - black white' print,'wb - white black' print,'mid - blue green white yellow red' color = '' read,'Enter color table from list above : ', color endif color = mklower(color) ; Set read, green, blue to values normalized to the 0.0 -- 1.0 range. case color of 'red' : begin r(*) = 1. g(*) = 1. - findgen(n)/(n-1) b(*) = 1. - findgen(n)/(n-1) end 'wb' : begin r(*) = 1. - findgen(n)/(n-1) g(*) = 1. - findgen(n)/(n-1) b(*) = 1. - findgen(n)/(n-1) end 'bw' : begin r(*) = 0. + findgen(n)/(n-1) g(*) = 0. + findgen(n)/(n-1) b(*) = 0. + findgen(n)/(n-1) end 'blue' : begin r(*) = 1. - findgen(n)/(n-1) b(*) = 1. g(*) = 1. - findgen(n)/(n-1) end 'rwb' : begin half=n/2 r(0:half-1) = 1. g(0:half-1) = findgen(half)/(half-1) b(0:half-1) = findgen(half)/(half-1) r(half:n-1) = 1. - findgen(n-half)/(n-half-1) g(half:n-1) = 1. - findgen(n-half)/(n-half-1) b(half:n-1) = 1. end 'wyr' : begin half=n/2 r(0:half-1) = 1. g(0:half-1) = 1. b(0:half-1) = 1. - findgen(half)/(half-1) r(half:n-1) = 1. g(half:n-1) = 1. - findgen(n-half)/(n-half-1) b(half:n-1) = 0. end 'bwr' : begin half=n/2 b(0:half-1) = 1. g(0:half-1) = findgen(half)/(half-1) r(0:half-1) = findgen(half)/(half-1) b(half:n-1) = 1. - findgen(n-half)/(n-half-1) g(half:n-1) = 1. - findgen(n-half)/(n-half-1) r(half:n-1) = 1. end 'mid' : begin r(0:n/3-1) = 0.0 r(n/3:n/2-1) = findgen(n/2-n/3)/(n/2-n/3-1) r(n/2:n-1) = 1.0 b(0:n/2-1) = 1. b(n/2:2*n/3-1) = 1. - findgen(2*n/3-n/2)/(2*n/3-n/2-1) b(2*n/3-1:n-1) = 0. g(0:n/3-1) = findgen(n/3)/(n/3-1) g(n/3:2*n/3-1) = 1. g(2*n/3:n-1) = 1. - findgen(n-2*n/3)/(n-2*n/3-1) r(n/2) = 1.0 g(n/2) = 1.0 b(n/2) = 1.0 end else : begin print, "Unknown value for color=",color r(*) = findgen(n) g(*) = findgen(n) b(*) = findgen(n) end endcase r(0) = 0.0 g(0) = 0.0 b(0) = 0.0 r(n-1) = 1.0 g(n-1) = 1.0 b(n-1) = 1.0 r=255*r g=255*g b=255*b r_orig = r g_orig = g b_orig = b r_curr = r_orig g_curr = g_orig b_curr = b_orig tvlct,r,g,b end ;***************************************************************************** pro plotct, ncolors, pos, maxmin, title, right=right, $ color = color, reverse = reverse ;****************************************************************************** ; this is to make Gabor's stuff work.... if (n_elements(ncolors) eq 4) then begin maxmin = pos pos = ncolors ncolors = 255 right = 1 endif xrange=!x.range & yrange=!y.range & !x.range=0 & !y.range=0 if n_elements(right) eq 0 then right = 0 else right = right if n_elements(maxmin) lt 2 then maxmin2 = [0,maxmin] else maxmin2 = maxmin if n_elements(color) eq 0 then color_in = -1 else color_in = color if n_elements(reverse) eq 0 then reverse = 0 else reverse = 1 if not right then begin if color_in eq -1 then $ plot, maxmin2, /noerase, pos = pos, $ xstyle=5,ystyle=1, /nodata, ytitle = title,charsize=0.9 $ else $ plot, maxmin2, /noerase, pos = pos, $ xstyle=5,ystyle=1, /nodata, ytitle = title, color = color_in,charsize=0.9 endif else begin plot, maxmin2, /noerase, pos = pos, $ xstyle=5,ystyle=5, /nodata,charsize=0.9 if color_in eq -1 then $ axis, 1, ystyle=1, /nodata, ytitle = title, yax=1, $ charsize=0.9 $ else $ axis, 1, ystyle=1, /nodata, ytitle = title, yax=1, $ charsize=0.9, color = color_in endelse plot, [0,9], [0,ncolors], /noerase, pos = pos, xstyle=5,ystyle=5, /nodata x = [0.0,0.0,1.0,1.0,0.0] y = [0.0,1.0,1.0,0.0,0.0] maxi = max(maxmin) mini = min(maxmin) levels = findgen(29)/28.0*(maxi-mini) + mini clevels = (ncolors-1)*findgen(29)/28.0 + 1 array = findgen(10,ncolors-1) for i=0,9 do array(i,*) = findgen(ncolors-1)/(ncolors-2)*(maxi-mini) + mini contour, array, /noerase, /cell_fill, xstyle = 5, ystyle = 5, $ levels = levels, c_colors = clevels, pos=pos ; index = indgen(ncolors) ; if reverse then index = (ncolors-1) - index ; for i=0,ncolors-1 do $ ; polyfill, x, float(index(i))+y, color = i if color_in eq -1 then begin plots, [0.0,1.0], [0.0,0.0] plots, [0.0,1.0], [ncolors-1,ncolors-1] plot, maxmin2, /noerase, pos = pos, $ xstyle=5,ystyle=1, /nodata, $ ytickname = strarr(10) + ' ', yticklen = 0.25 endif else begin plots, [0.0,9.0], [0.0,0.0], color = color_in plots, [0.0,9.0], [ncolors-1,ncolors-1], color = color_in plot, maxmin2, /noerase, pos = pos, $ xstyle=5,ystyle=1, /nodata, $ ytickname = strarr(10) + ' ', yticklen = 0.25, color = color_in endelse !x.range=xrange & !y.range=yrange return end ;---------------------------------------------------------------- ; PostScript Routines pro setdevice, psfile, orient, psfont, percent, eps=eps, $ psname_inq = psname_inq if n_elements(psfile) eq 0 then begin psfile = '' if n_elements(psname_inq) gt 0 then begin read, 'Enter ps filename : ',psfile endif if strlen(psfile) eq 0 then psfile = 'idl.ps' endif if n_elements(percent) eq 0 then percent = 1.0 $ else if percent gt 1.0 then percent = float(percent)/100.0 if n_elements(orient) eq 0 then orient = 'landscape' if n_elements(psfont) eq 0 then psfont = 28 if n_elements(eps) eq 0 then eps = 0 else eps = 1 set_plot, 'ps', /copy, /interpolate !p.font = 0 if (strmid(orient,0,1) eq 'p') or (strmid(orient,0,1) eq 'P') then begin changep = percent xs = 7.5 ys = 9.5 if eps eq 0 then begin case (psfont) of 0 : device, file = psfile, /color, bits=8, $ /inches, /portrait, xsize = xs*changep, ysize = ys*changep, $ xoff = (8.5-xs*changep)/2.0, yoff = (11.0-ys*changep)/2.0, $ /Courier 1 : device, file = psfile, /color, bits=8, $ /inches, /portrait, xsize = xs*changep, ysize = ys*changep, $ xoff = (8.5-xs*changep)/2.0, yoff = (11.0-ys*changep)/2.0, $ /Courier, /Bold 2 : device, file = psfile, /color, bits=8, $ /inches, /portrait, xsize = xs*changep, ysize = ys*changep, $ xoff = (8.5-xs*changep)/2.0, yoff = (11.0-ys*changep)/2.0, $ /Courier, /Oblique 3 : device, file = psfile, /color, bits=8, $ /inches, /portrait, xsize = xs*changep, ysize = ys*changep, $ xoff = (8.5-xs*changep)/2.0, yoff = (11.0-ys*changep)/2.0, $ /Courier, /Bold, /Oblique 4 : device, file = psfile, /color, bits=8, $ /inches, /portrait, xsize = xs*changep, ysize = ys*changep, $ xoff = (8.5-xs*changep)/2.0, yoff = (11.0-ys*changep)/2.0, $ /Helvetica 5 : device, file = psfile, /color, bits=8, $ /inches, /portrait, xsize = xs*changep, ysize = ys*changep, $ xoff = (8.5-xs*changep)/2.0, yoff = (11.0-ys*changep)/2.0, $ /Helvetica, /Bold 6 : device, file = psfile, /color, bits=8, $ /inches, /portrait, xsize = xs*changep, ysize = ys*changep, $ xoff = (8.5-xs*changep)/2.0, yoff = (11.0-ys*changep)/2.0, $ /Helvetica, /Oblique 8 : device, file = psfile, /color, bits=8, $ /inches, /portrait, xsize = xs*changep, ysize = ys*changep, $ xoff = (8.5-xs*changep)/2.0, yoff = (11.0-ys*changep)/2.0, $ /Helvetica, /Bold, /Oblique 12 : device, file = psfile, /color, bits=8, $ /inches, /portrait, xsize = xs*changep, ysize = ys*changep, $ xoff = (8.5-xs*changep)/2.0, yoff = (11.0-ys*changep)/2.0, $ /Avantgarde, /Book 13 : device, file = psfile, /color, bits=8, $ /inches, /portrait, xsize = xs*changep, ysize = ys*changep, $ xoff = (8.5-xs*changep)/2.0, yoff = (11.0-ys*changep)/2.0, $ /Avantgarde, /Book, /Oblique 14 : device, file = psfile, /color, bits=8, $ /inches, /portrait, xsize = xs*changep, ysize = ys*changep, $ xoff = (8.5-xs*changep)/2.0, yoff = (11.0-ys*changep)/2.0, $ /Avantgarde, /Demi 15 : device, file = psfile, /color, bits=8, $ /inches, /portrait, xsize = xs*changep, ysize = ys*changep, $ xoff = (8.5-xs*changep)/2.0, yoff = (11.0-ys*changep)/2.0, $ /Avantgarde, /Demi, /Oblique 20 : device, file = psfile, /color, bits=8, $ /inches, /portrait, xsize = xs*changep, ysize = ys*changep, $ xoff = (8.5-xs*changep)/2.0, yoff = (11.0-ys*changep)/2.0, $ /Schoolbook 21 : device, file = psfile, /color, bits=8,$ /inches, /portrait, xsize = xs*changep, ysize = ys*changep, $ xoff = (8.5-xs*changep)/2.0, yoff = (11.0-ys*changep)/2.0, $ /Schoolbook, /Bold 22 : device, file = psfile, /color, bits=8,$ /inches, /portrait, xsize = xs*changep, ysize = ys*changep, $ xoff = (8.5-xs*changep)/2.0, yoff = (11.0-ys*changep)/2.0, $ /Schoolbook, /Italic 23 : device, file = psfile, /color, bits=8, $ /inches, /portrait, xsize = xs*changep, ysize = ys*changep, $ xoff = (8.5-xs*changep)/2.0, yoff = (11.0-ys*changep)/2.0, $ /Schoolbook, /Bold, /Italic 28 : device, file = psfile, /color, bits=8, $ /inches, /portrait, xsize = xs*changep, ysize = ys*changep, $ xoff = (8.5-xs*changep)/2.0, yoff = (11.0-ys*changep)/2.0, $ /Times 29 : device, file = psfile, /color, bits=8, $ /inches, /portrait, xsize = xs*changep, ysize = ys*changep, $ xoff = (8.5-xs*changep)/2.0, yoff = (11.0-ys*changep)/2.0, $ /Times, /Bold 30 : device, file = psfile, /color, bits=8, $ /inches, /portrait, xsize = xs*changep, ysize = ys*changep, $ xoff = (8.5-xs*changep)/2.0, yoff = (11.0-ys*changep)/2.0, $ /Times, /Italic 31 : device, file = psfile, /color, bits=8, $ /inches, /portrait, xsize = xs*changep, ysize = ys*changep, $ xoff = (8.5-xs*changep)/2.0, yoff = (11.0-ys*changep)/2.0, $ /Times, /Bold, /Italic endcase endif else begin case (psfont) of 0 : device, file = psfile, /color, bits=8, $ /inches, /portrait, xsize = xs*changep, ysize = ys*changep, $ /Courier, /encapsulated 1 : device, file = psfile, /color, bits=8, $ /inches, /portrait, xsize = xs*changep, ysize = ys*changep, $ /Courier, /Bold, /encapsulated 2 : device, file = psfile, /color, bits=8, $ /inches, /portrait, xsize = xs*changep, ysize = ys*changep, $ /Courier, /Oblique, /encapsulated 3 : device, file = psfile, /color, bits=8, $ /inches, /portrait, xsize = xs*changep, ysize = ys*changep, $ /Courier, /Bold, /Oblique, /encapsulated 4 : device, file = psfile, /color, bits=8, $ /inches, /portrait, xsize = xs*changep, ysize = ys*changep, $ /Helvetica, /encapsulated 5 : device, file = psfile, /color, bits=8, $ /inches, /portrait, xsize = xs*changep, ysize = ys*changep, $ /Helvetica, /Bold, /encapsulated 6 : device, file = psfile, /color, bits=8, $ /inches, /portrait, xsize = xs*changep, ysize = ys*changep, $ /Helvetica, /Oblique, /encapsulated 8 : device, file = psfile, /color, bits=8, $ /inches, /portrait, xsize = xs*changep, ysize = ys*changep, $ /Helvetica, /Bold, /Oblique, /encapsulated 12 : device, file = psfile, /color, bits=8, $ /inches, /portrait, xsize = xs*changep, ysize = ys*changep, $ /Avantgarde, /Book, /encapsulated 13 : device, file = psfile, /color, bits=8, $ /inches, /portrait, xsize = xs*changep, ysize = ys*changep, $ /Avantgarde, /Book, /Oblique, /encapsulated 14 : device, file = psfile, /color, bits=8, $ /inches, /portrait, xsize = xs*changep, ysize = ys*changep, $ /Avantgarde, /Demi, /encapsulated 15 : device, file = psfile, /color, bits=8, $ /inches, /portrait, xsize = xs*changep, ysize = ys*changep, $ /Avantgarde, /Demi, /Oblique, /encapsulated 20 : device, file = psfile, /color, bits=8, $ /inches, /portrait, xsize = xs*changep, ysize = ys*changep, $ /Schoolbook, /encapsulated 21 : device, file = psfile, /color, bits=8,$ /inches, /portrait, xsize = xs*changep, ysize = ys*changep, $ /Schoolbook, /Bold, /encapsulated 22 : device, file = psfile, /color, bits=8,$ /inches, /portrait, xsize = xs*changep, ysize = ys*changep, $ /Schoolbook, /Italic, /encapsulated 23 : device, file = psfile, /color, bits=8, $ /inches, /portrait, xsize = xs*changep, ysize = ys*changep, $ /Schoolbook, /Bold, /Italic, /encapsulated 28 : device, file = psfile, /color, bits=8, $ /inches, /portrait, xsize = xs*changep, ysize = ys*changep, $ /Times, /encapsulated 29 : device, file = psfile, /color, bits=8, $ /inches, /portrait, xsize = xs*changep, ysize = ys*changep, $ /Times, /Bold, /encapsulated 30 : device, file = psfile, /color, bits=8, $ /inches, /portrait, xsize = xs*changep, ysize = ys*changep, $ /Times, /Italic, /encapsulated 31 : device, file = psfile, /color, bits=8, $ /inches, /portrait, xsize = xs*changep, ysize = ys*changep, $ /Times, /Bold, /Italic, /encapsulated endcase endelse endif else begin xs = 10.0 ys = 7.0 change = percent if eps eq 0 then begin case (psfont) of 0 : device, file = psfile, /color, bits=8, /landscape, $ xsize=xs*change, ysize=ys*change, $ yoff=11.0-(11.0-xs*change)/2.0, $ xoff=(8.5-ys*change)/2.0, $ /inches, $ /Courier 1 : device, file = psfile, /color, bits=8, /landscape, $ xsize=xs*change, ysize=ys*change, $ yoff=11.0-(11.0-xs*change)/2.0, $ xoff=(8.5-ys*change)/2.0, $ /inches, $ /Courier, /Bold 2 : device, file = psfile, /color, bits=8, /landscape, $ xsize=xs*change, ysize=ys*change, $ yoff=11.0-(11.0-xs*change)/2.0, $ xoff=(8.5-ys*change)/2.0, $ /inches, $ /Courier, /Oblique 3 : device, file = psfile, /color, bits=8, /landscape, $ xsize=xs*change, ysize=ys*change, $ yoff=11.0-(11.0-xs*change)/2.0, $ xoff=(8.5-ys*change)/2.0, $ /inches, $ /Courier, /Bold, /Oblique 4 : device, file = psfile, /color, bits=8, /landscape, $ xsize=xs*change, ysize=ys*change, $ yoff=11.0-(11.0-xs*change)/2.0, $ xoff=(8.5-ys*change)/2.0, $ /inches, $ /Helvetica 5 : device, file = psfile, /color, bits=8, /landscape, $ xsize=xs*change, ysize=ys*change, $ yoff=11.0-(11.0-xs*change)/2.0, $ xoff=(8.5-ys*change)/2.0, $ /inches, $ /Helvetica, /Bold 6 : device, file = psfile, /color, bits=8, /landscape, $ xsize=xs*change, ysize=ys*change, $ yoff=11.0-(11.0-xs*change)/2.0, $ xoff=(8.5-ys*change)/2.0, $ /inches, $ /Helvetica, /Oblique 8 : device, file = psfile, /color, bits=8, /landscape, $ xsize=xs*change, ysize=ys*change, $ yoff=11.0-(11.0-xs*change)/2.0, $ xoff=(8.5-ys*change)/2.0, $ /inches, $ /Helvetica, /Bold, /Oblique 12 : device, file = psfile, /color, bits=8, /landscape, $ xsize=xs*change, ysize=ys*change, $ yoff=11.0-(11.0-xs*change)/2.0, $ xoff=(8.5-ys*change)/2.0, $ /inches, $ /Avantgarde, /Book 13 : device, file = psfile, /color, bits=8, /landscape, $ xsize=xs*change, ysize=ys*change, $ yoff=11.0-(11.0-xs*change)/2.0, $ xoff=(8.5-ys*change)/2.0, $ /inches, $ /Avantgarde, /Book, /Oblique 14 : device, file = psfile, /color, bits=8, /landscape, $ xsize=xs*change, ysize=ys*change, $ yoff=11.0-(11.0-xs*change)/2.0, $ xoff=(8.5-ys*change)/2.0, $ /inches, $ /Avantgarde, /Demi 15 : device, file = psfile, /color, bits=8, /landscape, $ xsize=xs*change, ysize=ys*change, $ yoff=11.0-(11.0-xs*change)/2.0, $ xoff=(8.5-ys*change)/2.0, $ /inches, $ /Avantgarde, /Demi, /Oblique 20 : device, file = psfile, /color, bits=8, /landscape, $ xsize=xs*change, ysize=ys*change, $ yoff=11.0-(11.0-xs*change)/2.0, $ xoff=(8.5-ys*change)/2.0, $ /inches, $ /Schoolbook 21 : device, file = psfile, /color, bits=8, /landscape, $ xsize=xs*change, ysize=ys*change, $ yoff=11.0-(11.0-xs*change)/2.0, $ xoff=(8.5-ys*change)/2.0, $ /inches, $ /Schoolbook, /Bold 22 : device, file = psfile, /color, bits=8, /landscape, $ xsize=xs*change, ysize=ys*change, $ yoff=11.0-(11.0-xs*change)/2.0, $ xoff=(8.5-ys*change)/2.0, $ /inches, $ /Schoolbook, /Italic 23 : device, file = psfile, /color, bits=8, /landscape, $ xsize=xs*change, ysize=ys*change, $ yoff=11.0-(11.0-xs*change)/2.0, $ xoff=(8.5-ys*change)/2.0, $ /inches, $ /Schoolbook, /Bold, /Italic 28 : device, file = psfile, /color, bits=8, /landscape, $ xsize=xs*change, ysize=ys*change, $ yoff=11.0-(11.0-xs*change)/2.0, $ xoff=(8.5-ys*change)/2.0, $ /inches, $ /Times 29 : device, file = psfile, /color, bits=8, /landscape, $ xsize=xs*change, ysize=ys*change, $ yoff=11.0-(11.0-xs*change)/2.0, $ xoff=(8.5-ys*change)/2.0, $ /inches, $ /Times, /Bold 30 : device, file = psfile, /color, bits=8, /landscape, $ xsize=xs*change, ysize=ys*change, $ yoff=11.0-(11.0-xs*change)/2.0, $ xoff=(8.5-ys*change)/2.0, $ /inches, $ /Times, /Italic 31 : device, file = psfile, /color, bits=8, /landscape, $ xsize=xs*change, ysize=ys*change, $ yoff=11.0-(11.0-xs*change)/2.0, $ xoff=(8.5-ys*change)/2.0, $ /inches, $ /Times, /Bold, /Italic endcase endif else begin case (psfont) of 0 : device, file = psfile, /color, bits=8, /landscape, $ xsize=xs*change, ysize=ys*change, $ /inches, $ /Courier, /encapsulated 1 : device, file = psfile, /color, bits=8, /landscape, $ xsize=xs*change, ysize=ys*change, $ /inches, $ /Courier, /Bold, /encapsulated 2 : device, file = psfile, /color, bits=8, /landscape, $ xsize=xs*change, ysize=ys*change, $ /inches, $ /Courier, /Oblique, /encapsulated 3 : device, file = psfile, /color, bits=8, /landscape, $ xsize=xs*change, ysize=ys*change, $ /inches, $ /Courier, /Bold, /Oblique, /encapsulated 4 : device, file = psfile, /color, bits=8, /landscape, $ xsize=xs*change, ysize=ys*change, $ /inches, $ /Helvetica, /encapsulated 5 : device, file = psfile, /color, bits=8, /landscape, $ xsize=xs*change, ysize=ys*change, $ /inches, $ /Helvetica, /Bold, /encapsulated 6 : device, file = psfile, /color, bits=8, /landscape, $ xsize=xs*change, ysize=ys*change, $ /inches, $ /Helvetica, /Oblique, /encapsulated 8 : device, file = psfile, /color, bits=8, /landscape, $ xsize=xs*change, ysize=ys*change, $ /inches, $ /Helvetica, /Bold, /Oblique, /encapsulated 12 : device, file = psfile, /color, bits=8, /landscape, $ xsize=xs*change, ysize=ys*change, $ /inches, $ /Avantgarde, /Book, /encapsulated 13 : device, file = psfile, /color, bits=8, /landscape, $ xsize=xs*change, ysize=ys*change, $ /inches, $ /Avantgarde, /Book, /Oblique, /encapsulated 14 : device, file = psfile, /color, bits=8, /landscape, $ xsize=xs*change, ysize=ys*change, $ /inches, $ /Avantgarde, /Demi, /encapsulated 15 : device, file = psfile, /color, bits=8, /landscape, $ xsize=xs*change, ysize=ys*change, $ /inches, $ /Avantgarde, /Demi, /Oblique, /encapsulated 20 : device, file = psfile, /color, bits=8, /landscape, $ xsize=xs*change, ysize=ys*change, $ /inches, $ /Schoolbook, /encapsulated 21 : device, file = psfile, /color, bits=8, /landscape, $ xsize=xs*change, ysize=ys*change, $ /inches, $ /Schoolbook, /Bold, /encapsulated 22 : device, file = psfile, /color, bits=8, /landscape, $ xsize=xs*change, ysize=ys*change, $ /inches, $ /Schoolbook, /Italic, /encapsulated 23 : device, file = psfile, /color, bits=8, /landscape, $ xsize=xs*change, ysize=ys*change, $ /inches, $ /Schoolbook, /Bold, /Italic, /encapsulated 28 : device, file = psfile, /color, bits=8, /landscape, $ xsize=xs*change, ysize=ys*change, $ /inches, $ /Times, /encapsulated 29 : device, file = psfile, /color, bits=8, /landscape, $ xsize=xs*change, ysize=ys*change, $ /inches, $ /Times, /Bold, /encapsulated 30 : device, file = psfile, /color, bits=8, /landscape, $ xsize=xs*change, ysize=ys*change, $ /inches, $ /Times, /Italic, /encapsulated 31 : device, file = psfile, /color, bits=8, /landscape, $ xsize=xs*change, ysize=ys*change, $ /inches, $ /Times, /Bold, /Italic, /encapsulated endcase endelse endelse return end pro closedevice if !d.name eq 'PS' then begin device, /close set_plot, 'X' endif return end ;------------------------------------------------------------------- ; min/max ; ; function mm ; ; computes min and max of an array and returns them in an array ; function mm, array return, [min(array),max(array)] end