Skip to content

Commit

Permalink
correction of off-by-one error
Browse files Browse the repository at this point in the history
  • Loading branch information
marcdegraef committed Apr 12, 2024
1 parent 71316eb commit 4ee5a26
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions Source/EMsoftOOLib/mod_filters.f90
Original file line number Diff line number Diff line change
Expand Up @@ -1285,12 +1285,12 @@ recursive subroutine HannWindow(roi_size, window, alpha)
! this version implements the 2D HannWindow function from Mathematica
! the assumption is that roi_size is an odd number
r = (roi_size-1)/2
fr = 1.D0/dble(r)
fr = 1.D0/dble(2*r)
window = 0.D0
do i=-r/2,r/2
do i=-r,r
cx = cos(2.D0*cPi*dble(i)*fr)
hx = alpha*(1.D0-cx) + cx
do j=-r/2,r/2
do j=-r,r
cy = cos(2.D0*cPi*dble(j)*fr)
window(i+r+1,j+r+1) = hx * ( alpha*(1.D0-cy) + cy )
end do
Expand Down
2 changes: 1 addition & 1 deletion Source/EMsoftOOLib/program_mods/mod_4DEBSD.f90
Original file line number Diff line number Diff line change
Expand Up @@ -1748,7 +1748,7 @@ subroutine EBSD4D_(self, EMsoft, progname, HDFnames)

! get the virtual detector coordinates
if (trim(nml%VDreference).eq.'MPat') then
ival = iii*nml%ipf_wd + jj-1
ival = (iii-1)*nml%ipf_wd + jj
VDpx = nint(VDpositions(1,ival))
VDpy = nint(VDpositions(2,ival))
else
Expand Down

0 comments on commit 4ee5a26

Please sign in to comment.