'''
Created on 2021年9月1日
@author: hyxie
'''
import math
import numpy as np
original = np.loadtxt('example.data')
seimso = original[:,0]
topo = original[:,1]
seismo = seismo/np.sum(seismo)
topo = topo/np.sum(topo)
seismo_avg = np.mean(seismo)
topo_avg = np.mean(topo)
sigma_s = (np.sum((seismo-seismo_avg)**2)/len(seismo))**0.5
sigma_t = (np.sum((topo-topo_avg)**2)/len(topo))**0.5
gamma = 0
for i in range (len(seismo)):
gamma = gamma+(seismo[i]-seismo_avg)*(topo[i]-topo_avg)
gamma = gamma/(len(seismo)-1)
gamma = gamma/((sigma_s*sigma_t)**0.5)
c_s = sigma_s/(sigma_s+sigma_t)
c_t = sigma_t/(sigma_s+sigma_t)
eta_s = (seismo-np.min(seismo))/(np.max(seismo)-np.min(seismo))
eta_t = (topo-np.min(topo))/(np.max(