Magnetic field models for the Milky Way

At the moment, two models of the coherent component of Galactic magnetic field are available. Typically, the coherence length of the turbulent component is too small to induce large scale photon-ALP oscillations at gamma-ray energies and hence only the coherent components are considered here.

The two models are the ones described in detail in [Pshirkov2011] and [Jansson2012]. For the Jansson & Farrar model [Jansson2012], also the updates from measurements with the Planck satellite are available [Planck2016].

Reference / API

class gammaALPs.bfields.gmf.GMF(model='jansson12')[source]

Bases: object

Class with analytical functions that describe the galactic magnetic field according to the model of Jannson & Farrar (2012)

Only the regular field components are implemented. The striated field component is absent.

Rsun

Assumed position of the sun along the x axis in kpc

Type:

float

bring

field strength in ring at 3 kpc < rho < 5 kpc

Type:

float

bring_unc

associated uncertainty of field strength in ring at 3 kpc < rho < 5 kpc

Type:

float

hdisk

disk/halo transition height

Type:

float hdisk_unc: float,

hdisk_unc

associated uncertainty disk/halo transition height

Type:

float

wdisk

transition width

Type:

float

wdisk_unc

associated uncertainty of transition width

Type:

float, wdisk_unc: floats,

b

arrays with field strengths of spiral arms at 5 kpc

Type:

ndarray

b_unc

associated uncertainties with field strengths of spiral arms at 5 kpc

Type:

ndarray

f_cov

relative cross-sectional areas of the spirals (for a fixed radius)

Type:

ndarray

rx

dividing lines of spiral arms, coordinates of neg. x-axes that intersect with arm

Type:

ndarray

idisk

spiral arms opening angle

Type:

float

bn, bn_unc

field strength northern halo

Type:

float

bn_unc

associated uncertainty of field strength northern halo

Type:

float

Bs

field strength southern halo

Type:

float

Bs_unc

associated uncertainty of field strength southern halo

Type:

float

rhon

transition radius in northern hemisphere

Type:

float

rhon_unc

associated uncertainty of transition radius in northern hemisphere

Type:

float

rhos

transition radius in southern heisphere

Type:

float

rhos_unc

associated uncertainty of transition radius in southern hemisphere

Type:

float

whalo

transition width

Type:

float

whalo_unc

associated uncertainty of transition width

Type:

float

z0

vertical scale height

Type:

float

z0_unc

associated uncertainty of vertical scale height

Type:

float

BX0

field strength at origin of X component

Type:

float

BX0_unc

associated uncertainty of field strength at origin of X component

Type:

float

ThetaX0

elev. angle at z = 0, rho > rhoXc

Type:

float

ThetaX0_unc

associated uncertainty of elev. angle at z = 0, rho > rhoXc

Type:

float

rhoXc

radius where thetaX = thetaX0

Type:

float

rhoXc_unc

associated uncertainty of radius where thetaX = thetaX0

Type:

float

rhoX

exponential scale length

Type:

float,

rhoX_unc

associated uncertainty of exponential scale length

Type:

float,

gamma

striation and / or rel. elec. number dens. rescaling

Type:

float

gamma_unc

associated uncertainty striation and / or rel. elec. number dens. rescaling

Type:

float

Notes

see http://adsabs.harvard.edu/abs/2012ApJ…757…14J Jansson & Farrar (2012)

BX(rho, z)[source]

X (out of plane) component of galactic magnetic field in galactocentric cylindrical coordinates (rho,phi,z)

BX is purely poloidal, i.e. phi component = 0

Parameters:
  • rho (array-like) – N-dim array with distance from origin in GC cylindrical coordinates, is in kpc

  • z (array-like) – N-dim array with height in kpc in GC cylindrical coordinates

Returns:

BX, BX_abs – tuple containing the magnetic field of the X component as a (3,N)-dim array with (rho,phi,z) components of disk field for each coordinate tuple and absolute value of the field as N-dim array

Return type:

tuple of ndarray

Bdisk(rho, phi, z)[source]

Disk component of galactic magnetic field in galactocentric cylindrical coordinates (rho,phi,z)

Parameters:
  • rho (array-like) – N-dim array with distance from origin in GC cylindrical coordinates, is in kpc

  • z (array-like) – N-dim array with height in kpc in GC cylindrical coordinates

  • phi (array-like) – N-dim array with polar angle in GC cylindircal coordinates, in radian

Returns:

Bdisk, Bdisk_abs – tuple containing the magnetic field of the disk as a (3,N)-dim array with (rho,phi,z) components of disk field for each coordinate tuple and absolute value of the field as N-dim array

Return type:

