Skip to content

Put value to masked array #1223

Answered by mgrover1
raffyjef asked this question in Q&A
Jul 26, 2022 · 3 comments · 4 replies
Discussion options

You must be logged in to vote

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)

Replies: 3 comments 4 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
4 replies
@mgrover1
Comment options

@raffyjef
Comment options

@mgrover1
Comment options

@raffyjef
Comment options

Answer selected by mgrover1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants