Custom Structs

The following are custom structs used within the package.

Magnetic Anomaly Maps

MagNav.MapType
Map{T2 <: AbstractFloat}

Abstract type Map for a magnetic anomaly map.

source
MagNav.MapSType
MapS{T2 <: AbstractFloat} <: Map{T2}

Scalar magnetic anomaly map struct. Subtype of Map.

FieldTypeDescription
infoStringmap information
mapMatrix{T2}ny x nx scalar magnetic anomaly map [nT]
xxVector{T2}nx map x-direction (longitude) coordinates [rad]
yyVector{T2}ny map y-direction (latitude) coordinates [rad]
altT2map altitude [m]
maskBitMatrixny x nx mask for valid (not filled-in) map data
source
MagNav.MapSdType
MapSd{T2 <: AbstractFloat} <: Map{T2}

Scalar magnetic anomaly map struct used to store an additional altitude map for drape maps. Subtype of Map.

FieldTypeDescription
infoStringmap information
mapMatrix{T2}ny x nx scalar magnetic anomaly map [nT]
xxVector{T2}nx map x-direction (longitude) coordinates [rad]
yyVector{T2}ny map y-direction (latitude) coordinates [rad]
altMatrix{T2}ny x nx altitude map [m]
maskBitMatrixny x nx mask for valid (not filled-in) map data
source
MagNav.MapS3DType
MapS3D{T2 <: AbstractFloat} <: Map{T2}

3D (multi-level) scalar magnetic anomaly map struct. Subtype of Map.

FieldTypeDescription
infoStringmap information
mapArray{T2,3}ny x nx x nz 3D (multi-level) scalar magnetic anomaly map [nT]
xxVector{T2}nx map x-direction (longitude) coordinates [rad]
yyVector{T2}ny map y-direction (latitude) coordinates [rad]
altVector{T2}nz map altitude levels [m]
maskBitArray{3}ny x nx x nz mask for valid (not filled-in) map data
source
MagNav.MapVType
MapV{T2 <: AbstractFloat} <: Map{T2}

Vector magnetic anomaly map struct. Subtype of Map.

FieldTypeDescription
infoStringmap information
mapXMatrix{T2}ny x nx x-direction magnetic anomaly map [nT]
mapYMatrix{T2}ny x nx y-direction magnetic anomaly map [nT]
mapZMatrix{T2}ny x nx z-direction magnetic anomaly map [nT]
xxVector{T2}nx map x-direction (longitude) coordinates [rad]
yyVector{T2}ny map y-direction (latitude) coordinates [rad]
altT2map altitude [m]
maskBitMatrixny x nx mask for valid (not filled-in) map data
source
MagNav.Map_CacheType
Map_Cache

Map cache struct, mutable.

FieldTypeDescription
mapsVector{MapS{Float64}}vector of MapS scalar magnetic anomaly map structs
map_sort_indVector{Int64}maps indices sorted by altitude
fallbackMapS{Float64}fallback MapS scalar magnetic anomaly map struct
map_cacheDictmaps cache of scalar map interpolation functions (f(lat,lon)) at multiple altitudes
fallback_cacheDictfallback cache of scalar map interpolation functions (f(lat,lon)) at multiple altitudes
dzRealstep size between map altitude levels [m]
source

Vector Magnetometer

MagNav.MagVType
MagV{T2 <: AbstractFloat}

Vector magnetometer measurement struct.

FieldTypeDescription
xVector{T2}x-direction magnetic field [nT]
yVector{T2}y-direction magnetic field [nT]
zVector{T2}z-direction magnetic field [nT]
tVector{T2}total magnetic field [nT]
source

Flight Paths

MagNav.PathType
Path{T1 <: Signed, T2 <: AbstractFloat} <: Path{T1, T2}

Abstract type Path for a flight path.

source
MagNav.TrajType
Traj{T1 <: Signed, T2 <: AbstractFloat}

Trajectory struct, i.e., GPS or other truth flight data. Subtype of Path.

FieldTypeDescription
NT1number of samples (instances)
dtT2measurement time step [s]
ttVector{T2}time [s]
latVector{T2}latitude [rad]
lonVector{T2}longitude [rad]
altVector{T2}altitude [m]
vnVector{T2}north velocity [m/s]
veVector{T2}east velocity [m/s]
vdVector{T2}down velocity [m/s]
fnVector{T2}north specific force [m/s]
feVector{T2}east specific force [m/s]
fdVector{T2}down specific force [m/s]
CnbArray{T2,3}3 x 3 x N direction cosine matrix (body to navigation) [-]
source
MagNav.INSType
INS{T1 <: Signed, T2 <: AbstractFloat} <: Path{T1, T2}

Inertial navigation system (INS) struct. Subtype of Path.

FieldTypeDescription
NT1number of samples (instances)
dtT2measurement time step [s]
ttVector{T2}time [s]
latVector{T2}latitude [rad]
lonVector{T2}longitude [rad]
altVector{T2}altitude [m]
vnVector{T2}north velocity [m/s]
veVector{T2}east velocity [m/s]
vdVector{T2}down velocity [m/s]
fnVector{T2}north specific force [m/s]
feVector{T2}east specific force [m/s]
fdVector{T2}down specific force [m/s]
CnbArray{T2,3}3 x 3 x N direction cosine matrix (body to navigation) [-]
PArray{T2,3}17 x 17 x N covariance matrix, only relevant for simulated data, otherwise zeros [-]
source

Flight Data

MagNav.XYZType
XYZ{T1 <: Signed, T2 <: AbstractFloat}

Abstract type XYZ for flight data. Simplest subtype is XYZ0.

source
MagNav.XYZ0Type
XYZ0{T1 <: Signed, T2 <: AbstractFloat} <: XYZ{T1, T2}

Subtype of XYZ containing the minimum dataset required for MagNav.

FieldTypeDescription
infoStringdataset information
trajTraj{T1,T2}trajectory struct
insINS{T1,T2}inertial navigation system struct
flux_aMagV{T2}Flux A vector magnetometer measurement struct
flightVector{T2}flight number(s)
lineVector{T2}line number(s), i.e., segments within flight
yearVector{T2}year
doyVector{T2}day of year
diurnalVector{T2}measured diurnal, i.e., temporal variations or space weather effects [nT]
igrfVector{T2}International Geomagnetic Reference Field (IGRF), i.e., core field [nT]
mag_1_cVector{T2}Mag 1 compensated (clean) scalar magnetometer measurements [nT]
mag_1_ucVector{T2}Mag 1 uncompensated (corrupted) scalar magnetometer measurements [nT]
source
MagNav.XYZ1Type
XYZ1{T1 <: Signed, T2 <: AbstractFloat} <: XYZ{T1, T2}

Subtype of XYZ containing a flexible dataset for future use. NaNs may be used in place of any unused fields (e.g., aux_3) when creating struct.

FieldTypeDescription
infoStringdataset information
trajTraj{T1,T2}trajectory struct
insINS{T1,T2}inertial navigation system struct
flux_aMagV{T2}Flux A vector magnetometer measurement struct
flux_bMagV{T2}Flux B vector magnetometer measurement struct
flightVector{T2}flight number(s)
lineVector{T2}line number(s), i.e., segments within flight
yearVector{T2}year
doyVector{T2}day of year
diurnalVector{T2}measured diurnal, i.e., temporal variations or space weather effects [nT]
igrfVector{T2}International Geomagnetic Reference Field (IGRF), i.e., core field [nT]
mag_1_cVector{T2}Mag 1 compensated (clean) scalar magnetometer measurements [nT]
mag_2_cVector{T2}Mag 2 compensated (clean) scalar magnetometer measurements [nT]
mag_3_cVector{T2}Mag 3 compensated (clean) scalar magnetometer measurements [nT]
mag_1_ucVector{T2}Mag 1 uncompensated (corrupted) scalar magnetometer measurements [nT]
mag_2_ucVector{T2}Mag 2 uncompensated (corrupted) scalar magnetometer measurements [nT]
mag_3_ucVector{T2}Mag 3 uncompensated (corrupted) scalar magnetometer measurements [nT]
aux_1Vector{T2}flexible-use auxiliary data 1
aux_2Vector{T2}flexible-use auxiliary data 2
aux_3Vector{T2}flexible-use auxiliary data 3
source
MagNav.XYZ20Type
XYZ20{T1 <: Signed, T2 <: AbstractFloat} <: XYZ{T1, T2}

Subtype of XYZ for 2020 SGL datasets.

FieldTypeDescription
infoStringdataset information
trajTraj{T1,T2}trajectory struct
insINS{T1,T2}inertial navigation system struct
flux_aMagV{T2}Flux A vector magnetometer measurement struct
flux_bMagV{T2}Flux B vector magnetometer measurement struct
flux_cMagV{T2}Flux C vector magnetometer measurement struct
flux_dMagV{T2}Flux D vector magnetometer measurement struct
flightVector{T2}flight number(s)
lineVector{T2}line number(s), i.e., segments within flight
yearVector{T2}year
doyVector{T2}day of year
utm_xVector{T2}x-coordinate, WGS-84 UTM zone 18N [m]
utm_yVector{T2}y-coordinate, WGS-84 UTM zone 18N [m]
utm_zVector{T2}z-coordinate, GPS altitude above WGS-84 ellipsoid [m]
mslVector{T2}z-coordinate, GPS altitude above EGM2008 Geoid [m]
baroVector{T2}barometric altimeter [m]
diurnalVector{T2}measured diurnal, i.e., temporal variations or space weather effects [nT]
igrfVector{T2}International Geomagnetic Reference Field (IGRF), i.e., core field [nT]
mag_1_cVector{T2}Mag 1 compensated (clean) scalar magnetometer measurements [nT]
mag_1_lagVector{T2}Mag 1 lag-corrected scalar magnetometer measurements [nT]
mag_1_dcVector{T2}Mag 1 diurnal-corrected scalar magnetometer measurements [nT]
mag_1_igrfVector{T2}Mag 1 IGRF & diurnal-corrected scalar magnetometer measurements [nT]
mag_1_ucVector{T2}Mag 1 uncompensated (corrupted) scalar magnetometer measurements [nT]
mag_2_ucVector{T2}Mag 2 uncompensated (corrupted) scalar magnetometer measurements [nT]
mag_3_ucVector{T2}Mag 3 uncompensated (corrupted) scalar magnetometer measurements [nT]
mag_4_ucVector{T2}Mag 4 uncompensated (corrupted) scalar magnetometer measurements [nT]
mag_5_ucVector{T2}Mag 5 uncompensated (corrupted) scalar magnetometer measurements [nT]
mag_6_ucVector{T2}Mag 6 uncompensated (corrupted) scalar magnetometer measurements [nT]
ogs_magVector{T2}OGS survey diurnal-corrected, levelled, magnetic field [nT]
ogs_altVector{T2}OGS survey, GPS altitude (WGS-84) [m]
ins_wanderVector{T2}INS-computed wander angle (ccw from north) [rad]
ins_rollVector{T2}INS-computed aircraft roll [deg]
ins_pitchVector{T2}INS-computed aircraft pitch [deg]
ins_yawVector{T2}INS-computed aircraft yaw [deg]
roll_rateVector{T2}avionics-computed roll rate [deg/s]
pitch_rateVector{T2}avionics-computed pitch rate [deg/s]
yaw_rateVector{T2}avionics-computed yaw rate [deg/s]
ins_acc_xVector{T2}INS x-acceleration [m/s^2]
ins_acc_yVector{T2}INS y-acceleration [m/s^2]
ins_acc_zVector{T2}INS z-acceleration [m/s^2]
lgtl_accVector{T2}avionics-computed longitudinal (forward) acceleration [g]
ltrl_accVector{T2}avionics-computed lateral (starboard) acceleration [g]
nrml_accVector{T2}avionics-computed normal (vertical) acceleration [g]
pitot_pVector{T2}avionics-computed pitot pressure [kPa]
static_pVector{T2}avionics-computed static pressure [kPa]
total_pVector{T2}avionics-computed total pressure [kPa]
cur_com_1Vector{T2}current sensor: aircraft radio 1 [A]
cur_ac_hiVector{T2}current sensor: air conditioner fan high [A]
cur_ac_loVector{T2}current sensor: air conditioner fan low [A]
cur_tankVector{T2}current sensor: cabin fuel pump [A]
cur_flapVector{T2}current sensor: flap motor [A]
cur_strbVector{T2}current sensor: strobe lights [A]
cur_srvo_oVector{T2}current sensor: INS outer servo [A]
cur_srvo_mVector{T2}current sensor: INS middle servo [A]
cur_srvo_iVector{T2}current sensor: INS inner servo [A]
cur_heatVector{T2}current sensor: INS heater [A]
cur_acpwrVector{T2}current sensor: aircraft power [A]
cur_outpwrVector{T2}current sensor: system output power [A]
cur_bat_1Vector{T2}current sensor: battery 1 [A]
cur_bat_2Vector{T2}current sensor: battery 2 [A]
vol_acpwrVector{T2}voltage sensor: aircraft power [V]
vol_outpwrVector{T2}voltage sensor: system output power [V]
vol_bat_1Vector{T2}voltage sensor: battery 1 [V]
vol_bat_2Vector{T2}voltage sensor: battery 2 [V]
vol_res_pVector{T2}voltage sensor: resolver board (+) [V]
vol_res_nVector{T2}voltage sensor: resolver board (-) [V]
vol_back_pVector{T2}voltage sensor: backplane (+) [V]
vol_back_nVector{T2}voltage sensor: backplane (-) [V]
vol_gyro_1Vector{T2}voltage sensor: gyroscope 1 [V]
vol_gyro_2Vector{T2}voltage sensor: gyroscope 2 [V]
vol_acc_pVector{T2}voltage sensor: INS accelerometers (+) [V]
vol_acc_nVector{T2}voltage sensor: INS accelerometers (-) [V]
vol_blockVector{T2}voltage sensor: block [V]
vol_backVector{T2}voltage sensor: backplane [V]
vol_srvoVector{T2}voltage sensor: servos [V]
vol_cabtVector{T2}voltage sensor: cabinet [V]
vol_fanVector{T2}voltage sensor: cooling fan [V]
aux_1Vector{T2}flexible-use auxiliary data 1
aux_2Vector{T2}flexible-use auxiliary data 2
aux_3Vector{T2}flexible-use auxiliary data 3
source
MagNav.XYZ21Type
XYZ21{T1 <: Signed, T2 <: AbstractFloat} <: XYZ{T1, T2}

Subtype of XYZ for 2021 SGL datasets.

FieldTypeDescription
infoStringdataset information
trajTraj{T1,T2}trajectory struct
insINS{T1,T2}inertial navigation system struct
flux_aMagV{T2}Flux A vector magnetometer measurement struct
flux_bMagV{T2}Flux B vector magnetometer measurement struct
flux_cMagV{T2}Flux C vector magnetometer measurement struct
flux_dMagV{T2}Flux D vector magnetometer measurement struct
flightVector{T2}flight number(s)
lineVector{T2}line number(s), i.e., segments within flight
yearVector{T2}year
doyVector{T2}day of year
utm_xVector{T2}x-coordinate, WGS-84 UTM zone 18N [m]
utm_yVector{T2}y-coordinate, WGS-84 UTM zone 18N [m]
utm_zVector{T2}z-coordinate, GPS altitude above WGS-84 ellipsoid [m]
mslVector{T2}z-coordinate, GPS altitude above EGM2008 Geoid [m]
baroVector{T2}barometric altimeter [m]
diurnalVector{T2}measured diurnal, i.e., temporal variations or space weather effects [nT]
igrfVector{T2}International Geomagnetic Reference Field (IGRF), i.e., core field [nT]
mag_1_cVector{T2}Mag 1 compensated (clean) scalar magnetometer measurements [nT]
mag_1_ucVector{T2}Mag 1 uncompensated (corrupted) scalar magnetometer measurements [nT]
mag_2_ucVector{T2}Mag 2 uncompensated (corrupted) scalar magnetometer measurements [nT]
mag_3_ucVector{T2}Mag 3 uncompensated (corrupted) scalar magnetometer measurements [nT]
mag_4_ucVector{T2}Mag 4 uncompensated (corrupted) scalar magnetometer measurements [nT]
mag_5_ucVector{T2}Mag 5 uncompensated (corrupted) scalar magnetometer measurements [nT]
cur_com_1Vector{T2}current sensor: aircraft radio 1 [A]
cur_ac_hiVector{T2}current sensor: air conditioner fan high [A]
cur_ac_loVector{T2}current sensor: air conditioner fan low [A]
cur_tankVector{T2}current sensor: cabin fuel pump [A]
cur_flapVector{T2}current sensor: flap motor [A]
cur_strbVector{T2}current sensor: strobe lights [A]
vol_blockVector{T2}voltage sensor: block [V]
vol_backVector{T2}voltage sensor: backplane [V]
vol_cabtVector{T2}voltage sensor: cabinet [V]
vol_fanVector{T2}voltage sensor: cooling fan [V]
aux_1Vector{T2}flexible-use auxiliary data 1
aux_2Vector{T2}flexible-use auxiliary data 2
aux_3Vector{T2}flexible-use auxiliary data 3
source

Output Wrappers

MagNav.FILTresType
FILTres{T2 <: AbstractFloat}

Filter results struct.

FieldTypeDescription
xMatrix{T2}filtered states, i.e., E(xt y1,..,y_t)
PArray{T2,3}non-linear covariance matrix
rMatrix{T2}measurement residuals [nT]
cBoolif true, filter converged
source
MagNav.CRLBoutType
CRLBout{T2 <: AbstractFloat}

Cramér–Rao lower bound extracted output struct.

FieldTypeDescription
lat_stdVector{T2}latitude 1-σ [rad]
lon_stdVector{T2}longitude 1-σ [rad]
alt_stdVector{T2}altitude 1-σ [m]
vn_stdVector{T2}north velocity 1-σ [m/s]
ve_stdVector{T2}east velocity 1-σ [m/s]
vd_stdVector{T2}down velocity 1-σ [m/s]
tn_stdVector{T2}north tilt (attitude) 1-σ [rad]
te_stdVector{T2}east tilt (attitude) 1-σ [rad]
td_stdVector{T2}down tilt (attitude) 1-σ [rad]
fogm_stdVector{T2}FOGM 1-σ [nT]
n_stdVector{T2}northing 1-σ [m]
e_stdVector{T2}easting 1-σ [m]
source
MagNav.INSoutType
INSout{T2 <: AbstractFloat}

Inertial navigation system extracted output struct.

FieldTypeDescription
lat_stdVector{T2}latitude 1-σ [rad]
lon_stdVector{T2}longitude 1-σ [rad]
alt_stdVector{T2}altitude 1-σ [m]
n_stdVector{T2}northing 1-σ [m]
e_stdVector{T2}easting 1-σ [m]
lat_errVector{T2}latitude error [rad]
lon_errVector{T2}longitude error [rad]
alt_errVector{T2}altitude error [m]
n_errVector{T2}northing error [m]
e_errVector{T2}easting error [m]
source
MagNav.FILToutType
FILTout{T1 <: Signed, T2 <: AbstractFloat} <: Path{T1, T2}

Filter extracted output struct. Subtype of Path.

