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

Log contour #1856

Merged
merged 2 commits into from
Jul 7, 2017
Merged

Log contour #1856

merged 2 commits into from
Jul 7, 2017

Conversation

alexcjohnson
Copy link
Collaborator

fixes #641

We have a step in contour path creation that coalesces points that are too close together relative to the average distance between points. Without this we can get strange effects at crossings very close to corners of grid cells, but it was implemented in pixel coordinates, which means on nonlinear grids (particularly log axes with zero or negative positions) the threshold was incorrect. Fixed by calculating this threshold in index units.

Some existing mocks changed. Mostly the changes are minor and possibly even improvements. There's a slightly annoying one in contour_lines_coloring (and the others that use that same data) where it adds a new crossing of some nearby contours with differing topology, but to me that's just increasing our motivation to find an altogether better way to interpolate these curves.

@rreusser please review (since hopefully ^^ will land on your plate at some point!)

cc @etpinard

var dx = pt1[0] - pt2[0],
dy = pt1[1] - pt2[1];
var dx = pt1[2] - pt2[2],
dy = pt1[3] - pt2[3];
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is 0/1 vs 2/3 the difference between data units and grid index units?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes - kinda hacky but since we had this available when calculating the pixel positions I tacked it on.

@etpinard
Copy link
Contributor

etpinard commented Jul 7, 2017

Looks good! Thanks for the quick fix 🎉

I can't notice any differences in the updated baseline, except for

peek 2017-07-07 13-57

If this is expected, 💃

@alexcjohnson
Copy link
Collaborator Author

Yep, the changes are pretty minor - and in fact I notice that the change you highlighted actually swaps one instance of crossing contours for another... so it's basically a wash until we make an altogether different interpolation algorithm.

@alexcjohnson alexcjohnson merged commit 5849eab into master Jul 7, 2017
@alexcjohnson alexcjohnson deleted the log-contour branch July 7, 2017 18:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug something broken
Projects
None yet
Development

Successfully merging this pull request may close these issues.

This contour trace has intersecting contour lines
3 participants