-
Notifications
You must be signed in to change notification settings - Fork 11
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
EHN: Boxcar Filter #296
EHN: Boxcar Filter #296
Conversation
Discussion from meeting: include a warning here for the user with reference to relevant literature, and add to documentation how the data is being modified. Let me know any references and I can add in a warning when using and add a page in the documentation on what is happening when using the filter with some warnings (like don't use on twofsound data like me 👀 ) |
Matplotlib version: 3.5.3 Hi, I am getting the following error. I tried by dropping plot_coastline option as I am having trouble with cartopy. Script: import pydarn with bz2.open('20150331.1801.00.rkn.fitacf.bz2') as fp: Before filtering:pydarn.RTP.plot_summary(fitacf_data, beam_num=7, pydarn.Fan.plot_fan(fitacf_data, scan_index=10) Evoke filter on databx = pydarn.Boxcar( After filteringpydarn.RTP.plot_summary(filtered_data, beam_num=7, pydarn.Fan.plot_fan(filtered_data, scan_index=10) |
I also checked individual RTP plot and confirmed that only plotting the elevation angle has the same issue, plotting other parameters works fine. After filteringa = pydarn.RTP.plot_summary(filtered_data, beam_num=7, a = pydarn.RTP.plot_range_time(filtered_data, beam_num=7,parameter='elv', a = pydarn.RTP.plot_range_time(filtered_data, beam_num=7,parameter='p_l', a = pydarn.RTP.plot_range_time(filtered_data, beam_num=7,parameter='w_l', plt.show()
|
Thanks for testing both! EDIT: after looking further at the arrays, it looks like |
@carleyjmartin Yes, I think elev angle data should be filtered. But I have not gone through the code it. I might change a few lines in this branch. |
@carleyjmartin The code looks good to me. I approve of the modification under ehn/boxcar-filter. |
Excellent! I think we should just hang on merging this into develop until the Iceland radar changes are put into develop and then made into a patch release, if you're happy for this to be in the next major/minor release. |
Scope
This PR extends previous PR #204
Includes a module
filters.py
which can be extended if we want to in the future.filters.py
includes the code provided by @shibaji7 in the previous PR but I've made a new branch as the rest of the code was still at v2.1 so this was easier than pulling the old branch to be up to date.For @shibaji7, I had to add some additional code in to deal with ground scatter flags and repopulating the data dictionary to be able to use the outputted data in pyDARN methods afterwards. Please let me know if the changes at the bottom for groundscatter are okay. If you have a copyright line let me know and I can add it in at the top with mine.
Also included here is an addition to the documentation on how to use the boxcar filter.
issue: will close #171
Approval
Number of approvals: 2 (testing and code review where possible please)
Test
matplotlib version: 3.6.3
Note testers: please indicate what version of matplotlib you are using
The boxcar filter can take 5-10 minutes to run on a 2 hours file, please bear that in mind, it is not a bug, it's just how it is.
Reminder to also downgrade numpy to 1.23.0 as newer numpy breaks pydarnio, this is in a patch release waiting now. If you get a hardware file issue see solutions here: #292
The code produces the following plots to compare:
Summary unfiltered:
Summary filtered:
Fan unfiltered:
Fan filtered: