;+ ;Purpose: ;Generates esa 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_esa_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_esa_overviews.pro $ ;- pro thm_esa_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 esa 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_b1 = '' var_string_b2 = '' var_string_r1 = '' var_string_r2 = '' var_string_f1 = '' var_string_f2 = '' 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_esa_pkt,probe=sc thm_part_moments,probe=sc,instrument= ['peeb','peer','peef','peib','peir','peif'],moments = ['density', 'velocity', 't3'] ;set appropriate zlims ;zlim,'th'+sc+'_peib_en_counts',1.,1.e4,1 ;zlim,'th'+sc+'_peif_en_counts',1.,1.e4,1 ;zlim,'th'+sc+'_peir_en_counts',1.,1.e4,1 ;zlim,'th'+sc+'_peeb_en_counts',10.,1.e5,1 ;zlim,'th'+sc+'_peef_en_counts',10.,1.e5,1 ;zlim,'th'+sc+'_peer_en_counts',10.,1.e5,1 ;set ytitle options,'th'+sc+'_peeb_en_eflux','ytitle','th'+sc+'!Cpeeb' options,'th'+sc+'_peib_en_eflux','ytitle','th'+sc+'!Cpeib' options,'th'+sc+'_peer_en_eflux','ytitle','th'+sc+'!Cpeer' options,'th'+sc+'_peir_en_eflux','ytitle','th'+sc+'!Cpeir' options,'th'+sc+'_peef_en_eflux','ytitle','th'+sc+'!Cpeef' options,'th'+sc+'_peif_en_eflux','ytitle','th'+sc+'!Cpeif' ylim,'th'+sc+'_peeb_en_eflux',1e0,3e4 ylim,'th'+sc+'_peib_en_eflux',1e0,3e4 ylim,'th'+sc+'_peer_en_eflux',1e0,3e4 ylim,'th'+sc+'_peir_en_eflux',1e0,3e4 ylim,'th'+sc+'_peef_en_eflux',1e0,3e4 ylim,'th'+sc+'_peif_en_eflux',1e0,3e4 var_string_b1 += 'th'+sc+'_peeb_en_eflux ' var_string_b2 += ' sample_rate_'+sc+ ' th'+sc+'_peib_en_eflux ' var_string_r1 += 'th'+sc+'_peer_en_eflux ' var_string_r2 += ' sample_rate_'+sc+ ' th'+sc+'_peir_en_eflux ' var_string_f1 += 'th'+sc+'_peef_en_eflux ' var_string_f2 += ' sample_rate_'+sc+ ' th'+sc+'_peif_en_eflux ' endfor var_string_b = var_string_b1 + ' ' + var_string_b2 var_string_r = var_string_r1 + ' ' + var_string_r2 var_string_f = var_string_f1 + ' ' + var_string_f2 ;set colors !p.background=255. !p.color=0. time_stamp,/off loadct2,43 !p.charsize=0.8 tplot,var_string_b,title='TH-A,B,C,D,E PEIB,PEEB EFlux eV/(eV*cm!U2!N*sec*sr)' makepng,dir+'/thm_tohban_esa_burst_'+year+month+day+'_0024',/no_expose tplot, trange=[time_double(date2),time_double(date2)+3600.*6.] makepng,dir+'/thm_tohban_esa_burst_'+year+month+day+'_0006',/no_expose tplot, trange=[time_double(date2)+3600.*6,time_double(date2)+3600.*12.] makepng,dir+'/thm_tohban_esa_burst_'+year+month+day+'_0612',/no_expose tplot,trange=[time_double(date2)+3600.*12,time_double(date2)+3600.*18.] makepng,dir+'/thm_tohban_esa_burst_'+year+month+day+'_1218',/no_expose tplot,trange=[time_double(date2)+3600.*18,time_double(date2)+3600.*24.] makepng,dir+'/thm_tohban_esa_burst_'+year+month+day+'_1824',/no_expose tplot,var_string_r,title='TH-A,B,C,D,E PEIR,PEER EFlux eV/(eV*cm!U2!N*sec*sr)', trange=[time_double(date2),time_double(date2)+3600.*24.] makepng,dir+'/thm_tohban_esa_reduced_'+year+month+day+'_0024',/no_expose tplot, trange=[time_double(date2),time_double(date2)+3600.*6.] makepng,dir+'/thm_tohban_esa_reduced_'+year+month+day+'_0006',/no_expose tplot, trange=[time_double(date2)+3600.*6,time_double(date2)+3600.*12.] makepng,dir+'/thm_tohban_esa_reduced_'+year+month+day+'_0612',/no_expose tplot,trange=[time_double(date2)+3600.*12,time_double(date2)+3600.*18.] makepng,dir+'/thm_tohban_esa_reduced_'+year+month+day+'_1218',/no_expose tplot,trange=[time_double(date2)+3600.*18,time_double(date2)+3600.*24.] makepng,dir+'/thm_tohban_esa_reduced_'+year+month+day+'_1824',/no_expose tplot,var_string_f,title='TH-A,B,C,D,E PEIF,PEEF EFlux eV/(eV*cm!U2!N*sec*sr)',trange=[time_double(date2),time_double(date2)+3600.*24.] makepng,dir+'/thm_tohban_esa_full_'+year+month+day+'_0024',/no_expose tplot, trange=[time_double(date2),time_double(date2)+3600.*6.] makepng,dir+'/thm_tohban_esa_full_'+year+month+day+'_0006',/no_expose tplot, trange=[time_double(date2)+3600.*6,time_double(date2)+3600.*12.] makepng,dir+'/thm_tohban_esa_full_'+year+month+day+'_0612',/no_expose tplot,trange=[time_double(date2)+3600.*12,time_double(date2)+3600.*18.] makepng,dir+'/thm_tohban_esa_full_'+year+month+day+'_1218',/no_expose tplot,trange=[time_double(date2)+3600.*18,time_double(date2)+3600.*24.] makepng,dir+'/thm_tohban_esa_full_'+year+month+day+'_1824',/no_expose end