-
Hi everybody, from my measurement device I get spectral data like this: Can I use this directly to describe a spectrum? For me it seems not to be possible. thx in advance |
Beta Was this translation helpful? Give feedback.
Answered by
KelSolaar
Jan 10, 2022
Replies: 1 comment 5 replies
-
Hi @ademmler, Yes this should be easily possible: import colour
import numpy as np
data = """
360.00 4.9591E-002
361.00 6.0577E-002
362.00 9.0296E-002
363.00 1.5385E-001
364.00 2.4088E-001
365.00 3.1027E-001
""".strip().split('\n')
data = np.loadtxt(data, delimiter=' ')
colour.SpectralDistribution(data[..., 1], data[..., 0])
Out[6]:
SpectralDistribution([[ 3.60000000e+02, 4.95910000e-02],
[ 3.61000000e+02, 6.05770000e-02],
[ 3.62000000e+02, 9.02960000e-02],
[ 3.63000000e+02, 1.53850000e-01],
[ 3.64000000e+02, 2.40880000e-01],
[ 3.65000000e+02, 3.10270000e-01]],
interpolator=SpragueInterpolator,
interpolator_kwargs={},
extrapolator=Extrapolator,
extrapolator_kwargs={'method': 'Constant', 'left': None, 'right': None}) |
Beta Was this translation helpful? Give feedback.
5 replies
Answer selected by
KelSolaar
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi @ademmler,
Yes this should be easily possible: