SpectroscopySchool/msspecbook/Activity04/Ni_chain2.py

25 lines
690 B
Python

from msspec.calculator import MSSPEC
from ase import Atoms
import numpy as np
symbol = 'Ni' # The kind of atom for the chain
a = 3.499 * np.sqrt(2)/2 # The distance bewteen 2 atoms
# in [101] direction
chain = Atoms(symbol)
data = None
for i in range(1,5):
atom = Atoms(symbol, [[0,0,i*a]])
atom.rotate('y', 45)
chain += atom
calc = MSSPEC(spectroscopy='PED', algorithm='inversion')
calc.calculation_parameters.scattering_order = 1
chain.emitter = 0
calc.set_atoms(chain)
data = calc.get_theta_scan(level='3s', theta=np.arange(0,80,0.5), data=data)
data[-1].views[0].set_plot_options(ylim=[0,0.045])
data.view()