Following Olsen et al. (2003) and Olsen et al. (2020), the relationship between the raw magnetometer sensor readings \(\mathbf{E }\) and the calibrated and aligned magnetic field vector \(\mathbf{B }_{\text {NEC}}\) in the NEC (North–East–Center) frame is given by

$$\begin{aligned} \mathbf{B }_{\text {NEC}}= \,& {} {\underline{{{{{\underline{\varvec{R}}}}}}}_{\text {NEC}}} \ \underline{{{{{\underline{\varvec{R}}}}}}}_{\text {J2000}} \ \mathbf{B} _{{\mathrm{CRF}}} \end{aligned}$$

(2a)

$$\begin{aligned}= \,& {} {\underline{{{{{\underline{\varvec{R}}}}}}}_{\text {NEC}}} \ \underline{{{{{\underline{\varvec{R}}}}}}}_{\text {J2000}} \ \underline{{{{{\underline{\varvec{R}}}}}}}_{\text {A}} \ {\underline{{{\underline{\varvec{P}}}}}}^{-1}{ \ \underline{{{\underline{\varvec{S}}}}}}^{-1}{} \mathbf \ (\mathbf{E }-\mathbf{b }), \end{aligned}$$

(2b)

$$\begin{aligned} \mathbf{B }_{\text {CRF}}= \,& {} \underline{{{{{\underline{\varvec{R}}}}}}}_{\text {A}} \ {\underline{{{\underline{\varvec{P}}}}}}^{-1}{ \ \underline{{{\underline{\varvec{S}}}}}}^{-1}{} \mathbf \ (\mathbf{E }-\mathbf{b }) \end{aligned}$$

(2c)

$$\begin{aligned}= \,& {} \underline{{{{{\underline{\varvec{A}}}}}}}{} \mathbf \ (\mathbf{E }-\mathbf{b }) \end{aligned}$$

(2d)

$$\begin{aligned}= \,& {} \underline{{{{{\underline{\varvec{A}}}}}}}{} \mathbf \ \mathbf{E }+\tilde{\mathbf{b }}, \end{aligned}$$

(2e)

where \(\mathbf{b} \) is the vector of 3 magnetometer offsets, \({{{\underline{\varvec{\underline{S}}}}}}^{-1}\) is the inverse of the diagonal matrix \({{{\underline{\varvec{\underline{S}}}}}}\) of 3 scale values; \({{{\underline{\varvec{\underline{P}}}}}}^{-1}\) is the inverse of the lower triangular matrix \({{{\underline{\varvec{\underline{P}}}}}}\) of 3 non-orthogonalities; \(\mathbf{B} _{{\mathrm{CRF}}}\) is the magnetic field vector in the “Common Reference Frame” (CRF) of the satellite’s star tracker (STR); the rotation matrix \(\underline{{{{{\underline{\varvec{R}}}}}}}_{\text {A}}\) describes the rotation between the magnetometer (FGM) frame and CRF; the rotation matrix \(\underline{{{{{\underline{\varvec{R}}}}}}}_{\text {J2000}}\) contains the attitude information provided by the star tracker; and \({\underline{{{{{\underline{\varvec{R}}}}}}}_{\text {NEC}}}\) describes the rotation from the J2000 to the NEC frame. The matrices \({\underline{{{{{\underline{\varvec{R}}}}}}}_{\text {NEC}}}\) and \(\underline{{{{{\underline{\varvec{R}}}}}}}_{\text {J2000}}\) are assumed to be known (\({\underline{{{{{\underline{\varvec{R}}}}}}}_{\text {NEC}}}\) is determined using IERS algorithms (Vallado et al. 2006) and \(\underline{{{{{\underline{\varvec{R}}}}}}}_{\text {J2000}}\) is derived from the STR attitude) and thus only the 9 elements of the \(3 \times 3\) matrix \(\underline{{{{{\underline{\varvec{A}}}}}}} = \underline{{{{{\underline{\varvec{R}}}}}}}_{\text {A}} \ {{{\underline{\varvec{\underline{P}}}}}}^{-1}{{{\underline{\varvec{\underline{S}}}}}}^{-1}\) (which involves the 3 Euler angles describing \(\underline{{{{{\underline{\varvec{R}}}}}}}_A\), the 3 non-orthogonality parameters describing matrix \({{{\underline{\varvec{\underline{P}}}}}}^{-1}\) and the 3 scale values describing matrix \({{{\underline{\varvec{\underline{S}}}}}}^{-1}\)) plus the 3 elements of \(\tilde{\mathbf{b }} = -\underline{{{\underline{\varvec{A}}}}}{} \mathbf{b} \), that means in total 12 parameters, have to be determined in order to calibrate the magnetometer data for a given time interval. The 12 “classical” calibration parameters (3 offsets, 3 scale values, 3 non-orthogonalities and 3 Euler angles) can be determined from these 12 model parameters via QL decomposition of \(\underline{{{{{\underline{\varvec{A}}}}}}}\). See Olsen et al. (2020) for details of this parametrization.

Knowledge of \(\mathbf{B }_{{\mathrm{CRF}}}\) (e.g. as given by a model of Earth’s magnetic field) plus observations of the magnetometer sensor readings \(\mathbf{E }\) allows for estimating the 9 elements of \(\underline{{{{{\underline{\varvec{A}}}}}}}\) and the 3 elements of \(\tilde{\mathbf{b }}\) as a linear inverse problem. This approach has been used for calibrating the CryoSat-2 magnetic data (Olsen et al. 2020). However, for calibrating GRACE magnetometer data we instead chose to directly estimate the 3 offset values, 3 scale values, 3 non-orthogonalities and 3 Euler angles by solving a non-linear inverse problem. Although slightly more complicated, this approach allows us to apply separate temporal regularizations of the month-to-month variability of the Euler angles and of the other 9 parameters, enabling us to better account for boom bending, i.e. a mechanical variation of the coordinate frames of the magnetometer (at the tip of the boom) and of the star imager (fixed to the spacecraft body).

### Accounting for time dependence, non-linearities, sensor cross-talk and s/c disturbance fields

To account for the magnetic disturbance of magnetorquer activity, solar arrays, batteries as well as of non-linearities in sensor output and cross-talk between the three sensors we augment the linear equation of Eq. 2c as

$$\begin{aligned} \mathbf{B }_{\text {CRF}}= \, & {} \underline{{{{{\underline{\varvec{R}}}}}}}_{\text {A}} \ {{{\underline{\varvec{\underline{P}}}}}}^{-1}{{{\underline{\varvec{\underline{S}}}}}}^{-1}{} \mathbf \ (\mathbf{E }-\mathbf{b }) \nonumber \\&+ \ \underline{{{{{\underline{\varvec{M}}}}}}}\ \mathbf{I }_{{\mathrm{MTQ}}} + \mathbf{b }_{{\mathrm{SA1}}}I_{{\mathrm{SA1}}} + \mathbf{b }_{{\mathrm{SA2}}}I_{{\mathrm{SA2}}} + \mathbf{b }_{{\mathrm{Batt}}}I_{{\mathrm{Batt}}} + {\varvec{\xi }} + {\varvec{\eta }} + \underline{{{{{\underline{\varvec{b}}}}}}}_{\mathrm{ADC}} \text {sign}\, \mathbf{E }, \end{aligned}$$

(3)

where the \(3 \times 3\) matrix \(\underline{{{{{\underline{\varvec{M}}}}}}}\) (i.e. 9 parameters) describes the magnetic disturbance caused by the magnetorquer coil currents \(\mathbf{I }_{{\mathrm{MTQ}}}\) (separate currents for each of the three magnetorquer coils); \(\mathbf{b }_{{\mathrm{SA1}}}\), \(\mathbf{b }_{{\mathrm{SA2}}}\) and \(\mathbf{b }_{{\mathrm{Batt}}}\) (i.e. \(3 \times 3 = 9\) parameters) describe the magnetic disturbances due to the electric currents \(I_{{\mathrm{SA1}}}\), \(I_{{\mathrm{SA2}}}\) and \(I_{{\mathrm{Batt}}}\) of the two solar arrays and the batteries, respectively; the vectors \({\varvec{\xi }}\) and \({\varvec{\eta }}\) describe quadratic, and, respectively, cubic, effects in the sensor output \(\mathbf{E }\), and \(\underline{{{{{\underline{\varvec{b}}}}}}}_{\mathrm{ADC}}\) is a \(3 \times 3\) diagonal matrix with elements \(b_{k,\text {ADC}}, k = 1-3\), to account for zero-offsets in the analog–digital converter (ADC) of the magnetometer.

The *i*th components (\(i = 1-3\)) of \({\varvec{\xi }}\) and \({\varvec{\eta }}\) are parametrised according to

