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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@pasha-ponomarenko On slide 7 of your notes in #419 you said the following:
A sanity check flagging zero skynoise values can be added here as well.
This sounds like a good idea. Do you want to add it?
Also, could you please add a new entry under "modifications" at the top of the file?
rst/codebase/superdarn/src.lib/tk/fitacf_v3.0/src/preprocessing.c
Lines 21 to 23 in 866f3b6
Modifications: | |
2020-03-11 Marina Schmidt (SuperDARN Canada) removed all defined | |
constants and included rmath.h |
I just want to outline the problem background in a bit more detail so that we can find a suitable solution. I would prefer to get rid of yet another ad hoc procedure: to select the “weakest” lag 0 powers from the whole set of non-zero values and to abandon using the “search noise” as a substitute. |
My view is that we should avoid making modifications to FITACF2.5 that would have any impact on the data pre-selection or the fitted parameters. I think small "self-contained" changes are ok if there is a good reason to make them (e.g. #411), but nothing more significant than that. So I'd recommend that we review the noise calculation in FITACF3.0 only. We can rename it to FITACF3.1 if that seems appropriate. Two general notes about reproducibility:
Completely agree...the search noise is not a good substitute for the "sky noise" -- If anyone is interested, I have some fun examples buried in my notes 😜 |
Does anyone know when the radars stopped discarding ACFs below the threshold? |
Adding for reference the clear frequency search code. I have got it from Dieter few years ago: |
Yes, there is a separate ROS archive on Github: https://github.com/SuperDARN/ros-archive |
@ecbland, I made a quick fix (now in lne 840 of preporcessing.c) that performs the skynoise replacement by the search noise only if the search noise value is non-zero. In this way we preserve the old analysis output but resolve the "streaks" issue for BOREALIS data (and any other data that have zero search noise values). |
Thanks @pasha-ponomarenko! I'll take a look ASAP. There are indeed some other radars that haven't used the clear frequency search at one point or another, so I will test with them as well. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tested this for a few radars. I didn't find any non-BOREALIS examples where this change would matter, but it is possible there are examples out there in the historical data. In any case, this PR fixes the divide by zero problem.
@ecbland, yes these modificaitons do make sense! Please go ahead and implement those changes! |
I'm adding another example here to answer a specific question from a PI about the Clyde River data on 29 May 2021. The plots below show that this PR solves the issue with the vertical stripes in BOREALIS data.
|
Resolve an issue causing infinite SNR vlaues in BOREALIS data with noise level < 1. For more detail see SuperDARN/rst#420 (comment).
This pull request deals with the problem described in issue #419 when very high (Inf) SNR values sporadically occurr across all range gates in BOREALIS data processed with FITACF3 (note that those are absent if you process the same data with FITACF2.5). This effect is regularly observed in CLY data:
Testing of the bug fix is very simple: run make_fit from this branch on the respective rawacf file and plot it:
The vertical stripes should disappear: