;+ ;Purpose: ;Generates sst overview plots for a given date ;this includes one day long plot and 4 1/4 day plots ;It stores these plots in the current directory ; ;Arguments: ; date: the date for which the plots will be generated ; ; directory(optional): an optional output directory ; ; device(optional):switch to 'z' device for cron plotting ; ;Example: ; thm_sst_overviews,'2007-03-23',dir='~/out',device='z' ; ; $LastChangedBy: pcruce $ ; $LastChangedDate: 2007-10-15 12:52:49 -0700 (Mon, 15 Oct 2007) $ ; $LastChangedRevision: 1704 $ ; $URL: svn+ssh://thmsvn@ambrosia.ssl.berkeley.edu/repos/thmsoc/tags/tdas_3_01/idl/themis/common/thm_sst_overviews.pro $ ;- pro thm_sst_overviews,date,directory=directory,device=device probe_list = ['a','b','c','d','e'] ;clean slate del_data,'*' thm_init if not keyword_set(date) then begin message,/continue,'Date must be set to generate sst overview plots' return endif date2 = time_string(date) if keyword_set(directory) then dir=directory else dir='./' if keyword_set(device) then set_plot,device ;tplot_options,'lazy_ytitle',0 ; prevent auto formatting on ytitle (namely having carrage returns at underscores) timespan,date2,1,/day year=string(strmid(date2,0,4)) month=string(strmid(date2,5,2)) day=string(strmid(date2,8,2)) var_string_f1 = '' var_string_f2 = '' var_string_r1 = '' var_string_r2 = '' for i = 0L,n_elements(probe_list)-1L do begin sc = probe_list[i] thm_load_hsk,probe=sc,varformat='th'+sc+'*issr_mode*' ;start mode bar code block ;------------> ;reassign because thm_load_hsk mutates its input sc = probe_list[i] if tnames('th'+sc+'*issr_mode*') eq '' then store_data,strjoin('th'+sc+'_hsk_issr_mode_raw'),data={x:[time_double(date)],y:float('Nan')} get_data,strjoin('th'+sc+'_hsk_issr_mode_raw'),data=d ss_data=float(d.y) index_ss_fill=where(d.y ne 0) index_ss=where(d.y eq 0) if (index_ss_fill(0) ne -1) then ss_data(index_ss_fill)=float('NaN') if (index_ss(0) ne -1) then ss_data(index_ss)=0. fs_data=float(d.y) index_fs_fill=where(d.y ne 0 and d.y ne 1) index_fs=where(d.y eq 0 or d.y eq 1) if (index_fs_fill(0) ne -1) then fs_data(index_fs_fill)=float('NaN') if (index_fs(0) ne -1) then fs_data(index_fs)=0. pb_data=float(d.y) index_pb_fill=where(d.y ne 0 and d.y ne 1 and d.y ne 2) index_pb=where(d.y eq 0 or d.y eq 1 or d.y eq 2) if (index_pb_fill(0) ne -1) then pb_data(index_pb_fill)=float('NaN') if (index_pb(0) ne -1) then pb_data(index_pb)=0. pb_data2=float(d.y) ; pb_data2 is for symbols below bar index_pb_fill2=where(d.y ne 2) index_pb2=where(d.y eq 2) if (index_pb_fill2(0) ne -1) then pb_data2(index_pb_fill2)=float('NaN') if (index_pb2(0) ne -1) then pb_data2(index_pb2)=-1. wb_data=float(d.y) index_wb_fill=where(d.y ne 0 and d.y ne 1 and d.y ne 2 and d.y ne 3) index_wb=where(d.y eq 0 or d.y eq 1 or d.y eq 2 or d.y eq 3) if (index_wb_fill(0) ne -1) then wb_data(index_wb_fill)=float('NaN') if (index_wb(0) ne -1) then wb_data(index_wb)=0. wb_data2=float(d.y) ; wb_data2 is for symbols above bar index_wb_fill2=where(d.y ne 3) index_wb2=where(d.y eq 3) if (index_wb_fill2(0) ne -1) then wb_data2(index_wb_fill2)=float('NaN') if (index_wb2(0) ne -1) then wb_data2(index_wb2)=1. store_data,'slow_survey_bar_'+sc,data={x:d.x,y:ss_data} store_data,'fast_survey_bar_'+sc,data={x:d.x,y:fs_data} store_data,'particle_burst_bar_'+sc,data={x:d.x,y:pb_data} store_data,'particle_burst_sym_'+sc,data={x:d.x,y:pb_data2} store_data,'wave_burst_bar_'+sc,data={x:d.x,y:wb_data} store_data,'wave_burst_sym_'+sc,data={x:d.x,y:wb_data2} store_data,'aesthetic_bar_'+sc,data={x:d.x,y:ss_data} options,'aesthetic_bar_'+sc,'color',255 options,'slow_survey_bar_'+sc,'color',5 options,'fast_survey_bar_'+sc,'color',6 options,'particle_burst_bar_'+sc,'color',3 options,'particle_burst_sym_'+sc,'color',0 options,'wave_burst_bar_'+sc,'color',0 options,'wave_burst_sym_'+sc,'color',0 options,'slow_survey_bar_'+sc,'thick',5 options,'fast_survey_bar_'+sc,'thick',5 options,'particle_burst_bar_'+sc,'thick',5 options,'particle_burst_sym_'+sc,'psym',6 options,'particle_burst_sym_'+sc,'symsize',0.2 options,'wave_burst_bar_'+sc,'thick',5 options,'wave_burst_sym_'+sc,'psym',6 options,'wave_burst_sym_'+sc,'symsize',0.2 store_data,'sample_rate_'+sc,data=['aesthetic_bar_'+sc,'wave_burst_bar_'+sc,'particle_burst_bar_'+sc,'fast_survey_bar_'+sc,'slow_survey_bar_'+sc,'particle_burst_sym_'+sc,'wave_burst_sym_'+sc] ylim,'sample_rate_'+sc,-1.1,1.1,0 options,'sample_rate_'+sc,'panel_size',0.2 ;end mode bar code block ;---------------> thm_load_sst,probe=sc,lev=1 thm_part_moments, probe = sc, instrument = ['psif', 'psef','psir','pser'], $ moments = ['density', 'velocity', 't3'] ;kluge to prevent missing data from crashing things index_sst=where(strjoin('th'+sc+'_psef_en_eflux') eq tnames()) if index_sst eq -1 then begin filler=fltarr(2,16) filler(*,*)=float('NaN') store_data,strjoin('th'+sc+'_psef_en_eflux'),data={x:time_double(date)+findgen(2),y:filler,v:findgen(16)} name=strjoin('th'+sc+'_psef_en_eflux') options,name,'spec',1 ylim,name,1,1000,1 zlim,name,1,1000,1 options,name,'ytitle','th'+sc+'!Celec' options,name,'ztitle','Eflux !C eV/(eV*cm!U2!N*sec*sr)' endif else begin name='th'+sc+'_psef_en_eflux' options,name,'spec',1 ylim,name,2e4,3e6 options,name,'ytitle','th'+sc+'!Celec' options,name,'ztitle','Eflux !C eV/(eV*cm!U2!N*sec*sr)' options,name,'y_no_interp',1 options,name,'x_no_interp',1 endelse ;kluge to prevent missing data from crashing things index_sst=where(strjoin('th'+sc+'_psif_en_eflux') eq tnames()) if index_sst eq -1 then begin filler=fltarr(2,16) filler(*,*)=float('NaN') store_data,strjoin('th'+sc+'_psif_en_eflux'),data={x:time_double(date)+findgen(2)*86400.,y:filler,v:findgen(16)} name=strjoin('th'+sc+'_psif_en_eflux') options,name,'spec',1 ylim,name,1,1000,1 zlim,name,1,1000,1 options,name,'ytitle','th'+sc+'!Cions' options,name,'ztitle','Eflux !C eV/(eV*cm!U2!N*sec*sr)' endif else begin ;SST ion panel name='th'+sc+'_psif_en_eflux' options,name,'spec',1 ylim,name,2e4,3e6 options,name,'ytitle','th'+sc+'!Cions' options,name,'ztitle','Eflux !C eV/(eV*cm!U2!N*sec*sr)' options,name,'y_no_interp',1 options,name,'x_no_interp',1 endelse ;kluge to prevent missing data from crashing things index_sst=where(strjoin('th'+sc+'_psir_en_eflux') eq tnames()) if index_sst eq -1 then begin filler=fltarr(2,16) filler(*,*)=float('NaN') store_data,strjoin('th'+sc+'_psir_en_eflux'),data={x:time_double(date)+findgen(2),y:filler,v:findgen(16)} name=strjoin('th'+sc+'_psir_en_eflux') options,name,'spec',1 ylim,name,1,1000,1 zlim,name,1,1000,1 options,name,'ytitle','th'+sc+'!Celec' options,name,'ztitle','Eflux !C eV/(eV*cm!U2!N*sec*sr)' endif else begin name='th'+sc+'_psir_en_eflux' options,name,'spec',1 ylim,name,2e4,3e6 options,name,'ytitle','th'+sc+'!Celec' options,name,'ztitle','Eflux !C eV/(eV*cm!U2!N*sec*sr)' options,name,'y_no_interp',1 options,name,'x_no_interp',1 endelse ;kluge to prevent missing data from crashing things index_sst=where(strjoin('th'+sc+'_pser_en_eflux') eq tnames()) if index_sst eq -1 then begin filler=fltarr(2,16) filler(*,*)=float('NaN') store_data,strjoin('th'+sc+'_pser_en_eflux'),data={x:time_double(date)+findgen(2),y:filler,v:findgen(16)} name=strjoin('th'+sc+'_pser_en_eflux') options,name,'spec',1 ylim,name,1,1000,1 zlim,name,1,1000,1 options,name,'ytitle','th'+sc+'!Celec' options,name,'ztitle','Eflux !C eV/(eV*cm!U2!N*sec*sr)' endif else begin name='th'+sc+'_pser_en_eflux' options,name,'spec',1 ylim,name,2e4,3e6 options,name,'ytitle','th'+sc+'!Celec' options,name,'ztitle','Eflux !C eV/(eV*cm!U2!N*sec*sr)' options,name,'y_no_interp',1 options,name,'x_no_interp',1 endelse var_string_f1 += 'th'+sc+'_psef_en_eflux ' var_string_f2 += ' sample_rate_'+sc+ ' th'+sc+'_psif_en_eflux ' var_string_r1 += 'th'+sc+'_pser_en_eflux ' var_string_r2 += ' sample_rate_'+sc+ ' th'+sc+'_psir_en_eflux ' endfor var_string_f = var_string_f1 + ' ' + var_string_f2 var_string_r = var_string_r1 + ' ' + var_string_r2 ;set colors !p.background=255. !p.color=0. time_stamp,/off loadct2,43 !p.charsize=0.8 tplot,var_string_f,title='TH-A,B,C,D,E PSIF,PSEF EFlux eV/(eV*cm!U2!N*sec*sr)' makepng,dir+'/thm_tohban_sst_full_'+year+month+day+'_0024',/no_expose tplot, trange=[time_double(date2),time_double(date2)+3600.*6.] makepng,dir+'/thm_tohban_sst_full_'+year+month+day+'_0006',/no_expose tplot, trange=[time_double(date2)+3600.*6,time_double(date2)+3600.*12.] makepng,dir+'/thm_tohban_sst_full_'+year+month+day+'_0612',/no_expose tplot,trange=[time_double(date2)+3600.*12,time_double(date2)+3600.*18.] makepng,dir+'/thm_tohban_sst_full_'+year+month+day+'_1218',/no_expose tplot,trange=[time_double(date2)+3600.*18,time_double(date2)+3600.*24.] makepng,dir+'/thm_tohban_sst_full_'+year+month+day+'_1824',/no_expose tplot,var_string_r,title='TH-A,B,C,D,E PSIR,PSER EFlux eV/(eV*cm!U2!N*sec*sr)',trange=[time_double(date2),time_double(date2)+3600.*24.] makepng,dir+'/thm_tohban_sst_reduced_'+year+month+day+'_0024',/no_expose tplot, trange=[time_double(date2),time_double(date2)+3600.*6.] makepng,dir+'/thm_tohban_sst_reduced_'+year+month+day+'_0006',/no_expose tplot, trange=[time_double(date2)+3600.*6,time_double(date2)+3600.*12.] makepng,dir+'/thm_tohban_sst_reduced_'+year+month+day+'_0612',/no_expose tplot,trange=[time_double(date2)+3600.*12,time_double(date2)+3600.*18.] makepng,dir+'/thm_tohban_sst_reduced_'+year+month+day+'_1218',/no_expose tplot,trange=[time_double(date2)+3600.*18,time_double(date2)+3600.*24.] makepng,dir+'/thm_tohban_sst_reduced_'+year+month+day+'_1824',/no_expose end