tuple of ndarray

Bhalo(rho, z)[source]

Halo component of galactic magnetic field in galactocentric cylindrical coordinates (rho,phi,z)

Bhalo is purely azimuthal (toroidal), i.e. has only a phi component

Parameters:
  • rho (array-like) – N-dim array with distance from origin in GC cylindrical coordinates, is in kpc

  • z (array-like) – N-dim array with height in kpc in GC cylindrical coordinates

Returns:

Bhalo, Bhalo_abs – tuple containing the magnetic field of the halo as a (3,N)-dim array with (rho,phi,z) components of disk field for each coordinate tuple and absolute value of the field as N-dim array

Return type:

tuple of ndarray

L(z, h, w)[source]

Transition function, see Jansson & Farrar Eq. 5

Parameters:
  • z (float or array-like) – array with positions (height above disk, z; distance from center, rho)

  • h (float) – height parameter

  • w (float) – width parameter

Returns:

L – array or float (depending on z input) with transition function values

Return type:

ndarray

__init__(model='jansson12')[source]

Init the GMF class, all B-field values are in muG

Parameters:

model (str) – either jansson12, jansson12b, or jansson12c, where jansson12 is the original model and the other two options are the modifications of the model with Planck data, see http://arxiv.org/abs/1601.00546

r_log_spiral(phi)[source]

return distance from center for angle phi of logarithmic spiral

Parameters:

phi (scalar or array-like) – polar angle values

Returns:

result – logarithmic spiral result with r(phi) = rx * exp(b * phi) as an array

Return type:

ndarray

Notes

see http://en.wikipedia.org/wiki/Logarithmic_spiral

class gammaALPs.bfields.gmf.GMFPshirkov(model='ASS')[source]

Bases: object

Class with analytical functions that describe the galactic magnetic field according to the model of Pshirkov et al. (2011)

Only the regular field components are implemented.

Rsun

position of the sun in kpc along x axis

Type:

float

p

pitch angle, dictionary with entries ‘ASS’ and ‘BSS’, in radian

Type:

dict

z0

height of disk in kpc

Type:

float

d

value if field reversal in kpc

Type:

float

B0

Value of B field at position of the sun, in muG

Type:

float

z0n

position of northern halo in kpc

Type:

float

Bn

northern halo field in muG

Type:

float

r0n

northern halo

Type:

float

z1n

scale height of halo toward galactic plane, |z| < z0n

Type:

float

z2n

scale height of northern halo away from galactic plane, |z| >= z0n

Type:

float

z0s

position of southern halo in kpc

Type:

float

Bs

southern halo field in muG

Type:

float

r0s

southern halo

Type:

float

z1s

scale height of southern halo toward galactic plane, |z| < z0s

Type:

float

z2s

scale height of southern halo away from galactic plane, |z| >= z0n

Type:

float

Notes

Paper: http://adsabs.harvard.edu/abs/2011ApJ…738..192P Pshirkov et al. (2011)

Bdisk(rho, phi, z)[source]

Disk component of galactic magnetic field in galactocentric cylindrical coordinates (rho,phi,z)

Parameters:
  • rho (array-like) – N-dim array with distance from origin in GC cylindrical coordinates, is in kpc

  • phi (array-like) – N-dim array with polar angle in GC cylindircal coordinates, in radian

  • z (array-like) – N-dim array with height in kpc in GC cylindrical coordinates

Returns:

Bdisk, Bdisk_abs – tuple containing the magnetic field of the disk as a (3,N)-dim array with (rho,phi,z) components of disk field for each coordinate tuple and absolute value of the field as N-dim array

Return type:

tuple of ndarray

Notes

See Pshirkov et al. Eq. (3) - (5)

Bhalo(rho, z)[source]

Halo component of galactic magnetic field in galactocentric cylindrical coordinates (rho,phi,z)

Bhalo is purely azimuthal (toroidal), i.e. has only a phi component

Parameters:
  • rho (array-like) – N-dim array with distance from origin in GC cylindrical coordinates, is in kpc

  • z (array-like) – N-dim array with height in kpc in GC cylindrical coordinates

Returns:

Bhalo, Bhalo_abs – tuple containing the magnetic field of the halo as a (3,N)-dim array with (rho,phi,z) components of disk field for each coordinate tuple and absolute value of the field as N-dim array

Return type:

tuple of ndarray

__init__(model='ASS')[source]

Init the GMF class, all B-field values are in muG

Parameters:

model (string,) – either ASS or BSS for axissymmetric or bisymmetric model, respectively.

gammaALPs.bfields.gmf.signum(x)[source]

Return the sign of each entry of an array