galmag.B_generators package

Submodules

galmag.B_generators.B_generator module

class galmag.B_generators.B_generator.B_generator(grid=None, box=None, resolution=None, grid_type='cartesian', default_parameters={}, dtype=<type 'float'>)[source]

Bases: object

Base class for B-field generators

Note

This class does not work on its own.

get_B_field()[source]

galmag.B_generators.B_generator_disk module

class galmag.B_generators.B_generator_disk.B_generator_disk(grid=None, box=None, resolution=None, grid_type='cartesian', default_parameters={}, dtype=<type 'float'>)[source]

Bases: galmag.B_generators.B_generator.B_generator

Generator for the disk field

Parameters:
  • box (3x2-array_like) – Box limits
  • resolution (3-array_like) – containing the resolution along each axis.
  • grid_type (str, optional) – Choice between ‘cartesian’, ‘spherical’ and ‘cylindrical’ uniform coordinate grids. Default: ‘cartesian’
  • dtype (numpy.dtype, optional) – Data type used. Default: np.dtype(np.float)
find_B_field(B_phi_solar_radius=-3.0, reversals=None, number_of_modes=0, **kwargs)[source]

Constructs B_field objects for the disk field based on constraints.

Parameters:
  • B_phi_solar_radius (float) – Magnetic field intensity at the solar radius. Default: -3
  • reversals (list_like) – a list containing the r-positions of field reversals over the midplane (units consitent with the grid).
  • number_of_modes (int, optional) – Minimum of modes to be used. NB: modes_count = max(number_of_modes, len(reversals)+1)

Note

Other disc parameters should be specified as keyword arguments.

Returns:The computed disc component.
Return type:B_field_component
get_B_field(**kwargs)[source]

Computes a B_field object containing the specified disk field.

Parameters:disk_modes_normalization (array_like) – array of coefficients for the disc modes

Note

Other disc parameters should be specified as keyword arguments.

Returns:The computed disc component.
Return type:B_field_component

galmag.B_generators.B_generator_halo module

class galmag.B_generators.B_generator_halo.B_generator_halo(grid=None, box=None, resolution=None, grid_type='cartesian', default_parameters={}, dtype=<type 'float'>)[source]

Bases: galmag.B_generators.B_generator.B_generator

Generator for the halo field

Parameters:
  • box (3x2-array_like) – Box limits
  • resolution (3-array_like) – containing the resolution along each axis.
  • grid_type (str, optional) – Choice between ‘cartesian’, ‘spherical’ and ‘cylindrical’ uniform coordinate grids. Default: ‘cartesian’
  • dtype (numpy.dtype, optional) – Data type used. Default: np.dtype(np.float)
get_B_field(**kwargs)[source]

Constructs a B_field component object containing a solution of the dynamo equation for the halo field.

Module contents