Commit 57fde4d0 authored by Theo Steininger's avatar Theo Steininger

Adjusted Hammurapy parameters. Modified carrier_mapper.py

parent b27108cd
......@@ -33,9 +33,12 @@ def infinity_mapper(x, a=-np.inf, m=0, b=np.inf):
return y
def unity_mapper(x, a=0, b=1):
def unity_mapper(x, a=0, m=0.5, b=1):
"""
Maps x from [0, 1] into the interval [a, b]
"""
# rescale and shift
return x * (b-a) + a
if x <= 0.5:
return 2*x * (m-a) + m
else:
return (2*x-1) * (b-m) + b
......@@ -111,6 +111,7 @@ class MagneticFieldFactory(Loggable, object):
mapping = self.variable_to_parameter_mappings[variable_name]
mapped_variable = unity_mapper(variables[variable_name],
a=mapping[0],
m=mapping[1],
b=mapping[2])
# mapped_variable = carrier_mapper(variables[variable_name],
# a=mapping[0],
......
......@@ -32,6 +32,6 @@ class WMAP3yrMagneticFieldFactory(MagneticFieldFactory):
'B_field_psi0': self._positive_interval(27.0, 5.0, n), # psi0 astro-ph/0603450
'B_field_psi1': self._positive_interval(0.9, 5.0, n), # psi1 astro-ph/0603450
'B_field_xsi0': self._positive_interval(25, 5.0, n), # xsi0 astro-ph/0603450
'B_field_RMS_uG': self._positive_interval(1.0, 1.0, n)
'B_field_RMS_uG': self._positive_interval(1.0, 2.0, n)
}
return defaults
......@@ -36,16 +36,16 @@ class Hammurapy(Observer):
self.basic_parameters = {'B_ran_mem_lim': '6',
'obs_shell_index_numb': '1',
'total_shell_numb': '1',
'vec_size_R': '500',
'vec_size_R': '400',
'max_radius': '30',
'max_z': '15',
'max_z': '10',
'B_field_transform_lon': '-999',
'B_field_transform_lat': '-999',
'TE_grid_filename': 'negrid_n400.bin',
'TE_nx': '400',
'TE_ny': '400',
'TE_nz': '80',
'TE_interp': 'F',
'TE_interp': 'T',
'do_sync_emission': 'F',
'do_rm': 'F',
'do_dm': 'F',
......
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