-
Notifications
You must be signed in to change notification settings - Fork 390
Generalize EC cell widths function #526
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
Generalize EC cell widths function #526
Conversation
Many supposed parameters are actually hard-coded. Documentation has been updated to adhere to numpydoc formatting. Unnecessary looping has been removed.
Imports should be at the top of the file. Colormap is now perceputally uniform (not "jet"!) Plot layout is now tighter (though there's still considerable whitespace.
| ), extent=[-180, 180, -90, 90], cmap='jet') | ||
| im = ax.imshow(cellWidth, origin='lower', | ||
| transform=ccrs.PlateCarree(), | ||
| extent=[-180, 180, -90, 90], cmap='viridis_r') |
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.
Make this rainbow.
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.
Please don't-- this doesn't add value and rainbow is a notoriously bad 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.
(unless rainbow is the perceptually uniform one, not "jet") In that case this is ok.
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.
@pwolfram, thanks for the feedback. I agree, rainbow isn't a big improvement over jet. How about another solution? I have been using a colormap from paraview for resolution that is made up of 3 perceptually uniform segments ("Blue - Green - Orange"), the second colormap here: https://sciviscolor.org/3-wave-colormaps/. It will be more complicated to add this to COMPASS, since it's not standard in matplotlib, but I'll see what I can do. Would that work for you? @mark-petersen, what do you think?
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.
The problem with viridis is that it's too dark and the black outlines from cartopy don't show up well, but this could be fixed by drawing in the continents, not just the outlines.
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.
I'm happy with perceptually uniform solutions, but don't like it when you can see "lines" like yellow, in the colormap. But, I'm ok with non-jet solutions like proposed below-- thanks!
| fig.canvas.draw() | ||
| plt.tight_layout() |
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.
This cleans up some whitespace.
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.
👍
|
@mark-petersen, I'm still tinkering with this one. Please don't merge yet. |
|
@pwolfram, @mark-petersen and anyone else who wants to weigh in, which is better? I personally prefer 2 ( |
|
Pending @pwolfram and @mark-petersen's approval of using |
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.
bbox_inches='tight' eliminates some of the remaining white space around the image so it looks right.
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.
Thanks, good to know.
|
@xylar I strongly prefer your first one above (de-saturated rainbow?) because I can perceive six colors, and they are in an order I expect. In |
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.
It looks like you downloaded this directly from Paraview? That was smart.
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.
No, copied from MPAS-Analysis, which gives proper credit and got it from the original source (LANL's own SciVisColor web page, I believe).
|
@mark-petersen, so the problem is a really hard one. More colors does give more granularity in some sense but it really leaves you with no intuition about where is high res and where is low. As Leif pointed out, he couldn't even tell how many regions of different resolution there were in my plot 1. above -- he thought there were 9, and that the yellow bands were really distracting as if they had extra meaning. This is the general complaint about color maps that don't transition uniformly from dark to light or visa versa, and the reason for the push for perceptual uniformity. |
|
I played around with a bunch more color maps and I do think |
Add support for a colormap form SciVisColor (3Wbgy5).
67f6b51 to
964e31a
Compare
mark-petersen
left a comment
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.
@xylar thanks for your work on this. It all looks great!
pwolfram
left a comment
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.
Approved by inspection
|
@sbrus89, can you please review the above? |
sbrus89
left a comment
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.
I agree this is a nice improvement. I approve by inspection.
|
Thanks. Tested one last time with QU240, QU240wISC, EC60to30wISC, EC60to30, SO60to10wISC. Everything appears to be working and making the plots correctly. |
Generalize EC cell widths function MPAS-Dev#526 Many supposed parameters are actually hard-coded. Documentation has been updated to adhere to numpydoc formatting. Unnecessary looping has been removed. This merge also improves plotting of cell widths in define_base_mesh. Imports are now at the top of the file. Colormap is now perceptually uniform (not "jet"!) Plot layout is now tighter (though there's still considerable whitespace).




Many supposed parameters are actually hard-coded. Documentation has been updated to adhere to numpydoc formatting. Unnecessary looping has been removed.
This merge also improves plotting of cell widths in
define_base_mesh. Imports are now at the top of the file. Colormap is now perceptually uniform (not "jet"!) Plot layout is now tighter (though there's still considerable whitespace).