Skip to content

Commit

Permalink
modifications to EM4DEBSD program
Browse files Browse the repository at this point in the history
  • Loading branch information
marcdegraef committed Apr 3, 2024
1 parent 8a27705 commit b15b7ec
Show file tree
Hide file tree
Showing 2 changed files with 54 additions and 4 deletions.
4 changes: 3 additions & 1 deletion NamelistTemplates/EM4DEBSD.template
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,9 @@
! and with the data set name as the last name; leave the remaining strings empty (they should all
! be empty for the Binary and TSLup2 formats)
HDFstrings = '' '' '' '' '' '' '' '' '' '',

! name of the dot product file [relative to EMdatapathname]
dotproductfile = 'undefined',

!=====================================
! Master pattern file (for a future implementation)
!=====================================
Expand Down
54 changes: 51 additions & 3 deletions Source/EMsoftOOLib/program_mods/mod_4DEBSD.f90
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ module mod_4DEBSD
integer(kind=irg) :: VDheight
character(fnlen) :: exptfile
character(fnlen) :: masterfile
character(fnlen) :: dotproductfile
character(fnlen) :: inputtype
character(fnlen) :: HDFstrings(10)
character(fnlen) :: virtualimagefile
Expand Down Expand Up @@ -88,6 +89,8 @@ module mod_4DEBSD
procedure, pass(self) :: getexptfile_
procedure, pass(self) :: setmasterfile_
procedure, pass(self) :: getmasterfile_
procedure, pass(self) :: setdotproductfile_
procedure, pass(self) :: getdotproductfile_
procedure, pass(self) :: setinputtype_
procedure, pass(self) :: getinputtype_
procedure, pass(self) :: setHDFstrings_
Expand Down Expand Up @@ -128,6 +131,8 @@ module mod_4DEBSD
generic, public :: getnthreads => getnthreads_
generic, public :: setexptfile => setexptfile_
generic, public :: getexptfile => getexptfile_
generic, public :: setdotproductfile => setdotproductfile_
generic, public :: getdotproductfile => getdotproductfile_
generic, public :: setmasterfile => setmasterfile_
generic, public :: getmasterfile => getmasterfile_
generic, public :: setinputtype => setinputtype_
Expand Down Expand Up @@ -225,6 +230,7 @@ subroutine readNameList_(self, nmlfile, initonly)
integer(kind=irg) :: nthreads
character(fnlen) :: exptfile
character(fnlen) :: masterfile
character(fnlen) :: dotproductfile
character(fnlen) :: inputtype
character(fnlen) :: HDFstrings(10)
character(fnlen) :: virtualimagefile
Expand All @@ -238,7 +244,7 @@ subroutine readNameList_(self, nmlfile, initonly)
real(kind=sgl) :: VDHannAlpha

namelist / EBSD4Ddata / ipf_ht, ipf_wd, ROI, numsx, numsy, nthreads, exptfile, inputtype, HDFstrings, virtualimagefile, &
VDwidth, VDheight, VDtype, VDlocx, VDlocy, VDSD, VDHannAlpha, VDreference, masterfile
VDwidth, VDheight, VDtype, VDlocx, VDlocy, VDSD, VDHannAlpha, VDreference, masterfile, dotproductfile

ipf_ht = 100
ipf_wd = 100
Expand All @@ -248,6 +254,7 @@ subroutine readNameList_(self, nmlfile, initonly)
nthreads = 1
exptfile = 'undefined'
masterfile = 'undefined'
dotproductfile = 'undefined'
inputtype = 'Binary'
HDFstrings = (/ '', '', '', '', '', '', '', '', '', '' /)
virtualimagefile = 'undefined'
Expand Down Expand Up @@ -290,7 +297,10 @@ subroutine readNameList_(self, nmlfile, initonly)
if (VDreference.eq.'MPat') then
if (trim(masterfile).eq.'undefined') then
call Message%printError('readNameList:',' masterfile file name is undefined in '//nmlfile)
end if
end if
if (trim(dotproductfile).eq.'undefined') then
call Message%printError('readNameList:',' dotproductfile file name is undefined in '//nmlfile)
end if
end if
end if

Expand All @@ -302,6 +312,7 @@ subroutine readNameList_(self, nmlfile, initonly)
self%nml%nthreads = nthreads
self%nml%exptfile = exptfile
self%nml%masterfile = masterfile
self%nml%dotproductfile = dotproductfile
self%nml%inputtype = inputtype
self%nml%HDFstrings = HDFstrings
self%nml%virtualimagefile = virtualimagefile
Expand Down Expand Up @@ -622,6 +633,42 @@ function getmasterfile_(self) result(out)

end function getmasterfile_

!--------------------------------------------------------------------------
subroutine setdotproductfile_(self,inp)
!DEC$ ATTRIBUTES DLLEXPORT :: setdotproductfile_
!! author: MDG
!! version: 1.0
!! date: 04/01/24
!!
!! set dotproductfile in the EBSD4D_T class

IMPLICIT NONE

class(EBSD4D_T), INTENT(INOUT) :: self
character(fnlen), INTENT(IN) :: inp

self%nml%dotproductfile = trim(inp)

end subroutine setdotproductfile_

!--------------------------------------------------------------------------
function getdotproductfile_(self) result(out)
!DEC$ ATTRIBUTES DLLEXPORT :: getdotproductfile_
!! author: MDG
!! version: 1.0
!! date: 04/01/24
!!
!! get dotproductfile from the EBSD4D_T class

IMPLICIT NONE

class(EBSD4D_T), INTENT(INOUT) :: self
character(fnlen) :: out

out = trim(self%nml%dotproductfile)

end function getdotproductfile_

!--------------------------------------------------------------------------
subroutine setinputtype_(self,inp)
!DEC$ ATTRIBUTES DLLEXPORT :: setinputtype_
Expand Down Expand Up @@ -1264,7 +1311,8 @@ subroutine EBSD4D_(self, EMsoft, progname, HDFnames)

do j=1,TIFF_ny
do i=1,TIFF_nx
TIFF_image(i,j) = int(255 * (VDimage(i,TIFF_ny-j+1)-mi)/(ma-mi))
! TIFF_image(i,j) = int(255 * (VDimage(i,TIFF_ny-j+1)-mi)/(ma-mi))
TIFF_image(i,j) = int(255 * (VDimage(i,j)-mi)/(ma-mi))
end do
end do

Expand Down

0 comments on commit b15b7ec

Please sign in to comment.