Weighting between radars

I faced the same issues when retrieving winds from multiple lidars:

so I write my own weightings, and while looking up the source code in order to write my own ones as close as the original one as possible. I noticed a line in _get_dd_wind_field_scipy:

cur_array = parameters.weights[i, k]

maybe the culprit. It seems cur_array in fact references parameters.weights instead of copying a new array. Therefore, the changes to cur_array in the following lines will go into parameters.weights. Thus, the last line

parameters.weights[i, k] += cur_array

may not accumulate the weightings when j loops through other radars, as parameters.weights is over-written whenever j changes, until the last radar on the list.

I have played around with the order of the radar list, and the results suggested the last radar took a special place in determining the coverage of final results. I have replicated the weighting calculation part as far as I need to write my own weightings, and the final result seems reasonable.

However, I am not good at Python after all, could anyone confirm my thoughts? Thx.

@SunnysChan you are probably right. This would be an easy fix to replace the cur_array = parameters.weights[i, k] line with cur_array = parameters.weights[i, k].copy().

If you don’t mind, could you please raise an issue on the GitHub page and submit your fix as a PR?

No problem. I will try to figure out how to do that. This is the first time I submit a PR.