constant_magnetic_field_factory.py 711 Bytes
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
# -*- coding: utf-8 -*-

import numpy as np

from imagine.magnetic_fields.magnetic_field.magnetic_field_factory \
    import MagneticFieldFactory

from constant_magnetic_field import ConstantMagneticField


class ConstantMagneticFieldFactory(MagneticFieldFactory):
    @property
    def magnetic_field_class(self):
        return ConstantMagneticField

    @property
    def _initial_parameter_defaults(self):
        defaults = {'b_x': 0,
                    'b_y': 0,
                    'b_z': 0}
        return defaults

    @property
    def _initial_variable_to_parameter_mappings(self):
25 26 27
        return {'b_x': [-100, 0, 100],
                'b_y': [-100, 0, 100],
                'b_z': [-100, 0, 100]}