Compensating for variations in ambient conditions