diff --git a/Source/EMsoftOOLib/mod_DIC.f90 b/Source/EMsoftOOLib/mod_DIC.f90 index c4f6e3e..e31bcfe 100644 --- a/Source/EMsoftOOLib/mod_DIC.f90 +++ b/Source/EMsoftOOLib/mod_DIC.f90 @@ -609,9 +609,12 @@ recursive subroutine applyHomography_(self, h, PCx, PCy, dotarget) write (*,*) ' applyHomography_::range(defpat) : ',minval(self%defpat), maxval(self%defpat) end if + + call self%sdef%initialize(self%x,self%y,self%defpat,self%kx,self%ky,iflag) + + ! finally get the b-spline coefficients for the deformed pattern if (.not.tgt) then - call self%sdef%initialize(self%x,self%y,self%defpat,self%kx,self%ky,iflag) if (self%verbose) call Message%printMessage(' applyHomography_::sdef class initialized') call self%sdef%set_extrap_flag(.TRUE.) end if @@ -757,6 +760,7 @@ recursive subroutine solveHessian_(self, SOL, normdp) xi2max = maxval( self%XiPrime(1,:) ) normdp = sqrt(xi1max * (SL(1,1)**2+SL(4,1)**2+SL(7,1)**2) + & xi2max * (SL(2,1)**2+SL(5,1)**2+SL(8,1)**2) + SL(3,1)**2 + SL(6,1)**2) +! normdp = sum(SOL*SOL) if (self%verbose) write (*,*) ' solveHessian_::normdp : ', normdp end subroutine solveHessian_ @@ -788,7 +792,8 @@ recursive function getShapeFunction_(self, h, store) result(W) W(1,2:3) = -h(2:3) W(2,1) = -h(4) W(2,3) = -h(6) -W(3,1:2) = -h(7:8) +W(3,1) = h(7) +W(3,2) = -h(8) if (present(store)) then if (store.eqv..TRUE.) then @@ -819,7 +824,7 @@ recursive function getHomography_(self, W, store) result(h) logical, INTENT(IN), OPTIONAL :: store real(wp) :: h(8) -h = (/ 1.0_wp/W(1,1)-1.0_wp, -W(1,2), -W(1,3), -W(2,1), 1.0_wp/W(2,2)-1.0_wp, -W(2,3), -W(3,1), W(3,2) /) +h = (/ 1.0_wp/W(1,1)-1.0_wp, -W(1,2), -W(1,3), -W(2,1), 1.0_wp/W(2,2)-1.0_wp, -W(2,3), W(3,1), -W(3,2) /) if (present(store)) then if (store.eqv..TRUE.) then diff --git a/Source/EMsoftOOLib/program_mods/mod_HREBSDDIC.f90 b/Source/EMsoftOOLib/program_mods/mod_HREBSDDIC.f90 index 34fc6f9..bdd9d62 100644 --- a/Source/EMsoftOOLib/program_mods/mod_HREBSDDIC.f90 +++ b/Source/EMsoftOOLib/program_mods/mod_HREBSDDIC.f90 @@ -442,7 +442,7 @@ subroutine HREBSD_DIC_(self, EMsoft, progname, HDFnames) numpats, TID real(kind=dbl) :: interp_step, std real(kind=dbl) :: Wnew(3,3), Winv(3,3), oldW(3,3) -real(wp) :: hg(8), W(3,3), ndp, oldnorm, SOL(8), Hessian(8,8), CIC, PCx, PCy +real(wp) :: hg(8), W(3,3), ndp, oldnorm, SOL(8), Hessian(8,8), CIC, PCx, PCy, hpartial(8) character(11) :: dstr character(15) :: tstrb character(15) :: tstre @@ -502,8 +502,8 @@ subroutine HREBSD_DIC_(self, EMsoft, progname, HDFnames) L = binx * biny recordsize = 4 * L patsz = L -PCx = real(binx,wp)/2.0_wp -PCy = real(biny,wp)/2.0_wp +PCx = 0.5_wp ! real(binx,wp)/2.0_wp +PCy = 0.5_wp ! real(biny,wp)/2.0_wp write (*,*) ' pattern dimensions : ', binx, biny, L, self%ppEBSDnml%ROI @@ -529,8 +529,11 @@ subroutine HREBSD_DIC_(self, EMsoft, progname, HDFnames) read(dataunit,rec=offset) exptpattern close(dataunit,status='keep') +exptpattern = exptpattern - minval(exptpattern) +exptpattern = exptpattern/maxval(exptpattern) + write (*,*) ' reference entries : ', exptpattern(1:2,1:2) -write (*,*) 'reference pattern : ', minval(exptpattern), maxval(exptpattern) +write (*,*) ' reference pattern : ', minval(exptpattern), maxval(exptpattern) ! allocate global arrays to store the output of the DIC routine. call mem%alloc(normdp, (/ numpats /), 'normdp', initval=0.D0 ) @@ -548,7 +551,7 @@ subroutine HREBSD_DIC_(self, EMsoft, progname, HDFnames) ! here we go parallel with OpenMP !$OMP PARALLEL DEFAULT(SHARED) PRIVATE(TID, DIC, nbx, nby, targetpattern, ii, jj, hg, W)& -!$OMP& PRIVATE(oldnorm, oldW, SOL, ndp, Wnew, Winv, io_int, i) +!$OMP& PRIVATE(oldnorm, oldW, SOL, ndp, Wnew, Winv, io_int, i, hpartial) ! set the thread ID TID = OMP_GET_THREAD_NUM() @@ -561,7 +564,7 @@ subroutine HREBSD_DIC_(self, EMsoft, progname, HDFnames) ! define the border widths nbx and nby for the subregion nbx = enl%nbx nby = enl%nby -call DIC%defineSR( nbx, nby, PCx, PCy) ! 0.5_wp, 0.5_wp) +call DIC%defineSR( nbx, nby, PCx, PCy) ! generate the b-splines for the reference pattern and verify the accuracy ! also get the derivatives of the reference pattern to determine the Hessian @@ -573,36 +576,40 @@ subroutine HREBSD_DIC_(self, EMsoft, progname, HDFnames) ! compute the Hessian matrix call DIC%getHessian(Hessian) +hpartial = (/ (0.0_wp, i=1,8) /) +call DIC%applyHomography(hpartial, PCx, PCy) + ! allocate the targetpattern array call memth%alloc(targetpattern, (/ binx,biny /), 'targetpattern', TID=TID ) ! in the main loop we iterate over all the experimental patterns in the input file !$OMP DO SCHEDULE(DYNAMIC) do ii=1, numpats - ! write (*,*) '-----------------' - ! write (*,*) 'starting pattern ', ii !$OMP CRITICAL read(dataunit,rec=ii) targetpattern !$OMP END CRITICAL + targetpattern = targetpattern - minval(targetpattern) + targetpattern = targetpattern/maxval(targetpattern) + call DIC%setpattern( 'd', dble(targetpattern) ) call DIC%getbsplines(defp=.TRUE.) ! ! zero-mean and normalize the referenceSR and targetSR arrays call DIC%applyZMN(dotarget=.TRUE.) + call DIC%getresiduals() ! initialize the homography to zero - hg = (/ (0.0_wp, i=1,8) /) - W = DIC%getShapeFunction(hg) oldnorm = 100.0_wp oldW = W ! loop until max iterations or convergence do jj = 1, enl%maxnumit - ! write (*,*) '-----------------' - ! write (*,*) ' iteration # ',jj - ! call DIC%applyHomography(hg, 0.5_wp, 0.5_wp, dotarget=.TRUE.) - call DIC%applyHomography(hg, PCx, PCy, dotarget=.TRUE.) + if (jj.eq.1) then + hpartial = (/ (0.0_wp, i=1,8) /) + W = DIC%getShapeFunction(hpartial) + end if + call DIC%applyHomography(hpartial, PCx, PCy, dotarget=.TRUE.) call DIC%applyZMN(dotarget=.TRUE.) call DIC%getresiduals(CIC) call DIC%solveHessian(SOL, ndp) @@ -612,7 +619,7 @@ subroutine HREBSD_DIC_(self, EMsoft, progname, HDFnames) Winv = matrixInvert_wp( Wnew ) W = matmul( W, Winv ) W = W / W(3,3) - hg = DIC%getHomography(W) + hpartial = reshape(SOL, (/8/)) if (ndp.lt.enl%mindeltap) then EXIT end if @@ -623,7 +630,6 @@ subroutine HREBSD_DIC_(self, EMsoft, progname, HDFnames) io_int(2) = numpats call Message%WriteValue(' completed # patterns/total ',io_int,2) end if - W = matrixInvert_wp( W ) hg = DIC%getHomography(W) homographies(1:8,ii) = dble(hg) normdp(ii) = dble(ndp) diff --git a/Source/TestPrograms/play.f90 b/Source/TestPrograms/play.f90 index b47e696..85ba527 100644 --- a/Source/TestPrograms/play.f90 +++ b/Source/TestPrograms/play.f90 @@ -67,7 +67,7 @@ program EMplay real(kind=sgl),allocatable :: tmppat(:,:) real(kind=wp) :: DD, PCx, PCy, val, err, errmax, rnxi, rnyi, hg(8), W(3,3), gradCIC(8), Hessian(8,8), & minx, miny, xi1max, xi2max, normdp, oldnorm, oldW(3,3), horiginal(8), CIC, sol(8), & - homographies(8,2500) + homographies(8,1600), hpartial(8) real(kind=dbl) :: Wnew(3,3), Winv(3,3), dx, dy, p2(3), Woriginal(3,3), alp, srt(3,3), srtrot(3,3) integer(kind=irg) :: nx, ny, nxy, nbx, nby, i, ii, j, NSR, cnt, nxSR, nySR, jj, recordsize, ierr real(wp) :: tol @@ -99,40 +99,17 @@ program EMplay allocate(tmppat(nx,ny), refpat(0:nx-1,0:ny-1), defpat(0:nx-1,0:ny-1)) ! open(20,file='/Users/mdg/playarea/DIC/verification-sq.data',status='old',form='unformatted') -open(20,file='/Users/mdg/Files/EMPlay/playarea/DIC/refpat.data',status='old',form='unformatted') +if (trim(hostname).eq.'Mac-Studio.fios-router.home') then + fname = EMsoft%generateFilePath('EMdatapathname','DIC/refpat.data') +else + fname = EMsoft%generateFilePath('EMdatapathname','playarea/DIC/refpat.data') +end if +open(20,file=trim(fname),status='old',form='unformatted') read(20) tmppat close(20,status='keep') refpat = dble(tmppat) -! - ! open(20,file='/Users/mdg/Files/EMPlay/playarea/UCSB/GaN/pp27238.data',status='old',form='unformatted') -! recordsize = nxy*4 -! open(unit=15,file='/Users/mdg/Files/EMPlay/playarea/UCSB/GaN/pp27238.data', & - ! status='unknown',form='unformatted',access='direct',action='read',recl=recordsize,iostat=ierr) - -! read(15, rec=1, iostat=ierr) tmppat -! refpat = tmppat -! if (trim(hostname).eq.'Mac-Studio.fios-router.home') then -! fname = EMsoft%generateFilePath('EMdatapathname','UCSB/GaN/homographypatterns2.data') -! else -! fname = EMsoft%generateFilePath('EMdatapathname','playarea/UCSB/GaN/homographypatterns.data') -! end if -! open(unit=dataunit,file=trim(fname),& -! status='unknown',form='unformatted',access='direct',recl=recordsize,iostat=ierr) - - ! read(20) refpat -! read(dataunit, rec=1) tmppat -! read(20, rec=1) tmppat -! read(20) tmppat -! refpat = dble(tmppat) -! close(dataunit,status='keep') -! close(20,status='keep') - -! write (*,*) ' tmppat entries : ', tmppat(1:2,1:2) -! write (*,*) ' reference pattern : ', minval(tmppat), maxval(tmppat) - -! refpat(20:40,20:22) = 1.0_wp -! refpat(20:22,20:40) = 1.0_wp - +refpat = refpat - minval(refpat) +refpat = refpat/maxval(refpat) call DIC%setpattern('r', refpat) write (*,*) ' range refpat ', minval(refpat), maxval(refpat) @@ -162,112 +139,29 @@ program EMplay write (*,*) Hessian(i,1:8) end do -! read 2500 random homographies from a file and run the fitting, then -! write result to another file for comparison with an IDL routine. -! if (trim(hostname).eq.'Mac-Studio.fios-router.home') then -! gname = EMsoft%generateFilePath('EMdatapathname','UCSB/GaN/homographies2.data') -! else -! gname = EMsoft%generateFilePath('EMdatapathname','playarea/DIC/test/homographies1.data') -! end if -! open(unit=dataunit,file=trim(gname),status='unknown',form='unformatted') -! read(dataunit) homographies -! close(dataunit,status='keep') - if (trim(hostname).eq.'Mac-Studio.fios-router.home') then - gname = EMsoft%generateFilePath('EMdatapathname','UCSB/GaN/homographypatterns2.data') + gname = EMsoft%generateFilePath('EMdatapathname','DIC/test/homographypatterns2.data') else - gname = EMsoft%generateFilePath('EMdatapathname','playarea/DIC/test/homographypatterns.data') + gname = EMsoft%generateFilePath('EMdatapathname','playarea/DIC/test/homographypatterns2.data') end if open(unit=dataunit,file=trim(gname),& status='unknown',form='unformatted',access='direct',recl=recordsize,iostat=ierr) -! open(20,file='/Users/mdg/playarea/DIC/check.data',status='old',form='unformatted') - -open(unit=28,file='output-verify.txt',status='unknown',form='formatted') - -! PCx = real(nx,wp)/2.0_wp -! PCy = real(ny,wp)/2.0_wp - -! write (20) real(refpat) - -! horiginal = (/ 0.2D0, 0.D0, 0.D0, 0.D0, 0.D0, 0.D0, 0.D0, 0.D0 /) -! call DIC%applyHomography(horiginal, PCx, PCy) -! defpat = DIC%getpattern('d', nx, ny) -! write (20) real(defpat) -! call DIC%cleanup() -! horiginal = (/ 0.0D0, 0.5D0, 0.D0, 0.D0, 0.D0, 0.D0, 0.D0, 0.D0 /) -! call DIC%applyHomography(horiginal, PCx, PCy) -! defpat = DIC%getpattern('d', nx, ny) -! write (20) real(defpat) -! call DIC%cleanup() -! horiginal = (/ 0.D0, 0.D0, 50.0D0, 0.D0, 0.D0, 0.D0, 0.D0, 0.D0 /) -! call DIC%applyHomography(horiginal, PCx, PCy) -! defpat = DIC%getpattern('d', nx, ny) -! write (20) real(defpat) -! call DIC%cleanup() -! horiginal = (/ 0.D0, 0.D0, 0.0D0, 0.5D0, 0.D0, 0.D0, 0.D0, 0.D0 /) -! call DIC%applyHomography(horiginal, PCx, PCy) -! defpat = DIC%getpattern('d', nx, ny) -! write (20) real(defpat) -! call DIC%cleanup() -! horiginal = (/ 0.D0, 0.D0, 0.D0, 0.D0, 0.2D0, 0.D0, 0.D0, 0.D0 /) -! call DIC%applyHomography(horiginal, PCx, PCy) -! defpat = DIC%getpattern('d', nx, ny) -! write (20) real(defpat) -! call DIC%cleanup() -! horiginal = (/ 0.D0, 0.D0, 0.0D0, 0.D0, 0.D0, 50.0D0, 0.D0, 0.D0 /) -! call DIC%applyHomography(horiginal, PCx, PCy) -! defpat = DIC%getpattern('d', nx, ny) -! write (20) real(defpat) -! call DIC%cleanup() -! horiginal = (/ 0.D0, 0.D0, 0.0D0, 0.D0, 0.D0, 0.D0, 0.001D0, 0.D0 /) -! call DIC%applyHomography(horiginal, PCx, PCy) -! defpat = DIC%getpattern('d', nx, ny) -! write (20) real(defpat) -! call DIC%cleanup() -! horiginal = (/ 0.D0, 0.D0, 0.0D0, 0.D0, 0.D0, 0.D0, 0.0D0, 0.001D0 /) -! call DIC%applyHomography(horiginal, PCx, PCy) -! defpat = DIC%getpattern('d', nx, ny) -! write (20) real(defpat) -! call DIC%cleanup() -! horiginal = (/ 0.01D0, 0.1D0, 50.0D0, 0.1D0, 0.5D0,-50.D0, 0.002D0, 0.002D0 /) -! call DIC%applyHomography(horiginal, PCx, PCy) -! defpat = DIC%getpattern('d', nx, ny) -! write (20) real(defpat) - -! close(20,status='keep') - -! ! check - -! horiginal = (/ 0.01D0, 0.1D0, 50.0D0, 0.1D0, 0.5D0,-50.D0, 0.002D0, 0.002D0 /) -! write(*,*) horiginal -! W = DIC%getShapeFunction(horiginal) -! hg = DIC%getHomography(W) -! write(*,*) hg - +open(unit=28,file='output2-verify.txt',status='unknown',form='formatted') -! stop +horiginal = (/ (0.0_wp, i=1,8) /) +call DIC%applyHomography(horiginal, PCx, PCy) -do jj=1, 2500 +do jj=1, 1600 ! call Message%printMessage(' ---------------------- ') if (mod(jj,100).eq.0) write (*,*) 'starting pattern ', jj -! here we deform the reference pattern to obtain a defpat array with known homography -! define the homography hg - ! horiginal = homographies(1:8,jj) ! (/ 0.002_wp, 0.001_wp, -0.004_wp, -0.001_wp, -0.003_wp, 0.005_wp, 0.0_wp, 0.0_wp /) -horiginal = (/ (0.0_wp, i=1,8) /) - call DIC%applyHomography(horiginal, PCx, PCy) read(dataunit,rec=jj, iostat=ierr) tmppat -! read(20,rec=jj, iostat=ierr) tmppat -! read(20) tmppat -! write (*,*) 'read error = ', ierr defpat = dble(tmppat) +defpat = defpat - minval(defpat) +defpat = defpat/maxval(defpat) call DIC%setpattern('d', defpat) -! write (dataunit,rec=jj) DIC%getpattern('d',nx,ny) - -! if (1.eq.0) then - Woriginal = DIC%getShapeFunction(horiginal) ! get the derivatives of the reference pattern to determine the Hessian @@ -283,15 +177,18 @@ program EMplay ! initialize the homography coefficients to zero ! in a more general implementation we might initialize them to the ! values for one of the nearest neighbor patterns -hg = (/ (0.0_wp, i=1,8) /) -W = DIC%getShapeFunction(hg) oldnorm = 100.0_wp ! and here we start the loop -do ii=1,50 +do ii=1,20 ! 50 ! write (*,*) ' iteration # ',ii - call DIC%applyHomography(hg, PCx, PCy, dotarget=.TRUE.) + if (ii.eq.1) then ! initialize to identity homography in first cycle + hpartial = (/ (0.0_wp, i=1,8) /) + W = DIC%getShapeFunction(hpartial) + end if + + call DIC%applyHomography(hpartial, PCx, PCy, dotarget=.TRUE.) ! zero-mean and normalize the deformed sub-region array wtarget call DIC%applyZMN( dotarget = .TRUE. ) @@ -308,11 +205,13 @@ program EMplay W = matmul( W, Winv ) W = W / W(3,3) hg = DIC%getHomography(W) + hpartial = reshape(SOL, (/8/)) + ! write (*,*) '------------' ! write (*,*) hg ! write (*,*) ' norm(deltap) = ', normdp ! write (*,*) '------------' ! if (normdp.lt.oldnorm) then - if (normdp.lt.0.001D0) then + if (normdp.lt.0.0001D0) then ! oldnorm = normdp ! oldW = W ! else @@ -322,8 +221,8 @@ program EMplay ! call Message%printMessage(' ---------------------- ') end do -W = matrixInvert_wp( W ) -W = W / W(3,3) +! W = matrixInvert_wp( W ) +! W = W / W(3,3) hg = DIC%getHomography(W) ! write (*,*) '' ! write (*,*) ' Final homography : ' diff --git a/Source/TestPrograms/play2.f90 b/Source/TestPrograms/play2.f90 index 9a69a44..99a180a 100644 --- a/Source/TestPrograms/play2.f90 +++ b/Source/TestPrograms/play2.f90 @@ -63,11 +63,11 @@ program EMplay type(e_T) :: eu type(IO_T) :: Message -real(kind=wp), allocatable :: refpat(:,:), defpat(:,:) +real(kind=wp), allocatable :: refpat(:,:), defpat(:,:), newpat(:,:) real(kind=sgl),allocatable :: tmppat(:,:) real(kind=wp) :: DD, PCx, PCy, val, err, errmax, rnxi, rnyi, hg(8), W(3,3), gradCIC(8), Hessian(8,8), & minx, miny, xi1max, xi2max, normdp, oldnorm, oldW(3,3), horiginal(8), CIC, sol(8), & - homographies(8,2500) + homographies(8,1600) real(kind=dbl) :: Wnew(3,3), Winv(3,3), dx, dy, p2(3), Woriginal(3,3), alp, srt(3,3), srtrot(3,3) integer(kind=irg) :: nx, ny, nxy, nbx, nby, i, ii, j, NSR, cnt, nxSR, nySR, jj, recordsize, ierr real(wp) :: tol @@ -88,18 +88,25 @@ program EMplay nx = 640 ny = 480 +nxy = nx * ny +recordsize = nxy * 4 + ! instantiate the DIC class ! this also initializes the x and y coordinate arrays DIC = DIC_T( nx, ny ) call DIC%setverbose(.FALSE.) ! call DIC%setverbose(.TRUE.) -nxy = nx * ny -recordsize = nxy * 4 allocate(tmppat(nx,ny), refpat(0:nx-1,0:ny-1), defpat(0:nx-1,0:ny-1)) ! open(20,file='/Users/mdg/playarea/DIC/verification-sq.data',status='old',form='unformatted') -open(20,file='/Users/mdg/Files/EMPlay/playarea/DIC/refpat.data',status='old',form='unformatted') +if (trim(hostname).eq.'Mac-Studio.fios-router.home') then + fname = EMsoft%generateFilePath('EMdatapathname','DIC/refpat.data') +else + fname = EMsoft%generateFilePath('EMdatapathname','playarea/DIC/refpat.data') +end if + +open(20,file=trim(fname),status='old',form='unformatted') read(20) tmppat close(20,status='keep') refpat = dble(tmppat) @@ -133,8 +140,11 @@ program EMplay ! refpat(20:40,20:22) = 1.0_wp ! refpat(20:22,20:40) = 1.0_wp +refpat = refpat - minval(refpat) +refpat = refpat/maxval(refpat) call DIC%setpattern('r', refpat) + ! define some parameters for now... tol = 100 * epsilon(1.0_wp) PCx = 0.5_wp ! real(nx/2-1,wp) @@ -162,18 +172,18 @@ program EMplay ! read 2500 random homographies from a file and run the fitting, then ! write result to another file for comparison with an IDL routine. if (trim(hostname).eq.'Mac-Studio.fios-router.home') then - gname = EMsoft%generateFilePath('EMdatapathname','UCSB/GaN/homographies2.data') + gname = EMsoft%generateFilePath('EMdatapathname','DIC/test/homographies2.data') else - gname = EMsoft%generateFilePath('EMdatapathname','playarea/DIC/test/homographies1.data') + gname = EMsoft%generateFilePath('EMdatapathname','playarea/DIC/test/homographies2.data') end if open(unit=dataunit,file=trim(gname),status='unknown',form='unformatted') read(dataunit) homographies close(dataunit,status='keep') if (trim(hostname).eq.'Mac-Studio.fios-router.home') then - gname = EMsoft%generateFilePath('EMdatapathname','UCSB/GaN/homographypatterns2.data') + gname = EMsoft%generateFilePath('EMdatapathname','DIC/test/homographypatterns2.data') else - gname = EMsoft%generateFilePath('EMdatapathname','playarea/DIC/test/homographypatterns.data') + gname = EMsoft%generateFilePath('EMdatapathname','playarea/DIC/test/homographypatterns2.data') end if open(unit=dataunit,file=trim(gname),& status='unknown',form='unformatted',access='direct',recl=recordsize,iostat=ierr) @@ -245,7 +255,7 @@ program EMplay ! stop -do jj=1, 2500 +do jj=1, 1600 ! call Message%printMessage(' ---------------------- ') if (mod(jj,100).eq.0) write (*,*) 'starting pattern ', jj ! here we deform the reference pattern to obtain a defpat array with known homography @@ -260,8 +270,10 @@ program EMplay ! write (*,*) 'read error = ', ierr ! defpat = dble(tmppat) ! call DIC%setpattern('d', defpat) - -write (dataunit,rec=jj) DIC%getpattern('d',nx,ny) +defpat = DIC%getpattern('d',nx,ny) +defpat = defpat-minval(defpat) +defpat = defpat/maxval(defpat) +write (dataunit,rec=jj) sngl(defpat) if (1.eq.0) then @@ -286,7 +298,7 @@ program EMplay oldnorm = 100.0_wp ! and here we start the loop -do ii=1,50 +do ii=1,3 !50 ! write (*,*) ' iteration # ',ii call DIC%applyHomography(hg, PCx, PCy, dotarget=.TRUE.)