I have arrays of potential vorticity and potential temperature values on isobaric coordinates, and I am trying to interpolate potential temperature onto an isosurface of potential vorticity. The arrays have the same vertical coordinate and they are the same size, and I chose a PV level that intersects with the pressure level I am generally interested in and corresponds with the anomaly I am studying. However, the metpy function interpolate_to_isosurface is returning an array full of nan values. I'm not sure why it is doing this.
Note that the data is from a planetary atmosphere, so the numbers don't fall into the typical 1-2 PVU range - I'm in the tens to hundreds of PVU. I don't see why this would cause a problem, but perhaps I'm missing something.
The code is simple, just assigning the arrays and calling the function like so:
import metpy.interpolate as interp
theta = # calling model data
pv = # calling model data
level = # PV layer of interest
dt = interp.interpolate_to_isosurface(pv,theta,level)
I expected the code to return a 2D array of theta values interpolated onto the PV isosurface of value "level", but instead I got a 2D array of nan values.