Skip to content
Snippets Groups Projects
Commit 3bae858f authored by Argyro Sasli's avatar Argyro Sasli
Browse files

debugged scale + ID-sample variable added

parent ba67a7ab
Branches master
No related tags found
No related merge requests found
Pipeline #505888 passed
......@@ -68,7 +68,7 @@ def get_wavelet_params(filename, model, chirpflag=False, O1version=False, **keyw
return data
def wt(wave_params,psdfile):
def wt(wave_params,psdfile, ID):
"""
Makes a waveform from a set of wavelets
......@@ -79,6 +79,8 @@ def wt(wave_params,psdfile):
psdfile (str): data file of the PSD
ID (int): the number of the sample for the suggested reconstruction
outputs
-------
array of the waveform
......@@ -98,19 +100,18 @@ def wt(wave_params,psdfile):
fmin = int(psd[0,0]*Tobs)
wavenumber = wave_params['D'][0]
wavenumber = wave_params['D'][ID]
# the starting index in order to export the right set of parameters
start = sum(wave_params['D'][:ID])
for j in range(0,wavenumber):
t0 = wave_params['t'][j]
f0 = wave_params['f'][j]
Q = wave_params['Q'][j]
A = wave_params['A'][j]
phi0 = wave_params['phi'][j]
t0 = wave_params['t'][j+start]
f0 = wave_params['f'][j+start]
Q = wave_params['Q'][j+start]
A = wave_params['A'][j+start]
phi0 = wave_params['phi'][j+start]
i = int(f0*Tobs)
fac = 1.0/math.sqrt(psd[i-fmin,1])
tau = Q/(2*np.pi*f0)
......@@ -125,7 +126,6 @@ def wt(wave_params,psdfile):
for i in range(imin,imax):
t = float(i)/Nsamp*Tobs
sf = A*np.exp(-((t-t0)**2)/(tau**2))
sf *= fac
hs[i] += sf*np.cos(2*np.pi*f0*(t-t0)+phi0)
return hs
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment