Skip to content
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

[BUG/ISSUE] Restricted range differences incorrectly all zero in some emissions column sum plots #17

Closed
lizziel opened this issue Aug 19, 2019 · 1 comment
Assignees
Labels
category: Bug Something isn't working topic: Cubed-Sphere Grid Pertains to cubed-sphere grids and/or regridding

Comments

@lizziel
Copy link
Contributor

lizziel commented Aug 19, 2019

In some emissions column sum benchmark plots that compare cubed sphere data, the restricted difference plots (middle row, right column) show all zeros when the dynamic range difference subplot and fractional difference subplot show non-zeros differences. This appears to be a bug in gcpy. The colorbar range is [-0.1,0.1], which usually indicates NaN in the array trying to be plotted. This needs further investigation.

gcpy_emis_diff_plot_issue

yantosca added a commit that referenced this issue Aug 22, 2019
We have made the following fixes in benchmark.py:

(1) If Ref and/or Dev are all zeroes, the normalized color range
    (which is returned by routine normalize_colors) will be manually
    set to 0..1.  This will make the zero color show up as white.
    This also facilitates plotting a single tickmark at the middle
    of the range (e.g. cb.set_ticks([0.5]).

(2) If the data being plotted in any of the 6 plot windows is zero
    everywhere, we now set a single tickmark at the center of the
    colorbar range with the label "Zero throughout domain".  This
    makes it explicit that the data is zero everywhere.

This commit resolves Github issues #17 and #18.

Signed-off-by: Bob Yantosca <yantosca@seas.harvard.edu>
@yantosca yantosca added benchmark category: Bug Something isn't working topic: Cubed-Sphere Grid Pertains to cubed-sphere grids and/or regridding labels Aug 22, 2019
@yantosca
Copy link
Contributor

I have pushed commit 01b912c to the master branch. We now ensure that if all values in a data array are zero, that the white color will be placed at the appropriate position in the color scale.

Matplotlib normalizes the data into a range of 0..1 for plotting. For difference color scales (i.e. the bottom 4 plots), if all values are zero, then the white color will get placed at color value 0.5, in the center of the range. For non-difference color scales (the top 2 plots), the white color will get placed at the start of the color scale (at 0.0).

Here are some example using GCHP 12.4.0 as both Ref and Dev (ensuring that all diffs will be zero):

O3 at surface:
gcpy3

O3 zonal mean:
gcpy4

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
category: Bug Something isn't working topic: Cubed-Sphere Grid Pertains to cubed-sphere grids and/or regridding
Projects
None yet
Development

No branches or pull requests

2 participants