Commit 68ce7ccd authored by Tyson Littenberg's avatar Tyson Littenberg

Merge branch 'issue_92' into 'master'

Issue 92

See merge request !179
parents 7f5444f2 2370fad2
Pipeline #140338 passed with stages
in 2 minutes and 7 seconds
......@@ -1771,11 +1771,13 @@ static void tukey(double *data, double alpha, int N)
imin = (int)(alpha*(double)(N-1)/2.0);
imax = (int)((double)(N-1)*(1.0-alpha/2.0));
for(i=0; i< N; i++)
int Nwin = N-imax;
for(i=0; i< N; i++)
{
filter = 1.0;
if(i < imin) filter = 0.5*(1.0+cos(M_PI*( (double)(i)/(double)(imin)-1.0 )));
if(i>imax) filter = 0.5*(1.0+cos(M_PI*( (double)(i)/(double)(imin)-2.0/alpha+1.0 )));
if(i<imin) filter = 0.5*(1.0+cos(M_PI*( (double)(i)/(double)(imin)-1.0 )));
if(i>imax) filter = 0.5*(1.0+cos(M_PI*( (double)(i-imax)/(double)(Nwin))));
data[i] *= filter;
}
......@@ -1790,13 +1792,15 @@ static void tukey_scale(double *s1, double *s2, double alpha, int N)
imin = (int)(alpha*(double)(N-1)/2.0);
imax = (int)((double)(N-1)*(1.0-alpha/2.0));
int Nwin = N-imax;
x1 = 0.0;
x2 = 0.0;
for(i=0; i< N; i++)
{
filter = 1.0;
if(i < imin) filter = 0.5*(1.0+cos(M_PI*( (double)(i)/(double)(imin)-1.0 )));
if(i>imax) filter = 0.5*(1.0+cos(M_PI*( (double)(i)/(double)(imin)-2.0/alpha+1.0 )));
if(i<imin) filter = 0.5*(1.0+cos(M_PI*( (double)(i)/(double)(imin)-1.0 )));
if(i>imax) filter = 0.5*(1.0+cos(M_PI*( (double)(i-imax)/(double)(Nwin))));
x1 += filter;
x2 += filter*filter;
}
......@@ -2432,12 +2436,6 @@ void blstart(double *data, double *residual, int N, double dt, double fmin, int
// Tukey window parameter. Flat for (1-alpha) of data
//TODO: NEED TO MAKE THIS A PARAMETER WE CAN CONTROL AT THE COMMAND LINE
t_rise = 0.4; // Standard LAL setting
/*
t_rise increased because 0.4 was found to be insufficient.
Perhaps there is an additional data conditioning step in
LALInferenceReadData?
*/
//t_rise = 1.0;
alpha = (2.0*t_rise/Tobs);
df = 1.0/Tobs; // frequency resolution
......
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