ARM-DOE / pyart

The Python-ARM Radar Toolkit. A data model driven interactive toolkit for working with weather radar data.
https://arm-doe.github.io/pyart/
Other
516 stars 268 forks source link

changes to comp_z #1562

Open dopplerchase opened 7 months ago

dopplerchase commented 7 months ago

Code for issue #1559, where composite reflectivity code carried artifacts through with poor quality radar data from velocity sweeps. I also made a change to the interpolator because it was flagged as depreciated (e.g., scipy.interpolate.interp2d).

This is now open for comment from the maintainers! Happy to make changes as needed.

Example usage:

compz = pyart.retrieve.composite_reflectivity(radar, field="reflectivity")

image

The code is flexible, and allows you to still have the old functionality through the simple bool:

compz = pyart.retrieve.composite_reflectivity(radar, field="reflectivity",same_nyquist=False)

image

zssherman commented 7 months ago

@dopplerchase Thanks for the PR! The errors seem to be PEP8 fixes.

mgrover1 commented 6 months ago

@dopplerchase - is there anything we can do to help here?

dopplerchase commented 6 months ago

@mgrover1 find me some more time? lol We need to think carefully about Ryan's comments noted on https://github.com/ARM-DOE/pyart/issues/1559

mgrover1 commented 6 months ago

no worries 😄 that is a good point!!

decadeneo commented 6 months ago

I'm glad to hear that someone has encountered a similar bug. When directly using the function pyart.retrieve.composite_reflectivity, I found that the interpolated composite reflectivity values are all NaN. Upon diving into the source code, I was prompted to change the interpolation method. However, when attempting to modify it with alternative interpolation methods, I encountered an error indicating that the number of azimuth angles per layer in my radar data is inconsistent, thereby preventing a smooth interpolation process.

zssherman commented 4 months ago

@mgrover1 I'm seeing the testing fail due to the depreciation of interp2d, we might need to do a PR just with the depreciation change. I can work on that.