; Discussion of units in SSJ4 ~emery/reu11/cenergy.pro print-out ; 9/11 Barbara Emery, HAO/NCAR, ~emery/reu11/units_cenergy.txt ;----------------------------------------------------------------------------- ; ; procedure calc_flx ; ; This section gets the conversion factors from electron and ion ; counts to number flux and energy flux for the different energy gates. ; and computes the integrated fluxes, differential fluxes, avg energy ; and fluxes from 450 eV to 30 keV. ; ; ; Variables Used - ; ecnt, icnt - counts from J4 or J5 instrument. ; eflx, iflx - differential directional number flux in units of ; particles/(cm^2 s sr eV). ; eeflx, ieflx - integral energy flux in units of eV/(cm^2 s sr) ; printed out in units of mW/m^2 (or ergs/cm^2-s) with fac=1.602e-12*pi ; 1eV = 1.602e-12 erg and pi/sr (ster-radian) to get the isotropic downgoing particles ; 2piR is circumference of circle, so half circumference is piR. Thus pi for downgoing only. ; mW/m^2 = 1.e-3J/cm^2*1.e+4-s = 1.e-7*1.e+7erg/cm^2-s = erg/cm^2-s : NOTE: !pi is a special term for pi in IDL (! is NOT a comment or inverse etc) ; enflx, inflx - integral number flux in units of part/(cm^2 s sr) ; eave, iave - average energy in eV = eeflx/enflx or ieflx/inflx ; oeeflx, oieflx- energy flux into ionosphere assuming isotropic ; flux; for this, energies below ~450 eV are zeroed; ; units of eV/(cm^2 s). The energies which are zeroed ; are the 14-20 channels. ; oeave, oiave - average energy in eV for energies above and ; including ~450 eV. ; deeflx, deiflx- differential directional energy flux in units of ; eV/(cm^2 s sr eV). Calculated by multiplying eflx ; and iflx by the central energy of each bin and by ; the energy independent geometric factor, GF. The GF ; multiplication cancels the previous division by GF ; used to derive eflx and iflx. ; begtime - year,month,day,hour,minute,julian day (all floating point) ; for start of plot ;----------------------------------------------------------------------------- PRO calc_flx, ecnt, icnt, isat, eeflx, ieflx, eave, iave, eflx, iflx, $ oeeflx, oieflx, enflx, inflx, deeflx, deiflx, output_type, iyear, $ ; begtime, JGF_LABEL ; Emery 05/07: added begtime to calc_flx ; Emery 10/08: added minimum_cglat,mlat1m,mlt1m to calc_flx begtime,JGF_LABEL,totlen,minimum_cglat,uts1m,glat1m,glon1m,alt1m, $ glat1101m,glon1101m,mlon1101m,mlat1m,mlt1m ; Emery 10/08: added totlen, dumlat and ephemeris data to calc_flx (uts1m use float(hour)*3600., or bad!) ; Create the arrarys for integrated number and energy fluxes fac = 1.602e-12*!pi eeflx450 = fltarr(n_elements(eflx(*,0))) enflx450 = fltarr(n_elements(eflx(*,0))) ieflx450 = fltarr(n_elements(eflx(*,0))) inflx450 = fltarr(n_elements(eflx(*,0))) eeflx = fltarr(n_elements(eflx(*,0))) ieflx = fltarr(n_elements(eflx(*,0))) enflx = fltarr(n_elements(eflx(*,0))) inflx = fltarr(n_elements(eflx(*,0))) for i=0,numsec-1 do begin ;for i=0,n_elements(eflx[*,0])-1 do begin eeflx450(i) = 0 enflx450(i) = 0 ieflx450(i) = 0 inflx450(i) = 0 eeflx(i) = 0 ieflx(i) = 0 enflx(i) = 0 inflx(i) = 0 ; energy channels 0-19 (1-20) are: ; 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 ;30.18 20.62 14.04 9.58 6.50 4.42 3.05 2.06 1.41 .984 .992 .679 .462 .317 .213 .145 .100 .068 .046 .032 for j=0,19 do begin if isat ge 16 and j eq 10 then goto,SKIPENFLUX eeflx(i) = eeflx(i) + 1000.*elecal1(j)*ecnt(i,j) enflx(i) = enflx(i) + elecal2(j)*ecnt(i,j) if (j le 12) then begin eeflx450(i) = eeflx450(i) + 1000.*elecal1(j)*ecnt(i,j) enflx450(i) = enflx450(i) + elecal2(j)*ecnt(i,j) ieflx450(i) = ieflx450(i) + 1000.*ioncal1(j)*icnt(i,j) inflx450(i) = inflx450(i) + ioncal2(j)*icnt(i,j) endif if j lt 18 then begin ; Since the two lowest energy ion channels are often contaminated by ambient ; ions drawn in by the spacecraft's potential, ignore these channels in ; calculating the ion energy and number fluxes. These channels are not ignored ; when calculating the differential fluxes so that the contaminated data can be ; seen on the color spectograms. ieflx(i) = ieflx(i) + 1000.*ioncal1(j)*icnt(i,j) inflx(i) = inflx(i) + ioncal2(j)*icnt(i,j) endif SKIPENFLUX: endfor ; calculate mean energy from >462eV (mean "E-region" energy - term of Emery) ; See Rich et al., [Annal Geophys, 1987, 87/06 A, 527-534] for use in Robinson et al. ; [1987, JGR, 92, 2565-2570] equs to calculate SigP,H from aurora (NOTE: error in ; eq 14 of Rich et al. - do not divide Eo by 2 for SigH - delete '2' in eq 14.) ; Difference is minor for ions (unless include contamination <68eV), but can ; increase for electrons by almost a factor of 2 since there is lots of ; number flux in electrons <462eV, but very little energy flux. Electrons <600eV ; do not contribute much to the E-region conductivity, but in the cusp or LLBL, ; electrons <600eV contribute a lot to the F-region conductivity, especially in ; cusp reconnection where the downward Poynting flux is large [Li et al., ; 2011, JGR, doi:10.1029/2011JA016566; Knipp et al., 2011, GRL, doi:10.1029/2011GL048302] ele_eV = 0. ion_eV = 0. if (enflx450[i] gt 0.1) then ele_eV = eeflx450[i]/enflx450[i] if (inflx450[i] gt 0.1) then ion_eV = ieflx450[i]/inflx450[i] ; calculate mean energy for electrons from >32eV and for ions >68eV (<68eV contaminated) reg_ele_eV = 0. reg_ion_eV = 0. if (enflx[i] gt 0.1) then reg_ele_eV = eeflx[i]/enflx[i] if (inflx[i] gt 0.1) then reg_ion_eV = ieflx[i]/inflx[i] ;if (abs(rmlat) ge minimum_cglat) then begin ;printf,u_eflux,format='(i5,f7.0,8f8.2,6e12.4)',i,utsr,rglat,rglon,ralt,rglat110,rglon110, $ printf,u_eflux,format='(i5,f7.0,8f8.2,6e12.4,2f7.0)',i,utsr,rglat,rglon,ralt,rglat110,rglon110, $ rmlat,rmlon110,rmlt,eeflx[i]*fac,enflx[i],ele_eV,ieflx[i]*fac,inflx[i],ion_eV,reg_ele_eV,reg_ion_eV endfor close,u_eflux free_lun,u_eflux