pro El_AzE, intime=inTIME, high=HIGH, linear=LINEAR @compile_opt.pro ; On error, return to caller ;+ ; NAME: ; El_AzE ; PURPOSE: ; Plot electron data (Counts vs. Azimuth and Energy) for specified time ; CATEGORY: ; Plotting ; CALLING SEQUENCE: ; El_Aze, intime=inTIME, high=HIGH, linear=LINEAR ; INPUTS: ; inTIME spectrum time (if not present a user will be prompted) ; (in mSec since start of day) ; HIGH if present and non-zero the high energy channels ; (9-1445 eV) are plotted (by default the low energy ; channels 0-13.3 eV are used) ; LINEAR if present and non-zero a linear scale for the counts ; is used (by default a log scale is used) ; OUTPUTS: ; Plots to !ThePrinter ; CALLS: ; CartesianPolar, StrmSec ; COMMON BLOCKS: ; common I2, CHANSeV,AzNoShift,AzShift,I2_data,in_SC,in_YR,in_DOY ; SIDE EFFECTS: ; Sets hardcopy string OOZE_CMD for use by OOZE ; PROCEDURE: ; User is prompted for time if not specified in keyword INTIME ; MODIFICATION HISTORY: ; 1992, Tom Davidson, Paul Hick (UCSD) ;- common I2, CHANSeV,AzNoShift,AzShift,I2_data,in_SC,in_YR,in_DOY common El_Aze_Sav, savTIME, savHIGH, savLINEAR if !d.NAME eq !ThePrinter then begin if n_elements(in_YR) eq 0 then begin set_plot, !TheTerminal message, 'No plot available' endif inTIME = savTIME HIGH = savHIGH LINEAR = savLINEAR 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 not keyword_set(HIGH) then HIGH = 1 else HIGH = 0 if not keyword_set(LINEAR) then LINEAR = 1 else LINEAR = 0 ; If the inTime is not specified, prompt for it if n_elements(inTIME) eq 0 then begin ; get input from user print, 'Current spacecraft : Helios ',strcompress(in_SC,/remove_all) print, 'Current start time : ',StrmSec (in_YR, in_DOY, I2_data(0).TIME) dummy = n_elements(I2_data.TIME) print, 'Current end time : ',StrmSec (in_YR, in_DOY, I2_data(dummy-1).TIME) echo, 'Specify time (hour,min)' sTime = 0 & echo, 'Hour' ,sTime,0,24 & inTIME = sTime*60L sTime = 0 & echo, 'Minute',sTime,0,60 & inTIME = (inTIME+sTime)*60000L endif savTIME = inTIME savHIGH = HIGH savLINEAR = LINEAR endelse dummy = min(abs(I2_data.TIME-inTIME),Count) ; find right time inTIME = I2_data(Count).TIME ; Set energy channel range: [0,15] for low energies , [16,31] for high energies if HIGH then Chans = 16+indgen(16) else Chans = indgen(16) Z = I2_data(Count).Elec(*,Chans) ; Pick up electr counts ; Stop if no data if total(Z) eq 0 then message, $ 'No non-zero data at '+StrmSec(in_YR, in_DOY, inTIME)+ $ ' in chans '+strcompress(1+Chans(0),/rem)+'-'+ $ strcompress(1+Chans(15),/rem) ; Use proper azimuth angles if I2_data(Count).AzShift eq 0 then begin Azimuth = AzNoShift message, 'Azimuthal sectors: UNshifted',/info endif else begin Azimuth = AzShift message, 'Azimuthal sectors: SHIFTED',/info endelse CartesianPolar, vector=I2_data(Count).B, B,Theta,Phi ; THETA,PHI of B field Phi = Phi-(Phi gt 180)*360 ; Azimuth of B in [-180,180] PhiNeg = Phi+180*( (Phi lt 0)-(Phi ge 0) ) ; Azimuth of -B in [-180,180] if B eq 0 then begin ; IDL gets real confused when some of the xticks = 2 ; entries in xtickv are identical xtickname = ['-180','0','180'] xtickv = [-180.,0.,180.] endif else begin xticks = 4 xtickname = ['-180','-B','0','B','180'] xtickv = [-180.,PhiNeg,0.,Phi,180.] endelse Z = [Z,Z(0,*)] ; Sector 0 = Sector 8 ; Use log scale by default; linear if explicitly requested if LINEAR then $ Ztitle = 'COUNT' $ else begin Ztitle = 'Log (COUNT)' Z = alog10( Z > 1) endelse surface, $ reverse(Z,3),Azimuth,reverse(1+Chans), $ xtitle = 'AZIMUTH (DEG)', $ ytitle = 'Channel', $ ztitle = Ztitle, $ thick = 0.5, $ charsize= 1.5, $ xstyle = 1, $ xrange = [-200.,200.], $ xticks = xticks, $ xtickname=xtickname, $ xtickv = xtickv, $ yrange = [1+Chans(15),1+Chans(0)], $ ystyle = 1 ; Label plot : time, angle B with ecliptic xyouts, /normal, 0.,.96, StrmSec(in_YR, in_DOY, inTIME), charsize=1.35 if B ne 0. then $ xyouts, /normal, .7,.96, 'Decl B ='+string(format='(F7.2)',90-Theta),charsize=1.35 $ else $ xyouts, /normal, .7,.96, 'No B available', charsize=1.35 xyouts, /normal, .7,.0, charsize=1.1, systime() setup_ooze return & end