Flexible compensation of thermal errors