-
Notifications
You must be signed in to change notification settings - Fork 13
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
2072 export patterns as vectors #23
2072 export patterns as vectors #23
Conversation
thanks @sankhesh. reviewing now. |
Thanks @doutriaux1. I'm working on fixing the tests too. |
import vcs,cdms2
f=cdms2.open(vcs.sample_data+"/clt.nc")
s=f("clt")
x=vcs.init()
gm = x.createboxfill()
gm.fillareastyle
gm.fillareastyle = "hatch"
gm.fillareaindices = [ 1,2,3,4,5]
gm.boxfill_type="custom"
x.plot(s,gm) preceded with thousands of:
|
isofill works, but @bonfils2 needs boxfill |
@doutriaux1 Looking into it now. |
@sankhesh there are still some weirdness, plotting an isoline on top of the isofill heps see what a happens at the intersection, the following is a screenshot of of pdf zoomed into a chrome window. Notice the green horizontal lines around 40N latitude, why are they all chopped up? Like ants ate part of them. |
@doutriaux1 The clipping algorithm seems not so perfect. @aashish24 and I spoke a little about these issues and I'll look into it in the next iteration. Let me fix boxfill plot issues first. |
After latest set of changes, hatches/patterns work for boxfill plots. See example file. |
@doutriaux1 I fixed the test baselines as well. Can we merge this branch so that @bonfils2 can use this code? It works fine for boxfill patterns and hatches. Regarding clipping issues with isofill plots, Will is working on a filter that would provide the accuracy we need. Once that is ready I can incorporate it in our workflow. |
@sankhesh I will install your branch locally |
I'd rather wait for your clipping fixes |
A-ok |
@sankhesh it's looking much better, please consider the following scrit: import cdms2,vcs,MV2,os
f=cdms2.open(os.path.join(vcs.sample_data,"clt.nc")
s=f("clt")
iso = vcs.createboxfill()
box = vcs.createboxfill()
mask = MV2.greater(s,75)
x=vcs.init(geometry=(1200,800))
box.boxfill_type = "custom"
box.fillareastyle = "hatch"
box.fillareaindices = [10,]
box.levels=[0.5,1.5]
box.fillareacolors = ["black"]
x.plot(s,iso)
x.plot(mask.astype("f"),box)
x.svg("celine_pattern")
x.postscript("celine")
raw_input("Press enteR") clipping is not quite matching the boxfill area |
Actually pdf from RH6 opened on Mac give us: AL1Fa_map11a_hfls_F_JFM_4off.pdf
|
@doutriaux1 interestingly that file opens in Preview on OS X 10.11.6.. |
@doutriaux1 Based on this it seems like postscript does not support transparency. Was it supported earlier? |
@sankhesh all output should be the same. I'm not sure what it was doing earlier because nobdy used it really. Anyhow I'm attaching a trimmed down version of @bonfils2 script to help you. Notice that setting the color to "red" or [100,0,0,50] does not appear to affect pdf output at all (are we ignoring opacity in favor of fillareaopacity attribute?) Also different pattern seem to have different thickness and slightly different clipping. |
Thanks for the pared down script @doutriaux1 👍 |
@sankhesh there's definitely clipping issues left, look at the band for pattern 9 they should stop exactly at the limit of the box, but they're not, they look like they have been trimmed to some sort of interpolation line. |
Goes with VTK branch @ https://gitlab.kitware.com/vtk/vtk/merge_requests/2084 |
@aashish24 @sankhesh I'm buulding against @aashish24 branch, do I need to first merge them both together? |
15e9f14
to
77d5fff
Compare
@doutriaux1 I have updated my VTK branch with https://gitlab.kitware.com/vtk/vtk/merge_requests/2084 |
@sankhesh can you post your update here so that we all know what's the current status is? |
I've attached a pdf output of the latest code. Almost all clipping issues have been resolved barring one. The current issue we're looking into is specific to the pattern in the image below: You can see that the inner regions of the pattern somehow become distorted. |
Sankhesh, this is much better! Excellent Progress! Can we get this into the next release?
Thanks and best regards,
Dean
From: Sankhesh Jhaveri <[email protected]<mailto:[email protected]>>
Reply-To: UV-CDAT/vcs <[email protected]<mailto:[email protected]>>
Date: Wednesday, December 14, 2016 at 5:55 AM
To: UV-CDAT/vcs <[email protected]<mailto:[email protected]>>
Cc: Dean Williams <[email protected]<mailto:[email protected]>>, Mention <[email protected]<mailto:[email protected]>>
Subject: Re: [UV-CDAT/vcs] 2072 export patterns as vectors (#23)
I've attached a pdf output of the latest code.
test_fillarea (1).pdf<https://github.com/UV-CDAT/vcs/files/651899/test_fillarea.1.pdf>
Almost all clipping issues have been resolved barring one. The current issue we're looking into is specific to the pattern in the image below:
[selection_004 1]<https://cloud.githubusercontent.com/assets/936354/21184519/d42b4a22-c1da-11e6-821f-4e7e446ccd15.png>
You can see that the inner regions of the pattern somehow become distorted.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub<#23 (comment)>, or mute the thread<https://github.com/notifications/unsubscribe-auth/ACrXKdjPJc9PQmxR1XMylpmi6NMoil_Vks5rH_U1gaJpZM4KXE3w>.
|
@sankhesh this whole spacing/scale thing is quite mysterious to new users, do you think we could have a wiki page (or even better a jupyter notebook) that explains how all of this works? Thanks. |
+1 Also, @sankhesh and I talked about come up with reasonable default based on the viewport size of each plot. So by default users should be something very close to ideal and then the API can provide an option to tweak them if necessary. |
@doutriaux1 Sure, I'll add some documentation on the wiki and figure out the jupyter notebook thing. @aashish24 Change 77fc710 adds the reasonable defaults calculation based on the render window size. Note that adding a per-viewport calculation would change how the patterns look between individual plots and even the legend. I need to add one final change for making the legend work with these new parameters and add new baselines. |
These actors are transparent and not needed in the view
The patterns now look the same in the plot and the color bar
Adjusted the code so that scaling is applied appropriately to each dimension of the pattern. Auto-computed spacing is always a square now.
@aashish24 @doutriaux1 Take a look at the new baselines @ CDAT/uvcdat-testdata#158 The legend / colorbar pattern scale issues have been fixed. I have a merge request in VTK that fixes the weird transparency issue. Once the VTK change is merged, I'd say lets merge this branch. What do you think? |
@doutriaux1 @williams13 can you approve this branch and have us merge it? If there any other minor issues or feature, we can do in a separate PR? |
@aashish24 is the VTK branch from @sankhesh in VTK master? If not can we put it into our VTK/master? I can't really approve until we can access the bug fix. |
the plan is to have the branch merged into VTK master today and yes I will recommend not merging it until then but it would be good to have you look at it and run it if needed. |
@sankhesh make sure to ping Will as I do not think it should take him long time to approve the VTK branch. @doutriaux1 after we get the VTK branch merged and you are happy with this branch, for any minor issue let's create another PR so that we can get majority of improvements. |
@aashish24 @doutriaux1 The VTK MR is merged. |
Great @sankhesh! |
ping @doutriaux1 @williams13 VTK branch is merged into VTK master. |
built it, i'm having issues with test suite, but you can use the linux build from my channel |
@doutriaux1 not sure if you are asking @sankhesh to do something or just stating the fact. |
stating. Should be able to merge early next week |
Ok. thanks. |
@doutriaux1 @williams13 Were you able to test this branch? |
@sankhesh I'll test it no and merge in |
Fixes CDAT/cdat#2072