implement temperature lookup using linear interpolation
slight optimization to table lookup
funny pointer magic