FieldTypeDescription
NT1number of samples (instances)
dtT2measurement time step [s]
ttVector{T2}time [s]
latVector{T2}latitude [rad]
lonVector{T2}longitude [rad]
altVector{T2}altitude [m]
vnVector{T2}north velocity [m/s]
veVector{T2}east velocity [m/s]
vdVector{T2}down velocity [m/s]
tnVector{T2}north tilt (attitude) [rad]
teVector{T2}east tilt (attitude) [rad]
tdVector{T2}down tilt (attitude) [rad]
haVector{T2}barometer aiding altitude [m]
ahVector{T2}barometer aiding vertical acceleration [m/s^2]
axVector{T2}x accelerometer [m/s^2]
ayVector{T2}y accelerometer [m/s^2]
azVector{T2}z accelerometer [m/s^2]
gxVector{T2}x gyroscope [rad/s]
gyVector{T2}y gyroscope [rad/s]
gzVector{T2}z gyroscope [rad/s]
fogmVector{T2}FOGM catch-all [nT]
lat_stdVector{T2}latitude 1-σ [rad]
lon_stdVector{T2}longitude 1-σ [rad]
alt_stdVector{T2}altitude 1-σ [m]
vn_stdVector{T2}north velocity 1-σ [m/s]
ve_stdVector{T2}east velocity 1-σ [m/s]
vd_stdVector{T2}down velocity 1-σ [m/s]
tn_stdVector{T2}north tilt (attitude) 1-σ [rad]
te_stdVector{T2}east tilt (attitude) 1-σ [rad]
td_stdVector{T2}down tilt (attitude) 1-σ [rad]
ha_stdVector{T2}barometer aiding altitude 1-σ [m]
ah_stdVector{T2}barometer aiding vertical acceleration 1-σ [m/s^2]
ax_stdVector{T2}x accelerometer 1-σ [m/s^2]
ay_stdVector{T2}y accelerometer 1-σ [m/s^2]
az_stdVector{T2}z accelerometer 1-σ [m/s^2]
gx_stdVector{T2}x gyroscope 1-σ [rad/s]
gy_stdVector{T2}y gyroscope 1-σ [rad/s]
gz_stdVector{T2}z gyroscope 1-σ [rad/s]
fogm_stdVector{T2}FOGM catch-all 1-σ [nT]
n_stdVector{T2}northing 1-σ [m]
e_stdVector{T2}easting 1-σ [m]
lat_errVector{T2}latitude error [rad]
lon_errVector{T2}longitude error [rad]
alt_errVector{T2}altitude error [m]
vn_errVector{T2}north velocity error [m/s]
ve_errVector{T2}east velocity error [m/s]
vd_errVector{T2}down velocity error [m/s]
tn_errVector{T2}north tilt (attitude) error [rad]
te_errVector{T2}east tilt (attitude) error [rad]
td_errVector{T2}down tilt (attitude) error [rad]
n_errVector{T2}northing error [m]
e_errVector{T2}easting error [m]
source

Real-time EKF

MagNav.EKF_RTType
EKF_RT

Real-time (RT) extended Kalman filter (EKF) struct, mutable.

FieldTypeDescription
PMatrix{Float64}non-linear covariance matrix
QdMatrix{Float64}discrete time process/system noise matrix
RFloat64measurement (white) noise variance
baro_tauFloat64barometer time constant [s]
acc_tauFloat64accelerometer time constant [s]
gyro_tauFloat64gyroscope time constant [s]
fogm_tauFloat64FOGM catch-all time constant [s]
dateFloat64measurement date for IGRF [yr]
coreBoolif true, include core magnetic field in measurement
nxInt64total state dimension
nyInt64measurement dimension
tFloat64time [s]
xVector{Float64}filtered states, i.e., E(xt y1,..,y_t)
rVector{Float64}measurement residual
source

Compensation Parameters

MagNav.LinCompParamsType
LinCompParams <: CompParams

Linear aeromagnetic compensation parameters struct. Subtype of CompParams.

To see default parameters, type LinCompParams().

General Parameters:

