Commit 5532fc9d authored by Theo Steininger's avatar Theo Steininger

Refactored for pep8 compliance.

parent e3707e06
......@@ -7,9 +7,9 @@ class WMAP3yrMagneticField(MagneticField):
@property
def parameter_list(self):
parameter_list = ['B_field_b0',
'B_field_psi0_deg',
'B_field_psi1_deg',
'B_field_xsi0_deg']
'B_field_psi0_deg',
'B_field_psi1_deg',
'B_field_xsi0_deg']
return parameter_list
def _create_field(self):
......
......@@ -14,11 +14,11 @@ class WMAP3yrMagneticFieldFactory(MagneticFieldFactory):
@property
def _initial_parameter_defaults(self):
defaults = {
'B_field_b0': 6,
'B_field_psi0_deg': 27,
'B_field_psi1_deg': 0.9,
'B_field_xsi0_deg': 25
}
'B_field_b0': 6,
'B_field_psi0_deg': 27,
'B_field_psi1_deg': 0.9,
'B_field_xsi0_deg': 25
}
return defaults
@property
......@@ -27,9 +27,9 @@ class WMAP3yrMagneticFieldFactory(MagneticFieldFactory):
def _generate_variable_to_parameter_mapping_defaults(self, n):
defaults = {
'B_field_b0': self._positive_interval(6.0, 2.0, n), # b0
'B_field_psi0': self._positive_interval(27.0, 5.0, n), #psi0
'B_field_psi1': self._positive_interval(0.9, 5.0, n), #psi1
'B_field_xsi0': self._positive_interval(25, 5.0, n), #xsi0
}
'B_field_b0': self._positive_interval(6.0, 2.0, n), # b0
'B_field_psi0': self._positive_interval(27.0, 5.0, n), # psi0
'B_field_psi1': self._positive_interval(0.9, 5.0, n), # psi1
'B_field_xsi0': self._positive_interval(25, 5.0, n), # xsi0
}
return defaults
......@@ -2,33 +2,34 @@
from imagine.magnetic_fields.wmap3yr_magnetic_field import WMAP3yrMagneticField
class WMAP3yrMixin(object):
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',
'B_field_RMS_uG': '1.0',
'B_field_z_antisym': '0',
}
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)
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',
'B_field_RMS_uG': '1.0',
'B_field_z_antisym': '0',
}
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)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment