Skip to content
Snippets Groups Projects
Commit 05e006a0 authored by Loïc Le Guyader's avatar Loïc Le Guyader
Browse files

Fix XAS for data with NaN

parent c7fb9eed
No related branches found
No related tags found
Loading
......@@ -32,9 +32,17 @@ def absorption(T, Io):
counts: length of T
"""
T = np.array(T)
Io = np.array(Io)
counts = len(T)
assert counts == len(Io), "T and Io must have the same length"
# remove not number from the data
good = np.logical_and(np.isfinite(T), np.isfinite(Io))
T = T[good]
Io = Io[good]
# return type of the structured array
fdtype = [('muA', 'f8'), ('sigmaA', 'f8'), ('weights', 'f8'),
('muT', 'f8'), ('sigmaT', 'f8'), ('muIo', 'f8'), ('sigmaIo', 'f8'),
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment