Skip to content

Commit 9a4437e

Browse files
committed
performance fix
1 parent 0f3da24 commit 9a4437e

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

src/utils.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ end
2727
Pads a given array and creates a border with edge elements.
2828
"""
2929
function pad_edges(array_in::Matrix{T}) where {T}
30-
image = zeros(size(array_in)[1] + 2, size(array_in)[2] + 2)
30+
image = Matrix{T}(undef, size(array_in)[1] + 2, size(array_in)[2] + 2)
3131
image[2:end-1,2:end-1] = array_in
3232
image[2:end-1,1] = array_in[:,1]
3333
image[2:end-1,end] = array_in[:,end]

test/core.jl

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,10 @@ end
2525
hdu1 = astropy.io.fits.open(joinpath("data", "gc_2mass_k.fits"))[1]
2626
hdu2 = astropy.io.fits.open(joinpath("data", "gc_msx_e.fits"))[1]
2727

28-
@test isapprox(reproject(imgin, imgout, order = 0)[1]', rp.reproject_interp(hdu2, hdu1.header, order = 0)[1], nans = true, atol = 1e-4)
29-
@test isapprox(reproject(imgout, imgin, order = 0)[1]', rp.reproject_interp(hdu1, hdu2.header, order = 0)[1], nans = true, atol = 1e-3)
30-
@test isapprox(reproject(imgin, imgout, order = 1)[1]', rp.reproject_interp(hdu2, hdu1.header, order = 1)[1], nans = true, atol = 1e-4)
31-
@test isapprox(reproject(imgin, imgout, order = 2)[1]', rp.reproject_interp(hdu2, hdu1.header, order = 2)[1], nans = true, atol = 1e-4)
28+
@test isapprox(reproject(imgin, imgout, order = 0)[1]', rp.reproject_interp(hdu2, hdu1.header, order = 0)[1], nans = true, rtol = 1e-4)
29+
@test isapprox(reproject(imgout, imgin, order = 0)[1]', rp.reproject_interp(hdu1, hdu2.header, order = 0)[1], nans = true, rtol = 1e-3)
30+
@test isapprox(reproject(imgin, imgout, order = 1)[1]', rp.reproject_interp(hdu2, hdu1.header, order = 1)[1], nans = true, rtol = 1e-4)
31+
@test isapprox(reproject(imgin, imgout, order = 2)[1]', rp.reproject_interp(hdu2, hdu1.header, order = 2)[1], nans = true, rtol = 1e-4)
3232
@test isapprox(reproject(imgin[1], imgout[1], shape_out = (1000,1000))[1]',
3333
rp.reproject_interp(hdu2, astropy.wcs.WCS(hdu1.header), shape_out = (1000,1000))[1], nans = true, atol = 1e-4)
3434

0 commit comments

Comments
 (0)