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))