calculate linearity uncertainty calculate gain coefficient