PyRadarMet icon indicating copy to clipboard operation
PyRadarMet copied to clipboard

cal_zdr threshold on good points?

Open aamatthews opened this issue 10 years ago • 1 comments

When I was running this code, some of the biases counted toward the mean were very large (~ -8.0), but had only a few points, some even just 2 points, which meant often the standard deviation was low enough (<minSig) to be included in the mean. It would be nice if a threshold could be included to mask files that also had a low number of points. I am still learning python, so there may be a better way to do this, but I did:

    if zdr_bias['volume_standard_deviation'] > minSig:
        Stats[index,0] = np.ma.masked
        Stats[index,1] = np.ma.masked
        Stats[index,2] = np.ma.masked
    elif zdr_bias['volume_number_good'] < 1000.0:
        Stats[index,0] = np.ma.masked
        Stats[index,1] = np.ma.masked
        Stats[index,2] = np.ma.masked
    else:
        Stats[index,0] = zdr_bias['volume_average']
        Stats[index,1] = zdr_bias['volume_standard_deviation']
        Stats[index,2] = zdr_bias['volume_number_good']

aamatthews avatar Mar 25 '15 18:03 aamatthews

@aamatthews I just instituted the change you asked for. I added another keyword variable into the zdr_cal program and and then modified the scripts to use these. It seemed to work on a file I had lying around. Let me know if you get a chance to try the new code sometime.

nguy avatar Apr 17 '15 03:04 nguy