-
Notifications
You must be signed in to change notification settings - Fork 62
/
xas.py
56 lines (45 loc) · 1.35 KB
/
xas.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
from typing import Dict, List, Optional, Tuple, Union
from pydantic import BaseModel, Field
from pymatgen.core.periodic_table import Element
from emmet.core.utils import ValueEnum
from emmet.stubs import Structure
class Edge(ValueEnum):
"""
The interaction edge for XAS
There are 2n-1 sub-components to each edge where
K: n=1
L: n=2
M: n=3
N: n=4
"""
K = "K"
L2 = "L2"
L3 = "L3"
L2_3 = "L2,3"
class Type(ValueEnum):
"""
The type of XAS Spectrum
XANES - Just the near-edge region
EXAFS - Just the extended region
XAFS - Fully stitchted XANES + EXAFS
"""
XANES = "XANES"
EXAFS = "EXAFS"
XAFS = "XAFS"
class XASSpectrum(BaseModel):
"""
An XAS Spectrum
"""
x: List[float] = Field(..., title="X-ray energy")
y: List[float] = Field(..., title="Absorption (Arbitrary Units)")
structure: Structure = Field(..., title="Structure")
absorbing_element: Element = Field(..., title="Absoring Element")
absorbing_index: Optional[int] = Field(
None,
title="Absoring Index",
description="Site index for the absorbing element if this is a site-specific spectrum",
)
spectrum_type: Type = Field(None, title="XAS Spectrum Type")
edge: Edge = Field(
None, title="Absorption Edge", description="The interaction edge for XAS"
)