pro plot_mdi_synop,in=in,range=range,ps=ps,cps=cps,day=day,time=time,gif=gif,fuss=fuss,next=next,carrot=carrot !p.charsize = 2.0 if keyword_set(day) then daym=day else daym=0 if keyword_set(next) then labeln=1 else labeln=0 if keyword_set(time) then spawn,'time_index time='+time+' -d',daym if keyword_set(in) then begin filename=in title2str='From '+strcompress(filename,/remove_all) print, title2str endif else if daym NE 0 then begin dir='/synoptic/mdi/fits/mdisynop.' filename=dir+string(format='(i6.6)',daym)+'.fits' spawn,'time_index day='+strcompress(string(daym),/remove_all)+' -t',timestr datestr=strmid(timestr,0,10) titlestr=strcompress('MDI Synoptic Chart: MDI Day '+string(daym)+' : '+datestr) endif else begin print,'Must specify in="" or day= or time=""' print,'plot_synop [in=filename | day=MDIday | time=1999.05.01] range=100' print,' cps=make postscript on synop.day.ps gif=make gif on synop.day.gif' print,' ps=make b/w postscript on synop.day.ps' print,' next=label with next CR dates too; fuss=get interactive color table ' return endelse if keyword_set(range) then maxrange=range else range=100 if keyword_set(carrot) then begin name_length = strlen(in) gif_length = name_length - 5 pfn = strmid(in, 0, gif_length) cr_length = strlen(pfn) - 4 cr = strmid(pfn, cr_length, 4) print, cr titlestr='MDI Synoptic Chart for Carrington Rotation ' + cr endif else pfn='/synoptic/mdi/plots/synop.'+string(format='(i6.6)',daym) set_plot,'z' print,titlestr,' Plot range=',range print,'Be patient, it takes a while to load the data in ',filename map = readfits(filename,header) im_mag = bytscl(map, min=-range, max=range) common colors,r_orig,g_orig,b_orig,r_curr,g_curr,b_curr loadct,5 if keyword_set(ps) then do_ps=1 else do_ps=0 if keyword_set(gif) then do_ps=2 if keyword_set(cps) then do_ps=3 tslide_image,im_mag,xvisible=1000,yvisible=410,header=header,$ ps=do_ps,title=titlestr,pfile=pfn,next=labeln ;xyouts,-20,-1.4,title2str,charsize = 0.8 if keyword_set(fuss) then begin print,'loadct,3 and set gamma = 0.667 if you want something less garish' xloadct endif if keyword_set(gif) then begin print,'writing gif' x2gif,window=4,pfn+'.gif' endif end ;set_plot, 'X' ; Following modified slightly to change display from side-by-side to one-on-another ; Copyright (c) 1991-1993, Research Systems, Inc. All rights reserved. ; Unauthorized reproduction prohibited. ;+ ; NAME: ; SLIDE_IMAGE ; ; PURPOSE: ; Create a scrolling graphics window for examining large images. ; By default, 2 draw widgets are used. The left draw widget shows ; a reduced version of the complete image, while the draw widget on ; the right displays the actual image with scrollbars that allow sliding ; the visible window. ; ; CALLING SEQUENCE: ; SLIDE_IMAGE [, Image] ; ; INPUTS: ; Image: The 2-dimensional image array to be displayed. If this ; argument is not specified, no image is displayed. The ; FULL_WINDOW and SCROLL_WINDOW keywords can be used to obtain ; the window numbers of the 2 draw widgets so they can be drawn ; into at a later time. ; ; KEYWORDS: ; USECONGRID: Normally, the image is processed with the CONGRID ; procedure before it is written to the fully visible ; window on the left. Specifying CONGIRD=0 will force ; the image to be drawn as is. ; ; FULL_WINDOW: A named variable in which to store the IDL window number of \ ; the non-sliding window. This window number can be used with ; the WSET procedure to draw to the scrolling window at a later ; point. ; ; GROUP: The widget ID of the widget that calls SLIDE_IMAGE. If this ; keyword is specified, the death of the caller results in the ; death of SLIDE_IMAGE. ; ; ORDER: This keyword is passed directly to the TV procedure ; to control the order in which the images are drawn. Usually, ; images are drawn from the bottom up. Set this keyword to a ; non-zero value to draw images from the top down. ; ; REGISTER: Set this keyword to create a "Done" button for SLIDE_IMAGE ; and register the widgets with the XMANAGER procedure. ; ; The basic widgets used in this procedure do not generate ; widget events, so it is not necessary to process events ; in an event loop. The default is therefore to simply create ; the widgets and return. Hence, when register is not set, ; SLIDE_IMAGE can be displayed and the user can still type ; commands at the "IDL>" prompt that use the widgets. ; ; RETAIN: This keyword is passed directly to the WIDGET_DRAW ; function, and controls the type of backing store ; used for the draw windows. If not present, a value of ; 2 is used to make IDL handle backing store. ; ; SLIDE_WINDOW: A named variable in which to store the IDL window number of ; the sliding window. This window number can be used with the ; WSET procedure to draw to the scrolling window at a later ; time. ; ; TITLE: The title to be used for the SLIDE_IMAGE widget. If this ; keyword is not specified, "Slide Image" is used. ; ; TOP_ID: A named variable in which to store the top widget ID of the ; SLIDE_IMAGE hierarchy. This ID can be used to kill the ; hierarchy as shown below: ; ; SLIDE_IMAGE, TOP_ID=base, ... ; . ; . ; . ; WIDGET_CONTROL, /DESTROY, base ; ; XSIZE: The maximum width of the image that can be displayed by ; the scrolling window. This keyword should not be confused ; with the visible size of the image, controlled by the XVISIBLE ; keyword. If XSIZE is not specified, the width of Image is ; used. If Image is not specified, 256 is used. ; ; XVISIBLE: The width of the viewport on the scrolling window. If this ; keyword is not specified, 256 is used. ; ; YSIZE: The maximum height of the image that can be displayed by ; the scrolling window. This keyword should not be confused ; with the visible size of the image, controlled by the YVISIBLE ; keyword. If YSIZE is not present the height of Image is used. ; If Image is not specified, 256 is used. ; ; YVISIBLE: The height of the viewport on the scrolling window. If ; this keyword is not present, 256 is used. ; ; OUTPUTS: ; None. ; ; COMMON BLOCKS: ; None. ; ; SIDE EFFECTS: ; Widgets for displaying a very large image are created. ; The user typically uses the window manager to destroy ; the window, although the TOP_ID keyword can also be used to ; obtain the widget ID to use in destroying it via WIDGET_CONTROL. ; ; RESTRICTIONS: ; Scrolling windows don't work correctly if backing store is not ; provided. They work best with window-system-provided backing store ; (RETAIN=1), but are also usable with IDL provided backing store ; (RETAIN=2). ; ; Various machines place different restrictions on the size of the ; actual image that can be handled. ; ; MODIFICATION HISTORY: ; 7 August, 1991, Written by AB, RSI. ; 10 March, 1993, ACY, Change default RETAIN=2 ; 23 Sept., 1994 KDB, Fixed Typo in comments. Fixed error in ; Congrid call. xvisible was used instead of yvisible. ;- pro tslide_image, image, USECONGRID=USECONGRID, ORDER=ORDER, REGISTER=REGISTER, $ RETAIN=RETAIN, SHOW_FULL=SHOW_FULL, SLIDE_WINDOW=SLIDE_WINDOW, $ XSIZE=XSIZE, XVISIBLE=XVISIBLE, YSIZE=YSIZE, YVISIBLE=YVISIBLE, $ TITLE=TITLE, TOP_ID=BASE, FULL_WINDOW=FULL_WINDOW, GROUP=GROUP, $ pfile=pfile, header=header, ps=ps, next=next common colors ;;;;if keyword_set(USECONGRID) then use_congrid=1 else use_congrid=0 use_congrid=1 if keyword_set(ORDER) then ORDER=1 else ORDER=0 if (n_params() ne 0) then begin image_size = SIZE(image) if (image_size(0) ne 2) then message,'Image must be a 2-D array' if (n_elements(XSIZE) eq 0) then XSIZE = image_size(1) if (n_elements(YSIZE) eq 0) then YSIZE = image_size(2) endif else begin image_size=bytarr(1) if (n_elements(XSIZE) eq 0) then XSIZE = 256 if (n_elements(YSIZE) eq 0) then YSIZE = 256 endelse if (n_elements(xvisible) eq 0) then XVISIBLE=256 if (n_elements(yvisible) eq 0) then YVISIBLE=256 xborder=100 yborder=100 if (ps EQ 1) then begin if keyword_set(pfile) then fn=pfile+'.ps' else begin fn='synop.000000.ps' endelse spawn,string('rm ',fn) set_plot,'ps' device,XOFFSET=4,YOFFSET=24.4,ysize=11,xsize=21.8,filename=fn,/landscape,bits=8; /color,/encapsulated TV,congrid(image, xvisible, yvisible), ORDER=ORDER,/normal,xsize=1,ysize=1 plot,/nodata,image,pos=[0.,0.,1.,1.],xstyle=4,ystyle=4,/noerase endif else if ( ps EQ 3) then begin if keyword_set(pfile) then fn=pfile+'.ps' else begin fn='synop.000000.ps' endelse spawn,string('rm ',fn) set_plot,'ps' device,XOFFSET=4,YOFFSET=24.4,ysize=11,xsize=21.8,filename=fn,/landscape,bits=8,/color;,/encapsulated TV,congrid(image, xvisible, yvisible), ORDER=ORDER,/normal,xsize=1,ysize=1 plot,/nodata,image,pos=[0.,0.,1.,1.],xstyle=4,ystyle=4,/noerase endif else begin if ( ps EQ 2) then begin window,4,xsize=xvisible+2*xborder,ysize=yvisible+2*yborder,/pixmap endif else begin window,4,xsize=xvisible+2*xborder,ysize=yvisible+2*yborder,retain=2 endelse TV,congrid(image, xvisible, yvisible), ORDER=ORDER,xborder,yborder plot,/nodata,image,pos=[xborder,yborder,xvisible+xborder,yvisible+yborder], $ /noerase,/device,xstyle=4,ystyle=4 endelse axis,yaxis=0,ytitle='Sine Latitude',yrange=[-1,1],$ ystyle=1,yticks=2,yminor=4,ticklen=-0.01,/save axis,yaxis=1,ytitle='Latitude',$ ytickv= 0.5*(1 + (sin((!PI/18)*(findgen(19)-9.0)))), $ ytickname=['-90',' ',' ','-60',' ','-40',' ','-20',' ','0',$ ' ',' 20',' ',' 40',' ',' 60',' ',' ',' 90'], $ ystyle=1,ticklen=-0.01,yticks=18,yrange=[0,1] Cdeg1 = sxpar(header,'LON_FRST','Start Longitude MISSING') Crot = ceil(Cdeg1/360.0) Clon = Crot*360 - Cdeg1 Cdeg2 = sxpar(header,'LON_LAST','Final Longitude MISSING') if ( next EQ 1 ) then begin carr_label,startct=Cdeg1+360,finalct=Cdeg2+360,second=1 endif carr_label,startct=Cdeg1,finalct=Cdeg2 ; Now for the longitude labels CLoffset = Clon mod 60 Larrval = fltarr(6) Laxl = strarr(6) i=0 for CL = Clon+360-CLoffset,Clon+30-CLoffset,-60 do begin Larrval(i) = CL if CL LE 360 then Laxl(i) = string(format='(i3)',CL) else Laxl(i) = string(format='(i3)',CL-360) i=i+1 end axis,xaxis=0,xtitle='Carrington Longitude',xrange=[Clon,Clon+360],$ xtickv=Larrval,xtickname=Laxl, $ xstyle=1,xticks=5,ticklen=-0.04,xminor=6,/save ; Put in a few lat & lon lines for i = 0,720,180 do begin if ((i GT Clon) AND (i LT Clon+360)) then begin plots,[i,i],[-1.,1.] if i mod 360 EQ 180 then begin ; Label CR at 180 degree point cctime = Cdeg2 - (i-Clon) crlabel = string(format='(i4)',ceil(cctime/360)) ; xyouts,i,-1.08,crlabel,alignment=0.5 end end end plots,[Clon,Clon+360],[1.,1.] ; top plots,[Clon,Clon+360],[-1.,-1.] ; bottom plots,[Clon,Clon+360],[0.,0.] ; equator xyouts,Clon-20,1.4,title,alignment=-.65 if ((ps EQ 1) OR (ps EQ 3)) then begin device,/close set_plot,'x' end end ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; pro carr_label,startct=startct,finalct=finalct,second=second ; procedure to label a carrington rotation axis with dates ; TIME STUFF mon=['BAD','JAN','FEB','MAR','APR','MAY','JUN','JUL','AUG','SEP','OCT','NOV','DEC'] t_i = intarr(7) jdt = dblarr(4) tform='(i4.4,":",i2.2,":",i2.2,"_",i2.2,"h",i2.2,"m",i2.2,".",i3.3,"s")' ctform='("CT",i4.4,":",f6.2)' ; Start of map startCR = startct/360.0 Crot = ceil (startCR) Clon = Crot*360 - startct t_i=carr2ex(startCR+1.0) ; carr2ex doesn't use CT, exactly, must add 1.0. st0string=string(format='(i2,"-",a3,"-",i4)', t_i(4),mon(t_i(5)),t_i(6)) d0=anytim2jd(st0string) ; Julian day of map start jdt(0) = double(d0.int) + t_i(0)/24.0 + t_i(1)/1440.0 + (t_i(2)+(t_i(3)/1000.0))/84600.0 map1str=string(format=tform,t_i(6),t_i(5),t_i(4),t_i(0),t_i(1),t_i(2),t_i(3)) print,"Start: ",startCR," ",map1str sttime=carr2ex(startCR+1.05) ; for labeling dates t_i=sttime ststring=string(format='(i2,"-",a3,"-",i4)', t_i(4),mon(t_i(5)),t_i(6)) d1=anytim2jd(ststring) jdt(1) = double(d1.int) + t_i(0)/24.0 + t_i(1)/1440.0 + (t_i(2)+(t_i(3)/1000.0))/84600.0 startstr=string(format=tform,t_i(6),t_i(5),t_i(4),t_i(0),t_i(1),t_i(2),t_i(3)) print,format=ctform,Crot,Clon print,"Start Day: ",ststring," ",startct ; End of map finalCR = finalct/360.0 Crot2 = ceil (finalCR) Clon2 = Crot2*360 - finalct t_i=carr2ex(finalCR+1.0) st3string=string(format='(i2,"-",a3,"-",i4)', t_i(4),mon(t_i(5)),t_i(6)) d3=anytim2jd(st3string) ; Julian day of map end jdt(3) = double(d3.int) + t_i(0)/24.0 + t_i(1)/1440.0 + (t_i(2)+(t_i(3)/1000.0))/84600.0 map2str=string(format=tform,t_i(6),t_i(5),t_i(4),t_i(0),t_i(1),t_i(2),t_i(3)) print,"End: ",finalCR," ",map2str print,format=ctform,Crot2,Clon2 endtime=carr2ex(finalCR+0.95) ; For labeling dates t_i=endtime st2string=string(format='(i2,"-",a3,"-",i4)', t_i(4),mon(t_i(5)),t_i(6)) d2=anytim2jd(st2string) jdt(2) = double(d2.int) + t_i(0)/24.0 + t_i(1)/1440.0 + (t_i(2)+(t_i(3)/1000.0))/84600.0 print,"End Day: ",st2string," ",finalct firstd = ceil(jdt(0))+1 zpoint =floor(jdt(0)) lastd = floor(jdt(3))-1 df = jdt(0) - zpoint dl = jdt(3) - zpoint xf = float(df) xl = float(dl) ntick= lastd - firstd narrval=fltarr(ntick+1) naxlabl=strarr(ntick+1) for i = 0,ntick do begin narrval(i) = i + 1.5 ; Labels at Noon mjd2date,firstd-2400000.5+i,jyear,jmonth,jday if i EQ 0 then fm=jmonth if i EQ ntick then lm=jmonth naxlabl(i) = string(format='(i2.2)',jday) endfor lcolor=255-!p.background yoff=1.22 akind=0 chsize=1.3 ttitle='Central Meridian Passage Date' if keyword_set(second) then begin lcolor=128 akind=1 chsize=1.0 ttitle='Next CR CMP Date' endif ; Date labels centered at 12 UT's axis,xaxis=akind,xrange=[xl,xf],xstyle=1,ticklen=-0.01,$ xticks=ntick,xtickv=narrval,xtickname=naxlabl,$ 0,yoff,color=lcolor,charsize=chsize ; Longer 0 UT ticks - surpressing labels. narrval2=fltarr(ntick+3) naxlabl2=strarr(ntick+3) for i=0,ntick+2 do narrval2(i)=i+1 for i=0,ntick+2 do naxlabl2(i)=' ' naxlabl2(ntick+2) = mon(lm)+string(format='(" ", i2.2)',jyear mod 100) axis,xaxis=akind,xrange=[xl,xf],xstyle=1,ticklen=-0.02,$ xticks=ntick+2,xtickv=narrval2,xtickname=naxlabl2, $ xtitle=ttitle, $ 0,yoff,color=lcolor,charsize=chsize end