7. structurefactor (sf)¶
7.1. Structure Factors¶
disordered structures like fluids
ordered structures like crystals or lattices. Needs first to create a Lattice.
7.2. Hydrodynamics¶
7.3. Pair Correlation¶
7.4. Lattice¶
Lattices to describe atomic crystals or mesoscopic materials as ordered structures of spheres, ellipsoids, cylinders or planes in 3D (fcc, bcc, hcp, sc), 2D (hex, sq) and lamellar structures. For the later it is assumed that particles share the same normalised formfactor but allow particle specific scattering amplitude.
The small angle scattering of a nano particle build from a lattice may be calculated by
cloudScattering()
or orientedCloudScattering()
.
The crystal structure factor of a lattice may be calculated by
latticeStructureFactor()
or orientedLatticeStructureFactor()
(see examples within these).
To create your own lattice e.g. with a filled unit cell see the source code of one of the predefined lattices or latticeFromMDA.
Lattice creation
predefined 3D
predefined 2D
predefined 1D
general lattice methods :
rhombic lattice methods :
random lattice methods
Lattice objects describing a lattice of points.
Included are methods to select sublattices as parallelepiped, sphere or side of planes.
The small angle scattering is calculated by js.ff.cloudScattering.
The same method can be used to calculate the wide angle scattering with bragg peaks using larger scattering vectors to get crystalline bragg peaks of nanoparticles.
Examples
A hollow sphere cut to a wedge.
import jscatter as js
import numpy as np
grid = js.lattice.scLattice(1/2.,2*8,b=[0])
grid.inSphere(6,b=1)
grid.inSphere(4,b=0)
grid.planeSide([1,1,1],b=0)
grid.planeSide([1,-1,-1],b=0)
fig = grid.show()
q=js.loglist(0.01,5,600)
ffe=js.ff.cloudScattering(q,grid.points,relError=0.02,rms=0.1)
p=js.grace()
p.plot(ffe)
# fig.savefig(js.examples.imagepath+'/grid_wedge.jpg')

A cube decorated with spheres.
import jscatter as js
import numpy as np
grid= js.lattice.scLattice(0.2,2*15,b=[0])
v1=np.r_[4,0,0]
v2=np.r_[0,4,0]
v3=np.r_[0,0,4]
grid.inParallelepiped(v1,v2,v3,b=1)
grid.inSphere(1,center=[0,0,0],b=2)
grid.inSphere(1,center=v1,b=3)
grid.inSphere(1,center=v2,b=4)
grid.inSphere(1,center=v3,b=5)
grid.inSphere(1,center=v1+v2,b=6)
grid.inSphere(1,center=v2+v3,b=7)
grid.inSphere(1,center=v3+v1,b=8)
grid.inSphere(1,center=v3+v2+v1,b=9)
fig = grid.show()
q=js.loglist(0.01,5,600)
ffe=js.ff.cloudScattering(q,grid.points,relError=0.02,rms=0.)
p=js.grace()
p.plot(ffe)
# fig.savefig(js.examples.imagepath+'/grid_cubewithspheres.jpg')

A comparison of sc, bcc and fcc nanoparticles (takes a while )
import jscatter as js
import numpy as np
q=js.loglist(0.01,35,1500)
q=np.r_[js.loglist(0.01,3,200),3:40:800j]
unitcelllength=1.5
N=8
scgrid= js.lattice.scLattice(unitcelllength,N)
sc=js.ff.cloudScattering(q,scgrid.points,relError=50,rms=0.05)
bccgrid= js.lattice.bccLattice(unitcelllength,N)
bcc=js.ff.cloudScattering(q,bccgrid.points,relError=50,rms=0.05)
fccgrid= js.lattice.fccLattice(unitcelllength,N)
fcc=js.ff.cloudScattering(q,fccgrid.points,relError=50,rms=0.05)
p=js.grace(1.5,1)
# smooth with Gaussian to include instrument resolution
p.plot(sc.X,js.formel.smooth(sc,10, window='gaussian'),legend='sc')
p.plot(bcc.X,js.formel.smooth(bcc,10, window='gaussian'),legend='bcc')
p.plot(fcc.X,js.formel.smooth(fcc,10, window='gaussian'),legend='fcc')
q=q=js.loglist(1,35,100)
p.plot(q,(1-np.exp(-q*q*0.05**2))/scgrid.shape[0],li=1,sy=0,le='sc diffusive')
p.plot(q,(1-np.exp(-q*q*0.05**2))/bccgrid.shape[0],li=2,sy=0,le='bcc diffusive')
p.plot(q,(1-np.exp(-q*q*0.05**2))/fccgrid.shape[0],li=3,sy=0,le='fcc diffusive')
p.title('Comparison sc, bcc, fcc lattice for a nano cube')
p.yaxis(scale='l',label='I(Q)')
p.xaxis(scale='l',label='Q / A\S-1')
p.legend(x=0.03,y=0.001,charsize=1.5)
p.text('cube formfactor',x=0.02,y=0.05,charsize=1.4)
p.text('Bragg peaks',x=4,y=0.05,charsize=1.4)
p.text('diffusive scattering',x=4,y=1e-6,charsize=1.4)