def runR_each_duet(start_buff = 980, end_buff = 1180, min_dist = 0, max_dist = 180, slow_delta = 0.0025, start_beam = 0, end_beam = 0, dphase = 'PKiKP', event1_no = 0, event2_no = 0): import os os.environ['PATH'] += os.pathsep + '/usr/local/bin' os.chdir('/Users/vidale/Documents/GitHub/Array_codes') #%% Import functions from pro3b_sort_plot_singlet import pro3singlet from pro3a_sort_plot_pair import pro3pair from pro5a_stack import pro5stack from pro5b_stack2d import pro5stack2d from pro6_plot_singlet import pro6stacked_singlet from pro6_plot_pair import pro6stacked_pair from pro7a_plot_envstack import pro7plotstack from pro7b_plot_stack import pro7plotstack2 from pro7b_dec import pro7dec import matplotlib.pyplot as plt #%% Common parameters ev_directory = '/Users/vidale/Documents/PyCode/EvLocs' os.chdir(ev_directory) eq1_file = 'event' + str(event1_no) + '.txt' eq2_file = 'event' + str(event2_no) + '.txt' ARRAY = 1 # 0 Japan, 1 LASA, 2 China freq_min = 1 freq_max = 3 rel_time = 1 # phase alignment details # rel_time == 0 window in absolute time after origin time # rel_time == 1 each window has a shift proportional to (dist - ref_dist) at phase slowness at ref_dist # rel_time == 2 each window has a distinct phase-chose shift, but time offset is common to all stations # rel_time == 3 each station has an individual, chosen-phase shift, phase arrival set to common time # rel_time == 4 use same window around chosen phase for all stations, using ref distance ref_loc = 0 # 0 select stations by distance from epicenter, 1 select stations by distance from ref location ref_rad = 0.4 # radius of stations around ref_loc chosen # ref_lat = 36 # Japan # ref_lon = 138 ref_lat = 46.7 # LASA °N keep only inner rings A-D if radius is 0.4° ref_lon = -106.22 # °E NS = 1 # 0 plot slowness R-T, 1 plot slowness N-S auto_dist = 1 # automatically plot only real distance range min_dist = 0 max_dist = 180 slowR_lo = -0.03 slowR_hi = 0.03 slowT_lo = -0.03 slowT_hi = 0.03 slow_delta = 0.001 slowR_lo_1D = -0.05 slowR_hi_1D = 0.1 slow_delta_1D = 0.001 decimate_fac = 10 simple_taper = 1 snaptime = -0.5 freq_corr = 1.2 stat_corr = 1 corr_threshold = 0.6 skip_SNR = 1 qual_threshold = 1.5 # dphase = 'PcP' dphase2 = 'PP' dphase3 = 'PcP' dphase4 = 'sP' #%% Pairs # get data from Japan #os.chdir('/Users/vidale/Documents/PyCode/Hinet/Reps/Aleutians/Pair1') #pro1get(eq_file1) #pro1get(eq_file2) #pro2_decimate(eq_file1, decimate_fac = decimate_fac) #pro2_decimate(eq_file2, decimate_fac = decimate_fac) pro3pair(ARRAY = ARRAY, eq_file1 = eq1_file, eq_file2 = eq2_file, start_buff = start_buff, skip_SNR = skip_SNR, end_buff = end_buff, plot_scale_fac = 0.01, qual_threshold = qual_threshold, simple_taper = 1, dphase = dphase, dphase2 = dphase2, dphase3 = dphase3, dphase4 = dphase4, corr_threshold = corr_threshold, freq_min = freq_min, freq_max = freq_max, min_dist = min_dist, max_dist = max_dist, ref_loc = ref_loc, ref_rad = ref_rad, ref_lat = ref_lat, ref_lon = ref_lon) pro5stack(ARRAY = ARRAY, eq_file = eq1_file, plot_scale_fac = 0.05, event_no = event1_no, slowR_lo = slowR_lo_1D, slowR_hi = slowR_hi_1D, slow_delta = slow_delta_1D, start_buff = start_buff, end_buff = end_buff, ref_loc = ref_loc, ref_lat = ref_lat, ref_lon = ref_lon, log_plot = 0, envelope = 1, plot_dyn_range = 50, norm = 1, global_norm_plot = 1, color_plot = 1, fig_index = 301) pro5stack(ARRAY = ARRAY, eq_file = eq2_file, plot_scale_fac = 0.05, event_no = event2_no, slowR_lo = slowR_lo_1D, slowR_hi = slowR_hi_1D, slow_delta = slow_delta_1D, start_buff = start_buff, end_buff = end_buff, ref_loc = ref_loc, ref_lat = ref_lat, ref_lon = ref_lon, log_plot = 0, envelope = 1, plot_dyn_range = 50, norm = 1, global_norm_plot = 1, color_plot = 1, fig_index = 302) #%% --2D stacks # pro5stack2d(eq_file = eq1_file, plot_scale_fac = 0.05, # slowR_lo = slowR_lo, slowR_hi = slowR_hi, slowT_lo = slowT_lo, slowT_hi = slowT_hi, slow_delta = slow_delta, # start_buff = start_buff, end_buff = end_buff, # norm = 1, ref_loc = ref_loc, ref_lat = ref_lat, ref_lon = ref_lon, # ARRAY = ARRAY, decimate_fac = decimate_fac, NS = NS) # pro5stack2d(eq_file = eq2_file, plot_scale_fac = 0.05, # slowR_lo = slowR_lo, slowR_hi = slowR_hi, slowT_lo = slowT_lo, slowT_hi = slowT_hi, slow_delta = slow_delta, # start_buff = start_buff, end_buff = end_buff, # norm = 1, ref_loc = ref_loc, ref_lat = ref_lat, ref_lon = ref_lon, # ARRAY = ARRAY, decimate_fac = decimate_fac, NS = NS) #%% --Compare pair of 2D stack results # pro6stacked_pair(eq_file1 = eq1_file, eq_file2 = eq2_file, plot_scale_fac = 0.003, tdiff_clip = 0.1, # slowR_lo = slowR_lo, slowR_hi = slowR_hi, slowT_lo = slowT_lo, slowT_hi = slowT_hi, slow_delta = slow_delta, # start_buff = start_buff, end_buff = end_buff, R_slow_plot = 0, T_slow_plot = 0, dphase = dphase, freq_corr = freq_corr, # fig_index = 301, plot_dyn_range = 100, ARRAY = ARRAY, event_no = event1_no, start_beam = start_beam, end_beam = end_beam) #%% --Examine each one of a pair of 2D stack results # pro6stacked_singlet(eq_file = eq1_file, plot_scale_fac = 0.003, # slowR_lo = slowR_lo, slowR_hi = slowR_hi, slowT_lo = slowT_lo, slowT_hi = slowT_hi, slow_delta = slow_delta, # start_buff = start_buff, end_buff = end_buff, R_slow_plot = 0, T_slow_plot = 0, dphase = dphase, # fig_index = 301, plot_dyn_range = 100, ARRAY = ARRAY, event_no = event1_no, start_beam = start_beam, end_beam = end_beam) # # pro6stacked_singlet(eq_file = eq2_file, plot_scale_fac = 0.003, # slowR_lo = slowR_lo, slowR_hi = slowR_hi, slowT_lo = slowT_lo, slowT_hi = slowT_hi, slow_delta = slow_delta, # start_buff = start_buff, end_buff = end_buff, R_slow_plot = -0.015, T_slow_plot = 0, dphase = dphase, # fig_index = 301, plot_dyn_range = 100, ARRAY = ARRAY, event_no = event2_no, start_beam = start_beam, end_beam = end_beam) #%% --decimate stacking files to shorten processing time #pro7dec(eq_file1 = eq_file1, eq_file2 = eq_file2, decimate_fac = decimate_fac, ARRAY = ARRAY) #%% --slowness slices of time shift #pro7plotstack2(eq_file1 = eq_file1, eq_file2 = eq_file2, plot_scale_fac = 0.05, # slowR_lo = slowR_lo, slowR_hi = slowR_hi, slowT_lo = slowT_lo, slowT_hi = slowT_hi, slow_delta = slow_delta, # zoom = 0, ZslowR_lo = -0.03, ZslowR_hi = 0.03, ZslowT_lo = -0.03, ZslowT_hi = 0.03, Zstart_buff = 5, Zend_buff = 15, # start_buff = start_buff, end_buff = end_buff, skip_T = 0, skip_R = 1, skip_snaps = 0, tdiff_clip = 0.2, # fig_index = 301, plot_dyn_range = 100, snaptime = snaptime, snaps=1, decimate_fac = 1, in_dec = 1, # ref_phase = ref_phase, ARRAY = ARRAY) #%% --2D envelop stack results for individual events #pro7plotstack(eq_file = eq_file1, plot_scale_fac = 0.05, # slowR_lo = slowR_lo, slowR_hi = slowR_hi, slowT_lo = slowT_lo, slowT_hi = slowT_hi, slow_delta = slow_delta, # start_buff = start_buff, end_buff = end_buff, skip_T = 1, skip_R = 1, # zoom = 0, ZslowR_lo = -0.03, ZslowR_hi = 0.03, ZslowT_lo = -0.03, ZslowT_hi = 0.03, Zstart_buff = 0, Zend_buff = 200, # fig_index = 401, plot_dyn_range = 50, snaptime = snaptime, snaps=1, ARRAY = ARRAY) #pro7plotstack(eq_file = eq_file2, plot_scale_fac = 0.05, # slowR_lo = slowR_lo, slowR_hi = slowR_hi, slowT_lo = slowT_lo, slowT_hi = slowT_hi, slow_delta = slow_delta, # start_buff = start_buff, end_buff = end_buff, skip_T = 1, skip_R = 0, # zoom = 0, ZslowR_lo = -0.03, ZslowR_hi = 0.03, ZslowT_lo = -0.03, ZslowT_hi = 0.03, Zstart_buff = 0, Zend_buff = 200, # fig_index = 402, plot_dyn_range = 50, snaptime = snaptime, snaps=1, ARRAY = ARRAY) code_directory = '/Users/vidale/Documents/GitHub/Array_codes' os.chdir(code_directory)
plot_scale_fac = 1 #%% Comparing events #%% -- Cull seismic section for common stations if do_3 == True: pro3pair(ARRAY=ARRAY, eq_num1=eq_num1, eq_num2=eq_num2, skip_SNR=skip_SNR, rel_time=rel_time, start_buff=start_buff, end_buff=end_buff, freq_min=freq_min, freq_max=freq_max, max_taper_length=max_taper_length, simple_taper=simple_taper, plot_scale_fac=0.025, stat_corr=stat_corr, dphase=ref_phase, dphase2='PKKP', dphase3='PP', dphase4='S', min_dist=min_dist, max_dist=max_dist, ref_loc=ref_loc, ref_rad=ref_rad) #%% -- 2D stacks if do_5 == True: pro5stack2d(eq_num=eq_num1, slowR_lo=slowR_lo,
def runpair_getconvo(Tstart, Tend, eq_num1, eq_num2, con78 = False): import os import matplotlib.pyplot as plt #%% close plots plt.close('all') os.environ['PATH'] += os.pathsep + '/usr/local/bin' os.chdir('/Users/vidale/Documents/GitHub/Array_codes') #%% Import functions from pro2_con_stfs import pro2_convstf from pro2_plot_conv import pro2_test from pro3a_sort_plot_pair import pro3pair from pro3b_sort_plot_singlet import pro3singlet from pro5a_stack import pro5stack from pro5b_stack2d import pro5stack2d from pro6_pair_cc import pro6_cc_pair from pro6_singlet import pro6_singlet from pro7_pair_scan import pro7_pair_scan from pro7_singlet import pro7_singlet #%% Workflow selection do_3 = True # pair of events do_5 = True do_1D = False do_6 = False do_7 = False eq_num1 = str(eq_num1) # pair eq_num2 = str(eq_num2) do_3a = False # single event do_5a = False # stack do_6a = False # treats single events, no time shifts calculated or plotted do_7a = False eq_num = '7' # singlet #%% Common parameters ARRAY = 1 no_plots = True auto_dist = True min_dist = 0 max_dist = 180 # Window start_buff = Tstart end_buff = Tend zoom = True # to restrict time range and slowness range in pro7_pair_scan Zstart_buff = Tstart Zend_buff = Tend # HF freq_min = 1 freq_max = 3 # Pro5 stacking stat_corr = 1 decimate_fac = 5 # set for pro5stack2d for single event envelopes, set to 0 for other codes simple_taper = 1 max_taper_length = 5 # taper is minimum of taper_frac (0.05) and this number of seconds skip_SNR = 1 ref_phase = 'PKiKP' slowR_lo = 0.008 slowR_hi = 0.008 slowT_lo = 0.000 slowT_hi = 0.000 slow_delta = 0.001 NS = False # 1 for N-S co=ords, 0 for R-T # Pro5 1D plot options slowR_lo_1D = -0.1 slowR_hi_1D = 0.1 slow_delta_1D = 0.001 # Pro6 options: mostly time shift measurement cc_twin = 2 # time window for cross-correlation (s) cc_len = 0.2 # max time window shift to compute CC (fraction of whole time window) cc_delta = 0.4 # temporal frequency of cc (s) cc_interp1d = 5 # interpolation factor cc_thres = 0.5 # threshold beam correlation to use in stack min_amp = 0.2 # threshold amp to use in stack # Pro 7 range selection options ZslowR_lo = 0.008 ZslowR_hi = 0.008 ZslowT_lo = 0.000 ZslowT_hi = 0.000 start_beam = 0 # Limit time window for summary slowness beam in beam sums end_beam = 0 # better be within Zstart and Zend, if zoom is set # Pro 7 auto_slice == True options auto_slice = False # slices span wide range of R and T slownesses two_slice_plots = False # makes R-T pair and snap through time span beam_sums = False # sums tdiff and amp over time wiggly_plots = False # shows wiggly plots # Pro7 auto-plot options nR_plots = 2 # number of plots along the radial axis, makes (2 x nR_plots - 1) total nT_plots = 2 # number of plots along the transv axis slow_incr = 0.01 # increment at which amp and tdiff are plotted # Pro7 two_slice and snap options R_slow_plot = 0.008 T_slow_plot = 0.000 snaptime = 0 # relative to start_buff snaps = 0 snap_depth = 30 # time window over which snap is integrated (s) # Pro 7 more plotting options do_T = False # present T plots do_R = True # present R plots no_tdiff_plot = False # also to speed plots of only amplitude, only applies to auto_slice turn_off_black = False # controls whether wiggle plot also has time shift plotted log_plot = True tdiff_clip = 0.5 wig_scale_fac = 0.1 tdiff_scale_fac = 3 log_plot_range = 1.5 plot_scale_fac = 1 #%% Comparing events #%% -- Cull seismic section for common stations if do_3 == True: pro3pair(ARRAY = ARRAY, eq_num1 = eq_num1, eq_num2 = eq_num2, skip_SNR = skip_SNR, rel_time = 0, start_buff = start_buff, end_buff = end_buff, freq_min = freq_min, freq_max = freq_max, no_plots = no_plots, max_taper_length = max_taper_length, simple_taper = simple_taper, plot_scale_fac = 0.025, stat_corr = stat_corr, taper_frac = 0.25, dphase = ref_phase, dphase2 = 'PKKP', dphase3 = 'PP', dphase4 = 'S', min_dist = min_dist, max_dist = max_dist, auto_dist = auto_dist, ref_loc = 0) if con78 == True: # Cross_convolve time functions only set up for Amchitka events 7 & 8 conv_file1 = '/Users/vidale/Documents/GitHub/Array_codes/Files/HD1971-11-06_stf.mseed' conv_file2 = '/Users/vidale/Documents/GitHub/Array_codes/Files/HD1969-10-02_stf.mseed' pro2_convstf(eq_num = eq_num1, conv_file = conv_file1) pro2_convstf(eq_num = eq_num2, conv_file = conv_file2) pro2_test(conv_file1 = conv_file1, conv_file2 = conv_file2) #%% -- 2D stacks if do_5 == True: pro5stack2d(eq_num = eq_num1, slowR_lo = slowR_lo, slowR_hi = slowR_hi, slowT_lo = slowT_lo, slowT_hi = slowT_hi, slow_delta = slow_delta, start_buff = start_buff, end_buff = end_buff, norm = 1, ARRAY = ARRAY, decimate_fac = decimate_fac, NS = NS) pro5stack2d(eq_num = eq_num2, slowR_lo = slowR_lo, slowR_hi = slowR_hi, slowT_lo = slowT_lo, slowT_hi = slowT_hi, slow_delta = slow_delta, start_buff = start_buff, end_buff = end_buff, norm = 1, ARRAY = ARRAY, decimate_fac = decimate_fac, NS = NS) #%% -- Compare pair of 2D stack results to find shift, amp, amp ratio, uses cc rather than instant phase if do_6 == True: pro6_cc_pair(eq_num1 = eq_num1, eq_num2 = eq_num2, slowR_lo = slowR_lo, slowR_hi = slowR_hi, slowT_lo = slowT_lo, slowT_hi = slowT_hi, slow_delta = slow_delta, start_buff = start_buff, end_buff = end_buff, cc_twin = cc_twin, cc_len = cc_len, cc_interp1d = cc_interp1d, cc_delta = cc_delta, cc_thres = cc_thres) #%% -- Make a variety of plots if do_7 == True: pro7_pair_scan(eq_num1 = eq_num1, eq_num2 = eq_num2, wig_scale_fac = wig_scale_fac, tdiff_scale_fac = tdiff_scale_fac, slowR_lo = slowR_lo, slowR_hi = slowR_hi, slowT_lo = slowT_lo, slowT_hi = slowT_hi, slow_delta = slow_delta, zoom = zoom, ZslowR_lo = ZslowR_lo, ZslowR_hi = ZslowR_hi, ZslowT_lo = ZslowT_lo, ZslowT_hi = ZslowT_hi, Zstart_buff = Zstart_buff, Zend_buff = Zend_buff, start_buff = start_buff, end_buff = end_buff, do_T = do_T, do_R = do_R, tdiff_clip = tdiff_clip, min_amp = min_amp, ref_phase = ref_phase, cc_thres = cc_thres, turn_off_black = turn_off_black, R_slow_plot = R_slow_plot, T_slow_plot = T_slow_plot, no_plots = no_plots, snaptime = snaptime, snaps = snaps, snap_depth = snap_depth, nR_plots = nR_plots, nT_plots = nT_plots, slow_incr = slow_incr, NS = NS, ARRAY = ARRAY, auto_slice = auto_slice, two_slice_plots = two_slice_plots, beam_sums = beam_sums, wiggly_plots = wiggly_plots, log_plot = log_plot, log_plot_range = log_plot_range, no_tdiff_plot = no_tdiff_plot, start_beam = start_beam, end_beam = end_beam) #%% Individual event #%% -- Cull seismic section event if do_3a == True: pro3singlet(ARRAY = ARRAY, stat_corr = stat_corr, eq_num = eq_num, max_taper_length = max_taper_length, simple_taper = simple_taper, rel_time = 0, start_buff = start_buff, end_buff = end_buff, plot_scale_fac = 0.1, skip_SNR = 1, dphase = ref_phase, dphase2 = 'SKKP', dphase3 = 'PKPPcP', dphase4 = 'pPKIKKIKP', freq_min = freq_min, freq_max = freq_max, min_dist = min_dist, max_dist = max_dist, ref_loc = 0, fig_index = 101) #%% -- 1D stack if do_1D == True: pro5stack(ARRAY = ARRAY, eq_num = eq_num, plot_scale_fac = 0.05, slowR_lo = slowR_lo_1D, slowR_hi = slowR_hi_1D, slow_delta = slow_delta_1D, start_buff = start_buff, end_buff = end_buff, log_plot = 1, envelope = 1, plot_dyn_range = 50, norm = 1, global_norm_plot = 1, color_plot = 1, fig_index = 301) #%% -- 2D stack if do_5a == True: pro5stack2d(eq_num = eq_num, slowR_lo = slowR_lo, slowR_hi = slowR_hi, slowT_lo = slowT_lo, slowT_hi = slowT_hi, slow_delta = slow_delta, start_buff = start_buff, end_buff = end_buff, norm = 1, ARRAY = ARRAY, decimate_fac = decimate_fac, NS = NS) #%% just amp, no time shifts estimates if do_6a == True: pro6_singlet(eq_num = eq_num, slowR_lo = slowR_lo, slowR_hi = slowR_hi, slowT_lo = slowT_lo, slowT_hi = slowT_hi, slow_delta = slow_delta, start_buff = start_buff, end_buff = end_buff, cc_delta = cc_delta) #%% -- Make a variety of plots if do_7a == True: pro7_singlet(eq_num = eq_num, wig_scale_fac = wig_scale_fac, slowR_lo = slowR_lo, slowR_hi = slowR_hi, slowT_lo = slowT_lo, slowT_hi = slowT_hi, slow_delta = slow_delta, zoom = zoom, ZslowR_lo = ZslowR_lo, ZslowR_hi = ZslowR_hi, ZslowT_lo = ZslowT_lo, ZslowT_hi = ZslowT_hi, Zstart_buff = Zstart_buff, Zend_buff = Zend_buff, start_buff = start_buff, end_buff = end_buff, do_T = do_T, do_R = do_R, min_amp = min_amp, ref_phase = ref_phase, turn_off_black = turn_off_black, R_slow_plot = R_slow_plot, T_slow_plot = T_slow_plot, snaptime = snaptime, snaps = snaps, snap_depth = snap_depth, nR_plots = nR_plots, nT_plots = nT_plots, slow_incr = slow_incr, NS = NS, ARRAY = ARRAY, auto_slice = auto_slice, two_slice_plots = two_slice_plots, beam_sums = beam_sums, wiggly_plots = wiggly_plots, log_plot = log_plot, log_plot_range = log_plot_range, start_beam = start_beam, end_beam = end_beam)
snaps = 5 freq_corr = 1.2 ref_phase = 'PKiKP' #%% Comparing events #%% --Cull seismic section for common stations pro3pair(ARRAY=ARRAY, eq_file1=eq_file1, eq_file2=eq_file2, simple_taper=simple_taper, skip_SNR=skip_SNR, rel_time=0, start_buff=start_buff, end_buff=end_buff, freq_min=freq_min, freq_max=freq_max, plot_scale_fac=0.025, stat_corr=stat_corr, dphase=ref_phase, dphase2='PKKP', dphase3='PP', dphase4='S', min_dist=min_dist, max_dist=max_dist, ref_loc=0) ##%% --2D stacks pro5stack2d(eq_file=eq_file1, plot_scale_fac=0.2, slowR_lo=slowR_lo, slowR_hi=slowR_hi,
#pro2_decimate(eq_file2, decimate_fac = decimate_fac) #pro3singlet(eq_file = eq_file1, start_buff = start_buff, # end_buff = end_buff, plot_scale_fac = 0.1, qual_threshold = qual_threshold, # dphase = ref_phase, dphase2 = 'pP', dphase3 = 'PcP', dphase4 = 'sP', # corr_threshold = corr_threshold, freq_min = freq_min, freq_max = freq_max, # min_dist = min_dist, max_dist = max_dist) #pro3singlet(eq_file = eq_file2, start_buff = start_buff, # end_buff = end_buff, plot_scale_fac = 0.1, qual_threshold = qual_threshold, # dphase = ref_phase, dphase2 = 'pP', dphase3 = 'PcP', dphase4 = 'sP', # corr_threshold = corr_threshold, freq_min = freq_min, freq_max = freq_max, # min_dist = min_dist, max_dist = max_dist) pro3pair(eq_file1 = eq_file2, eq_file2 = eq_file1, start_buff = start_buff, end_buff = end_buff, plot_scale_fac = 0.2, qual_threshold = qual_threshold, dphase = ref_phase, dphase2 = 'pP', dphase3 = 'PcP', dphase4 = 'sP', corr_threshold = corr_threshold, freq_min = freq_min, freq_max = freq_max, min_dist = min_dist, max_dist = max_dist) pro5stack(eq_file = eq_file1, plot_scale_fac = 0.05, slowR_lo = slowR_lo_1D, slowR_hi = slowR_hi_1D, slow_delta = slow_delta_1D, start_buff = start_buff, end_buff = end_buff, envelope = 1, norm = 1, global_norm_plot = 1, color_plot = 1, fig_index = 301) pro5stack(eq_file = eq_file2, plot_scale_fac = 0.05, slowR_lo = slowR_lo_1D, slowR_hi = slowR_hi_1D, slow_delta = slow_delta_1D, start_buff = start_buff, end_buff = end_buff, envelope = 1, norm = 1, global_norm_plot = 1, color_plot = 1, fig_index = 301) #%% --2D stacks #pro5stack2d(eq_file = eq_file1, plot_scale_fac = 0.05, # slowR_lo = slowR_lo, slowR_hi = slowR_hi, slowT_lo = slowT_lo, slowT_hi = slowT_hi, slow_delta = slow_delta, # start_buff = start_buff, end_buff = end_buff, # norm = 1, global_norm_plot = 1,