; Calcuate Energy Input to Thermal Plasma ; Initialize - 0 for windows, 1 for postscript (portrait), 2 for postscript (landscape) ; type ps=0, 1, or 2 on command line checkvar,ps,0 initialize, ps !p.multi = [0,1,6] restore,'idlsave_goes031028.dat' ; Calculate start time ; Time range to plot s = 600. & e = n_elements(tarray) - 1 stime = anytim(utbase+tarray(s),/atime) etime = anytim(utbase+tarray(e),/atime) ; Plot emission measure utplot,tarray(s:e),emis(s:e),utbase, $ /ylog, ytitle='Emission Measure in 10!u49!n cm!u-3!n', title = 'plots from GOES data', $ color=0,background=255, xticklen = 1, xtickname = ' ',$ xtitle = ' ', ymargin = [0,2], xmargin = [20,0], yrange = [0.001,1000.] xyouts,0.3,0.95,'Start Time = ' + stime,color=0,/normal xyouts,0.3,0.85,'End Time = ' + etime,color=0,/normal ; Plot temperature in MK utplot,tarray(s:e),tempr(s:e),utbase, $ ytitle='Temperature in MK', $ color=0,background=255,xticklen = 1,$ xtitle = ' ', ymargin = [0,0], xmargin = [20,0], yrange = [5., 30.] ;----------------------------------------------------------- c = rd_ascii('flux_output_oct28_12-25.txt') c = c[1:*] b = str2cols(c) box = fix(reform(b[0,*])) areas = float(reform(b[5,*])) q = where(box eq 0) b0 = b[*,q] box = (box[q]) areas = (areas[q]) box = fix(reform(b0[0,*])) areas = float(reform(b0[5,*])) statimes = reform(b0[1,*] + ' ' + b0[2,*]) endtimes=reform(b0[1,*] + ' ' + b0[3,*]) stime_sec = anytim(reform(statimes)) etime_sec = anytim(reform(endtimes)) goestimes = tarray+utbase vec = goestimes vol = (4./3.) * (1. / sqrt (!pi)) im_vol = vol * areas^(1.5)*72498958.3^3 v = fltarr(n_elements(tarray)) + 4.7e27 for i=0, n_elements(areas)-1 do begin i1 = value_locate(vec, stime_sec[i]) i2 = value_locate(vec, etime_sec[i]) ; print, i1,i2, im_vol[i] v[i1:i2] = im_vol[i] endfor ;---------------------------------------------------------- ;Plot thermal energy U = 3 n k T V erg ; nV = SQRT(EM * V) ; Boltzmann constant - k = 1.38e-16 erg K^-1 k = 1.38e-16 ; i.e., U = 4.14e-16 T(K) sqrt(EM(cm^-3) * V(cm^-3)) ergs ; U = 4.14e-16 tempr * 1.e6 (K) sqrt(emis*1.e49(cm^-3) * V(cm^3)) ergs ; U = 4.14 e-10 * sqrt(10) * 1.e24 *tempr * sqrt(emis * V) ergs ; U = 1.309e15 * tempr * sqrt(emis * V) erg ; V = source volume in cm^3 ;reads ascii file and returns it as a text array U = 1.309e15 * tempr * sqrt(emis * V) utplot,tarray[s:e],U[s:e],utbase, $ /ylog,ytitle='Thermal Energy U in ergs', $ color=0,background=255,xticklen = 1,$ xtitle = ' ', ymargin = [0,0], yrange=[1.e28,1.e32], xmargin = [20,0] ;y = findgen(15600,2) A = [1.2e31,1.3e30] t = [5200.,20000.] y1 = A(0) * exp(-tarray/t(0)) y2 = A(1) * exp(-tarray/t(1)) ;outplot,tarray,y1,color=0 ;outplot,tarray,y2,color=0 ;xyouts,0.4,0.85,charsize=1.5, $ ; 'Zero Intercepts = '+num2str(A(*)), /normal,color=0 ;xyouts,0.4,0.75,charsize=1.5, $ ; 'Time Constants (s) = '+num2str(t(*)), /normal,color=0 ; Plot dU/dt - rate of change of thermal energy with time ; First, smooth energy array, U, with a boxcar of length, bcl = an odd number of time intervals bcl = 51 Usmooth = smooth(U,bcl) Udot = deriv(tarray,Usmooth) Udot = smooth(Udot,bcl) utplot,tarray(s:e),Udot(s:e),ytitle='Required Energy Input Rate in ergs s!u-1!n', $ color=0,background=255,xticklen = 1,xtitle = ' ', $ ymargin = [0,0], xmargin = [20,0], yrange=[-4.e29,4.e29] ; Plot radiative loss rate Lrad = loss_rad_chianti(emis,tempr*1.e6) utplot,tarray(s:e),Lrad(s:e),color = 0, $ ytitle='Energy loss rate in ergs s!u-1!n', $ /ylog,yrange = [1.e21,1.e29], $ background=255,xticklen = 1,$ xtitle = ' ', ymargin = [0,0], xmargin = [20,0] ; Plot conductive loss rate ; Loop cross-sectional area in cm^2 ; Loop length in cm area = 2.6e18 length = 1.2e10 Lcond = loss_cond(area,length,tempr*1.e6) outplot,tarray(s:e),Lcond(s:e),color=2 ;ytitle='Conductive energy loss rate in ergs s!u-1!n', $ ; ,background=255, ymargin = [4,0], yrange = [1.e22,1.e24], /ylog, $ ; xticklen = 1,xtitle = ' ' xyouts,0.2,0.18, $ 'Area = ' + num2str(area) + ' cm!u2!n, Length = ' + num2str(length) + ' cm', $ color=0,/normal xyouts,0.4,0.3, $ 'black=lrad, red=lcond, green=lrad+lcond+udot', $ color=0,/normal ; Plot rate of total energy input to thermal plasma ; Pin = Udot + Lrad + Lcond erg s^-1 Pin = Udot + Lrad +Lcond outplot,tarray(s:e),Pin(s:e),color=7 ;ytitle='Conductive energy loss rate in ergs s!u-1!n', $ ; Integrate Pin with wrt time to get the total energy input to the thermal plasma IPin = integrate(Pin) utplot,tarray(s:e),IPin(s:e),ytitle='Energy Input to Thermal Plasma in ergs', $ color=0,background=255, ymargin = [4,0], xmargin = [20,0], yrange = [0,5.e31], $ xticklen = 1;,xtitle = ' ' if ps gt 0 then device,/close set_plot,'win' end