Calibrating the magnetometer in very poor weather