Skip to content

Strange error for advection function #2836

Answered by dopplershift
Marston asked this question in Q&A
Discussion options

You must be logged in to vote

So the original all NaN result comes from pydata/xarray#7385, coming out of our use of xr.broadcast(), but caused by the way the arrays are constructed in the sample code. When constructing a Dataset of a single variable and then calling to_array() the returned result isn't a list, but a DataArray that includes an extra variable dimension with a single coordinate that seems to correspond to the original variable. That (for reasons unknown at this point) causes broadcast to put nan in the broadcast field rather than repeating the original values.

We still need to fix in MetPy the issue with "no units lat/lon" -> "lat/lon in radians".

Replies: 3 comments 16 replies

Comment options

You must be logged in to vote
14 replies
@Marston
Comment options

@Marston
Comment options

@dopplershift
Comment options

@Marston
Comment options

@dopplershift
Comment options

Comment options

You must be logged in to vote
0 replies
Answer selected by Marston
Comment options

You must be logged in to vote
2 replies
@dopplershift
Comment options

@Marston
Comment options

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