Hello, I am working on a project that requires me to use pyart.map.grid_from_radars. I was wondering what the difference between the Barnes and Barnes2 weighting functions were.
Thanks!
Ashlee
Hi Ashlee,
If I remember correctly, Barnes weighting function was calculating the ROI incorrectly see:
opened 03:16AM - 16 Jul 18 UTC
closed 09:30PM - 05 Apr 19 UTC
The Barnes weighting function can be expressed as
weight = exp( - (d^2) / (2 … * sigma^2) )
where d is the distance between a grid point and an observation and sigma is the standard deviation. [Barnes (1964)](https://journals.ametsoc.org/doi/pdf/10.1175/1520-0450%281964%29003%3C0396%3AATFMDI%3E2.0.CO%3B2) expressed this slightly differently as
weight = exp( - (d^2) / (4*k) )
Thus, k = (sigma^2) / 2. [Barnes (1964)](https://journals.ametsoc.org/doi/pdf/10.1175/1520-0450%281964%29003%3C0396%3AATFMDI%3E2.0.CO%3B2) defined a radius of influence (ROI), R, beyond which the weight is assumed to be zero, as
(R^2) / (4*k) = E
A value of E = 4 was recommended as this ensures that ~98 % of the influence of each observation is included. This gives R = 4 * sqrt(k) = 2 * sqrt(2) * sigma. The same recommendation was also made by [Pauley and Wu (1990)](https://journals.ametsoc.org/doi/pdf/10.1175/1520-0493%281990%29118%3C1145%3ATTDAAR%3E2.0.CO%3B2), although note that they again expressed the weight function slightly differently.
Currently, in _gate_to_grid_map.pyx the formulation of the weight is
`weight = exp(-(dist2) / (2*roi2)) + 1e-5`
where `dist2` is the square of the distance between a grid point and a radar pixel and `roi2` is the square of the ROI. By this definition, R = sigma. In other words, **the ROI currently being used is a factor of 2*sqrt(2) too small**.
It is recommended that the function be reformulated such that sigma is defined by the user and the ROI is calculated following Barnes' (and Pauley and Wu's) recommendation.
We added in Barnes 2 as a fix and then we were over time depreciating Barnes due to giving folks time to switch if they were using Barnes 1 in their workflows. Which this is actually a good reminder that we need to fully phase out Barnes 1.
Hope that helps!
Oh perfect! Thanks for the reply!