## 2 Methods
### Alignment to North  
The geographic coordinate system with three axes pointing to north, east and up respectively is taken as the datum coordinate system for magnetic survey. Here, the north direction is the geographic North Pole, also known as true north. After finishing the above two steps of calibration, we will discuss how to align the axis of magnetometer to true north in this part. As illustrated in Figure 3, \(\theta\) is the angle between the line of two sites (A and B) of distance \(d\) and true north direction. The challenge of aligning to true north direction is to obtain the angle \(\theta\) accurately. Here, the angle \(\theta\) can be calculated by the following steps. Firstly, the latitude and longitude of the selected sites A and site B are measured using differential GPS. Then, the latitude \(L\) and longitude \(B\) are converted into \(x\) and \(y\) coordinate values of plane coordinates by means of coordinate transformation to obtain the relative position of sites A and B [15]. The transformation of the coordinate system is as follows. Figure 3: Diagram of aligning to north. The arc length \(\tau(B)\) of an ellipsoid from the equator to the site is given by  
\[\tau(B)=\alpha(B+\beta\sin 2B+\gamma\sin 4B+\delta\sin 6B+\varepsilon\sin 8B) \tag{25}\]  
where  
\(\alpha=\frac{a+b}{2}\Big{(}1+\frac{1}{4}n^{2}+\frac{1}{64}n^{4}\Big{)}\)  
\(\beta=-\frac{3}{2}n+\frac{9}{16}n^{3}-\frac{3}{32}n^{5}\)  
\(\gamma=\frac{15}{16}n^{2}-\frac{1}{32}n^{4}\)  
\(\delta=-\frac{3}{48}n^{3}+\frac{105}{256}n^{5}\)  
\(\varepsilon=\frac{315}{512}n^{4}\)  
\(n=\frac{a-b}{a+b}\)  
\(b=a\Big{(}1-\frac{1}{b}\Big{)}\)  
with '\(a\)' denoting the semi-major axis of the earth, '\(F\)' denoting the flattening factor of the earth. The prime vertical radius of curvature \(N\) is  
\[N=\frac{a}{\sqrt{1-e^{2}\sin^{2}B}} \tag{26}\]  
where the first eccentricity of earth \(e\) is  
\[e=\frac{\sqrt{a^{2}-b^{2}}}{a} \tag{27}\]  
The transformation equation is given by  
\[ \begin{array}{c}x=\tau(B)+\frac{t}{2}N\cos^{2}B(L-L_{0})^{2}+\frac{t}{24}N \cos^{4}B\big{(}5-t^{2}+9\eta^{2}+4\eta^{4}\big{)}(L-L_{0})^{4}\\ +\frac{t}{720}N\cos^{6}B\big{(}61-58t^{2}+t^{4}+270\eta^{2}-330t^{2}\eta^{2} \big{)}(L-L_{0})^{6}\\ +\frac{t}{40320}N\cos^{8}B\big{(}1385-3111t^{2}+543t^{4}-t^{6}\big{)}(L-L_{0} )^{8}\end{array}  \tag{28}\]  
\[ \begin{array}{c}y=y_{o}+N\cos B(L-L_{0})+\frac{1}{6}N\cos^{3}B\big{(}1-t^{2 }+\eta^{2}\big{)}(L-L_{0})^{3}\\ +\frac{1}{120}N\cos^{5}B\big{(}5-18t^{2}+t^{4}+14\eta^{2}-58t^{2}\eta^{2} \big{)}(L-L_{0})^{5}\\ +\frac{1}{5000}N\cos^{7}B\big{(}61-478t^{2}+179t^{4}-t^{6}\big{)}(L-L_{0})^{7 }\end{array}  \tag{29}\]  
with '\(L_{0}\)' denoting the longitude of central meridian. Where \(t=\tan B\), \(\eta=\frac{c^{2}}{1-e^{2}}\), \(y_{o}=\)500,000. We can substitute the coordinate values of sites A and B into Equation (30) to calculate the angle \(\theta\). Theoretically, the farther the distance between sites A and B, the higher the accuracy of angle \(\theta\) is. A distance between the two sites no less than 100 m is acceptable. \[\theta=\arctan\left|\frac{y_{A}-y_{B}}{x_{A}-x_{B}}\right| \tag{30}\]  
where \((x_{A},y_{A})\) and \((x_{B},y_{B})\) are coordinate values of the sites A and B respectively. Before aligning the axis of magnetometer to true north direction using the obtained angle \(\theta\), the following preparations are quite necessary: (1) place the theodolite on the site B using the optical plummet; (2) level the theodolite by adjusting the leveling foot screw; (3) align the reticle of objective lens to site A by adjusting the theodolite. After making the above preparations, the coming procedure is to rotate the theodolite to align the axis of magnetometer to true north. It should be noted that the relative position of sites A and B will affect the rotation angle of the theodolite.