Browse Source

cleaning 2

split_comp
gesape 5 days ago
parent
commit
a045a0100c
  1. 7
      helper_functions/plotly_cluster_check.py
  2. 4
      src/cc.py
  3. 6
      src/clustering.py
  4. 2
      src/clusty.py

7
helper_functions/plotly_cluster_check.py

@ -235,10 +235,3 @@ def plot_merged(cat_path):
fig.show()
if __name__ == '__main__':
plotly_3d('/media/peter/7739547D1B1A00DA/greece_clusty/clusty_rundir/compare_freq_results/results/merged_freqs.yaml',
'/media/peter/7739547D1B1A00DA/greece_clusty/clusty_rundir/compare_freq_results/used_stations.pf')
plot_merged('/media/peter/7739547D1B1A00DA/greece_clusty/clusty_rundir/compare_freq_results/results/merged_freqs.yaml')
plot_merged('/media/peter/7739547D1B1A00DA/greece_clusty/clusty_rundir/compare_freq_results/results/merged_freqs2.yaml')

4
src/cc.py

@ -1301,9 +1301,9 @@ def get_similarity_matrix(comp, station_list, catalog, cc_settings, waveform_dir
title = './results/cc_%s.%s_%s' % (st.network, st.station, comp_base)
small_imshow_plot(coef_array[i_st], catalog, title, cbarlabel='cc',
fig_name=title+'.png', scale=[0,1])
logger.info('Station: %s:::%.2f' % (st.station,time.time()))
# logger.info('Station: %s:::%.2f' % (st.station,time.time()))
num.save(arr=coef_array, file='./precalc_arrays/cccoef_array_%s' % comp_base)
num.save(arr=weights_array, file='./precalc_arrays/ccweights_array_%s' % comp_base)
num.save(arr=tshifts_array, file='./precalc_arrays/cctshifts_array_%s' % comp_base)
logger.info('Finished Processing component %s:::%.2f' % (comp_base,time.time()))
# logger.info('Finished Processing component %s:::%.2f' % (comp_base,time.time()))

6
src/clustering.py

@ -826,7 +826,6 @@ def wf_cluster_plot(resultcat, subset_stations_and_indices, waveform_dir, arriva
want_incomplete=True, degap=True, maxgap=10,
trace_selector=lambda tr: tr.station == st.station and
tr.channel.endswith('Z'))[0]
print('tr Z found', tr_Z)
if 'N' in test_comps:
tr_N = p.all(tmin=arr-cc_cnf.filtertmin, tmax=arr+cc_cnf.filtertmax,
want_incomplete=True, degap=True, maxgap=10,
@ -878,7 +877,7 @@ def wf_cluster_plot(resultcat, subset_stations_and_indices, waveform_dir, arriva
try:
if 'Z' in test_comps:
tr_Z.chop(tmin=arr - t_buffer, tmax=arr + twd[1]+t_buffer)
logger.info('first chop %s %s %s ' % (tr_Z.tmin, tr_Z.tmax, len(tr_Z.ydata)))
logger.debug('first chop %s %s %s ' % (tr_Z.tmin, tr_Z.tmax, len(tr_Z.ydata)))
if 'N' in test_comps:
tr_N.chop(tmin=arr - t_buffer, tmax=arr + twd[1]+t_buffer)
if 'E' in test_comps:
@ -1270,7 +1269,6 @@ def wf_cluster_snuffle(resultcat, subset_stations_and_indices, waveform_dir, arr
tr_Z = p.all(tmin=arr-cc_cnf.filtertmin, tmax=arr+cc_cnf.filtertmax,
trace_selector=lambda tr: tr.station == st.station and
tr.channel.endswith('Z'))[0]
print('tr Z found', tr_Z)
if 'N' in test_comps:
tr_N = p.all(tmin=arr-cc_cnf.filtertmin, tmax=arr+cc_cnf.filtertmax,
trace_selector=lambda tr: tr.station == st.station and
@ -1320,7 +1318,7 @@ def wf_cluster_snuffle(resultcat, subset_stations_and_indices, waveform_dir, arr
try:
if 'Z' in test_comps:
tr_Z.chop(tmin=arr - t_buffer, tmax=arr + twd[1]+t_buffer)
logger.info('first chop %s %s %s ' % (tr_Z.tmin, tr_Z.tmax, len(tr_Z.ydata)))
logger.debug('first chop %s %s %s ' % (tr_Z.tmin, tr_Z.tmax, len(tr_Z.ydata)))
if 'N' in test_comps:
tr_N.chop(tmin=arr - t_buffer, tmax=arr + twd[1]+t_buffer)
if 'E' in test_comps:

2
src/clusty.py

@ -543,7 +543,7 @@ def main():
n_ev = len(cat)
network_similarity =num.empty((n_comp,n_ev, n_ev))
n_used_stats = num.empty((n_comp,n_ev, n_ev))
logger.info('NETSIM allocation:::%.2f' % time.time())
# logger.info('NETSIM allocation:::%.2f' % time.time())
for i_comp, comp in enumerate(cc_cnf.components):
comp_base = comp[-1]

Loading…
Cancel
Save