;+ ;NAME: ; mvn_lpw_overplot ;PURPOSE: ; MAVEN PFP LPW Quicklook Plot ;CALLING SEQUENCE: ; mvn_lpw_overplot, date = date, time_range = time_range, $ ; makepng=makepng, device = device, directory = pdir, $ ; l0_input_file = l0_input_file, noload_data = noload_data, $ ; _extra=_extra ;INPUT: ; No explicit input, everthing is via keyword. ;OUTPUT: ; Plots, on the screen or in a png file ;KEYWORDS: ; date = If set, a plot for the input date. ; time_range = If set, plot this time range, note that this supercedes ; the date keyword, if both are set, the time range is ; attempted. ; l0_input_file = A filename for an input file, if this is set, the ; date and time_range keywords are ignored. ; makepng = If set, make a png file, with filename ; 'mvn_lpw_qlook_start_time_end_time.png' ; device = a device for set_plot, the default is to use the current ; setting, for cron jobs, device = 'z' is recommended. Note ; that this does not reset the device at the end of the ; program. ; directory = If a png is created, this is the output directory, the ; default is the current working directory. ; noload_data = if set, don't load data ;HISTORY: ; Hacked from thm_over_shell, 2013-05-12, jmm, jimm@ssl.berkeley.edu ; $LastChangedBy: jimm $ ; $LastChangedDate: 2013-12-02 14:09:05 -0800 (Mon, 02 Dec 2013) $ ; $LastChangedRevision: 13612 $ ; $URL: svn+ssh://thmsvn@ambrosia.ssl.berkeley.edu/repos/idl_socware/trunk/projects/maven/quicklook/mvn_lpw_overplot.pro $ Pro mvn_lpw_overplot, date = date, time_range = time_range, $ makepng=makepng, device = device, directory = directory, $ l0_input_file = l0_input_file, $ noload_data = noload_data, $ _extra=_extra mvn_qlook_init ;First load the data If(~keyword_set(noload_data)) Then Begin If(keyword_set(l0_input_file)) Then Begin filex = l0_input_file[0] Endif Else Begin dprint, "No Database Yet', dlev=0 ; filex = mvn_l0_db2file(date=date, time_range=time_range) Endelse mvn_lpw_load, filex, filetype='L0', tplot_var='all' ;for make a sc_attitude variable this is a fejk variable..... needed for the *prd* routines get_data,'mvn_lpw_hsk',data=data store_data,'mvn_sc_atitude',data={x:data.x,y:data.x*0} mvn_lpw_prd_lp_IV mvn_lpw_prd_w_e12 ;From Laila Andersson get_data,'mvn_lpw_hsk',data=data,limit=limit store_data,'Beb_temp',data={x:data.x,y:data.y(*,0:2)} options,'Beb_temp','ytitle','BEB+preamp temp !C!C (C)' ylim,'Beb_temp',min(data.y(*,0:2)),max(data.y(*,0:2)) store_data,'modes',data=['mvn_lpw_swp2_mode','mvn_lpw_atr_mode','mvn_lpw_adr_mode'] options, 'mvn_lpw_adr_mode','color',2 options, 'mvn_lpw_atr_mode','color',6 ylim,'modes',0,16 options,'modes','ytitle','LPW Modes' options,'*mode','psym',1 store_data,'E12',data=['mvn_lpw_pas_E12','mvn_lpw_act_E12'] options,'mvn_lpw_act_E12','color',6 options,'E12','ytitle','E12 !C [V]' ;options,'mvn_lpw_pas_E12_LF','psym',-1 options,'mvn_lpw_act_E12','psym',1 store_data,'SC_pot',data=['mvn_lpw_swp1_V2','mvn_lpw_act_V2','mvn_lpw_pas_V2', $ 'mvn_lpw_swp2_V1','mvn_lpw_act_V1','mvn_lpw_pas_V1'] options,'SC_pot','ytitle','SC_pot !C!C [V]' options,'mvn_lpw_act_V2','color',1 options,'mvn_lpw_pas_V2', 'color',2 options,'mvn_lpw_swp2_V1','color',3 options,'mvn_lpw_act_V1','color',5 options,'mvn_lpw_pas_V1','color',6 ;options,'*V1','psym',-1 ;options,'*V2','psym',-1 store_data,'htime',data=['mvn_lpw_htime_cap_lf','mvn_lpw_htime_cap_mf','mvn_lpw_htime_cap_hf'] options,'htime','ytitle','HSBM data !C' options,'mvn_lpw_htime_cap_mf','color',4 options,'mvn_lpw_htime_cap_hf','color',6 options,'*htime_cap*','psym',1 ylim,'htime',0,4 Endif varlist = ['mvn_lpw_euv','mvn_lpw_euv_temp_C','Beb_temp','modes',$ 'mvn_lpw_spec_hf_pas',$ 'mvn_lpw_spec_mf_pas','mvn_lpw_spec_lf_pas', $ 'E12','SC_pot','mvn_lpw_swp1_IV','mvn_lpw_swp2_IV','htime'] varlist0 = varlist ;You need a time range for the data, Assuming that everything comes ;from one kind of packet, you should be ok, but check all variables ;just in case varlist = mvn_qlook_vcheck(varlist, tr = tr) If(varlist[0] Eq '') Then Begin dprint, 'No data, Returning' Return Endif ;Remove gap between plot panels tplot_options, 'ygap', 0.0d0 ;plot the data tplot, varlist If(keyword_set(makepng)) Then Begin If(keyword_set(directory)) Then pdir = directory Else pdir = './' fname = pdir+mvn_qlook_filename('lpw', tr, _extra=_extra) makepng, fname Endif Return End