# harmonica.prism_magnetic#

harmonica.prism_magnetic(coordinates, prisms, magnetization, field, parallel=True, dtype=<class 'numpy.float64'>, progressbar=False, disable_checks=False)[source]#

Magnetic field of right-rectangular prisms in Cartesian coordinates

Compute the component(s) of the magnetic field vector generated by a collection of prisms on a set of observation points.

Important

The component(s) of the magnetic field are returned in $$nT$$.

Parameters:
coordinateslist of arrays

List of arrays containing the easting, northing and upward coordinates of the computation points defined on a Cartesian coordinate system. All coordinates should be in meters.

prismslist, 1d-array, or 2d-array

List or array containing the coordinates of the prism(s) in the following order: west, east, south, north, bottom, top in a Cartesian coordinate system. All coordinates should be in meters. Coordinates for more than one prism can be provided. In this case, prisms should be a list of lists or 2d-array (with one prism per row).

magnetizationtuple or arrays

Tuple containing the three arrays corresponding to the magnetization vector components of each prism in $$Am^{-1}$$. These arrays should be provided in the following order: magnetization_e, magnetization_n, magnetization_u.

fieldstr

Magnetic field that will be computed. The available fields are:

• The full magnetic vector: b

• Easting component of the magnetic vector: b_e

• Northing component of the magnetic vector: b_n

• Upward component of the magnetic vector: b_u

parallelbool (optional)

If True the computations will run in parallel using Numba built-in parallelization. If False, the forward model will run on a single core. Might be useful to disable parallelization if the forward model is run by an already parallelized workflow. Default to True.

dtypedata-type (optional)

Data type assigned to the resulting gravitational field. Default to np.float64.

progressbarbool (optional)

If True, a progress bar of the computation will be printed to standard error (stderr). Requires numba_progress to be installed. Default to False.

disable_checksbool (optional)

Flag that controls whether to perform a sanity check on the model. Should be set to True only when it is certain that the input model is valid and it does not need to be checked. Default to False.

Returns:
magnetic_fieldarray or tuple of arrays

Computed magnetic field on every observation point in $$nT$$. If field is set to a single component, then a single array with the computed magnetic field component will be returned. If field is set to "b", then a tuple containing the three components of the magnetic vector will be returned in the following order: b_e, b_n, b_u.