diff options
author | Paweł Redman <pawel.redman@gmail.com> | 2020-02-16 11:14:09 +0100 |
---|---|---|
committer | Paweł Redman <pawel.redman@gmail.com> | 2020-02-16 11:18:55 +0100 |
commit | 87eb67408f9230315494a8cf66fe264196a04ad0 (patch) | |
tree | 63ee9d8b92b7cffaa38d83b4222ffd1e391eb75b /src/rea2008.py |
Diffstat (limited to 'src/rea2008.py')
-rw-r--r-- | src/rea2008.py | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/src/rea2008.py b/src/rea2008.py new file mode 100644 index 0000000..0621068 --- /dev/null +++ b/src/rea2008.py @@ -0,0 +1,32 @@ +import numpy as np, os +import crl, crl.data +from matplotlib import pyplot as plt +from shared import * + +rea2008 = [ + # CCT Ra GAI FSCI + ["CW1", 5137, 75, 65, 60], + ["CW2", 6682, 78, 97, 74], + ["CW3", 6126, 71, 81, 64], + ["CW4", 5854, 94, 99, 74], + ["WW1", 3174, 95, 55, 67], + ["WW2", 3443, 80, 64, 68], + ["WW3b", 3732, 81, 74, 72], + ["WW4", 3261, 91, 93, 77] +] + + +with TexWriter(os.path.join(os.path.dirname(__file__), "../build/rea2008.tex")) as fd: + for name, CCT_ref, Ra_ref, GAI_ref, FSCI_ref in rea2008: + path = os.path.join(os.path.dirname(__file__), "../lab/Rea2008/", name + ".csv") + data = np.sort(crl.data.load(path)) + data = data[np.lexsort((data[:, 0], data[:, 1]))] + spec = crl.Spectrum(data[:, 1], data[:, 0]) + + res = crl.cri_Ra(spec) + GAI, _ = crl.cri_GAI(spec) + FSCI = crl.cri_FSCI(spec) + + fd.write("%s & %g & %.4g & %g & %.1f & %g & %.1f & %g & %.1f \\\\\n" + % (name, CCT_ref, res.CCT, Ra_ref, res.CRI, + GAI_ref, GAI, FSCI_ref, FSCI)) |