-
Hi! When using min_rhv=0.8. it masked values less than 0.8, then assigns what value to the masked array? Is it possible to assign a value of 0 for masked arrays? I'm trying to use np.where(data == np.nan) = 0. But it doesn't work because values are not equal to nan. |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 4 replies
-
Which function are you working with? |
Beta Was this translation helpful? Give feedback.
-
I'm using different functions like pyart.correct_calculate_attenuation, pyart.retrieve.est_rain_rate_z and others |
Beta Was this translation helpful? Give feedback.
-
Py-ART uses a masked array for the values, not a regular numpy array with np.nan values. To fill the values, you would need to use something like this function https://numpy.org/doc/stable/reference/generated/numpy.ma.MaskedArray.filled.html For example: rho_hv = radar.fields["rho_hv"]["data"]
rho_hv.filled(fill_value=0) |
Beta Was this translation helpful? Give feedback.
Py-ART uses a masked array for the values, not a regular numpy array with np.nan values. To fill the values, you would need to use something like this function
https://numpy.org/doc/stable/reference/generated/numpy.ma.MaskedArray.filled.html
For example: