# Three-Dimensional Magnetic Inversion Based on an Adaptive Quadtree Data Compression
## 2 Methods
### Synthetic Model Test  
To illustrate the effectiveness and feasibility of data compression based on the adaptive quadtree decomposition algorithm in 3D magnetic inversion, two synthetic models are used in this paper. Model 1: As shown in Figure 3a, the synthetic model is a simple cuboid with a length, width, and height of 400 m, 400 m, and 200 m, respectively, the buried depth of the top surface is 200 m, the magnetization is 5 A/m, the magnetic inclination is 60\({}^{\circ}\), and the magnetic declination is 10\({}^{\circ}\). Then, the forward calculation is carried out for the model. The observation height is set at 80 m, the survey network is \(128\times 128\), the spacing in x-axis and y-axis directions is 10 m, and the magnetic anomaly map with 7% Gaussian noise is added, as shown in Figure 3b. Figure 3: Synthetic model 1: (**a**) schematic diagram; (**b**) magnetic anomaly contour map. Figure 2: The flowchart for the adaptive quadtree decomposition. The magnetic data for synthetic model 1 is compressed by the adaptive quadtree data compress algorithm. The parameter settings are as follows: the minimum grid is 4, the maximum grid is 16, and the variance threshold is 2000. Figure 4a,b show the cut image and the extracted data scatter map after data compression, respectively. The amount of data is reduced from 16384 points to 277 points. The compressed data is only 1.69% of the original data, and the error is 0.040. Model 2: As shown in Figure 5a, the composite model is a complex model consisting of five different cubes. The depth of the buried surface is 200 m, and the magnetization is 5 A/m. The inclination angle and magnetic declination angle are the same as those of model 1. The magnetic anomaly map with 7% Gaussian noise is shown in Figure 5b. The magnetic data for synthetic model 2 is compressed by adaptive quadtree decomposition algorithm. The parameter settings are as follows: the minimum grid is 4, the maximum grid is 16, and the variance threshold is 1600. Figure 6a shows the cut image using quadtree decomposition algorithm, and Figure 6b shows the compression algorithm extracts data scatter diagram, the data volume is reduced from 16384 points to 505 points, thus the compressed data volume is only 3.08% of the original data, and the error is 0.067. Figure 4: Synthetic model 1: (**a**) the image is segmented by quadtree; (**b**) the scattered point location map of data extracted by compression algorithm; (**c**) contour map of magnetic anomalies reconstructed from compressed data. Figure 5: Synthetic model 2: (**a**) schematic diagram; (**b**) magnetic anomaly contour map. As can be seen from Figures 4b and 6b, the data points at the anomaly boundary are intensively sampled, which fully preserves the detailed features while only a small number of data points are reserved at the places where the anomaly changes slowly, thus greatly reducing the magnitude of the data. The compressed data are reconstructed as shown in Figures 4c and 6c. The results show that the compressed data retains the abnormal details and effectively eliminates the noise compared with the original data. Taking the inversion calculation of model 2 as an example, we can compare the inversion using the compressed data and the inversion using the original data. The underground grid is divided into \(64\times 64\times 32\), and the grid spacing is \(20\) m \(\times 20\) m \(\times 20\) m. The horizontal and vertical slices of the inversion results are shown in Figure 7. When comparing the inversion results of the compressed data with the original data, it can be seen that the resolution of the compressed data is better than that of the original data. The results show that although some information is lost after data compression, the detailed features of the data are still retained.