$$\begin{aligned} {\xi ^i}= \, & {} \xi ^i_{11} {\hat{E}}_1^2 + \xi ^i_{22} {\hat{E}}_2^2 + \xi ^i_{33} {\hat{E}}_3^2 + \xi ^i_{12} {\hat{E}}_1{\hat{E}}_2 + \xi ^i_{13} {\hat{E}}_1{\hat{E}}_3 + \xi ^i_{23} {\hat{E}}_2{\hat{E}}_3 \\ {\eta ^i}= \, & {} \eta ^i_{111} {\hat{E}}_1^3 + \eta ^i_{222} {\hat{E}}_2^3 + \eta ^i_{333} {\hat{E}}_3^3 + \eta ^i_{112} {\hat{E}}_1^2{\hat{E}}_2 + \eta ^i_{113} {\hat{E}}_1^2{\hat{E}}_3 + \eta ^i_{223} {\hat{E}}_2^2{\hat{E}}_3 \\&+\eta ^i_{122} {\hat{E}}_1{\hat{E}}_2^2 + \eta ^i_{133} {\hat{E}}_1{\hat{E}}_3^2 + \eta ^i_{233} {\hat{E}}_2{\hat{E}}_3^2 + \eta ^i_{123} {\hat{E}}_1{\hat{E}}_2{\hat{E}}_3, \end{aligned}$$

where we have scaled the sensor output \(E_k\) according to \({\hat{E}}_k = E_k/E_0\) with \(E_0 = 10^4\) nT in order to achieve non-dimensional quantities \({\hat{E}}_k\) of order *O*(1), thereby reducing numerical instabilities in estimating these parameters.

There are 6 coefficients \(\xi ^i_{kn}, k=1\dots 3, n = k \dots 3\) (due to \(\xi ^i_{nk} = \xi ^i_{kn}\)) per sensor axis (i.e. 18 parameters) describing quadratic effects, and 10 coefficients \(\eta ^i_{knm}, k=1\dots 3, n = k \dots 3, m = n \dots 3\) per sensor axis (i.e. 30 parameters) describing cubic effects, resulting in at total of 48 parameters for modelling non-linear effects. This part of the calibration model parameterization follows the approach described in Olsen et al. (2020) for calibration of CryoSat-2 magnetic data.

To account for a possible zero-offset in the Analog-Digital-Converter (ADC) of the magnetometer we co-estimate a bias correction \(b_{k,\text {ADC}}\) for all three magnetometer sensors, resulting in additional 3 model parameters.

### Accounting for sun-related magnetic disturbance fields

The calibration parameters of fluxgate magnetometers are known to depend on the temperature of sensor and electronics, an effect that is accounted for, e.g. in the calibration of *Swarm* (Tøffner-Clausen et al. 2016) and CryoSat-2 (Olsen et al. 2020) magnetometer data for which measurements of magnetometer temperatures are available. However, such temperature data are unfortunately not available for GRACE. Not accounting for the temperature dependence of the magnetometer readings results in magnetic data that show a pronounced variation with the Local Time of the satellite orbit, likely due to the heating caused by Sun illumination. To mitigate the lack of temperature measurements on GRACE, we use—following an approach developed by Tøffner-Clausen et al. (2016) for the *Swarm* satellites—the Sun incident angles \(\alpha \) and \(\beta \) w.r.t. the spacecraft, defined in Fig. 4, as proxy for magnetometer temperature. The “azimuth” angle \(\alpha \) varies rapidly within one orbit (i.e. within about 1.5 h), while the “elevation” \(\beta \) varies slowly with orbital LTAN.

Figure 5 shows the time evolution of the slowly changing Sun incident angle \(\beta \) for both GRACE satellites. Their nominal flight configuration (since December 2005) as “tandem” means that the lead satellite GRACE-B is flying in \(+x\)-direction, while the trailing GRACE-B satellite flies in \(-x\)-direction. The \(\beta \) angle of the two satellites therefore follow each other closely, but have opposite sign: if GRACE-A is illuminated by the Sun “from left” (\(-y\)-direction, i.e. \(\beta \approx 90^\circ \)) the corresponding \(\beta \) angle for GRACE-B is \(\beta \approx -90^\circ \) corresponding to illumination “from right” (\(+y\)-direction). After 2014, however, the two satellites “swap order”, and correspondingly flight direction, during four periods of a few months duration each. These periods are indicated by grey-shaded areas in Fig. 5. As a consequence, GRACE-A is always illuminated “from left” (\(\beta > 0\)) after mid-2014, while GRACE-B is always illuminated “from right” (\(\beta < 0\)).

In case of the *Swarm* satellite trio, a magnetic disturbance field depending on the Sun incident angles \(\alpha \) and \(\beta \) was found, and thermoelectric currents in the groundings of the blankets covering the magnetometers have been identified as the likely cause of these disturbances. These disturbances have been successfully modelled by co-estimating offset values depending on \(\alpha \) and \(\beta \) together with the other magnetometer calibration parameters—see Tøffner-Clausen et al. (2016) for details.

In case of the GRACE satellites the situation is more complicated since \(\alpha \) and \(\beta \) are used as proxy for instrument temperature, which not only affects sensor offsets, but also scale values (the impact of temperature changes on non-orthogonalities is found to be small). In addition, a temperature-related bending of the magnetometer boom will result in Euler angles that depend on the Sun incident angles \(\alpha \) and \(\beta \).

We therefore include an explicit dependence of the three offsets \(b = {b_1, b_2, b_3}\), of the three scale values \(S_1, S_2, S_3\), and of the three Euler angles \(\epsilon _1, \epsilon _2, \epsilon _3\) on Sun incident angles \(\alpha , \beta \) by expanding each of these 9 parameters in terms of spherical harmonics:

$$\begin{aligned} x(\alpha , \beta ) = \sum _{n = 1}^N \sum _{m = 0}^M \left( x_n^{m,c} \cos m \alpha + x_n^{m,s} \sin m \alpha \right) P_n^m(\sin \beta ), \end{aligned}$$

(5)

where *x* is any of the 9 calibration parameters offsets, scale values and Euler angles, \(P_n^m\) are associated Schmidt-normalized Legendre functions with \(N = 8\) as the maximum degree and \(M=2\) as the maximum order of the spherical harmonic expansion. Since co-estimating terms of high spherical harmonic order *m* may absorb small-scale along-track geophysical magnetic field variations (like the Equatorial Electrojet on the dayside at the magnetic equator) we limit our expansion to rather low degrees of \(m \le M=2\), and \(x_n^{m,c}\) and \(x_n^{m,s}\) are expansion coefficients corresponding to \(\cos (m\phi )P_n^m(\sin \beta )\) and \(\sin (m\phi )P_n^m(\sin \beta )\), respectively. This expansion yields 38 parameters for each of the 9 calibration parameters, resulting in \(9 \times 38 = 342\) additional model parameters in total.

Preliminary calibration efforts revealed rather large changes, in particular of the Euler angles for months when the GRACE satellites fly in non-nominal, “reversed”, configuration (indicated by the grey shadow time periods in Fig. 5 and following), compared to nominal flight direction. The reason for this is presently unknown. To account for this effect we solve for 12 “reverse flying” correction parameters, describing corrections of the offsets, scale values, non-orthogonalities and Euler angles for time periods of “reverse flying satellites”, assumed to be the same for those four periods.

These 12 “reverse flying” parameters together with the 9 parameters describing magnetorquer disturbances (matrix \(\underline{{{{{\underline{\varvec{M}}}}}}}\)), the \(3 \times 3 = 9\) model parameters \(\mathbf{b }_{{\mathrm{SA1}}}\), \(\mathbf{b }_{{\mathrm{SA2}}}\) and \(\mathbf{b }_{{\mathrm{Batt}}}\), the \(18 + 30 = 48\) parameters describing quadratic and cubic magnetometer sensor effects and cross-talks, the 3 ADC offset corrections, and the 342 parameters describing dependency on \(\alpha , \beta \) result in a total of additional \(9 + 9 + 48 + 3 + 342 + 12 = 423\) model parameters. We refer to them as “common parameters” since they are assumed to be constant for the whole data period.

### Model estimation procedure

Temporal variation of the 12 “classical” calibration parameters is accounted for by estimating them in monthly bins. Since we use GRACE data spanning 118 months (January 2008 to October 2017) for GRACE-A (and 1 month less for GRACE-B), i.e. for time instants \(t_k, k = 1 - K\) with \(K=118\), this yields \(118 \times 12 = 1416\) model parameters (1404 for GRACE-B).

Adding the 423 “common parameters” which are assumed to be constant for the entire time period results in a total of 1839 model parameters for GRACE-A (1827 for GRACE-B).

These model parameters are estimated by performing a combined vector and scalar calibration, minimizing the squared difference \(|\Delta \mathbf{B} |^2 + w_F |\Delta F|^2\) averaged over all data points, with

