A complete workflow for processing magnetic field measurements from sensor data to actionable visualizations
mag_to_csv.py
Collect magnetic field measurements from MMC5983MA magnetometer sensor and save to CSV
MMC5983MA sensor via I2C
data/raw/mag_data.csv
validate_and_diagnosticsV1.py
Validate, clean, and generate diagnostics for magnetometer CSV data
data/raw/mag_data.csv
data/processed/mag_data_clean.csv
compute_local_anomaly_v2.py
Detect local magnetic anomalies by comparing each point to its neighborhood
data/processed/mag_data_clean.csv
data/processed/mag_data_anomaly.csv
interpolate_to_heatmapV1.py
Interpolate scattered measurement points onto a regular grid and generate heatmap visualizations
data/processed/mag_data_anomaly.csv
data/exports/mag_data_grid.csv + heatmap.png
Raw Data
data/raw/
Processed Data
data/processed/
Exports
data/exports/
Systematic measurement collection with configurable grid parameters (NX, NY, DX, DY, X0, Y0). The script automatically calculates each grid point and prompts you to move the sensor there.
Flag columns identify problematic data: outliers (extreme values), spikes (sudden jumps), and combined flags. These can be used to filter data in subsequent processing steps.
Unlike global anomalies, local anomalies compare each point to nearby neighbors. This helps detect small-scale variations, regional differences, and localized sources of magnetic disturbance.