Commit 78564707 authored by Simran Dave's avatar Simran Dave
Browse files

Upload New File

parent a4651ce2
%% Cell type:code id: tags:
``` python
import pylab
import pycbc
from pycbc.waveform import get_td_waveform
from pycbc.waveform import get_fd_waveform
from pycbc.waveform import fd_approximants
import pycbc.noise
import pycbc.psd
from pycbc.types import TimeSeries
from pycbc import distributions
import numpy as np
for i in range(10):
mass1_distribution = distributions.uniform_log.UniformLog10(mass1=(5, 95))
mass1_value=mass1_distribution.rvs(size=1)
mass2_distribution = distributions.uniform_log.UniformLog10(mass2=(5, 95))
mass2_value=mass2_distribution.rvs(size=1)
print(mass1_value['mass1'])
print(mass2_value['mass2'])
hp, hc = get_td_waveform(approximant='SEOBNRv4',
mass1=mass1_value['mass1'],
mass2=mass2_value['mass2'],
delta_t=1.0/4096,
f_lower=40)
for j in range(10):
seed_value=np.random.randint(1, 200)
flow = 30.0
delta_f = 1.0 / 16
flen = int(2048 / delta_f) + 1
psd = pycbc.psd.aLIGOZeroDetHighPower(flen, delta_f, flow)
delta_t = 1.0 / 4096
tsamples = int(5 / delta_t)
ts = pycbc.noise.noise_from_psd(tsamples, delta_t, psd, seed=seed_value)
tlen = 5 / delta_t
hp.resize(tlen)
ts.resize(tlen)
hp_new = TimeSeries(hp.data.data, dtype=hp.dtype,delta_t=delta_t, epoch=0)
final = hp_new + ts
np.savetxt(str(i) + str(j) + '.txt',np.transpose([final.sample_times,final]))
```
%% Cell type:code id: tags:
``` python
import sys
!{sys.executable} -m pip install pycbc ligo-common --no-cache-dir
```
%% Cell type:code id: tags:
``` python
cd
```
%% Cell type:code id: tags:
``` python
cd OneDrive
```
%% Cell type:code id: tags:
``` python
```
%% Cell type:code id: tags:
``` python
cd Documents
```
%% Cell type:code id: tags:
``` python
cd aei_research
```
%% Cell type:code id: tags:
``` python
from pycbc import distributions
mass1_distribution = distributions.uniform_log.UniformLog10(mass1=(5, 95))
mass1_value=mass1_distribution.rvs(size=1)
print(mass1_value['mass1'])
```
%% Cell type:code id: tags:
``` python
mass1_distribution = distributions.uniform_log.UniformLog10(mass1=(5, 95))
mass1_value=mass1_distribution.rvs(size=1)
mass2_distribution = distributions.uniform_log.UniformLog10(mass2=(5, 95))
mass2_value=mass2_distribution.rvs(size=1)
print(mass1_value['mass1'])
print(mass2_value['mass2'])
```
%% Cell type:code id: tags:
``` python
```
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment