-
Notifications
You must be signed in to change notification settings - Fork 66
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use pint to properly deal with unit conversions in "Barotropic streamfunction" example #316
Conversation
Check out this pull request on See visual diffs & provide feedback on Jupyter Notebooks. Powered by ReviewNB |
I removed the warnings by passing |
@julia-neme, I don't know if it was you who defined the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry for the delay in getting back to you. I was flat out this week, and thanks again for being on top of keeping the examples up to date.
I checked the notebook and it runs, but if I am honest, I do not really understand what it does because I do not know what a barotropic streamfunction is. Perhaps it would be clearer to a physical oceanographer, which I am not.
I do have a question/request. Is it important to highlight positive and negative values in the map? At the moment is a continuous colourmap and I cannot distinguish positive from negative values. If this is important, maybe a divergent colourmap would be more appropriate (maybe the delta
palette from cmocean
, which has blues/yellows/green).
If it is not important to make this distinction, let me know and I will approve it so this can be merged.
hi @lidefi87! the stream function is a quantity whose derivatives give you the velocities... thus its actual value is irrelevant, only its gradients matter. you can think of it like pressure. the colormap was actually a divergent one but because it was highlighting the value ψ=0 as a "special one" I decided to change to this non-diverging colormap. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah. Got it now. Thanks for explaining it. I'm approving it now 😊
This PR showcases how we can use pint to properly deal with unit conversions e.g. when we want to convert from mass to volume transport or when we want to convert from m^3/s to Sverdrup.
There are heaps of warnings that xarray spits out and
at the beginning seems to have no effect... I don't know how to remove them or what do they are really trying to say (I mean, I can read them but I don't know what I should do...). If anyone has any idea is welcome!