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

Interpolator tweak #6

Merged
merged 3 commits into from
Jul 29, 2019
Merged

Interpolator tweak #6

merged 3 commits into from
Jul 29, 2019

Conversation

aquatiko
Copy link
Member

This patch adds a tweak as done and mentioned here.

src/utils.jl Outdated
Pads a given array and creates a border with edge elements.
"""
function pad_edges(array_in::Matrix{T}) where {T}
image = zeros(size(array_in)[1] + 2, size(array_in)[2] + 2)
Copy link
Member

Choose a reason for hiding this comment

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

You're not using the type T. I'm pretty sure that for type-stability you really want to allocate a matrix with eltype T

test/core.jl Outdated
@test check_diff(reproject(imgin, imgout, order = 2)[1], rp.reproject_interp(hdu2, hdu1.header, order = 2)[1]) == true
@test check_diff(reproject(imgin[1], imgout[1], shape_out = (1000,1000))[1],
rp.reproject_interp(hdu2, astropy.wcs.WCS(hdu1.header), shape_out = (1000,1000))[1]) == true
@test isapprox(reproject(imgin, imgout, order = 0)[1]', rp.reproject_interp(hdu2, hdu1.header, order = 0)[1], nans = true, atol = 1e-4)
Copy link
Member

Choose a reason for hiding this comment

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

I prefer using relative tolerance, rtol, rather than absolute tolerance. The latter doesn't say anything about the significance of the difference

src/utils.jl Show resolved Hide resolved
test/core.jl Outdated Show resolved Hide resolved
@giordano giordano merged commit baaacef into JuliaAstro:master Jul 29, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants