Skip to content

Commit

Permalink
Better channel-naming for T-T cross-correlations
Browse files Browse the repository at this point in the history
  • Loading branch information
geojunky committed Oct 3, 2024
1 parent 250a940 commit 9a22759
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 5 deletions.
3 changes: 2 additions & 1 deletion seismic/xcorqc/correlator.py
Original file line number Diff line number Diff line change
Expand Up @@ -240,6 +240,7 @@ def get_loccha(cha1, cha2):
# end if
else:
if(item[2] not in ulocs):
cha = item[3][:-1] + 'T' # transverse channel e.g. BHT
if(loc_pref is None):
result[chidx].append('{}.{}'.format(item[2], cha))
ulocs.add(item[2])
Expand All @@ -260,7 +261,7 @@ def get_loccha(cha1, cha2):
if (corr_chan == 'z'): loccha1_list, loccha2_list = get_loccha(ds1_zchan, ds2_zchan)
elif (corr_chan == 'n'): loccha1_list, loccha2_list = get_loccha(ds1_nchan, ds2_nchan)
elif (corr_chan == 'e'): loccha1_list, loccha2_list = get_loccha(ds1_echan, ds2_echan)
elif (corr_chan == 't'): loccha1_list, loccha2_list = get_loccha('00T', '00T')
elif (corr_chan == 't'): loccha1_list, loccha2_list = get_loccha('', '')
else: raise ValueError('Invalid corr-chan')

if(len(loccha1_list)<1 or len(loccha2_list)<1):
Expand Down
6 changes: 3 additions & 3 deletions seismic/xcorqc/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -341,9 +341,9 @@ def get_stream(fds, net, sta, loc, cha, start_time, end_time,
baz=None, trace_count_threshold=200,
logger=None, verbose=1):

if (cha == '00T'): return _get_stream_00T(fds, net, sta, loc, start_time, end_time,
baz=baz, trace_count_threshold=trace_count_threshold,
logger=logger, verbose=verbose)
if (cha[-1] == 'T'): return _get_stream_00T(fds, net, sta, loc, start_time, end_time,
baz=baz, trace_count_threshold=trace_count_threshold,
logger=logger, verbose=verbose)
st = Stream()
if(loc is None):
stations = fds.get_stations(start_time, end_time, network=net, station=sta,
Expand Down
Binary file modified tests/test_seismic/xcorqc/data/expected/expected.tar.gz
Binary file not shown.
2 changes: 1 addition & 1 deletion tests/test_seismic/xcorqc/test_interval_stack_xcorr.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@
os.system(cmd)
output_folder = str(tempfile.mkdtemp())

@pytest.fixture(params=['.BHZ', '.00T'])
@pytest.fixture(params=['.BHZ', '.BHT'])
def loccha(request):
return request.param

Expand Down

0 comments on commit 9a22759

Please sign in to comment.