Development of a Quadrotor UAV Aeromagnetic Quality Evaluation System Using GMT Scripts

Aeromagnetic surveying is a well-established method widely applied in mineral exploration, oil and gas resource assessment, fundamental geological research, and deep Earth probing. In recent years, with the rapid advancement of unmanned aerial vehicle (UAV) technology and the miniaturization of magnetometers, UAV-based aeromagnetic systems have seen significant development and refinement. Among various UAV platforms, multi-rotor systems, particularly quadrotor UAVs, have garnered attention due to their ability to fly at very low altitudes, enabling higher sampling density and data resolution. The quadrotor platform’s terrain-following capability allows operations in inaccessible areas such as special landscapes and mid-to-high mountain regions. However, the quadrotor UAV is constrained by limited endurance due to payload and battery capacity, often necessitating the division of survey areas into multiple blocks with several takeoff points, leading to frequent relocation during fieldwork. Furthermore, low-altitude flight is susceptible to wind disturbances, causing deviations from planned flight paths. During measurement flights, strong electromagnetic interference can result in abnormal magnetic field values or even signal loss from the magnetometer, preventing data acquisition. Therefore, it is crucial to promptly evaluate data quality after each flight mission, analyze problematic survey lines, and conduct timely re-flights. Traditional aeromagnetic quality evaluation processes are cumbersome, requiring data extraction from each survey line followed by separate assessments of flight quality and aeromagnetic data quality. To address these challenges, we developed a quality evaluation system for quadrotor UAV aeromagnetic surveys by writing scripts within the Generic Mapping Tools (GMT) software platform. This system automates the extraction of survey line data and performs statistical calculations for both flight quality and aeromagnetic quality. By integrating satellite imagery and Digital Elevation Model (DEM) data, it generates vectorized graphical outputs, facilitating rapid analysis and judgment of aeromagnetic work quality by field personnel, thereby enhancing field efficiency and ensuring operational continuity.

The quadrotor UAV aeromagnetic system represents a recently developed low-altitude aeromagnetic solution. Its ability to operate at very low heights and follow terrain contours makes it ideal for detailed surveys in complex environments. However, the limited flight endurance of a typical quadrotor UAV often requires partitioning the survey area and using multiple takeoff points. This operational mode introduces logistical challenges, including frequent movement of equipment and personnel. Moreover, the low-altitude flight characteristics of the quadrotor make it prone to deviations caused by wind, and the proximity to the ground can sometimes expose the system to localized electromagnetic noise. Consequently, a robust and efficient method for quality control immediately after data acquisition is essential. The system we developed leverages the powerful data processing and mapping capabilities of GMT to provide a comprehensive evaluation framework. This paper details the design, implementation, and application of this system, emphasizing its utility in improving the workflow for quadrotor UAV-based aeromagnetic surveys.

System Design Philosophy

The evaluation of aeromagnetic work quality is divided into two main components: flight quality and aeromagnetic data quality. The assessment is based on valid data extracted from within the planned flight lines. Therefore, the initial step involves processing the raw aeromagnetic data to isolate and save data corresponding to the planned survey lines. Each line’s data is then evaluated individually. Flight quality assessment encompasses navigation accuracy (deviation from the planned path) and flight altitude quality. Using GMT’s data processing modules, data within the planned flight lines is extracted based on the planned route file and split into individual survey lines. The cross-track distance (XTD) for each measurement point is calculated, and the range and average XTD for each line are statistically determined to evaluate navigation quality. Subsequently, GMT is used to obtain the ground elevation at each measurement point from a DEM grid file, allowing the calculation of the flight height above ground level (AGL). The range and average AGL for each line are then computed to assess flight altitude quality. Aeromagnetic data quality is evaluated based on the dynamic noise level, calculated using a fourth-difference method for each survey line.

These statistical computations on the raw aeromagnetic data yield the dynamic noise level, navigation accuracy, and flight altitude quality for each line. However, statistical values alone are not sufficiently intuitive for field personnel to pinpoint the location and nature of potential issues. To provide an intuitive assessment of flight quality and aeromagnetic data quality, the cross-track distance, flight height, and total magnetic intensity (TMI) data are plotted on a base map. By incorporating external reference data such as satellite imagery, topographic contours, and known sources of interference, GMT’s plotting modules generate graphical quality evaluation results. This visual representation helps in promptly identifying the specific survey lines and locations where data quality is subpar and in determining whether anomalous magnetic data is related to pre-identified interference sources. Furthermore, the statistical results for each survey line are presented in the form of statistical tables and histograms below the plan-view maps, providing a comprehensive summary for each flight mission and individual survey line.

In addition to automating the preprocessing and quality statistics of raw aeromagnetic data using GMT scripting, the system also calculates ancillary information for each survey line, such as start and end coordinates, start and end times, acquisition duration, and the UAV’s average flight speed. This comprehensive dataset assists field personnel in quickly evaluating the quality of the raw aeromagnetic data, identifying problems, analyzing influencing factors, and promptly re-flying unacceptable lines. This integrated approach helps avoid repeated travel to and from takeoff points, refines the operational workflow for quadrotor UAV aeromagnetic surveys, and enhances overall efficiency and data quality. The entire workflow, from data input to final output, is designed to be efficient and user-friendly, specifically catering to the needs of field operations involving quadrotor platforms.

System Architecture and Implementation

Development Environment and Language

The system is developed using GMT (Generic Mapping Tools) version 6.4 as the core platform. GMT is one of the most widely used mapping software suites in the Earth sciences, renowned for its powerful plotting and data processing capabilities. The scripting is performed using bash, executed via Git for Windows in a Windows environment, but the scripts are also compatible with Linux and macOS systems. GMT provides UnixTools scripting utilities, including essential commands like awk, paste, ls, and grep. The awk programming language, particularly GNU awk version 5.2, is extensively used for data extraction and standardized text output due to its efficiency in processing columnar data. The paste command merges files by column, while ls and grep are employed to filter and list specific data files from directories. This combination of tools within the GMT framework provides a flexible and powerful environment for automating the quality evaluation process for data collected by a quadrotor UAV.

System Functionality

The system’s functionality is primarily divided into two parts: Preprocessing and Graphical Display. The overall system workflow is designed to handle data from a quadrotor UAV survey efficiently.

Table 1: Core System Functions
Module Primary Function Key Outputs
Preprocessing Extracts survey line data from raw files; calculates flight and magnetic quality metrics. Text files with line data; statistical variables for navigation, altitude, and magnetic noise.
Graphical Display Generates vectorized maps and charts based on quality statistics and reference data (e.g., satellite images, DEM). Plan-view maps, profile-plan maps, statistical tables, and histograms for each survey line.

Preprocessing: This module performs the essential tasks of survey line data extraction, flight quality statistics, and aeromagnetic data quality statistics. After extraction, the survey line data is saved in text files. The various quality statistics are assigned to different variables, which are later called by GMT’s plotting modules to render parameters and values onto various charts and graphs. The preprocessing stage is critical for transforming the raw, often disorganized, data stream from the quadrotor UAV into a structured format suitable for analysis.

Graphical Display: Based on the statistical results of the aeromagnetic data quality assessment, this module utilizes GMT’s plotting capabilities to create charts and maps. It integrates satellite imagery, DEM data, and known interference sources to produce intuitive, vectorized graphical outputs. The visualizations are key to enabling field personnel to make rapid and accurate assessments.

Program Implementation

The implementation involves a multi-step process to convert raw quadrotor UAV aeromagnetic data into quality-evaluated, graphical outputs. The workflow is illustrated in the following diagram and described in detail thereafter. Data files used and generated during processing are summarized in Table 2.

Table 2: Data File Formats and Descriptions
Category Filename Column 1 Column 2 Column 3 Column 4 Column 5 Column 6 Column 7 Column 8 Description
Reference Data Plan.txt Longitude Latitude Planned flight lines with line identifiers.
Reference Data Info.txt Longitude Latitude Marks known interference source locations.
Process File ini.tmp Longitude Latitude Altitude TMI Timestamp Extracted aeromagnetic data (all tracks).
Process File mag.tmp Longitude Latitude Altitude TMI Cumulative Dist. Aeromagnetic data split into lines.
Process File time.tmp Timestamp Timestamps split into lines.
Process File sor.tmp Longitude Latitude Altitude TMI Cumulative Dist. Timestamp Merged, line-numbered aeromagnetic data.
Result profile.txt Longitude Latitude Altitude TMI Cumulative Dist. Timestamp XTD AGL Final line data with XTD and AGL.
Result profile_%01d.nc Longitude Latitude Altitude TMI Cumulative Dist. Timestamp XTD AGL NetCDF format data for individual lines.

Preprocessing Details:

1. Survey Line Data Extraction: Raw aeromagnetic data from a quadrotor UAV may include information from magnetometer compensators and other sensors not relevant for basic quality evaluation. Therefore, the data is first simplified by extracting columns pertinent to quality assessment: longitude, latitude, altitude, total magnetic intensity (TMI), and timestamp. This condensed data is saved as `ini.tmp`. Using the planned flight line file (`Plan.txt`), GMT’s `select` module filters data within a specified buffer (e.g., 10 meters) of the planned lines. The `split` module then divides this data into individual survey lines based on changes in azimuth (`-C` option) or a given azimuth (`-A` option), outputting to `mag.tmp`. Since `select` limits output to 5 columns, timestamps are separately processed into `time.tmp` and later merged with `mag.tmp` using the `paste` command, resulting in the `sor.tmp` file. Finally, GMT’s `mapproject` module calculates the cross-track distance (XTD) for each point relative to its planned line, and the `grdtrack` module samples the DEM grid to get ground elevation. The AGL is computed as the difference between the UAV’s altitude and the ground elevation. An `awk` command adds line numbers and the calculated AGL, generating the final `profile.txt` file containing all survey line data with XTD and AGL. The `convert` module is then used to split `profile.txt` into individual NetCDF (`.nc`) files for each survey line (e.g., `profile_0.nc`, `profile_1.nc`), which facilitates line-by-line statistical analysis. The sequential numbering (starting from 0) reflects the chronological order of data acquisition by the quadrotor, which is often more practical than using planned line numbers.

2. Flight Quality Statistics: Flight quality is assessed based on navigation (XTD) and flight altitude (AGL). A list of the individual NetCDF line files is generated using `ls` and `grep`. A loop iterates through this list, and for each line file, GMT’s `math` module and `awk` are used to compute key statistics. Variables are defined to store values like the line’s start and end latitude, calculated using `awk` to read specific rows and columns. For example, the starting latitude is the value in the second row, second column (the first row contains the line identifier). The `math` module’s functions like `LOWER`, `UPPER`, and `MEAN` are used to find the minimum, maximum, and average values for the XTD and AGL columns (columns 7 and 8 respectively in the `.nc` files).

Example code snippets for variable assignment:

# Starting latitude: 2nd column, 2nd row of a line file (1st row is line ID)
lat_start=`awk 'NR==2 {print $2}' $nc`
# Ending latitude: 2nd column, last row of a line file
lat_end=`awk 'END {print $2}' $nc`
# Minimum XTD: minimum of column 7 (XTD)
xtk_min=`gmt math $nc -i6 -S LOWER =`
# Maximum XTD: maximum of column 7 (XTD)
xtk_max=`gmt math $nc -i6 -S UPPER =`
# Mean XTD: arithmetic mean of column 7 (XTD)
xtk_mean=`gmt math $nc -i6 -S MEAN =`

Similar calculations are performed for AGL (using column index 7 for AGL after DEM calculation, though the exact index must be consistent with the file structure).

3. Aeromagnetic Quality Statistics: The range of TMI values provides a quick check for obviously erroneous data, also computed using the `math` module’s `LOWER` and `UPPER` functions on the TMI column. The dynamic noise level is evaluated using the fourth-difference method. Due to the typically high sampling rate of magnetometers on a quadrotor UAV (often significantly higher than 2 Hz), the data is first decimated to a 0.5-second interval using `awk`. The `math` module’s `DIFF` operator is then used to calculate the distance difference and the TMI difference between consecutive points in this decimated dataset. Using `awk`, the TMI values at times Ti-2, Ti-1, Ti, Ti+1, Ti+2 are extracted. The `paste` command merges these five columns of TMI values into a single row for each central point Ti. An `awk` command then performs the fourth-difference calculation. Data points where the magnetic field gradient exceeds a threshold (e.g., 600 nT/km) are considered outliers and are filtered out. Finally, the `math` module is used to count the total number of valid points and compute the average magnetic field value, leading to the final dynamic noise level statistic for the line. The formula for the fourth-difference (Δ⁴B) at point i is fundamental to this calculation:

$$ \Delta^4 B_i = \frac{(B_{i+2} – 4B_{i+1} + 6B_i – 4B_{i-1} + B_{i-2})}{16 \delta s^4} $$

where \( B_i \) is the magnetic field value at point i, and \( \delta s \) is the distance interval. The dynamic noise is typically reported as the standard deviation or root mean square (RMS) of these fourth-differences after outlier removal.

Graphical Display Details:

The output presentation follows a “3 Plan-View Maps + N Statistical Charts” layout. The “3 Plan-View Maps” are positioned at the top of the image, consisting of a Flight Track Map, a Flight Height Profile-Plan Map, and an Aeromagnetic Total Field Profile-Plan Map. These provide an intuitive representation of flight quality and aeromagnetic data quality. The “N Statistical Charts” are placed below the plan-view maps and consist of quality evaluation statistical tables and histograms for N survey lines, providing detailed quality metrics for each line. GMT’s `subplot` module is used to create the three top subplots. Because the number of survey lines from a quadrotor flight is variable, the `subplot begin` command includes the `-Y` option to shift the plotting origin upwards significantly (e.g., `-Y100c` for 100 cm), ensuring that the lower statistical charts for all lines are fully visible and not truncated.

Since the number of lines is variable, a loop statement combined with the `subplot` module is used to plot the quality evaluation charts for each line individually. A list of all NetCDF line files is created, and a `while` loop iterates through this list, using `subplot` to create a new subplot for each line’s statistical output.

1. Flight Track Map: This is a plan-view map with a satellite image base, overlaid with the planned flight lines and the actual flight tracks. The `grdcut` module extracts the relevant section of the satellite image, and `grdimage` displays it. The `plot` module is then used to overlay the planned lines (`Plan.txt`) and the actual flight tracks (`ini.tmp`). Finally, the `convert` and `text` modules are used to annotate the line numbers from the `profile.txt` file onto the map.

2. Flight Height Profile-Plan Map: This map uses a topographic contour map as its base, overlaid with the flight height profile. The `grdimage` and `grdcontour` modules convert the DEM grid into a topographic contour map. Using the designed flight altitude as a reference, the `wiggle` module plots the AGL column from the `profile.txt` file as a profile-plan map. The actual flight tracks and line numbers can also be added to this map.

The choice of DEM significantly impacts the accuracy of the AGL calculation. Various open-source DEMs like NASADEM, AW3D30 DEM, and Copernicus DEM have comparable vertical accuracies (around 6.6 m). However, for aeromagnetic quality evaluation, it is crucial to use a Digital Terrain Model (DTM) that represents the bare earth surface rather than a Digital Surface Model (DSM) that includes vegetation and structures. The flight height relevant for magnetic interpretation is the height above the ground. Therefore, using a DTM like FABDEM, which is based on Copernicus DEM but with buildings and vegetation removed, is preferable. Studies indicate that FABDEM reduces elevation RMSE by 24% and bias by 135% compared to the standard Copernicus DEM dataset. Thus, for accurate AGL assessment in surveys conducted by a quadrotor UAV, a high-quality DTM should be prioritized.

3. Aeromagnetic Total Field Profile-Plan Map: This map primarily analyzes whether the TMI data exhibits abrupt changes. Using the average TMI value of all lines (calculated by the `math` module) as a reference, the `wiggle` module plots the TMI column from the `profile.txt` file in a profile-plan format. Flight tracks and line numbers are added. Additionally, known interference sources, compiled during reconnaissance and saved in an `Info.txt` file, can be plotted using the `plot` and `text` modules to mark their locations with points, lines, or annotations. This helps determine if anomalous data correlates with known interference, a common consideration when analyzing data from a low-flying quadrotor platform.

4. Survey Line Quality Evaluation Charts: For each survey line, this section consists of a quality statistics table and histograms (for XTD, AGL, TMI, etc.). The statistics table includes information such as the line’s start/end coordinates, length, start/end times, acquisition duration, average flight speed, and dynamic noise level. The histograms show the distribution of these parameters, with the x-axis representing the parameter’s value range and the y-axis showing the percentage frequency. Key statistical values (range, mean) are annotated within the histogram. The `subplot` module sets up the subplot for each line, the `text` module places the statistical results (stored in variables) as text, the `histogram` module generates the histogram, and the `legend` module inserts the statistical values into the plot.

System Characteristics and Advantages

The development of this quadrotor UAV aeromagnetic quality evaluation system using GMT scripts provides a practical solution for rapidly assessing data quality in the field. The system offers several distinct advantages tailored to the operational constraints of quadrotor-based surveys.

1. Rapid Execution for Field Deployment: The script typically completes its run and generates the final image output within 1 to 2 minutes, fulfilling the requirement for rapid quality assessment crucial for field operations involving a quadrotor UAV. Apart from the inherent performance of the computer, the primary factors affecting execution speed are the cutting of satellite imagery and the reading of image files. These can be mitigated by using pre-prepared, lower-resolution base maps for the specific work area or by processing data from the current work period separately to reduce I/O overhead.

2. Enhanced Interpretability with Contextual Data: The integration of satellite imagery and topographic contours significantly aids in the interpretation of flight quality. By visualizing cross-track deviations and altitude variations in the context of the underlying terrain and land cover, operators can better understand the performance of the quadrotor aeromagnetic system under different conditions. For instance, it becomes easier to correlate increased deviations or altitude fluctuations with specific terrain features like ridges or valleys, potentially influenced by wind patterns. This visual context also helps identify any inherent flaws in the initial flight plan, allowing for corrections in subsequent missions.

