Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Revising the noise calculation in FITACF3.0 #420

Merged
merged 4 commits into from
Jun 19, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
17 changes: 14 additions & 3 deletions codebase/superdarn/src.lib/tk/fitacf_v3.0/src/preprocessing.c
Expand Up @@ -21,6 +21,8 @@ Author(s): Keith Kotyk July 2015
Modifications:
2020-03-11 Marina Schmidt (SuperDARN Canada) removed all defined
constants and included rmath.h
2021-05-26 Pasha Ponomarenko (SuperDARN Canada) check that the search noise
is nonzero before using it to replace the skynoise when min_pwr < 1

*/

Expand Down Expand Up @@ -823,8 +825,18 @@ double ACF_cutoff_pwr(FITPRMS *fit_prms){
ni = (ni > 0) ? ni : 1;
cpc = cutoff_power_correction(fit_prms);
min_pwr = min_pwr/ni * cpc;
if (min_pwr < 1.0) min_pwr = fit_prms->noise;



/* The commented line below causes Inf values of the SNR when the search noise
is zero. Therefore, we introduce an additional condition that the search noise
must be nonzero. This is a temporary fix that allows the affected data to be
processed properly while not affecting the processing of any other data.
A more universal solution to this issue should be developed for the
next release. */

/*if (min_pwr < 1.0) min_pwr = fit_prms->noise;*/
ecbland marked this conversation as resolved.
Show resolved Hide resolved
if ((min_pwr < 1.0) && (fit_prms->noise != 0.0)) min_pwr = fit_prms->noise;

free(pwr_levels);
return min_pwr;

Expand Down Expand Up @@ -1479,4 +1491,3 @@ void Fill_Data_Lists_For_Range(llist_node range,llist lags,FITPRMS *fit_prms){

}