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

boxfill missing value does not respect opacity #121

Closed
doutriaux1 opened this Issue Jan 23, 2017 · 20 comments

Comments

@doutriaux1
Member

doutriaux1 commented Jan 23, 2017

import vcs
import cdms2

f=cdms2.open(vcs.sample_data+"/clt.nc")

s=f("clt")
x=vcs.init()
x.plot(s)
s2=cdms2.MV2.masked_greater(s,50.)
gm =x.createboxfill()
gm.missing=[50,50,50,50]
x.plot(s2,gm)

raw_input("press enteR")

gives:
crap

@doutriaux1

This comment has been minimized.

Member

doutriaux1 commented Jan 23, 2017

grey should be transparent

@durack1

This comment has been minimized.

Member

durack1 commented Jan 23, 2017

@doutriaux1 happy to test this out in my example case, so for isofill:
bluemarble_siconc_satellite_view_daytimeview
And for boxfill:
bluemarble_siconc_satellite_view_daytimeview_boxfill
I'd also be curious about the isofill clipping along the Northern pole, this feature seems a weird artifact of the graphics method to me

@durack1

This comment has been minimized.

Member

durack1 commented Jan 26, 2017

@danlipsa it would be great to get your input on this, I was hoping to generate a correct figure (with the masking working correctly) by the end of this week

@sankhesh

This comment has been minimized.

Contributor

sankhesh commented Jan 26, 2017

@doutriaux1 @durack1 Looking into this now

@durack1

This comment has been minimized.

Member

durack1 commented Jan 26, 2017

@sankhesh great, let me know when you have a branch to test..

@sankhesh

This comment has been minimized.

Contributor

sankhesh commented Jan 26, 2017

@doutriaux1 @durack1

PR #123 fixes the issue

Here is clt with gm.missing = [50, 50, 50, 0]

121_boxfill_mask_opacity

and with gm.missing = [50, 50, 50, 50]

121_boxfill_mask_opacity_50

@doutriaux1

This comment has been minimized.

Member

doutriaux1 commented Jan 26, 2017

awesome! thanks @sankhesh

@durack1

This comment has been minimized.

Member

durack1 commented Jan 26, 2017

@doutriaux1 great, once this is merged by @danlipsa will it be magically available through the nightly channel? I was hoping to get these figs done this week...

@durack1

This comment has been minimized.

Member

durack1 commented Jan 26, 2017

@danlipsa @doutriaux1 @sankhesh I'm also curious about the northern bound behaviour in the isofill example above. It seems that some boundary effect is impacting the isofill so that missing (or lower) values are found along the northern fringe, with boxfill this isn't an issue as there is no interpretation/interpolation of the data, it just plots cells as they are stored. I think the current isofill behaviour is wrong

@danlipsa

This comment has been minimized.

Contributor

danlipsa commented Jan 26, 2017

@durack1 I don't really understand what is missing?

@danlipsa

This comment has been minimized.

Contributor

danlipsa commented Jan 26, 2017

@durack1 Are these the black values along the northern bound?

@durack1

This comment has been minimized.

Member

durack1 commented Jan 26, 2017

@danlipsa exactly, so identical data yet you get the differences (the black values in isofill along the northern boundary) as per the screenshot below:
isofilltopvsboxfillbottom
And this plot is isofill on top (with the cropping/interpolation issues) and boxfill on the bottom - identical data

@doutriaux1

This comment has been minimized.

Member

doutriaux1 commented Jan 26, 2017

@danlipsa yes. It's odd, but I think it's the algorithm, not much we can do about it, high gradient around there

@danlipsa

This comment has been minimized.

Contributor

danlipsa commented Jan 26, 2017

@durack1 Are the white values masked?

@durack1

This comment has been minimized.

Member

durack1 commented Jan 26, 2017

@doutriaux1 if you were to pad the boundary with the same value one pixel around the boundary (so obviously here it's 90N+), then you wouldn't get such an artifact.. And that is exactly what boxfill faithfully plots, isofill is attempting to pad with interpolated values (assuming there is no or missing value beyond the 90N bound) is my guess

@durack1

This comment has been minimized.

Member

durack1 commented Jan 26, 2017

@danlipsa nope, the masked values (in boxfill lower panel) are the grey colour

@danlipsa

This comment has been minimized.

Contributor

danlipsa commented Jan 26, 2017

@durack1 Can we have the nc file and the script?

@durack1

This comment has been minimized.

Member

durack1 commented Jan 26, 2017

@danlipsa here you go, it's a single time slice.. I can provide the plotting script if you want that as well..
siconc_input4MIPs_SSTsAndSeaIce_CMIP_PCMDI-AMIP-1-1-1_gn_187001.nc.zip

@durack1

This comment has been minimized.

Member

durack1 commented Feb 10, 2017

@doutriaux1 it seems this change isn't available through nightly on conda the latest available build is 21st Jan 2017 (not 27/28th)

@durack1

This comment has been minimized.

Member

durack1 commented Feb 22, 2017

@sankhesh @danlipsa @doutriaux1 just to confirm, using the vcx-nox 2017.2.22-py27_0 uvcdat/label/nightly and vtk-cdat-nox 7.1.0.2017.1.20-py27_0 uvcdat/label/nightly yields the image below, which is exactly what I expected.. Thanks!
bluemarble_siconc_satellite_view_daytimeview_boxfill
Compare the this boxfill image to the second image above

@doutriaux1 doutriaux1 modified the milestone: 2.10 May 5, 2017

@doutriaux1 doutriaux1 added the bug label May 8, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment