pro synoptic, map, rot=rot, levels=levels, notv=notv, $ title=title, AU=AU, smoothed=smoothed, $ w_xsize= w_xsize, w_ysize= w_ysize, $ im_xsize=im_xsize, im_ysize=im_ysize @compile_opt.pro ; On error, return to caller ;+ ; NAME: ; SYNOPTIC ; PURPOSE: ; Plot 2D array in a synoptic map format ; CALLING SEQUENCE: ; synoptic, map, rot=rot, levels=levels, notv=notv, $ ; title=title, AU=AU, smoothed=smoothed, $ ; im_xsize=im_xsize, im_ysize=im_ysize, $ ; w_xsize= w_xsize, w_ysize= w_ysize ; INPUTS: ; map scalar string file name or 2D array ; OPTIONAL INPUT PARAMETERS: ; im_xsize=im_xsize, im_ysize=im_ysize ; image dimension on display (see procedure) ; w_xsize=w_xsize, w_ysize=w_ysize ; size of IDL window used for display (see procedure) ; levels=levels contour levels ; /notv if set then CONTOUR is used to display the map ; (by default TV is used) ; rot=rot Carrington rotation number ; title=title main plot title ; AU=AU reference distance for plot in AU ; (by default the map is assumed to be for 1 Rsun) ; smoothed=smoothed ; used to smooth the array using the SMOOTH procedure ; OUTPUTS: ; map (smoothed) array ; The size is the size returned by sfltmap, or is the ; same as the input array (NOT the im_(x)(y)size values). ; CALLS: ; twin, sfltmap, getcolors ; RESTRICTIONS: ; Using the /notv option is slow and for really complicated contours ; can cause an X-window protocol error. Use smooth option to simplify ; the contours. ; PROCEDURE: ; The image is read from file and then smoothed. ; The image is rebinned for display to a im_xsize by im_ysize image ; (using CONGRID). Defaults are im_xsize=512, im_ysize=256 ; TWIN is called to set up a w_xsize by w_ysize window. ; Defaults are w_xsize=640, w_ysize=512 ; MODIFICATION HISTORY: ; JAN-1996, Paul Hick (UCSD) ;- notv = keyword_set(notv) if n_elements(smoothed) eq 0 then smoothed = 0 a = size(map) if a(a(0)+1) eq 7 then begin ; Intercept file name map = sfltmap(map,error=error) ; Read file if error ne '' then return ; No map read endif a = size(map) ; Check dimensions if a(0) ne 2 then message, 'specify file name or 2D array as first argument if n_elements( w_xsize) eq 0 then w_xsize = 640 ; Window size if n_elements( w_ysize) eq 0 then w_ysize = 512 if n_elements(im_xsize) eq 0 then im_xsize = 512 ; image size on display if n_elements(im_ysize) eq 0 then im_ysize = 256 map = congrid(map,im_xsize,im_ysize) ; Rebin and smooth if smoothed ne 0 then map = smooth(map,smoothed) twin, /show, xsize=w_xsize, ysize=w_ysize ; Open window xof = 30. ; Shifts image across window yof = 0. x0d = xof+(w_xsize-im_xsize)/2. ; Lower-left corner in device units y0d = yof+(w_ysize-im_ysize)/2. x1d = x0d+im_xsize-1 ; Upper-right corner in device units y1d = y0d+im_ysize-1 x0n = x0d/!d.x_vsize ; Lower-left corner in normal units y0n = y0d/!d.y_vsize x1n = x1d/!d.x_vsize ; Upper-right corner in normal units y1n = y1d/!d.y_vsize pos = [x0n,y0n,x1n,y1n] ; Plot window ; First establish the data coordinates (same as device coordinates) plot, [x0d,x1d], [y0d,y1d], pos=pos, xstyle=5, ystyle=5, /nodata if notv then begin ; Use contour to draw the map if n_elements(levels) eq 0 then begin Amin = min(map) levels = Amin+(max(map)-Amin)/8.*(1.+findgen(8-2)) levels = fix(levels) endif ; c_colors are evenly space across color table A = GetColors(map,levels,/legend,usedcolors=c_colors) levels = [Amin,levels] contour, map, x0d+indgen(im_xsize), y0d+indgen(im_ysize), $ levels=levels, /overplot, /fill, c_color=c_colors endif else begin ; Use TV if n_elements(levels) eq 0 then $ tvscl, map, x0d, y0d, /data $ else $ tv, GetColors(map,levels,/legend), x0d, y0d, /data endelse ; Draw the axes axis, xaxis=0, xticks=6, xstyle=1, xrange=[0,360] axis, xaxis=1, xticks=6, xstyle=1, xrange=[0,360], xtickn=replicate(' ',7) axis, yaxis=0, yticks=6, ystyle=1, yrange=[-90,90] axis, yaxis=1, yticks=6, ystyle=1, yrange=[-90,90],ytickn=replicate(' ',7) size=1.8 ; Add title and other stuff if n_elements(title) ne 0 then $ xyouts, /norm, 0.30, 0.10, title, size=size if n_elements(rot ) ne 0 then $ xyouts, /norm, 0.40, 0.06, 'Rotation '+strcompress(rot,/rem), size=size if n_elements(AU) ne 0 then $ xyouts, /norm, 0.43, 0.02, 'AT '+strcompress(AU,/rem)+' AU', size=size return & end