API, list of functions

Data structures

class BodySegments2D(idx1, vertices)[source]

Class containing the segments of a polygonal body. To create an instance a set of indices have to be passed on.

class MagPolyBodies2D(bodyindices, allvert)[source]

Class containing a set of polygonal bodies described by their segments and all vertices. To create an instance, input an array of vectors of indices (of vertices) for each body and the array of all the vertices.

class MagnetizVector(mod: float, Ideg: float, Ddeg: float)[source]

Class containing the components of a magnetization vector, i.e., module, inclination and declination angles.

Warning

Vertices of the polygonal bodies must be provided counterclockwise to the function BodySegments2D to perform magnetic anomaly calculation using the functions in the next section Forward functions

Forward functions

Single polygonal body

tmagpoly2D(xzobs, Jind, Jrem, northxax, body, forwardtype)[source]

Total magnetic field (2D) for a polygon defined by its corners. Takes into account both induced and remnant magnetization. Based on Talwani & Heitzler (1964), the default algorithm in pyMag2DPoly.

tmagpoly2Dgen(xzobs, Jind, Jrem, northxax, body, forwardtype)[source]

Total magnetic field (2D) for a polygon defined by its corners. Takes into account both induced and remnant magnetization. Generic version containing four different algorithm formulations forwardtype, passed as a string: - “talwani” –> Talwani & Heitzler (1964) - “talwani_red” –> Talwani & Heitzler (1964) rederived from Kravchinsky et al. 2019 - “krav” –> Kravchinsky et al. (2019) rectified by Ghirotto et al. (2020) - “wonbev” –> Won & Bevis (1987)

Multiple polygonal bodies

tmagpolybodies2D(xzobs, Jinds, Jrems, northxax, bodies)[source]

Total magnetic field (2D) for a set of polygonal bodies defined by their corners. Takes into account both induced and remnant magnetization. Based on Talwani & Heitzler (1964), the default algorithm in Mag2Dpoly package.

tmagpolybodies2Dgen(xzobs, Jinds, Jrems, northxax, bodies, forwardtype)[source]

Total magnetic field (2D) for a set of polygonal bodies defined by their corners. Takes into account both induced and remnant magnetization. Generic version containing four different algorithm formulations forwardtype, passed as a string: - “talwani” –> Talwani & Heitzler (1964) - “talwani_red” –> Talwani & Heitzler (1964) rederived from Kravchinsky et al. 2019 - “krav” –> Kravchinsky et al. (2019) rectified by Ghirotto et al. (2020) - “wonbev” –> Won & Bevis (1987)

Forward algorithms alone

tmagkrav(x1, z1, x2, z2, Jtotx, Jtotz, Iind, Dind, Cnorth)[source]

Total magnetic field (2D) for a line segment. Formulas from Kravchinsky et al (2019) rectified by Ghirotto et al. (2021).

tmagtalwani(x1, z1, x2, z2, Jx, Jz, Iind, Dind, C)[source]

Total magnetic field (2D) for a line segment. Formulas from Talwani & Heitzler (1964).

tmagtalwanired(x1, z1, x2, z2, Jx, Jz, Iind, Dind, C)[source]

Total magnetic field (2D) for a ribbon. Talwani & Heitzler (1964) modified by Kravchinsky et al. (2019).

tmagwonbev(x1, z1, x2, z2, modJind, modJrem, Iind, Dind, Irem, Drem, C)[source]

Total magnetic field (2D) for a line segment. Formulas from Won & Bevis (1987).

Note

These functions are not exported. To call them type mag2dpoly. before the name of the functions.

Useful functions

convert_B_nT_to_H(B_nT)[source]

Convert from the field B (nT) to H (A/m).

convert_H_to_B_nT(H_Am)[source]

Convert from the field H (A/m) to B (nT).

magcomp(modJind, Iind, Dind, modJrem, Irem, Drem, C)[source]

Vector addition of magnetic (remnant + induced) components.

checkanticlockwiseorder(body)[source]

Check whether the polygonal body has segments ordered anticlockwise.

Note

These functions are not exported. To call them type mag2dpoly. before the name of the functions.