-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathexample_rixs.py
executable file
·85 lines (66 loc) · 2.15 KB
/
example_rixs.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
#! /usr/bin/env python3
# -*- coding: utf-8 -*-
"""template."""
# %% imports ===================================================================
from pathlib import Path
import numpy as np
import matplotlib.pyplot as plt
import copy
import spectragen4 as sg4
import brixs as br
%matplotlib qt5
%load_ext autoreload
%autoreload 2
# %% Initial calculation paramenters ===========================================
q = sg4.Calculation(element='Cu', charge='2+', symmetry='D4h', experiment='RIXS', edge='L2,3-M4,5 (2p3d)', toCalculate='ld')
q.xMin = 932.7-0.1
q.xMax = 932.7+0.1
q.xNPoints = 20
q.yMin = -0.5
q.yMax = 2
Dq = 0.09
Ds = -0.07
for h in ['Initial Hamiltonian', 'Intermediate Hamiltonian', 'Final Hamiltonian']:
q.hamiltonianData['Crystal Field'][h]['Dq(3d)'] = Dq
q.hamiltonianData['Crystal Field'][h]['Ds(3d)'] = Ds
q.hamiltonianData['Crystal Field'][h]['Dt(3d)'] = -(0.45+4*Ds)/5#-(0.45+4*Ds)/5
# for h in ['Initial Hamiltonian', 'Intermediate Hamiltonian', 'Final Hamiltonian']:
# q.hamiltonianData['Atomic'][h]['ζ(3d)'][1] = 2
print(q.hamiltonianData)
q.save_parameters('parameters_z2')
Dq = 0.12
Ds = 0.08
for h in ['Initial Hamiltonian', 'Intermediate Hamiltonian', 'Final Hamiltonian']:
q.hamiltonianData['Crystal Field'][h]['Dq(3d)'] = Dq
q.hamiltonianData['Crystal Field'][h]['Ds(3d)'] = Ds
q.hamiltonianData['Crystal Field'][h]['Dt(3d)'] = (0.45-4*Ds)/5#(0.45-4*Ds)/5
q.save_parameters('parameters_x2-y2')
# print(q.hamiltonianData)
# q.hamiltonianState
# %% Energy map template =======================================================
q = sg4.Calculation()
q.load_parameters('parameters_z2.par')
q.save_input()
output = q.run()
ss, _ = q.spectrum()
# plot spectra
plt.figure()
_ = ss.plot()
plt.xlabel('Energy loss (eV)')
plt.ylabel('Intensity (arb. units)')
# plot map
map = ss.calculate_map(axis='h')
map.y_centers = ss.incident_energy
plt.figure()
map.plot()
plt.xlabel('Energy loss (eV)')
plt.ylabel('Excitation energy (eV)')
# get resonance energy
i_max = 0
for i in range(len(ss.incident_energy)):
if max(ss[i].y) > max(ss[i_max].y):
i_max = i
print(i_max)
print(ss[i_max].incident_energy)
# plt.close('all')
# %%