Skip to content

Commit c7ec0b6

Browse files
authored
fix axes orientation
1 parent 19080c1 commit c7ec0b6

File tree

1 file changed

+2
-7
lines changed

1 file changed

+2
-7
lines changed

src/PSFModels.jl

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -163,18 +163,13 @@ Base.getindex(model::PSFModel, idx::Vararg{Int,2}) = model(reverse(idx))
163163
Broadcast.combine_axes(kern::PSFModel, other) = axes(other)
164164
Broadcast.combine_axes(other, kern::PSFModel) = axes(other)
165165

166-
function indices_from_extent(pos, fwhm, maxsize)
167-
halfextent = @. maxsize * fwhm / 2
168-
lower = @. floor(Int, pos - halfextent)
169-
upper = @. ceil(Int, pos + halfextent)
170-
return (first(lower):first(upper), last(lower):last(upper))
171-
end
166+
indices_from_extent(pos, fwhm, maxsize) = indices_from_extent(pos, maxsize * fwhm)
172167

173168
function indices_from_extent(pos, extent)
174169
halfextent = @. extent / 2
175170
lower = @. round(Int, pos - halfextent)
176171
upper = @. round(Int, pos + halfextent)
177-
return (first(lower):first(upper), last(lower):last(upper))
172+
return last(lower):last(upper), first(lower):first(upper)
178173
end
179174

180175
# TODO

0 commit comments

Comments
 (0)