Commit 4bcd2134 authored by Theo Steininger's avatar Theo Steininger
Browse files

Reset parameter defaults for Jaffe13 model.

parent ad6df122
......@@ -84,8 +84,8 @@ class EnsembleLikelihood(Likelihood):
result_1 = -c.dot(first_summand)
result_2 = -c.dot(second_summand)
result = result_1 + result_2
self.logger.debug("Calculated: %f + %f = %f" %
(result_1, result_2, result))
self.logger.debug("Calculated %i of %i: %f + %f = %f" %
(i, k, result_1, result_2, result))
result_array[i] = result
total_result = result_array.mean()
......
......@@ -8,7 +8,7 @@ class Jaffe13MagneticField(MagneticField):
def parameter_list(self):
parameter_list = ['B_f_ord', 'B_field_alpha', 'B_field_cutoff',
'B_ran_b2', 'B_ran_h_d', 'B_ran_h_d2', 'B_ran_h_r',
'B_ran_h_r2', 'b1_Psi_0', 'bb_amps_0', 'bb_amps_1',
'B_ran_h_r2', 'bb_amps_0', 'bb_amps_1',
'bb_amps_2', 'bb_amps_3', 'bb_amps_4', 'bb_bar_a',
'bb_bar_boa', 'bb_bar_phi0_deg', 'bb_cr0_coh',
'bb_cr0_iso', 'bb_cr0_ord', 'bb_d0_iso', 'bb_d0',
......@@ -16,9 +16,8 @@ class Jaffe13MagneticField(MagneticField):
'bb_disk_b0', 'bb_disk_h_d', 'bb_halo_b0',
'bb_halo_h_d', 'bb_phi0_deg', 'bb_pitch_biso',
'bb_pitch', 'bb_r_compconst', 'bb_r_innercut',
'bb_r_peak', 'bb_r_peak', 'bb_r_scale',
'bb_rmax_arms', 'bb_spiral_cpow', 'bb_spiral_h_d',
'bb_spiral_h_d']
'bb_r_peak', 'bb_r_scale', 'bb_rmax_arms',
'bb_spiral_cpow', 'bb_spiral_h_d']
return parameter_list
def _create_field(self):
......
......@@ -13,43 +13,44 @@ class Jaffe13MagneticFieldFactory(MagneticFieldFactory):
@property
def _initial_parameter_defaults(self):
defaults = {'B_f_ord': 0.,
defaults = {'B_f_ord': 0.5,
'B_field_RMS_uG': 1.,
'B_field_alpha': -2.37,
'B_field_cutoff': 5.,
'B_ran_b2': 0.,
'B_ran_h_d': 1.,
'B_ran_b2': 0.1,
'B_ran_h_d': 4.,
'B_ran_h_d2': 1.,
'B_ran_h_r': 10.,
'B_ran_h_r2': 10.,
'bb_amps_0': 1.,
'bb_amps_1': 1.,
'bb_amps_2': -1.,
'bb_amps_3': 1.,
'bb_amps_4': -1.,
'B_ran_h_r': 15.,
'B_ran_h_r2': 15.,
'bb_amps_0': 2.,
'bb_amps_1': 0.133,
'bb_amps_2': -3.78,
'bb_amps_3': 0.32,
'bb_amps_4': -0.023,
'bb_bar_a': 0.,
'bb_bar_boa': 1.,
'bb_bar_phi0_deg': 45.,
'bb_cr0_coh': 1.,
'bb_cr0_iso': 1.,
'bb_cr0_ord': 1.,
'bb_cr0_coh': 0.5,
'bb_cr0_iso': 0.3,
'bb_cr0_ord': 0.5,
'bb_d0_iso': 0.3,
'bb_d0': 0.3,
'bb_delta_phi_iso_deg': 0.,
'bb_delta_phi_ord_deg': 0.,
'bb_disk_b0': 1.,
'bb_disk_h_d': 1.,
'bb_halo_b0': 1.,
'bb_halo_h_d': 4.,
'bb_phi0_deg': 65.,
'bb_pitch_biso': -11.5,
'bb_disk_b0': 0.167,
'bb_disk_h_d': 0.1,
'bb_halo_b0': 1.38,
'bb_halo_h_d': 3.,
'bb_phi0_deg': 70.,
'bb_pitch_biso': -11.,
'bb_pitch': -11.5,
'bb_r_compconst': 10.,
'bb_r_compconst': 12.,
'bb_r_innercut': 0.5,
'bb_r_peak': -1.,
'bb_r_scale': 13.2,
'bb_rmax_arms': 15.,
'bb_r_scale': 20.,
'bb_rmax_arms': 30.,
'bb_spiral_cpow': 3.,
'bb_spiral_h_d': 0.5,
'bb_spiral_h_d': 0.1,
}
return defaults
......@@ -59,44 +60,44 @@ class Jaffe13MagneticFieldFactory(MagneticFieldFactory):
return self._generate_variable_to_parameter_mapping_defaults(n=3)
def _generate_variable_to_parameter_mapping_defaults(self, n):
defaults = {'B_f_ord': self._interval(0, 1, n),
defaults = {'B_f_ord': self._interval(0.5, 1, n),
'B_field_RMS_uG': self._interval(1., 0.3, n),
'B_field_alpha': self._interval(-2.37, 1., n),
'B_field_cutoff': self._interval(5., 1., n),
'B_ran_b2': self._interval(0., 1., n),
'B_ran_h_d': self._interval(1., 1., n),
'B_ran_b2': self._interval(0.1, 1., n),
'B_ran_h_d': self._interval(4., 1., n),
'B_ran_h_d2': self._interval(1., 1., n),
'B_ran_h_r': self._interval(10., 3., n),
'B_ran_h_r2': self._interval(10., 3., n),
'bb_amps_0': self._interval(1., 1., n),
'bb_amps_1': self._interval(1., 1., n),
'bb_amps_2': self._interval(-1., 1., n),
'bb_amps_3': self._interval(1., 1., n),
'bb_amps_4': self._interval(-1., 1., n),
'B_ran_h_r': self._interval(15., 5., n),
'B_ran_h_r2': self._interval(15., 5., n),
'bb_amps_0': self._interval(2., 1., n),
'bb_amps_1': self._interval(0.133, 1., n),
'bb_amps_2': self._interval(-3.78, 1., n),
'bb_amps_3': self._interval(0.32, 1., n),
'bb_amps_4': self._interval(-0.023, 1., n),
'bb_bar_a': self._interval(0., 1., n),
'bb_bar_boa': self._interval(1., 1., n),
'bb_bar_phi0_deg': self._interval(45., 15., n),
'bb_cr0_coh': self._interval(1., 1., n),
'bb_cr0_iso': self._interval(1., 1., n),
'bb_cr0_ord': self._interval(1., 1., n),
'bb_cr0_coh': self._interval(0.5, 1., n),
'bb_cr0_iso': self._interval(0.3, 1., n),
'bb_cr0_ord': self._interval(0.5, 1., n),
'bb_d0_iso': self._interval(0.3, 0.1, n),
'bb_d0': self._interval(0.3, 0.1, n),
'bb_delta_phi_iso_deg': self._interval(0., 1., n),
'bb_delta_phi_ord_deg': self._interval(0., 1., n),
'bb_disk_b0': self._interval(1., 1., n),
'bb_disk_h_d': self._interval(1., 1., n),
'bb_halo_b0': self._interval(1., 1., n),
'bb_halo_h_d': self._interval(4., 1., n),
'bb_phi0_deg': self._interval(65., 20., n),
'bb_pitch_biso': self._interval(-11.5, 5., n),
'bb_disk_b0': self._interval(0.167, 1., n),
'bb_disk_h_d': self._interval(0.1, 1., n),
'bb_halo_b0': self._interval(1.38, 1., n),
'bb_halo_h_d': self._interval(3., 1., n),
'bb_phi0_deg': self._interval(70., 20., n),
'bb_pitch_biso': self._interval(-11, 5., n),
'bb_pitch': self._interval(-11.5, 5., n),
'bb_r_compconst': self._interval(10., 3., n),
'bb_r_compconst': self._interval(12., 3., n),
'bb_r_innercut': self._interval(0.5, 1., n),
'bb_r_peak': self._interval(-1., 1., n),
'bb_r_scale': self._interval(13.2, 4., n),
'bb_rmax_arms': self._interval(15., 5., n),
'bb_r_scale': self._interval(20., 4., n),
'bb_rmax_arms': self._interval(30., 5., n),
'bb_spiral_cpow': self._interval(3., 1., n),
'bb_spiral_h_d': self._interval(0.5, 1., n),
}
'bb_spiral_h_d': self._interval(0.1, 1., n),
}
return defaults
......@@ -13,7 +13,8 @@ class JF12MagneticFieldFactory(MagneticFieldFactory):
@property
def _initial_parameter_defaults(self):
defaults = {'b51_ran_b1': 10.8,
defaults = {'B_field_RMS_uG': 1.,
'b51_ran_b1': 10.8,
'b51_ran_b2': 6.96,
'b51_ran_b3': 9.59,
'b51_ran_b4': 6.96,
......@@ -51,6 +52,7 @@ class JF12MagneticFieldFactory(MagneticFieldFactory):
def _generate_variable_to_parameter_mapping_defaults(self, n):
defaults = {
'B_field_RMS_uG': self._interval(1., 0.3, n),
'b51_ran_b1': self._interval(10.8, 2.33, n), # b_1, 1210.7820
'b51_ran_b2': self._interval(6.96, 1.58, n), # b_2, 1210.7820
'b51_ran_b3': self._interval(9.59, 1.10, n), # b_3, 1210.7820
......
......@@ -25,6 +25,11 @@ class Hammurapy(Observer):
self.last_call_log = ""
sync_template_fname = os.path.join(self.conf_directory,
'IQU_sync.fits')
dust_template_fname = os.path.join(self.conf_directory,
'IQU_dust.fits')
self.basic_parameters = {'obs_shell_index_numb': '1',
'total_shell_numb': '3',
'vec_size_R': '500',
......@@ -42,7 +47,9 @@ class Hammurapy(Observer):
'do_dust': 'F',
'do_tau': 'F',
'do_ff': 'F',
'obs_freq_GHz': '23'
'obs_freq_GHz': '23',
'sync_template_fname': sync_template_fname,
'dust_template_fname': dust_template_fname
}
@abc.abstractproperty
......
# -*- coding: utf-8 -*-
from jaffe13_mixin import Jaffe13Mixin
from jf12_mixin import JF12Mixin
......@@ -13,7 +13,6 @@ class Jaffe13Mixin(object):
'B_field_interp': 'T',
'use_B_analytic': 'F',
'B_ran_mem_lim': '4',
'bb_molr_aniso': 'T',
'bb_ord_interarm': 'T',
'bb_scale_coh_amps': 'T',
......
......@@ -9,7 +9,6 @@ class JF12Mixin(object):
self.__parameter_dict = {'B_field_type': '7',
'B_field_do_random': 'T',
'B_analytic_beta': '1.36',
'B_field_RMS_uG': '1',
'B_field_interp': 'T',
'use_B_analytic': 'F',
'B_ran_mem_lim': '4'}
......
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