This paper shows how to calculate the magnetic field of an aircraft with the help of measurements taken by an on-board tensor magnetic gradiometer. We assume that the magnetic field of an aircraft obeys a simple linear model. The external magnetic field is modeled by Gauss-Markov processes. It is assumed that magnetic gradiometry measurements are collected during flight with significant angular maneuvers. Under these assumptions, our problem may be reformulated as a well-known linear estimation problem. After solution of the problem, one may execute the so-called compensation procedure, i.e., to filter out aircraft-dependent disturbances from on-board magnetic measurements. After such compensation, measurements of the on-board magnetic gradiometer may be used to correct INS errors.