chaosmagpy.model_utils.synth_from_pp

chaosmagpy.model_utils.synth_from_pp(breaks, order, coeffs, time, radius, theta, phi, *, nmax=None, source=None, deriv=None, grid=None)[source]

Compute radial, colatitude and azimuthal field components from the magnetic potential in terms of a spherical harmonic expansion in form of a piecewise polynomial.

Parameters
breaksndarray, shape (m+1,)

1-D array, containing m+1 break points (without endpoint repeats) for m intervals.

orderint, positive

Order k of piecewise polynomials (4 = cubic).

coeffsndarray, shape (k, m, nmax*(nmax+2))

Coefficients of the piecewise polynomials, where m is the number of polynomial pieces. The trailing dimension is equal to the number of expansion coefficients for each interval.

timendarray, shape (…)

Array containing the time in days.

radiusndarray, shape (…) or float

Array containing the radius in kilometers.

thetandarray, shape (…) or float

Array containing the colatitude in degrees \([0^\circ,180^\circ]\).

phindarray, shape (…) or float

Array containing the longitude in degrees.

nmaxint, positive, optional

Maximum degree harmonic expansion (default is given by coeffs, but can also be smaller, if specified).

source{‘internal’, ‘external’}, optional

Magnetic field source (default is an internal source).

derivint, positive, optional

Derivative to be taken (default is 0).

gridbool, optional

If True, field components are computed on a regular grid. Arrays theta and phi must have one dimension less than the output grid since the grid will be created as their outer product.

Returns
B_radius, B_theta, B_phindarray, shape (…)

Radial, colatitude and azimuthal field components.

See also

synth_values