$$\begin{aligned} |\Delta \mathbf{B} |^2= \, & {} |\mathbf{B} _{{\mathrm{CRF}}} - \mathbf{B} _{{\mathrm{mod,CRF}}} |^2, \end{aligned}$$

(6a)

$$\begin{aligned} |\Delta {F}|^2= \, & {} \left( |\mathbf{B} _{{\mathrm{CRF}}}| - |\mathbf{B} _{{\mathrm{mod,CRF}}} |\right) ^2, \end{aligned}$$

(6b)

where the calibrated magnetic field vector \(\mathbf{B} _{{\mathrm{CRF}}}\) depends on the sensor output \(\mathbf{E} \) and on the model parameters as indicated by Eq. 3 and \(w_F\) is the relative weight given to the scalar residuals \(|\Delta {F}|^2\) compared to the vector residuals \(|\Delta \mathbf{B} |^2\). The reference (model) values \(\mathbf{B} _{{\mathrm{mod,CRF}}}\) are given for each satellite position and time instant by the CHAOS-7 field model (Finlay et al. 2020); they consist of contributions from the core, lithosphere and large-scale magnetosphere (plus Earth-induced counterparts) and are rotated from NEC to the CRF frame:

$$\begin{aligned} \mathbf{B }_{\text {mod,CRF}} = \underline{{{{{\underline{\varvec{R}}}}}}}_{\text {J2000}}^{-1} \ {\underline{{{{{\underline{\varvec{R}}}}}}}_{\text {NEC}}^{-1}} \ \mathbf{B }_{\text {mod,NEC}} . \end{aligned}$$

(7)

Note that a *scalar calibration* (i.e. minimizing the average of Eq. 6b) constrains all model parameters but the Euler angles, while a *vector calibration* (i.e. minimizing the average of Eq. 6a) provides information regarding all model parameters. Although this at first glance seems to be advantageous, mechanical bending of the GRACE magnetometer boom on time-scales not parametrized in the model (either explicitly due to the monthly bins or indirectly due to dependence of Euler angles on Sun incident angles \(\alpha \) and \(\beta \)) might degrade the estimation of all the other calibration parameters when performing a pure vector calibration. A combined vector and scalar calibration, with an empirically determined scalar weight of \(w_F = 5\), mitigates this problem and has been found to be suitable for calibrating the GRACE magnetometer data.

We use an *Iteratively Reweighted Least-Squares approach* with Huber weights (Huber 1981), minimizing the Chi-squared misfit

$$\begin{aligned} \chi ^2 = \mathbf{e }^{T} \underline{\underline{W}}\mathbf{e } + \mathbf{m }^T \underline{\underline{\Lambda }} \mathbf{m }, \end{aligned}$$

(8)

where the model vector \(\mathbf{m }\) contains the 1839 model parameters and the data residual vector \(\mathbf{e }=\mathbf{d }_{\mathrm {obs}}-\mathbf{d }_{\mathrm {mod}}\) is the difference between the data vector \(\mathbf{d }_{\mathrm {obs}}\) (containing all elements of \(\mathbf{B} _{{\mathrm{CRF}}}\) as well as \(F = |\mathbf{B} _{{\mathrm{CRF}}}|\)) and the model prediction vector \(\mathbf{d }_{\mathrm {mod}}\) (containing all elements of \(\mathbf{B} _{{\mathrm{mod,CRF}}}\) and \(F_{{\mathrm{mod}}}\)). The diagonal weight matrix \(\underline{\underline{W}}\) contains the Huber weights (to account for data outliers) and \(\underline{\underline{\Lambda }}\) is a block diagonal matrix which regularizes the month-to-month variation (first differences) of the 12 “basic” model parameters offsets, scale values, non-orthogonalities and Euler angles. We use different regularization parameters to constrain the temporal variation of the offsets (\(\lambda _b = 1 \cdot 10^5\ \text{(month/nT) }^2\)), scale values (\(\lambda _S = 1 \cdot 10^{14}\ \text{ month}^2\)), non-orthogonalities (\(\lambda _u = 1 \cdot 10^{14}\ \text{(month/rad) }^2\)) and Euler angles (\(\lambda _\epsilon = 1 \cdot 10^{13}\ \text{(month/rad) }^2\)) due to their different magnitude and expected temporal variability; for instance we allow for larger month-to-month variations of the Euler angles to account for a likely boom bending, compared to the non-orthogonalities which are expected to have less temporal variability. The values of these regularization parameters were found by visual inspection of the month-to-month variations of the estimated calibration parameters and the achieved rms data misfit.