;finds plots area vs. time from text file checkvar, ps, 0 initialize, ps ;reads ascii file and returns it as a text array c = rd_ascii('flux_output_june1_12-25_d45678.txt') ;removes top line which was: ;box date stime etime flux area centr peak st.dev peak.val Elow Ehi detectors c = c[1:*] ;makes 1 line string two rows b = str2cols(c) b = strcompress(b,/remove_all) ;changes the dims of array (does not change number of elements) ;box is all the box numbers box = fix(reform(b[0,*])) ;area in arcsec^2 areas = float(reform(b[5,*])) q = where(box eq 0) ;q=lines where box=0 (0,25...) b0 = b[*,q] ;b0=all full lines where box=0 ;all boxs are now 0 box = (box[q]) ;areas with box number 0 areas = (areas[q]) box = fix(reform(b0[0,*])) areas = float(reform(b0[5,*])) areas = areas * 72500000.^2 ;print,b0[*,0] ;prints all columns first row ; 0 21-Apr-2002 00:40:00.000 00:40:20.000 0.20812 1216.00 1051.61 -246.67 1048.77 -259.32 9.37 18.96 ; 0.00029369 12.000 25.000 4F 5F 6F 7F 8F ;print,b0[1,*] ;prints second column and all rows in that column which are the dates ;print,b[2,*] ;start times ;print,b[3,*] ; end times ;start times = date start time ;b0[1,*] = date statimes = reform(b0[1,*] + ' ' + b0[2,*]) ;print, stimes ;dates and start time ;end times = date end time endtimes=reform(b0[1,*] + ' ' + b0[3,*]) ;print, etimes ;dates and end time ;turns stimes into seconds stime_sec = anytim(reform(statimes)) etime_sec = anytim(reform(endtimes)) ;help,stime_sec ;STIME_SEC DOUBLE = Array[1, 327] ;print,stime_sec ;7.3535280e+008..... ;print,anytim(stime_sec,/vms) ;21-Apr-2002 00:40:00.000 ;print,anytim(stime_sec,/ecs) ;2002/04/21 00:40:00.000 tarr = (stime_sec + etime_sec)/2. ;plots volume ; Time range to plot s = 0 & e = n_elements(tarr) - 2 ;stime = anytim(tarr(s),/vms) ;etime = anytim(tarr(e),/vms) utb = min(tarr) ;create plot utplot, tarr(s:e)-utb, areas(s:e), utb, ytitle = 'area in cm!u2!n', title='Area vs. Time 12-25 keV', $ position=[0.15,0.10,0.95,0.90] ;------------------------------------------------------------------------------------------------ ;reads ascii file and returns it as a text array cc = rd_ascii('flux_output_june1_12-25_d345678.txt') ;removes top line which was: ;box date stime etime flux area centr peak st.dev peak.val Elow Ehi detectors cc = cc[1:*] ;makes 1 line string two rows bb = str2cols(cc) bb = strcompress(bb,/remove_all) ;changes the dims of array (does not change number of elements) ;box is all the box numbers boxx = fix(reform(bb[0,*])) ;area in arcsec^2 areass = float(reform(bb[5,*])) qq = where(boxx eq 0) ;qq=lines where boxx=0 (0,25...) bb0 = bb[*,qq] ;b0=all full lines where box=0 ;all boxs are now 0 boxx = (boxx[qq]) ;areas with box number 0 areass = (areass[qq]) boxx = fix(reform(bb0[0,*])) areass = float(reform(bb0[5,*])) areass = areass * 72500000.^2 ;print,b0[*,0] ;prints all columns first row ; 0 21-Apr-2002 00:40:00.000 00:40:20.000 0.20812 1216.00 1051.61 -246.67 1048.77 -259.32 9.37 18.96 ; 0.00029369 12.000 25.000 4F 5F 6F 7F 8F ;print,b0[1,*] ;prints second column and all rows in that column which are the dates ;print,b[2,*] ;start times ;print,b[3,*] ; end times ;start times = date start time ;b0[1,*] = date statimess = reform(bb0[1,*] + ' ' + bb0[2,*]) ;print, stimes ;dates and start time ;end times = date end time endtimess=reform(bb0[1,*] + ' ' + bb0[3,*]) ;print, etimess ;dates and end time ;turns stimes into seconds stime_secc = anytim(reform(statimess)) etime_secc = anytim(reform(endtimess)) ;help,stime_secc ;STIME_SEC DOUBLE = Array[1, 327] ;print,stime_secc ;7.3535280e+008..... ;print,anytim(stime_secc,/vms) ;21-Apr-2002 00:40:00.000 ;print,anytim(stime_secc,/ecs) ;2002/04/21 00:40:00.000 tarrr = (stime_secc + etime_secc)/2. ;plots volume ; Time range to plot ss = 0 & ee = n_elements(tarrr) - 1 ;stimee = anytim(tarrr(ss),/vms) ;etimee = anytim(tarrr(ee),/vms) utbb = min(tarrr) ;create plot outplot, tarrr(ss:ee)-utbb, areass(ss:ee), utbb, color=2 xyouts,0.15,0.15, $ 'black line = det 45678, red line = det 345678', color=0,/normal if ps gt 0 then device,/close set_plot,'win' end