pro mag_plot, day1, day2 if (n_elements(day2) eq 0) then day2 = day1 for i=day1,day2 do begin day = strtrim(string(i),2) file = '/soidata/info/mdi_rec/lev1.5/fd_M_96m_01d/00'+day+'.record.rdb.Z' if (file_exist(file)) then begin com = 'zcat ' + file + ' > /tmp/record.synop.rdb' spawn, com, tmpfile infile1 = '/tmp/record.synop.rdb' endif else infile1 = '/soidata/info/mdi_rec/lev1.5/fd_M_96m_01d/00'+day+'.record.rdb' tmp = rd_rdb(infile1) dat = strtrim(tmp(*, 2:* ),2) xx = where(dat(1,*) eq "") hd = strtrim(tmp(*,0),2) m=n_elements(hd) n = n_elements(dat(1,*)) tex = intarr(7,n) tex(0,*) = strmid(dat(2,*),11,2) tex(1,*) = strmid(dat(2,*),14,2) tex(2,*) = strmid(dat(2,*),17,2) tex(3,*) = 0 tex(4,*) = strmid(dat(2,*),8,2) tex(5,*) = strmid(dat(2,*),5,2) tex(6,*) = strmid(dat(2,*),0,4) tim = anytim2ints(tex) for j=0,m-1 do begin if ( hd(j,0) eq 'DPC_OBSR' ) then obs = string(reform(dat(j,*))) ; if ( hd(j,0) eq 'QUALITY' ) then quality = float(reform(dat(j,*))) ; if ( hd(j,0) eq 'DATA_RMS' ) then datarms = float(reform(dat(j,*))) if ( hd(j,0) eq 'DATAMEAN' ) then datamean = float(reform(dat(j,*))) if ( hd(j,0) eq 'MEAN_FLD' ) then meanfld = float(reform(dat(j,*))) ; if ( hd(j,0) eq 'MISSVALS' ) then missvals = float(reform(dat(j,*)))+1 if ( hd(j,0) eq 'TOT_FLUX' ) then begin totflux = float(reform(dat(j,*))) totflux5 = float(reform(dat(j,*))) end if ( hd(j,0) eq 'AVG_FLUX' ) then begin avgflux = float(reform(dat(j,*))) avgflux5 = float(reform(dat(j,*))) end if ( hd(j,0) eq 'X0' ) then x0 = float(reform(dat(j,*))) if ( hd(j,0) eq 'Y0' ) then y0 = float(reform(dat(j,*))) end if (strtrim(xx(0),2) ne "-1" ) then begin ; quality(xx) = -1.0 ; datarms(xx) = 0.0 datamean(xx) = -3.0 meanfld(xx) = -3.0 ; missvals(xx) = .001 totflux(xx) = 0.0 avgflux(xx) = 0.0 x0(xx) = 509.0 y0(xx) = 509.0 end for k=0,n-1 do begin if ((datamean(k) gt 3.0) or (datamean(k) lt -3.0)) then datamean(k) = 3.0 if ((meanfld(k) gt 3.0) or (meanfld(k) lt -3.0)) then meanfld(k) = 3.0 ; if (missvals(k) gt 1000.0) then missvals(k) = 1000.0 ; if (datarms(k) gt 30.0) then datarms(k) = 30.0 if (totflux(k) gt 10000000.0) then totflux(k) = 10000000.0 if (avgflux(k) gt 20.0) then avgflux(k) = 20.0 if (x0(k) gt 513.5) then x0(k) = 513.5 if (y0(k) gt 513.5) then y0(k) = 513.5 if (obs(k) eq "FD_Magnetogram_Sum") then begin totflux(k) = 100000000 avgflux(k) = 100000000 endif else begin totflux5(k) = 100000000 avgflux5(k) = 100000000 end end com='time_index -h day='+strtrim(string(day),2) spawn,com,hour1 a=long(strtrim(hour1(0),2)) hour0 =a-1 com='time_index -t in='+strtrim(string(hour0),2) spawn,com,time1 st = intarr(7,1) st(0,*) = strmid(time1(0),11,2) st(1,*) = strmid(time1(0),14,2) st(2,*) = strmid(time1(0),17,2) st(3,*) = 0 st(4,*) = strmid(time1(0),8,2) st(5,*) = strmid(time1(0),5,2) st(6,*) = strmid(time1(0),0,4) sttim=anytim2ints(st) com='time_index -h day='+strtrim(string(i+1),2) spawn,com,hour24 b=long(strtrim(hour24(0),2)) hour25 = b + 1 com='time_index -t in='+strtrim(string(hour25),2) spawn,com,time2 en = intarr(7,1) en(0,*) = strmid(time2(0),11,2) en(1,*) = strmid(time2(0),14,2) en(2,*) = strmid(time2(0),17,2) en(3,*) = 0 en(4,*) = strmid(time2(0),8,2) en(5,*) = strmid(time2(0),5,2) en(6,*) = strmid(time2(0),0,4) entim=anytim2ints(en) infile2 = '/soidata/info/mdi_rec/lev1.5/fd_M_96m_01d/overview.00' + strtrim(day,2) + '.rdb.Z' if (file_exist(infile2)) then begin spawn, 'zcat ' + infile2 + ' > /tmp/overview.rdb' ; com = 'column RUNTIME < /tmp/overview.rdb' spawn, com, runtime endif else begin infile2 = '/soidata/info/mdi_rec/lev1.5/fd_M_96m_01d/overview.00' + strtrim(day,2) + '.rdb' if (file_exist(infile2)) then begin ; com = 'column RUNTIME < ' + infile2 spawn, com, runtime endif else print, infile2 + '(.Z) do not exist' endelse !p.multi=[0,1,4] !Y.MINOR=-1 !p.charsize=1.3 set_plot, 'z' device, set_resolution=[600,640] ; window,0,xsize=600,ysize=640 utplot,tim,datamean,timerange=[sttim,entim],yrange=[-2.5,2.5],psym=7,symsize=.7,title='Data Mean(x) Mean Field' outplot,tim,meanfld,psym=6,symsize=.7 utplot,tim,totflux,timerange=[sttim,entim],yrange=[0,20000000],psym=7,symsize=.7,title='Total Flux (x=1m)' outplot,tim,totflux5,psym=6,symsize=.7 utplot,tim,avgflux,timerange=[sttim,entim],yrange=[0,20],psym=7,symsize=.7,title='Average Flux (x=1m)' outplot,tim,avgflux5,psym=6,symsize=.7 utplot,tim,x0,timerange=[sttim,entim],yrange=[509,513.5],psym=7,symsize=.7,title='X0(x) Y0' outplot,tim,y0,psym=6,symsize=.7 ; xyouts, -9000,25, alignment=1.0, orientation=90, charsize=.9, runtime(2) outfil = '/surge40/synoptic/mag_plots/' + strtrim(i,2) + '.gif' ; outfil = 'plot.gif' write_gif, outfil, tvrd() end set_plot, 'X' end