pro El_AzT, channel=CHAN, declim=DecLim, noB=noB, log=LOG, color=Color @compile_opt.pro ; On error, return to caller ;+ ; NAME: ; El_AzT ; PURPOSE: ; Plot electron data (Counts vs. Azimuth and Time) for a specified channel ; CATEGORY: ; Plotting ; CALLING SEQUENCE: ; El_AzT, channel=CHAN, log=LOG, declim=DecLim ; OPTIONAL INPUTS: ; channel=CHAN energy channel (1,..,32); illegal values are ignored ; log=LOG if set and non-zero, log(counts) is plotted ; noB=noB if set and non-zero, no magnetic field is plotted ; declim=DecLim only electron spectrum for which the declination angle ; (angle B-vector with ecliptic) is less than DecLim are ; plotted (0<=DecLim<=90) ; OUTPUTS: ; Plot to !ThePrinter. ; If plotting is to screen, a hardcopy can be obtained by executing ; OOZE (without any arguments) immediately following execution of EL_AZT ; CALLS: ; CartesianPolar, davis, plot, twin, xyouts, surface, t3d ; COMMON BLOCKS: ; common I2, CHANSeV,AzNoShift,AzShift,I2_data,in_SC,in_YR,in_DOY ; common El_Azt_Sav, savCHAN, savLOG, savDecLim, savnoB ; SIDE EFFECTS: ; The values of various arguments are saved in common block El_Azt_Sav. ; These values are used by a subsequent call to OOZE ; PROCEDURE: ; User is prompted for unspecified input ; MODIFICATION HISTORY: ; 1992, Tom Davidson, Paul Hick (1992) ; JUL-1993, Paul Hick (UCSD) ; - modifications required for using the OOZE procedure ;- common I2, CHANSeV,AzNoShift,AzShift,I2_data,in_SC,in_YR,in_DOY common El_Azt_Sav, savCHAN, savLOG, savDecLim, savnoB, savColor if !d.NAME eq !ThePrinter then begin if n_elements(in_YR) eq 0 then begin set_plot, !TheTerminal message, 'No plot available endif CHAN = savCHAN DecLim = savDecLim LOG = savLOG noB = savnoB Color = savColor if Color then message, 'Forget it. Color plots can not be printed endif else begin if n_elements(in_YR) eq 0 then begin message, /info, 'Use EL_READ to read electron data el_read endif if keyword_set(CHAN) then if CHAN lt 1 or CHAN gt 32 then CHAN = 0 if not keyword_set(CHAN) then begin if n_elements(savCHAN) ne 0 then CHAN = savCHAN else CHAN = 24 echo, 'Channel [1,32]', CHAN, 1,32 endif if not keyword_set(DeclLim) then DecLim = 90. else DecLim = (DecLim > 0.) < 90. echo, 'Limit B declination (90=All)',DecLim, 0,90 if keyword_set(LOG) then LOG = 1 else LOG = 0 if keyword_set(noB) then noB = 1 else noB = 0 if keyword_set(Color) then Color = 1 else Color = 0 savCHAN = CHAN savDecLim = DecLim savLOG = LOG savnoB = noB savColor = Color endelse CHANm1 = CHAN-1 Tshift = where ( I2_data.AZshift eq 1 , Nshift ) Tnoshift = where ( I2_data.AZshift eq 0 , Nnoshift ) if ( Nshift ne 0 and Nnoshift ne 0 ) then begin message, 'Time span contains spectra with and without azimuthal shift',/info echo, '1. Plot only unshifted spectra echo, '2. Plot only shifted spectra echo, '3. Plot all spectra assuming unshifted azimuths throughout echo, ' Your choice, dummy, 1, 3 if dummy eq 1 then begin Azimuth = AzNoShift endif else if dummy eq 2 then begin Azimuth = AzShift Tnoshift = Tshift endif else begin Azimuth = AzNoShift Tnoshift = [Tshift,Tnoshift] & Tnoshift = Tnoshift(sort(Tnoshift)) endelse endif else if ( Nshift eq 0 ) then begin message, 'All spectra with unshifted azimuths',/info Azimuth = AzNoShift endif else if ( Nnoshift eq 0) then begin message, 'All spectra with shifted azimuths',/info Azimuth = AzShift Tnoshift = Tshift endif else message, 'No spectra in memory ?? This is not supposed to happen !! T = I2_data(Tnoshift).TIME Z = I2_data(Tnoshift).ELEC(*,CHANm1) B = I2_data(Tnoshift).B Z = [Z,Z(0,*)] ; Append sector : Sector 8 = Sector 0 if keyword_set(LOG) then begin ; Counts or log(COUNTS) Z = alog10 ( Z > 1 ) ZTITLE = 'Log (COUNTS)' endif else ZTITLE = 'COUNTS' if Color then begin Position = [.2,.15,1,.9] ; Plot window in normalize units PhiRange = [Azimuth(0)-30,Azimuth(8)+30] Z = transpose(Z) plot, T/3600000., Azimuth, $ position= Position, $ xtitle = 'HOUR', $ ytitle = 'AZIMUTH (DEG)', $ /nodata, color=15, $ yrange = PhiRange, $ yticks = 4, $ ytickv = [-180,-90,0,90,180], $ ystyle = 2, $ xstyle = 2 if LOG then $ BreakVal = .5+.125*16/!d.n_colors*findgen(!d.n_colors-1) $ else begin $ BreakVal = 50.+50.*16/!d.n_colors*findgen(!d.n_colors-1) BreakVal = round(BreakVal) endelse print, min(Z), max(Z) Th = (shift(T,-1)-T)/3600000. Th(n_elements(T)-1) = .01 ColorBox, T/3600000., Azimuth-22.5 , Th, 45., $ GetColors( Z , BreakVal, /legend , format='(F10.1)', chars=1.1, load=5 ) endif else begin PhiRange = [-200.,200.] Position = [.075,.05,1,1,.25,1] ; Plot window in normalize units twin, 1 & davis, 0 ; To graphics screen, dialog buffer invisible surface, $ ; Surface for electron counts Z,Azimuth,T/3600000., $ xtitle = 'AZIMUTH (DEG)', $ ytitle = 'HOUR', $ ztitle = ZTITLE, $ thick = 0.5, $ charsize= 1.5, $ position= Position, $ ; Plot window (normalized) /save, $ ; Save !x,!y,!z ; x-axis : phase angle xstyle = 1, $ ; Exact range xrange = PhiRange, $ ; Range of phase angles xmargin = [0.,0.], $ xticks = 4, $ xtickv = [-180,-90,0,90,180], $ ; y-axis : time ymargin = [0.,0.], $ ; z-axis : electron counts zrange = [0.,max(Z)] endelse T1 = StrmSec(in_YR,in_DOY,T(0)) T2 = StrmSec(in_YR,in_DOY,T(n_elements(T)-1)) T2 = strmid(T2,strpos(T2,',')+1,99) xyouts, /normal, 0.,.98, charsize=1.25, $ ' HOS '+strcompress(in_SC,/remove_all)+' Channel '+ $ strcompress(CHAN,/remove_all)+ $ ' ['+strcompress( string(format='(F7.2)',CHANSeV(CHANm1)) )+' eV]' xyouts, /normal, .50,.975, charsize=1.1,T1+' - '+T2 xyouts, /normal, .7, .0, charsize=1.1, systime() ; Now deal with the magnetic field ; Check for times without B-field data (Bx=By=Bz=-1). Set to 0. Bv = transpose(I2_data.B) I = where(Bv(*,0) ne -1. and Bv(*,1) ne -1. and Bv(*,2) ne -1.,CntB) ; Check whether magnetic field available : Count > 1 if CntB gt 1 then begin Bv = Bv(I,*) T = I2_data(I).TIME endif else begin message, /info, 'No magnetic field available setup_ooze & return endelse if noB then begin message, /info, 'No magnetic field plotted setup_ooze & return endif CartesianPolar, vector=Bv, B, BTheta, BPhi I = where (B gt 0., CntB) if CntB lt n_elements(B) then begin message, /info, '# zero B data points dumped '+strcompress(n_elements(B)-CntB,/rem) T = T(I) & B = B(I) & BTheta = BTheta(I) & BPhi = BPhi(I) endif I = where(BPhi gt 180,CntB) & if CntB ne 0 then BPhi(I) = BPhi(I)-360 BTheta = 90.-BTheta & BTheta = (BTheta < DecLim) > (-Declim) ; Plot magnetic field T = T/3600000. ; Convert to hours if Color then begin if Count ge 1 then oplot, T, BPhi, color=15 endif else begin axis, 0.,T(0),!z.CRANGE(1), $ ; T-axis for B azimuth /noerase, /t3d, /noclip, $ ystyle = 1, $ yaxis = 0, $ ytitle = 'B Azimuth', $ charsize= 1.5 oplot, BPhi,T, $ ; B azimuth /t3d, /noclip, $ zvalue = !z.S(0)+!z.S(1)*!z.CRANGE(1) t3d, /xzexch plot, BTheta,T, $ ; Magnetic field decl /noerase, /t3d, /noclip, $ xtitle = 'DECL B', $ position= [0,.05,.5,1,.075,1], $ xcharsize= 2, $ xrange = [-90.,90.], $ xstyle = 1,ystyle=5, $ xticks = 4, $ xtickv = [-90,-45,0,45,90], $ xmargin = [0,0], $ ymargin = [0,0], $ zvalue = .075 endelse setup_ooze return & end