# Calculates the cumlative BNS range values for a given frequency bin using LIGO-P1200087-v18-AdV_MID_LOW as design reference #uses the formula from matlab code by Patrick J. Sutton (2003/03/31) for BNS range caculation # required values gps and duration of hrec data (). Calculation done for dec_2 : 16.30 # author- neha singh gps =1227803420 #dec_2 : 16.30 dur=3600 import numpy as np import matplotlib.pyplot as plt import matplotlib.mlab import pylab import pandas as pd import virgotools from virgotools import getChannel matplotlib.style.use('classic') matplotlib.style.use('seaborn-poster') SMALL_SIZE = 12 MEDIUM_SIZE =12 #BIGGER_SIZE =20 plt.rc('font', size=SMALL_SIZE) # controls default text sizes plt.rc('axes', titlesize=MEDIUM_SIZE) # fontsize of the axes title plt.rc('axes', labelsize=MEDIUM_SIZE) # fontsize of the x and y labels plt.rc('xtick', labelsize=SMALL_SIZE) # fontsize of the tick labels plt.rc('ytick', labelsize=SMALL_SIZE) # fontsize of the tick labels plt.rc('legend', fontsize=SMALL_SIZE) # legend fontsize plt.rc('figure', titlesize=MEDIUM_SIZE) # fontsize of the figure title hrec=getChannel('raw', 'Hrec_hoft_20000Hz',gps, dur).data # at fs=20000 Hz #hrec= np.load('/users/singh/Mpc_calc/hrec_%s_%s.npy'%(gps, dur)) print('hrec_%s_%s'%(gps, dur)) #====design asd ==============# design_data= np.transpose(np.genfromtxt('/users/singh/Mpc_calc/LIGO-P1200087-v18-AdV_MID_LOW.txt')) print('LIGO-P1200087-v18-AdV_MID_LOW.txt') freq_d=design_data[0] d_asd=design_data[1] #========hrec asd==============# fs=20000 t=50 #secs s=fs*t hrec_psd, freq = matplotlib.mlab.psd(hrec, NFFT= s, Fs=fs, detrend=None, window=matplotlib.mlab.window_hanning, noverlap=s/2, pad_to=None, sides='onesided', scale_by_freq=None) hrec_asd=hrec_psd**(0.5) #===================from Patrick J. Sutton (2003/03/31) code=========================# THETA = 1.77 M0 = 1.989*10**30 M1 = 1.4 M2 = 1.4 G = 6.67*10**-11 C = 299792458 CHM = G/(C**2)*M0*(M1*M2)**(3./5.)*(M1+M2)**(-1./5.) SNR_0 = 8 FISCO = ((6**1.5)*np.pi*(M1+M2)*M0*G/C**3)**(-1) METER_PER_KILOPARSEC = 3.086*10**19 #===================freq range=====================# f_start=10. # limit for which SNR = SNR_0 f_stop= FISCO ind_start=min(np.where(freq>=f_start)[0]) ind_stop= max(np.where(freq=l)[0]) ind_up_c= max(np.where(Freq