Skip to content

Can I use scientific notation for spectral data? #917

Answered by KelSolaar
ademmler asked this question in Q&A
Discussion options

You must be logged in to vote

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]],
…

Replies: 1 comment 5 replies

Comment options

You must be logged in to vote
5 replies
@ademmler
Comment options

@KelSolaar
Comment options

@ademmler
Comment options

@KelSolaar
Comment options

@ademmler
Comment options

Answer selected by KelSolaar
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants