def det_weights(m1, m2, N=1): """Compute detection weights for distributions of CBC systems.""" pdet = gwdet.detectability() # Instantiate detection weight class m1_many = np.array([m1 for x in range(N)]).flatten() # bootstrap binaries m2_many = np.array([m2 for x in range(N)]).flatten() z_many = np.array([generate_redshift() for x in m1_many]) # compute redshifts det_many = pdet(m1_many, m2_many, z_many) # output weights return (compute_chirpmass(m1_many, m2_many), z_many, det_many)
#m1 = input() #print('please input m2') #m2 = input() #print('please input z') #z = input() #p=gwdet.detectability() #m1=10. # Component mass in Msun #m2=10. # Component mass in Msun #z=0.1 # Redshift #print(p(m1,m2,z)) # Fraction of detectabile sources #p_det is completed! p = gwdet.detectability() def dR_det(m_1, m_2, z): if m_1 < 0.0: return 0.0 elif m_2 < 0.0: return 0.0 elif z < 0.0: return 0.0 else: return dVdz(z) * p(m_1, m_2, z) * R_th(m_1, m_2, z) / (1 + z) #return 1 / ( 1 + z ) * 1 * p( m_1 ,m_2 ,z ) * R_th( m_1 ,m_2 , z )
print('hello world!') import gwdet import numpy as np import math import scipy from scipy import integrate from scipy import stats print('please select sensitivity mode.') x = input() if x == 1: p = gwdet.detectability() print('the sensitibity mode is design sensitibity.') else: p = gwdet.detectability(psd='aLIGOEarlyHighSensitivityP1200087') print('the sensitibity mode is aLIGOEarlyHighSensitivityP1200087.') #p = gwdet.detectability(psd = 'aLIGOEarlyHighSensitivityP1200087') #p = gwdet.detectability() import time t1 = time.time() N = 1000 for i in range(0, N): print(p(0.05 * i, 0.05 * i, 0.1))