[minor] small modifications (naming conventions)
This commit is contained in:
parent
cdcd226c87
commit
0f29d0e20d
@ -10,6 +10,7 @@ import traceback
|
|||||||
|
|
||||||
import matplotlib.pyplot as plt
|
import matplotlib.pyplot as plt
|
||||||
import yaml
|
import yaml
|
||||||
|
|
||||||
from code_base.fmtomo_tools.fmtomo_teleseismic_utils import *
|
from code_base.fmtomo_tools.fmtomo_teleseismic_utils import *
|
||||||
from code_base.util.utils import get_metadata
|
from code_base.util.utils import get_metadata
|
||||||
from joblib import Parallel, delayed
|
from joblib import Parallel, delayed
|
||||||
@ -17,6 +18,7 @@ from obspy import read, Stream
|
|||||||
from obspy.core.event.base import WaveformStreamID, ResourceIdentifier
|
from obspy.core.event.base import WaveformStreamID, ResourceIdentifier
|
||||||
from obspy.core.event.origin import Pick
|
from obspy.core.event.origin import Pick
|
||||||
from obspy.signal.cross_correlation import correlate, xcorr_max
|
from obspy.signal.cross_correlation import correlate, xcorr_max
|
||||||
|
|
||||||
from pylot.core.io.inputs import PylotParameter
|
from pylot.core.io.inputs import PylotParameter
|
||||||
from pylot.core.io.phases import picks_from_picksdict
|
from pylot.core.io.phases import picks_from_picksdict
|
||||||
from pylot.core.pick.autopick import autopickstation
|
from pylot.core.pick.autopick import autopickstation
|
||||||
@ -24,6 +26,7 @@ from pylot.core.util.utils import check4rotated
|
|||||||
from pylot.core.util.utils import identifyPhaseID
|
from pylot.core.util.utils import identifyPhaseID
|
||||||
from pylot.core.util.event import Event as PylotEvent
|
from pylot.core.util.event import Event as PylotEvent
|
||||||
|
|
||||||
|
|
||||||
class CorrelationParameters(object):
|
class CorrelationParameters(object):
|
||||||
"""
|
"""
|
||||||
:param filter_type: filter type for data (e.g. bandpass)
|
:param filter_type: filter type for data (e.g. bandpass)
|
||||||
@ -83,7 +86,7 @@ class CorrelationParameters(object):
|
|||||||
self.__parameter[key] = value
|
self.__parameter[key] = value
|
||||||
|
|
||||||
|
|
||||||
class Xcorr_pick_correction:
|
class XcorrPickCorrection:
|
||||||
def __init__(self, pick1, trace1, pick2, trace2, t_before, t_after, cc_maxlag, frac_max=0.5):
|
def __init__(self, pick1, trace1, pick2, trace2, t_before, t_after, cc_maxlag, frac_max=0.5):
|
||||||
"""
|
"""
|
||||||
MP MP : Modified version of obspy xcorr_pick_correction
|
MP MP : Modified version of obspy xcorr_pick_correction
|
||||||
@ -559,8 +562,6 @@ def correlate_event(eventdir, pylot_parameter, params, channel_config, update):
|
|||||||
picks = remove_outliers(picks, taupypicks_corr_initial,
|
picks = remove_outliers(picks, taupypicks_corr_initial,
|
||||||
params[phase_type]['initial_pick_outlier_threshold'])
|
params[phase_type]['initial_pick_outlier_threshold'])
|
||||||
|
|
||||||
# # MP MP TEST # taupypicks, time_shift = get_corrected_taupy_picks(picks, taupypicks_orig, all_available=True) # # picks = copy.deepcopy(taupypicks) # for pick in picks: # pick.method_id.id = 'auto' # # MP MP
|
|
||||||
|
|
||||||
if phase_type == 'S':
|
if phase_type == 'S':
|
||||||
# check whether rotation to ZNE is possible (to get rid of horizontal channel 1,2,3)
|
# check whether rotation to ZNE is possible (to get rid of horizontal channel 1,2,3)
|
||||||
# the two rotations here (first to ZNE then LQT) could, however, be optimised into one
|
# the two rotations here (first to ZNE then LQT) could, however, be optimised into one
|
||||||
@ -1517,14 +1518,14 @@ def correlation_worker(input_dict):
|
|||||||
|
|
||||||
try:
|
try:
|
||||||
logging.debug(f'Starting Pick correction for {nwst_id}')
|
logging.debug(f'Starting Pick correction for {nwst_id}')
|
||||||
xcpc = Xcorr_pick_correction(pick_this.time, input_dict['trace1'], other_pick.time, input_dict['trace2'],
|
xcpc = XcorrPickCorrection(pick_this.time, input_dict['trace1'], other_pick.time, input_dict['trace2'],
|
||||||
t_before=t_before, t_after=t_after, cc_maxlag=cc_maxlag)
|
t_before=t_before, t_after=t_after, cc_maxlag=cc_maxlag)
|
||||||
|
|
||||||
dpick, ccc, uncert, fwm = xcpc.cross_correlation(plot, fig_dir, plot_name='dpick')
|
dpick, ccc, uncert, fwm = xcpc.cross_correlation(plot, fig_dir, plot_name='dpick')
|
||||||
logging.debug(f'dpick of first correlation: {dpick}')
|
logging.debug(f'dpick of first correlation: {dpick}')
|
||||||
|
|
||||||
if input_dict['ncorr'] > 1: # and not ccc <= 0:
|
if input_dict['ncorr'] > 1: # and not ccc <= 0:
|
||||||
xcpc2 = Xcorr_pick_correction(pick_this.time, input_dict['trace1_highf'], other_pick.time + dpick,
|
xcpc2 = XcorrPickCorrection(pick_this.time, input_dict['trace1_highf'], other_pick.time + dpick,
|
||||||
input_dict['trace2_highf'], t_before=1., t_after=40., cc_maxlag=cc_maxlag2)
|
input_dict['trace2_highf'], t_before=1., t_after=40., cc_maxlag=cc_maxlag2)
|
||||||
|
|
||||||
dpick2, ccc, uncert, fwm = xcpc2.cross_correlation(plot=plot, fig_dir=fig_dir, plot_name='error',
|
dpick2, ccc, uncert, fwm = xcpc2.cross_correlation(plot=plot, fig_dir=fig_dir, plot_name='error',
|
||||||
|
Loading…
Reference in New Issue
Block a user