MoonMag.asymmetry_funcs module

Contains functions for calculating induced magnetic fields

from near-spherical conductors. Developed in Python 3.8 for “A perturbation method for evaluating the magnetic field induced from an arbitrary, asymmetric ocean world analytically” by Styczinski et al. DOI: 10.1016/j.icarus.2021.114840

Author: M. J. Styczinski, mjstyczi@uw.edu

MoonMag.asymmetry_funcs.BiList(r_bds, sigmas, peak_omegas, asym_shape_layers, grav_shape, Benm, rscale_moments, nvals, mvals, p_max, nprm_max=1, writeout=True, path=None, bodyname=None, verbose=True, append='', debug=False, do_parallel=True, Schmidt=False, outFname=None, outFnameS=None, Xid=None)
MoonMag.asymmetry_funcs.BinmResponse(r_bds, sigmas, omega, asym_shape, Benm, Xid, p_max, rscaling, nprm_max=1, verbose=True, debug=False)
MoonMag.asymmetry_funcs.F_M(n, m, twokap)
MoonMag.asymmetry_funcs.F_P(n, m, twokap, nprm_max)
MoonMag.asymmetry_funcs.XidDenom(n, m, nprm_max)
MoonMag.asymmetry_funcs.XidSeriesLower(n, m, p, q, nprm, mprm)
MoonMag.asymmetry_funcs.XidSeriesUpper(n, m, p, q, nprm, mprm, nprm_max)
MoonMag.asymmetry_funcs.calc_Xi(n, m, p, q, nprm, mprm)
MoonMag.asymmetry_funcs.calc_Xid(n, m, p, q, nprm, mprm, nprm_max)
MoonMag.asymmetry_funcs.calc_Xiw(n, m, p, q, nprm, mprm)
MoonMag.asymmetry_funcs.cpx_div(a, b)
MoonMag.asymmetry_funcs.cpx_div_val(a, b)
MoonMag.asymmetry_funcs.eval_dev(p, q, chi_pq, ltht, lphi, outShape)
MoonMag.asymmetry_funcs.eval_inner_recur_sym(n_max, n_bds, beta, gamm, delt, epsi)
MoonMag.asymmetry_funcs.getMagSurf(nvals, mvals, Binm, r_th_ph, ltht, lphi, nmax_plot=10, Schmidt=False, do_parallel=True)
MoonMag.asymmetry_funcs.get_Binm_from_gh(n_max, gnm, hnm)

Convert from Schmidt semi-normalized form without the C-S phase (common in geophysics) to orthonormal harmonic coefficients with the Condon-Shortley phase (common in physics). Handles all values for a given n at once. :param n_max: int. Maximum degree n of induced moments. :param gnm: complex, shape(n_max+1,n_max+1). g_nm and h_nm values for all m = [0,n].

Schmidt normalization here means the integral of |Ynm|^2 * dOmega over a unit sphere is 4pi/(2n+1) for all n and m. No Condon-Shortley phase.

Parameters:

hnm – complex, shape(n_max+1,n_max+1). g_nm and h_nm values for all m = [0,n]. Schmidt normalization here means the integral of |Ynm|^2 * dOmega over a unit sphere is 4pi/(2n+1) for all n and m. No Condon-Shortley phase.

Returns:

complex, shape(2,n_max+1,n_max+1). Complex induced magnetic moments for fully normalized spherical harmonics.

Return type:

Binm

MoonMag.asymmetry_funcs.get_CSpq_from_chipq(pmax, chipq, CSchange=True, noRenorm=False)
MoonMag.asymmetry_funcs.get_Deltanmi(n_max, p_max, nprm_max, n, n_bds, r_bds, Benm, asym_shape, Xid, aBar, Ad, TransferQts)
MoonMag.asymmetry_funcs.get_all_Xid(n_max, p_max, nprm_max, nprmvals, mprmvals, do_parallel=True, writeout=True, reload=False, fpath=None, fname=None)
MoonMag.asymmetry_funcs.get_apq_from_chipq(pvals, qvals, chipq)
MoonMag.asymmetry_funcs.get_chipq_from_CSpq(pmax, Cpq, Spq, CSchange=True)
MoonMag.asymmetry_funcs.get_chipq_from_CSpq_single(p, Cpq, Spq, CSchange=True)
MoonMag.asymmetry_funcs.get_chipq_from_apq(pvals, qvals, apq)
MoonMag.asymmetry_funcs.get_gh_from_Binm(n_max, Binm)
MoonMag.asymmetry_funcs.get_rsurf(pvals, qvals, asym_shape, r_mean, ltht, lphi, do_parallel=True)
MoonMag.asymmetry_funcs.get_series_terms(n_max, nprm_max, n, n_bds, TransferQts, R, Benm)
MoonMag.asymmetry_funcs.jdx(n, x)
MoonMag.asymmetry_funcs.jnx(n, x)
MoonMag.asymmetry_funcs.mpc_global
read_shape()

Get boundary shape parameters from disk. Usage: asym_shape = read_shape(n_bds, p_max, rscale, bodyname=None, relative=False, eps_scaled=None,

single_asym=None, concentric=True, fpath=None, r_bds=None, r_io=-2, append=””, convert_depth_to_chipq=False)

Returns:
asym_shape: complex, shape(n_bds,2,p_max+1,p_max+1). A list of absolute boundary shape parameters chi_pq

for each boundary in m, converted from values in km read from .txt files.

grav_shape: complex, shape(n_bds,2,p_max+1,p_max+1). Analogous to asym_shape, but due to tides deforming the

body surface. Kept separate from asym_shape to preserve ice shell thickness contours for comparison to prior work.

Parameters:

n_bds: integer. Number of conducting boundaries in the model (this is N). p_max: integer. Largest degree p in boundary shape. rscale: float. 1/R_body; used to scale absolute asymmetry values in making asym_shape arrays. bodyname: string (None). Body name as it appears in file names. If None, a generic file name will be searched for. relative: boolean (True). Optional argument to toggle whether chi_pq values are normalized

to bcdev (True) or give absolute coefficients for the deviations (False).

eps_scaled: float, shape(n_bds) (None). Maximum boundary deviation in km, for converting relative asym_shape values to absolute.

Required if relative = True.

single_asym: integer (None). If not None, apply asymmetry only to the boundary with this index. concentric: boolean (True). Optional argument to toggle whether to use the same spherical harmonic

coefficients for every boundary (concentric asymmetry). In this case, only a single file is read in. If concentric = True, r_bds is required.

fpath: string (None). Optional location to search for .txt files. Defaults to “interior/”. r_bds: float, shape(n_bds) (None). Boundary radii in m. Required if concentric = True. r_io: integer (-2). The index of r_bds corresponding to the ice-ocean interface, where asymmetry is expected to

be its most pronounced. Defaults to -2, i.e. no ionosphere. Set to -3 for the ice-ocean boundary when a symmetric ionosphere (one layer) is included.

append: string (“”). Optional string appended to file names. convert_depth_to_chipq: boolean (False). Optional flag to print relative chi_pq values to disk.

MoonMag.asymmetry_funcs.norm4pi(n, m)

Calculate normalization factor for 4pi-normalized spherical harmonics. :param n: int. Degree of spherical harmonic. :param m: int. Order of spherical harmonic.

Returns:

float. Normalization factor, not including any possible Condon-Shortley phase.

Return type:

norm

MoonMag.asymmetry_funcs.print_Xi_table(n_max, p_max, nprm_max)
MoonMag.asymmetry_funcs.print_Xid_table(Xid, n_max, p_max, nprm_max)
MoonMag.asymmetry_funcs.read_Benm(nprm_max, p_max, bodyname=None, fpath=None, synodic=False, orbital=False, limit_osc=None, model=None, fName=None)
MoonMag.asymmetry_funcs.read_shape(n_bds, p_max, rscale, bodyname=None, relative=False, eps_scaled=None, single_asym=None, concentric=True, fpath=None, r_bds=None, r_io=-2, append='', convert_depth_to_chipq=False)
MoonMag.asymmetry_funcs.spherharm4pi(n, m, ltht, lphi)

Determines the 4pi-normalized surface spherical harmonic without the Condon-Shortley phase. :param n: int. Degree of spherical harmonic to evaluate. :param m: int. Order of spherical harmonic to evaluate. :param ltht: float, shape(lleny). 1D list along theta at which to evaluate. :param lphi: float, shape(llenx). 1D list along phi at which to evaluate.

Returns:

float, shape(lleny, llenx). Real surface spherical harmonics in 4pi normalization

for input n, m. cSnm is the cos of tesseral part and sSnm is the sin part.

Return type:

cSnm, sSnm

MoonMag.asymmetry_funcs.validate(r_bds, sigmas, bcdev, asym_shape, p_max)
MoonMag.asymmetry_funcs.w_M(n, m)
MoonMag.asymmetry_funcs.w_P(n, m)
MoonMag.asymmetry_funcs.ydx(n, x)
MoonMag.asymmetry_funcs.ynx(n, x)