Error with examples in MetPy Mondays #22 (CAPE/CIN): zero-size array #3287
-
I have had a couple of issues come up working through the "Metpy Mondays 22 - CAPE/CIN" video on YouTube, in which when we get to the line:
It errors out with "ValueError: zero-size array to reduction operation minimum which has no identity". This is using all the same code and case examples given in the video. I did an output to a separate array rather than overwriting the old values and ran some basic checks on the data and get this, so I'm not sure what the problem is.
I also had a separate warning come up with the very first Skew-T examples:
This warning didn't come up in the video example. I wasn't sure what to do about this so I wrote some code to remove duplicates. Is there anything in metpy that will clean up these arrays automatically? Here is the complete code I have for MetPy Mondays 22 with the changes I added (but which still produces errors).
|
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Hi @rolypolyman, it appears that with the layer you have chosen the equilibrium layer (EL) is undefined since the layer only goes to ~600 hPa and no EL level is found. So I don't think we currently support the calculation of CAPE/CIN without a valid EL. The duplicate temperatures that you experienced were high up in the atmosphere. Another way to get around that would be to subset the data for pressure >= 100 hPa. valid_levels = p >= 100*units.hPa
p_subset = p[valid_levels]
T_subset = T[valid_levels]
Td_subset = Td[valid_levels]
heights_subset = heights[valid_levels] |
Beta Was this translation helpful? Give feedback.
Hi @rolypolyman, it appears that with the layer you have chosen the equilibrium layer (EL) is undefined since the layer only goes to ~600 hPa and no EL level is found. So I don't think we currently support the calculation of CAPE/CIN without a valid EL.
The duplicate temperatures that you experienced were high up in the atmosphere. Another way to get around that would be to subset the data for pressure >= 100 hPa.