Stream: python-questions

Topic: Av'g Ocean Temp Calculation


view this post on Zulip Mira Berdahl (Jun 10 2022 at 18:45):

I'm trying to calculated mean ocean temperatures below 700m. I'm using the weighted function to weight by the layer thickness, but most of my result ends up being NANs because of they are present at depth in shallower areas. Is there a way around this? I've taken a few screenshots of simplified workflow showing the basic issue. Any thoughts on how to work around this?

Screen-Shot-2022-06-10-at-11.44.00-AM-2.png Screen-Shot-2022-06-10-at-11.44.05-AM-2.png

view this post on Zulip Stephen Yeager (Jun 10 2022 at 22:09):

Your method looks reasonable to me. Have you tried plotting your "xx" array? It's not surprising there are NaNs at low/high latitudes and a plot should show valid values where ocean is deeper than 700m. Also, it looks like you need to request more memory when logging in to JupyterHub, as your memory usage exceeds your request.

view this post on Zulip Mira Berdahl (Jun 10 2022 at 22:27):

Yes, I've tried plotting a map for a time slice and it is just blank (all NaNs). I also thought it should show valid values. I don't know what else I could try? (And yes, will request more memory, thanks for the reminder)

view this post on Zulip Mira Berdahl (Jun 13 2022 at 18:15):

This error actually looks like it had to do with pop-tools layer depths. They are apparently slightly different (rounding error) than those in the actual POP temp files...


Last updated: May 16 2025 at 17:14 UTC