ParameterTypeDescription
versionVersionNumberMagNav.jl version used to generate this struct
features_setupVector{Symbol}vector of features to include, only used for model_type = :elasticnet, :plsr
features_no_normVector{Symbol}vector of features to not normalize, only used for model_type = :elasticnet, :plsr
model_typeSymbolaeromagnetic compensation model type (see below)
y_typeSymboly target type (see below)
use_magSymboluncompensated scalar magnetometer to use for y target vector {:mag_1_uc, etc.}, only used for y_type = :c, :d, :e
use_vecSymbolvector magnetometer (fluxgate) to use for "external" Tolles-Lawson A matrix {:flux_a, etc.}, only used for model_type = :TL, :mod_TL, :map_TL
data_normsTuplelength-4 tuple of data normalizations, (A_bias,A_scale,y_bias,y_scale) for model_type = :TL, :mod_TL, :map_TL or (x_bias,x_scale,y_bias,y_scale) for model_type = :elasticnet, :plsr
modelTuplelinear model coefficients
termsVector{Symbol}Tolles-Lawson terms to use for Tolles-Lawson A matrix (or matrices) within x data matrix {:permanent,:induced,:eddy}, only used for model_type = :elasticnet, :plsr
terms_AVector{Symbol}Tolles-Lawson terms to use for "external" Tolles-Lawson A matrix {:permanent,:induced,:eddy,:bias}, only used for model_type = :TL, :mod_TL, :map_TL
sub_diurnalBoolif true, subtract diurnal from scalar magnetometer measurements
sub_igrfBoolif true, subtract IGRF from scalar magnetometer measurements
bpf_magBoolif true, bpf scalar magnetometer measurements in x data matrix, only used for model_type = :elasticnet, :plsr
reorient_vecBoolif true, align vector magnetometers (fluxgates) with body frame
norm_type_ASymbolnormalization for "external" Tolles-Lawson A matrix, only used for model_type = :TL, :mod_TL, :map_TL (see below)
norm_type_xSymbolnormalization for x data matrix, only used for model_type = :elasticnet, :plsr (see below)
norm_type_ySymbolnormalization for y target vector (see below)
  • model_type options:

    • :TL = classical Tolles-Lawson
    • :mod_TL = modified Tolles-Lawson
    • :map_TL = map-based Tolles-Lawson
    • :elasticnet = elastic net (ridge regression and/or Lasso)
    • :plsr: = partial least squares regression (PLSR)
  • y_type options:

    • :a = anomaly field #1, compensated tail stinger total field scalar magnetometer measurements
    • :b = anomaly field #2, interpolated magnetic anomaly map values
    • :c = aircraft field #1, difference between uncompensated cabin total field scalar magnetometer measurements and interpolated magnetic anomaly map values
    • :d = aircraft field #2, difference between uncompensated cabin and compensated tail stinger total field scalar magnetometer measurements
    • :e = BPF'd total field, bandpass filtered uncompensated cabin total field scalar magnetometer measurements
  • norm_type options:

    • :standardize = Z-score normalization
    • :normalize = min-max normalization
    • :scale = scale by maximum absolute value, bias = 0
    • :none = scale by 1, bias = 0

Linear Model-Specific Parameters:

ParameterTypeDescription
k_plsrInt64number of components, only used for model_type = :plsr
λ_TLFloat64ridge parameter, only used for model_type = :TL, :mod_TL, :map_TL
source
MagNav.NNCompParamsType
NNCompParams <: CompParams

Neural network-based aeromagnetic compensation parameters struct. Subtype of CompParams.

To see default parameters, type NNCompParams().

General Parameters:

ParameterTypeDescription
versionVersionNumberMagNav.jl version used to generate this struct
features_setupVector{Symbol}vector of features to include
features_no_normVector{Symbol}vector of features to not normalize
model_typeSymbolaeromagnetic compensation model type (see below)
y_typeSymboly target type (see below)
use_magSymboluncompensated scalar magnetometer to use for y target vector {:mag_1_uc, etc.}, only used for y_type = :c, :d, :e
use_vecSymbolvector magnetometer (fluxgate) to use for "external" Tolles-Lawson A matrix {:flux_a, etc.}, not used for model_type = :m1
data_normsTuplelength-7 tuple of data normalizations, (A_bias,A_scale,v_scale,x_bias,x_scale,y_bias,y_scale)
modelChainneural network model
termsVector{Symbol}Tolles-Lawson terms to use for Tolles-Lawson A matrix (or matrices) within x data matrix {:permanent,:induced,:eddy}
terms_AVector{Symbol}Tolles-Lawson terms to use for "external" Tolles-Lawson A matrix {:permanent,:induced,:eddy,:bias}, not used for model_type = :m1
sub_diurnalBoolif true, subtract diurnal from scalar magnetometer measurements
sub_igrfBoolif true, subtract IGRF from scalar magnetometer measurements
bpf_magBoolif true, bpf scalar magnetometer measurements in x data matrix
reorient_vecBoolif true, align vector magnetometers (fluxgates) with body frame
norm_type_ASymbolnormalization for "external" Tolles-Lawson A matrix, only used for model_type = :m2* (see below)
norm_type_xSymbolnormalization for x data matrix (see below)
norm_type_ySymbolnormalization for y target vector (see below)
  • model_type options are broken into 3 architectures, with 1 being a standard feedforward neural network and 2 & 3 being used in conjunction with Tolles-Lawson

    • :m1 = standard feedforward neural network (NN)
    • :m2a = NN determines Tolles-Lawson (TL) coefficients
    • :m2b = NN determines additive correction to classical TL
    • :m2c = NN determines additive correction to classical TL, TL coefficients tuned as well
    • :m2d = NN determines additive correction to each TL coefficient
    • :m3tl = no NN, TL coefficients fine-tuned via SGD, without Taylor expansion for y_type = :b, :c (for testing)
    • :m3s = NN determines scalar correction to TL, using expanded TL vector terms for explainability
    • :m3v = NN determines vector correction to TL, using expanded TL vector terms for explainability
    • :m3sc = :m3s with curriculum learning based on TL error
    • :m3vc = :m3v with curriculum learning based on TL error
    • :m3w = :m3s with window NN for temporal dataset
    • :m3tf = :m3s with time series transformer for temporal dataset
  • y_type options:

    • :a = anomaly field #1, compensated tail stinger total field scalar magnetometer measurements
    • :b = anomaly field #2, interpolated magnetic anomaly map values
    • :c = aircraft field #1, difference between uncompensated cabin total field scalar magnetometer measurements and interpolated magnetic anomaly map values
    • :d = aircraft field #2, difference between uncompensated cabin and compensated tail stinger total field scalar magnetometer measurements
    • :e = BPF'd total field, bandpass filtered uncompensated cabin total field scalar magnetometer measurements
  • norm_type options:

    • :standardize = Z-score normalization
    • :normalize = min-max normalization
    • :scale = scale by maximum absolute value, bias = 0
    • :none = scale by 1, bias = 0

Neural Network-Based Model-Specific Parameters:

ParameterTypeDescription
TL_coefVector{Float64}Tolles-Lawson coefficients, not used for model_type = :m1, :m2a
η_adamFloat64learning rate for Adam optimizer
epoch_adamInt64number of epochs for Adam optimizer
epoch_lbfgsInt64number of epochs for LBFGS optimizer
hiddenVector{Int64}hidden layers & nodes (e.g., [8,8] for 2 hidden layers, 8 nodes each)
activationFunctionactivation function (see below)
lossFunctionloss function (see below)
batchsizeInt64mini-batch size
frac_trainFloat64fraction of training data used for training (remainder for validation), only used for Adam optimizer
α_sglFloat64Lasso (α_sgl=0) vs group Lasso (α_sgl=1) balancing parameter {0:1}
λ_sglFloat64sparse group Lasso parameter, typically ~1e-5 (if non-zero)
k_pcaInt64number of components for pre-processing with PCA + whitening, -1 to ignore
drop_fiBoolif true, perform drop-column feature importance
drop_fi_bsonStringpath/name of drop-column feature importance data BSON file to save/load (.bson extension optional)
drop_fi_csvStringpath/name of drop-column feature importance data CSV file to save (.csv extension optional)
perm_fiBoolif true, perform permutation feature importance
perm_fi_csvStringpath/name of permutation feature importance data CSV file to save (.csv extension optional)
  • activation options, which can be visualized by running plot_activation():

    • relu = rectified linear unit
    • σ = sigmoid (logistic function)
    • swish = self-gated
    • tanh = hyperbolic tan
  • loss options:

    • mse = mean squared error
    • mae = mean absolute error
    • huber_loss = mean Huber loss
source