calculated_data = measured_u_i.map(o => {
var p = o.u * o.i;
var t = power_to_temperature(p);
var lm_w = 0;
var css = "black";
if (t > bb_table[0].temp && t < bb_table.at(-1).temp)
{
var ix = Math.floor((t - 200) / dt);
var bb1 = bb_table[ix]
var bb2 = bb_table[ix + 1]
var mix = (t - bb1.temp) / (bb2.temp - bb1.temp);
lm_w = (1 - mix) * bb1.lm_w + mix * bb2.lm_w;
css = bb1.css;
}
return {...o, p: p, r: o.u / o.i, t: t, lm_w: lm_w, css_bb: css};
})