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
WIP: Support for curvilinear coordinates #16
Conversation
Very cool! I have no idea what the quirks are about, but I'm sure you'll find it =) I have a couple of concerns about argument types for some of these, but that should be quite easy to fix. I'll comment on the relevant code lines separately. |
src/Contour.jl
Outdated
@@ -153,7 +152,7 @@ end | |||
# Given the row and column indices of the lower left | |||
# vertex, add the location where the contour level | |||
# crosses the specified edge. | |||
function interpolate{T<:FloatingPoint}(x, y, z::Matrix{T}, h::Number, xi::Int, yi::Int, edge::Uint8) | |||
function interpolate{T<:FloatingPoint}(x::Vector{Float64}, y::Vector{Float64}, z::Matrix{T}, h::Number, xi::Int, yi::Int, edge::Uint8) |
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.
Do we really need to enforce Vector{Float64}
here? I suggest AbstractVector{T}
, or even just AbstractVector
. I guess the point is to distinguish from the method that takes a matrix below, but since the only important type parameter is the dimension (1 vs 2), we should try to keep everything else as generic as possible.
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.
That makes sense. I think the only requirement we need is for the type to have arithmetic functions defined for it.
Nice! Still needs documentation, though, even though these examples are a good starting point - I'd need a mathematical description of how to create x and y to understand how to do it for whatever system I'm working in. |
Yeah, definitely. I'll add the documentation as soon as I can. There are also a few edge cases I want to test out. |
@darwindarak, would be nice to merge this ;) |
3f864bf
to
191f22b
Compare
Just rebased on master branch and updated the syntax. @SimonDanisch I haven't used Julia in a while, do you mind taking a look to see if anything needs to be changed? Otherwise I'll merge once the tests go through. |
This will be helpful to my lab mates. I say lets merge and work out the bugs. edit: The code looks good! |
It almost works!
so
z
has the formwhich would look like straight lines if plotted in rectangular coordinates. But if the matrices
x
andy
that contain the coordinate points are passed in, we getThere are still a few kinks to work out though. For example:
results in