only perform gain and offset if required. references #29