Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
ift
IMAGINE
Commits
57fde4d0
Commit
57fde4d0
authored
Sep 07, 2017
by
Theo Steininger
Browse files
Adjusted Hammurapy parameters. Modified carrier_mapper.py
parent
b27108cd
Changes
4
Show whitespace changes
Inline
Side-by-side
imagine/carrier_mapper.py
View file @
57fde4d0
...
...
@@ -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
imagine/magnetic_fields/magnetic_field/magnetic_field_factory.py
View file @
57fde4d0
...
...
@@ -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],
...
...
imagine/magnetic_fields/wmap3yr_magnetic_field/wmap3yr_magnetic_field_factory.py
View file @
57fde4d0
...
...
@@ -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
imagine/observers/hammurapy/hammurapy.py
View file @
57fde4d0
...
...
@@ -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'
:
'
5
00'
,
'vec_size_R'
:
'
4
00'
,
'max_radius'
:
'30'
,
'max_z'
:
'1
5
'
,
'max_z'
:
'1
0
'
,
'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'
,
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment