Commit b3b07d7e authored by Katerina Chatziioannou's avatar Katerina Chatziioannou
Browse files

use existing functions for wavelet SNR

parent 20c3f6e0
...@@ -69,8 +69,8 @@ void draw_glitch_amplitude(double *params, double *Snf, gsl_rng *seed, double To ...@@ -69,8 +69,8 @@ void draw_glitch_amplitude(double *params, double *Snf, gsl_rng *seed, double To
invmax = 1./max; invmax = 1./max;
i = (int)(params[1]*Tobs); i = (int)(params[1]*Tobs);
double SNRmin = range[3][0]*sqrt((params[2]/(2.0*RT2PI*params[1]))/(Snf[i]*2.0/Tobs)); double SNRmin = range[3][0]*SineGaussianSNR(params, Snf, Tobs);
double SNRmax = range[3][1]*sqrt((params[2]/(2.0*RT2PI*params[1]))/(Snf[i]*2.0/Tobs)); double SNRmax = range[3][1]*SineGaussianSNR(params, Snf, Tobs);
k = 0; k = 0;
...@@ -109,7 +109,9 @@ void draw_glitch_amplitude(double *params, double *Snf, gsl_rng *seed, double To ...@@ -109,7 +109,9 @@ void draw_glitch_amplitude(double *params, double *Snf, gsl_rng *seed, double To
} }
//SNR defined with Sn(f) but Snf array holdes <n_i^2> //SNR defined with Sn(f) but Snf array holdes <n_i^2>
params[3] = SNR/sqrt((params[2]/(2.0*RT2PI*params[1]))/(Snf[i]*2.0/Tobs)); //params[3] = SNR/sqrt((params[2]/(2.0*RT2PI*params[1]))/(Snf[i]*2.0/Tobs));
params[3] *= SNR/SineGaussianSNR(params, Snf, Tobs);
} }
...@@ -132,10 +134,10 @@ void draw_signal_amplitude(double *params, double *Snf, gsl_rng *seed, double To ...@@ -132,10 +134,10 @@ void draw_signal_amplitude(double *params, double *Snf, gsl_rng *seed, double To
i = (int)(params[1]*Tobs); i = (int)(params[1]*Tobs);
double SNRmin = range[3][0]*sqrt((params[2]/(2.0*RT2PI*params[1]))/(Snf[i]*2.0/Tobs)); double SNRmin = range[3][0]*SineGaussianSNR(params, Snf, Tobs)/params[3];
double SNRmax = range[3][1]*sqrt((params[2]/(2.0*RT2PI*params[1]))/(Snf[i]*2.0/Tobs)); double SNRmax = range[3][1]*SineGaussianSNR(params, Snf, Tobs)/params[3];
k = 0; k = 0;
SNR = SNRmin + (SNRmax-SNRmin)*uniform_draw(seed); SNR = SNRmin + (SNRmax-SNRmin)*uniform_draw(seed);
...@@ -197,7 +199,7 @@ void draw_uniform_amplitude(double *params, double *Snf, gsl_rng *seed, double T ...@@ -197,7 +199,7 @@ void draw_uniform_amplitude(double *params, double *Snf, gsl_rng *seed, double T
//SNR defined with Sn(f) but Snf array holdes <n_i^2> //SNR defined with Sn(f) but Snf array holdes <n_i^2>
params[3] = SNR/sqrt((params[2]/(2.0*RT2PI*params[1]))/(Snf[i]*2.0/Tobs)); params[3] *= SNR/SineGaussianSNR(params, Snf, Tobs);
} }
...@@ -494,7 +496,7 @@ void intrinsic_fisher_update(double *params, double *dparams, double *Snf, doubl ...@@ -494,7 +496,7 @@ void intrinsic_fisher_update(double *params, double *dparams, double *Snf, doubl
double betasq; double betasq;
//SNR defined with Sn(f) but Snf array holdes <n_i^2> //SNR defined with Sn(f) but Snf array holdes <n_i^2>
SNR = params[3]*sqrt((params[2]/(2.0*RT2PI*params[1]))/(Snf[i]*2.0/Tobs)); SNR = SineGaussianSNR(params, Snf, Tobs);
if(SNR < 5.0) SNR = 5.0; // this caps the size of the proposed jumps if(SNR < 5.0) SNR = 5.0; // this caps the size of the proposed jumps
......
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