wmap3yr_mixin.py 1.43 KB
Newer Older
Jiaxin Wang's avatar
Jiaxin Wang committed
1
2
3
4
# -*- coding: utf-8 -*-

from imagine.magnetic_fields.wmap3yr_magnetic_field import WMAP3yrMagneticField

5

Jiaxin Wang's avatar
Jiaxin Wang committed
6
class WMAP3yrMixin(object):
7
8
9
10
11
12
    def __init__(self, hammurabi_executable, conf_directory='./confs',
                 working_directory_base='.', nside=128,
                 analytic_ensemble_mean=False):

        self.__parameter_dict = {'B_field_type': '1',
                                 'B_field_do_random': 'T',
Theo Steininger's avatar
Theo Steininger committed
13
                                 'B_field_z_antisym': 'F',
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
                                 }
        super(WMAP3yrMixin, self).__init__(hammurabi_executable,
                                           conf_directory,
                                           working_directory_base,
                                           nside,
                                           analytic_ensemble_mean)

    @property
    def magnetic_field_class(self):
        return WMAP3yrMagneticField

    def _build_parameter_dict(self, parameter_dict, magnetic_field,
                              working_directory, local_ensemble_index):
        parameter_dict.update(self.__parameter_dict)

        parameter_dict.update(magnetic_field.parameters)

        super(WMAP3yrMixin, self)._build_parameter_dict(parameter_dict,
                                                        magnetic_field,
                                                        working_directory,
                                                        local_ensemble_index)