pro plot_all_one, inputfile common ffinfo, header itime = intarr(6) if (n_elements(inputfile) eq 0) then begin filein = '' read, 'Enter files to input ("filein".hed, filein can be *) : ', filein filelist = findfile(filein+'.hed') print, 'Number of files found : ',n_elements(filelist) sdate = '' ndays = 0 print, 'my plot_all_one: sample date : 03-jan-93' read, 'Enter start date in form "dd-mon-yy" : ',sdate read, 'Enter number of days to plot : ',ndays endif else begin openr,1,inputfile filein = '' sdate = '' ndays = 0 readf,1,filein readf,1,sdate readf,1,ndays filelist = findfile(filein+'.hed') close,1 endelse c_s_to_a, sitime, sdate c_a_to_r, sitime, stime etime = stime + float(ndays)*24.0*3600.0 c_r_to_a, eitime, etime c_r_to_a, itime, stime psfile = 'p'+tostr(itime(0))+chopr('0'+tostr(itime(1)),2)+ $ chopr('0'+tostr(itime(2)),2)+'.ps' title = '' nf = n_elements(filelist) nn = 1500L*ndays nn = 86401L*ndays nn = 86401L*ndays*2L data = fltarr(nf,3,nn) time = fltarr(nf,nn) stats = strarr(nf,3) npts = lonarr(nf)*0L mlat = fltarr(nf) mlon = fltarr(nf) line = '' ppp = 1 spawn,"/usr/bin/whoami",name name = name(0) fname = $ "/galileo/d/ganglu/mags/tempfiles/mas.loc." + $ name+"."+sdate fl = findfile(fname) mlist = 0 if strlen(fl(0)) gt 0 then begin openr,1,fname readf,1,fname close,1 mlist = 1 endif if (strlen(fl(0)) gt 0) then print,'Find master_dec file: ',fname for i=0,n_elements(filelist)-1 do begin filein = strmid(filelist(i),0,strpos(filelist(i),'.hed')) print,'Reading file # ',chopr('00'+tostr(i+1),3),': ',filein setup_var_menu, 1, filein, timeint, vars, units, count, nrows, rowlen for j=0,2 do stats(i,j) = strcompress(vars(j), /remove_all) if mlist eq 1 then begin openr,1, fname done = 0 readf,1,line readf,1,line while (not done) do begin readf,1,line if (strpos(line,strmid(stats(i,0),0,3)) eq 0) then begin mlat(i) = float(strmid(line,51,7)) mlon(i) = float(strmid(line,58,7)) done = 1 endif if eof(1) then done = 1 endwhile close,1 endif else begin mlat(i) = 0.0 mlon(i) = 0.0 endelse id = 0 header = {nr : nrows(0), unit : 51, rl : rowlen(0)} openr, header.unit(0), filein+'.dat' srow = loc_ffunix_row(id, stime) erow = loc_ffunix_row(id, etime) if erow-srow gt 0 then begin for row=srow,erow do begin ; if (npts(i) lt 1500L*ndays-2) then begin fdget, id, row, uttime, indata loc = where(indata eq -1.0e32, count) if count eq 0 then begin for j=0,2 do data(i,j,npts(i)) = indata(j) time(i,npts(i)) = uttime - stime npts(i) = npts(i)+1L endif else begin for j=0,2 do data(i,j,npts(i)) = 999999.0 time(i,npts(i)) = uttime - stime npts(i) = npts(i)+1L endelse ; endif endfor endif close, header.unit(0) endfor if (strlen(psfile) gt 0) then setdevice, psfile, 'l', 4, 0.9 $ else window,1,xsize=800,ysize=600 plotnum = 0 offset = 300.0 space = 0.02 ;xmin = 0.02 ;xmax = 0.99 ;ymin = 0.00-space ;ymax = 1.00 xmin = 0.05 xmax = 0.95 ymin = 0.07 ymax = 0.95 dy = (ymax-ymin)/3.0 dx = (xmax-xmin)/3.0 time_axis, sitime, eitime, btr, etr, $ xtickname, xtitle, xtickvalue, xminor, xtickn ytickname = strarr(ppp+1)+' ' ytickvalue = findgen(ppp+1)*offset yminor = 10 ytickn = ppp filen = 0 order = intarr(nf) mtemp = mlat for i = 0, nf-1 do begin loc = where(mtemp eq max(mtemp)) order(i) = loc(0) mtemp(order(i)) = -100.0 endfor mtemp = 0 while filen le nf-1 do begin range = 0.0 ii = order(filen) if npts(ii) gt 0 then begin for icomp = 0, 2 do begin d = data(ii,icomp,0:npts(ii)-1) loc = where(abs(d) lt 999998.0, count) if count gt 0 then begin maxd = max(d(loc)) mind = min(d(loc)) if (maxd - mind gt range) then begin range = maxd - mind endif endif endfor endif if range lt 1.0 then range = 1.0 range = float(fix((1.33*range+99.0)/100.0))*100.0 for icomp = 0, 2 do begin if npts(ii) gt 0 then d = data(ii,icomp,0:npts(ii)-1) $ else d = [0.0,0.0] if (icomp eq 0) then plotdumb pos = [xmin,ymax-float(icomp+1)*dy+space,xmax, ymax-float(icomp)*dy] if (icomp eq 2) then begin xtickna = xtickname xtitl = xtitle endif else begin xtickna = strarr(n_elements(xtickname)) + ' ' xtitl = ' ' endelse loc = where(abs(d) lt 999998.0, count) if count gt 0 then begin maxd = max(d(loc)) mind = min(d(loc)) rs = range - (maxd-mind) m1 = maxd + rs/2.0 m2 = mind - rs/2.0 m = mean(d(loc)) endif else begin m1 = range/2.0 m2 = -m1 m = 0.0 endelse plot, [btr,etr], [m1,m2], $ xstyle = 1, $ ystyle = 1, $ pos = pos, $ /nodata, $ /noerase, $ xtickname = xtickna, $ xtitle = xtitl, $ xtickv = xtickvalue, $ xminor = xminor, $ xticks = xtickn, $ title = title if npts(ii) gt 0 then oplot, time(ii,0:npts(ii)-1), d, $ max_value = 999998.0,min_value = -999998.0 oplot, [btr,etr],[m,m], linestyle = 2 xyouts, [etr+etr/100],[(m1+m2)/2.0], $ strmid(stats(ii,icomp),3,1) + ' mean : ' + $ tostrf(m) + ' nT', $ alignment=0.5, orientation=270 if (icomp eq 0) then begin xyouts, [btr],[(m1+m2)/2.0 + range*0.55], $ strmid(stats(ii,icomp),0,3), charsize = 1.5 xyouts, [etr],[(m1+m2)/2.0 + range*0.55], $ ' alat : '+tostrf(mlat(ii)), alignment = 1.0 xyouts, [1.03],[0.5], $ 'Plot Scale : '+tostrf(range)+' nT', $ /norm, $ alignment=0.5, orientation=270, charsize = 0.9 endif for i=1,ndays-1 do begin t = btr+float(i)*24.0*3600.0 oplot, [t,t],[m1,m2], linestyle = 1 endfor endfor spawn,"date",date xyouts, 0.0, -0.1, date,/norm,charsize=0.5 filen = filen + 1 if (!d.name eq 'X' and filen le nf-1) then prompt_for_next endwhile if (!d.name eq 'PS') then begin device, /close set_plot,'X' endif return end