;------------------ INPUT PARAMETERS ----------------------------------
;sat:  'A' for Ahead, 'B' for Behind
;
;          
;
;time:       Start date/time string in tplot format ('yyyy-mm-dd/hh:mm:ss')
;num_days:   Set the time span in days
;
;output_dir:  where to put the output files
;tplot_dir:   where to put the .tplot files
;table_location:  where the ESA and efficiency tables are stored
;            
;----------------------------------------------------------------------

sat ='B' 


; Enter the day and time for the start of the plot, and then the duration.
time='2008-10-29/00:00:00' ; year, month, day, hour, minute, second
num_days=1
timespan, time, num_days, /DAYS ; Presently set up to run only in units of days
  
;----------------------------------------------------------------------
; Here is the location for the program's output
;----------------------------------------------------------------------
tplot_dir='Plots/'

;----------------------------------------------------------------------
; Here is the location of the ESA and efficiency tabls
;----------------------------------------------------------------------
table_location = '/data1/Software/SPLAT_latest/Tables/'
;table_location = '/Users/kristin/Desktop/Tables/'


;----------------------------------------------------------------------
; CALCULATE BULK PARAMETERS AND MAKE TPLOT VARIABLES
;----------------------------------------------------------------------
set_com_high_res
set_com_mon
pl_calc_proton_bulk_from_crib, sat, bkgd, time, num_days, table_location, tplot_dir, /INST_COORD
