;+ ;NAME: ; mvn_over_shell ;PURPOSE: ; Top shell for production of MAVEN PFP overview plots ;CALLING SEQUENCE: ; mvn_over_shell, date = date, $ ; num_days = num_days, $ ; reprocess = reprocess, $ ; instr_to_process = instr_to_process, $ ; direct_to_dbase=direct_to_dbase, $ ; start_date=start_date, end_date=end_date ;INPUT: ; All via keyword ;OUTPUT: ; No explicit outputs, just plots ;KEYWORDS: ; date = start date for process, default is today ; num_days = number of days to process ; instr_to_process = which instruments, or plopt types, currently one ; of: ['over', 'lpw', 'mag', 'sep', 'sta', 'swe', 'swia'] ; direct_to_dbase = set this to have the plot written to appropriate database ; directory. (Will implement when there is one) ; start_date, end_date = Start and end dates to facilitate ; reprocessing. ;HISTORY: ; Hacked from thm_over_shell, 2013-05-12, jmm, jimm@ssl.berkeley.edu ; $LastChangedBy: jimm $ ; $LastChangedDate: 2013-11-05 14:25:06 -0800 (Tue, 05 Nov 2013) $ ; $LastChangedRevision: 13494 $ ; $URL: svn+ssh://thmsvn@ambrosia.ssl.berkeley.edu/repos/idl_socware/trunk/projects/maven/quicklook/mvn_over_shell.pro $ ;- Pro mvn_over_shell, date = date, $ num_days = num_days, $ instr_to_process = instr_to_process, $ direct_to_dbase=direct_to_dbase, $ start_date=start_date, end_date=end_date, $ l0_input_file=l0_input_file, xxx = xxx, _extra=_extra ;Hold load position for error handling common mvn_over_shell_private, load_position If(~keyword_set(datein)) Then $ datein = time_string(systime(/seconds), precision = -3) catch, error_status If(error_status Ne 0) Then Begin dprint, dlevel = 0, 'Got Error Message' help, /last_message, output = err_msg For ll = 0, n_elements(err_msg)-1 Do print, err_msg[ll] Case load_position Of 'over':Begin print, 'Skipped Overview: '+time_string(datein) Goto, skip_over End 'lpw':Begin print, 'Skipped LPW Overview: '+time_string(datein) Goto, skip_lpw End 'mag':Begin print, 'Skipped MAG Overview: '+time_string(datein) Goto, skip_mag End 'sep':Begin print, 'Skipped SEP Overview: '+time_string(datein) Goto, skip_sep End 'sta':Begin print, 'Skipped STA Overview: '+time_string(datein) Goto, skip_sta End 'swe':Begin print, 'Skipped Swe Plot: '+time_string(datein) Goto, skip_swe End 'swia':Begin print, 'Skipped Swia Plot: '+time_string(datein) Goto, skip_swia End Else: Begin print, 'MVN_OVER_SHELL exiting with no clue' End Endcase Endif load_position = 'init' set_plot,'z' ; set_plot now done in thm_over_shell.pro device, set_resolution = [750, 900] ;changed to be consistent with thm_gen_overplot, 7-jun-2010, jmm mvn_qlook_init, _extra=_extra ;not sure what this will do yet If(keyword_set(instr_to_process)) Then Begin instx = strcompress(/remove_all, strlowcase(instr_to_process)) Endif Else instx = ['over', 'lpw', 'mag', 'sep', 'sta', 'swe', 'swia'] If(keyword_set(l0_input_file)) Then Begin date = time_string(systime(/seconds), precision = -3) start_date = time_double(date) end_date= start_date Endif Else Begin If(Not keyword_set(date)) Then $ date = time_string(systime(/seconds), precision = -3) If(keyword_set(start_date)) Then start_date = time_double(start_date) Else Begin If(keyword_set(num_days)) Then ndays = num_days Else ndays = 5 start_date = time_double(date)-86400.*(ndays-1) Endelse If(keyword_set(end_date)) Then end_date = time_double(end_date) $ Else end_date = time_double(date) Endelse i = 0. ;Remove gap between plot panels tplot_options, 'ygap', 0.0d0 tplot_options, 'lazy_ytitle', 1 ;mess with margins tplot_options, 'xmargin', [ 18, 10] tplot_options, 'ymargin', [ 5, 5] While start_date+86400.*i Le end_date Do Begin If(~keyword_set(xxx)) Then del_data,'*' datein = time_string(start_date+86400.*i) dprint, 'Processing: '+time_string(datein) datein = time_string(datein) datein_d = time_double(datein) ;plot_dir check down here, to allow direct output If(keyword_set(plot_dir)) Then pdir = plot_dir Else pdir = 'mvn_qlook_plots' do_over = where(instx Eq 'over') If(do_over[0] Ne -1) Then Begin load_position = 'over' If(keyword_set(xxx)) Then noload = 1 Else noload = 0 mvn_gen_overplot, date = datein, /makepng, device = 'z', $ directory = pdir, l0_input_file=l0_input_file, noload_data = noload, _extra=_extra skip_over: Endif do_lpw = where(instx Eq 'lpw') If(do_lpw[0] Ne -1) Then Begin load_position = 'lpw' mvn_lpw_overplot, date = datein, /makepng, device = 'z', $ directory = pdir, /noload_data, _extra=_extra skip_lpw: Endif do_mag = where(instx Eq 'mag') If(do_mag[0] Ne -1) Then Begin load_position = 'mag' mvn_mag_overplot, date = datein, /makepng, device = 'z', $ directory = pdir, /noload_data, _extra=_extra skip_mag: Endif do_sep = where(instx Eq 'sep') If(do_sep[0] Ne -1) Then Begin load_position = 'sep' mvn_sep_overplot, date = datein, /makepng, device = 'z', $ directory = pdir, /noload_data, _extra=_extra skip_sep: Endif do_sta = where(instx Eq 'sta') If(do_sta[0] Ne -1) Then Begin load_position = 'sta' mvn_sta_overplot, date = datein, /makepng, device = 'z', $ directory = pdir, /noload_data, _extra=_extra skip_sta: Endif do_swe = where(instx Eq 'swe') If(do_swe[0] Ne -1) Then Begin load_position = 'swe' mvn_swe_overplot, date = datein, /makepng, device = 'z', $ directory = pdir, /noload_data, _extra=_extra skip_swe: Endif do_swia = where(instx Eq 'swia') If(do_swia[0] Ne -1) Then Begin load_position = 'swia' mvn_swia_overplot, date = datein, /makepng, device = 'z', $ directory = pdir, /noload_data, _extra=_extra skip_swia: Endif i=1+1 End Return End