3. Comprehensive and Actionable Quality Reporting: Presenting the statistical results for flight quality and aeromagnetic quality for each survey line in both tabular and graphical form provides field personnel with a clear and immediate understanding of data integrity. This detailed breakdown allows for the precise identification of problematic lines, complementing the overview provided by the plan-view maps. It directly supports the decision-making process for whether a line needs to be re-flown.

4. Seamless Integration with Post-Processing Workflows: The extracted and line-numbered survey data produced by the system serves as a direct input for subsequent data processing stages. The `profile.txt` file and the individual NetCDF line files, containing coordinates, time stamps, and magnetic field values, are formatted and structured ready for use in various aeromagnetic data processing software, streamlining the overall workflow from acquisition to final interpretation for quadrotor UAV surveys.

Application Example

The system was applied to field data acquired during a 1:50,000 low-altitude aeromagnetic survey conducted as part of the “Mineral Survey in Important Tin and Manganese Ore Concentration Areas” project in Laiwu City, Shandong Province. This example utilizes data from two flight missions performed by a quadrotor UAV. The GMT script was executed to preprocess the raw aeromagnetic data and perform the quality evaluation.

Overall Quality Assessment: The raw data consisted of 4 survey lines (representing two out-and-back flights). The takeoff point was located south of the survey lines. The generated output, which includes the flight track map, flight height profile-plan map, aeromagnetic total field profile-plan map, and the quality statistics charts for the 4 lines, is shown in the integrated figure.

From the Flight Track Map, the actual flight paths show minimal deviation from the planned routes, with no significant off-track events. The quadrotor UAV took off, flew directly to the southern end of line 0, proceeded northwards to complete the planned line, then turned west to the northern endpoint of line 1, flew south to complete it, and was manually controlled back to the takeoff point for landing. After a battery change, it flew directly to the southern end of line 2, flew north, turned east at the northern endpoint to fly line 3, and finally landed manually at the takeoff point. The Flight Height Profile-Plan map, referenced against the design flight height of 100 meters, reveals that the quadrotor maintained height well over the relatively flat southern terrain. In the northern mountainous area, the flight height varied more significantly, generally flying lower over ridges and higher over valleys. Line 3, traversing complex topography, exhibited flight heights consistently above the design altitude (predominantly purple on the map). The Aeromagnetic Total Field Profile-Plan map indicates a clear data anomaly in the northern section of line 0, while the TMI values for the other lines appear stable.

Line-by-Line Quality Evaluation: The statistical results for flight quality and aeromagnetic data quality for each line indicate that the flight height and cross-track distance for all 4 lines met the specified standards. The lines in the topographically complex western area (lines 2 and 3) had slightly higher average flight heights (103.3 m and 110.9 m, respectively). The average cross-track distance was less than 3 meters for all lines. With the exception of line 0, the range of TMI values was normal, and the dynamic noise was very low (maximum of 0.07 nT), meeting the criteria for first-grade quality. Line 0, however, showed an abnormal range of TMI values, as was visually apparent on the profile-plan map. Its dynamic noise level was calculated to be 104 nT, leading to the conclusion that line 0 required a supplementary flight. This immediate, quantitative assessment allowed the field team to quickly schedule a re-flight for the deficient line, optimizing the use of field time and resources for the quadrotor UAV operation.

Conclusion

We have developed a quality evaluation system specifically for multi-rotor, particularly quadrotor, UAV aeromagnetic surveys using the GMT software platform. This system automates the statistical assessment of key quality parameters: flight height, cross-track distance, and dynamic noise. By incorporating external reference data such as satellite imagery and DEMs, it enriches the graphical output, making the results highly intuitive and enabling field personnel to make accurate and timely judgments. This facilitates the prompt re-flight of substandard lines, preventing wasted time and effort associated with repeated mobilization. Furthermore, the preprocessing stage effectively converts raw aeromagnetic data into organized, line-based datasets that are immediately suitable for subsequent processing and interpretation workflows. The quadrotor UAV aeromagnetic quality evaluation system based on GMT scripts provides a foundational assessment of data quality and contributes significantly to streamlining the operational workflow, thereby enhancing overall efficiency. As wireless data transmission technologies advance, the real-time telemetry of both flight and aeromagnetic data from the quadrotor UAV to a ground processing terminal is becoming feasible. This development paves the way for the next evolutionary step: the real-time evaluation of flight quality and aeromagnetic data quality during the flight mission itself, further optimizing the efficiency and effectiveness of quadrotor UAV-based aeromagnetic surveying.

Scroll to Top