chaosmagpy.coordinate_utils.matrix_geo_to_base

chaosmagpy.coordinate_utils.matrix_geo_to_base(theta, phi, base_1, base_2, base_3, inverse=None)[source]

Transform vector components in the local USE frame of GEO to components in the local USE frame of a rotated spherical coordinate system as given by three cartesian unit base vectors.

Parameters:
thetafloat or ndarray, shape (…)

Geocentric colatitude in degrees.

phifloat or ndarray, shape (…)

Longitude in degrees.

base_1, base_2, base_3ndarray, shape (…, 3)

Base vectors 1 through 3 resolved into cartesian components in GEO.

inversebool

Use inverse transformation instead, i.e. transform from rotated coordinates to geographic (default is False).

Returns:
thetandarray, shape (…)

Reference colatitude in degrees \([0^\circ, 180^\circ]\).

phindarray, shape (…)

Reference longitude in degrees \((-180^\circ, 180^\circ]\).

Rndarray, shape (…, 3, 3), optional

Stacked matrices that rotate spherical vector components from GEO to the rotated reference frame. The matrices (3x3) reside in the last two dimensions, while the leading dimensions are identical to the input grid.

B_radius_ref = B_radius
B_theta_ref = R[1, 1]*B_theta + R[1, 2]*B_phi
B_phi_ref = R[2, 1]*B_theta + R[2, 2]*B_phi