Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
N
NIFTy
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
13
Issues
13
List
Boards
Labels
Service Desk
Milestones
Merge Requests
8
Merge Requests
8
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
ift
NIFTy
Commits
7d6c6bc5
Commit
7d6c6bc5
authored
Sep 12, 2017
by
Martin Reinecke
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
cosmetics
parent
635e4bc6
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
67 additions
and
66 deletions
+67
-66
nifty2go/plotting/plot.py
nifty2go/plotting/plot.py
+66
-64
nifty2go/spaces/power_space/power_space.py
nifty2go/spaces/power_space/power_space.py
+1
-2
No files found.
nifty2go/plotting/plot.py
View file @
7d6c6bc5
...
...
@@ -82,6 +82,7 @@ def _limit_xy(**kwargs):
y2
=
kwargs
.
get
(
"ymax"
)
plt
.
axis
((
x1
,
x2
,
y1
,
y2
))
def
_register_cmaps
():
try
:
if
_register_cmaps
.
_cmaps_registered
:
...
...
@@ -91,45 +92,45 @@ def _register_cmaps():
from
matplotlib.colors
import
LinearSegmentedColormap
import
matplotlib.pyplot
as
plt
planckcmap
=
{
'red'
:
((
0.0
,
0.0
,
0.0
),
(
0.4
,
0.0
,
0.0
),
(
0.5
,
1.0
,
1.0
),
(
0.7
,
1.0
,
1.0
),
(
0.8
,
0.83
,
0.83
),
(
0.9
,
0.67
,
0.67
),
(
1.0
,
0.5
,
0.5
)),
'green'
:((
0.0
,
0.0
,
0.0
),
(
0.2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
0.667
,
0.5
,
0.5
),
(
0.833
,
1.0
,
1.0
),
(
1.0
,
1.0
,
1.0
)),
'blue'
:
((
0.0
,
0.0
,
0.0
),
'blue'
:
((
0.0
,
0.0
,
0.0
),
(
0.167
,
1.0
,
1.0
),
(
0.333
,
0.5
,
0.5
),
(
0.5
,
0.0
,
0.0
),
(
1.0
,
1.0
,
1.0
))
}
fd_cmap
=
{
'red'
:
((
0.0
,
0.35
,
0.35
),
(
1.0
,
1.0
,
1.0
))}
fd_cmap
=
{
'red'
:
((
0.0
,
0.35
,
0.35
),
(
0.1
,
0.4
,
0.4
),
(
0.2
,
0.25
,
0.25
),
(
0.41
,
0.47
,
0.47
),
...
...
@@ -140,7 +141,7 @@ def _register_cmaps():
(
0.8
,
0.8
,
0.8
),
(
0.9
,
0.5
,
0.5
),
(
1.0
,
0.4
,
0.4
)),
'green'
:
((
0.0
,
0.0
,
0.0
),
'green'
:
((
0.0
,
0.0
,
0.0
),
(
0.2
,
0.0
,
0.0
),
(
0.362
,
0.88
,
0.88
),
(
0.5
,
1.0
,
1.0
),
...
...
@@ -148,7 +149,7 @@ def _register_cmaps():
(
0.8
,
0.25
,
0.25
),
(
0.9
,
0.3
,
0.3
),
(
1.0
,
0.2
,
0.2
)),
'blue'
:
((
0.0
,
0.35
,
0.35
),
'blue'
:
((
0.0
,
0.35
,
0.35
),
(
0.1
,
0.4
,
0.4
),
(
0.2
,
0.8
,
0.8
),
(
0.26
,
0.8
,
0.8
),
...
...
@@ -157,43 +158,43 @@ def _register_cmaps():
(
0.5
,
0.8
,
0.8
),
(
0.59
,
0.47
,
0.47
),
(
0.8
,
0.0
,
0.0
),
(
1.0
,
0.0
,
0.0
))
}
fdu_cmap
=
{
'red'
:
((
0.0
,
1.0
,
1.0
),
(
0.1
,
0.8
,
0.8
),
(
0.2
,
0.65
,
0.65
),
(
0.41
,
0.6
,
0.6
),
(
0.5
,
0.7
,
0.7
),
(
0.56
,
0.96
,
0.96
),
(
0.59
,
1.0
,
1.0
),
(
0.74
,
0.8
,
0.8
),
(
0.8
,
0.8
,
0.8
),
(
0.9
,
0.5
,
0.5
),
(
1.0
,
0.4
,
0.4
)),
'green'
:((
0.0
,
0.9
,
0.9
),
(
0.2
,
0.65
,
0.65
),
(
0.362
,
0.95
,
0.95
),
(
0.5
,
1.0
,
1.0
),
(
0.638
,
0.88
,
0.88
),
(
0.8
,
0.25
,
0.25
),
(
0.9
,
0.3
,
0.3
),
(
1.0
,
0.2
,
0.2
)),
'blue'
:
((
0.0
,
1.0
,
1.0
),
(
0.1
,
0.8
,
0.8
),
(
0.2
,
1.0
,
1.0
),
(
0.41
,
1.0
,
1.0
),
(
0.44
,
0.96
,
0.96
),
(
0.5
,
0.7
,
0.7
),
(
0.59
,
0.42
,
0.42
),
(
0.8
,
0.0
,
0.0
),
(
1.0
,
0.0
,
0.0
))
}
pm_cmap
=
{
'red'
:
((
0.0
,
1.0
,
1.0
),
(
1.0
,
0.0
,
0.0
))}
fdu_cmap
=
{
'red'
:
((
0.0
,
1.0
,
1.0
),
(
0.1
,
0.8
,
0.8
),
(
0.2
,
0.65
,
0.65
),
(
0.41
,
0.6
,
0.6
),
(
0.5
,
0.7
,
0.7
),
(
0.56
,
0.96
,
0.96
),
(
0.59
,
1.0
,
1.0
),
(
0.74
,
0.8
,
0.8
),
(
0.8
,
0.8
,
0.8
),
(
0.9
,
0.5
,
0.5
),
(
1.0
,
0.4
,
0.4
)),
'green'
:
((
0.0
,
0.9
,
0.9
),
(
0.2
,
0.65
,
0.65
),
(
0.362
,
0.95
,
0.95
),
(
0.5
,
1.0
,
1.0
),
(
0.638
,
0.88
,
0.88
),
(
0.8
,
0.25
,
0.25
),
(
0.9
,
0.3
,
0.3
),
(
1.0
,
0.2
,
0.2
)),
'blue'
:
((
0.0
,
1.0
,
1.0
),
(
0.1
,
0.8
,
0.8
),
(
0.2
,
1.0
,
1.0
),
(
0.41
,
1.0
,
1.0
),
(
0.44
,
0.96
,
0.96
),
(
0.5
,
0.7
,
0.7
),
(
0.59
,
0.42
,
0.42
),
(
0.8
,
0.0
,
0.0
),
(
1.0
,
0.0
,
0.0
))
}
pm_cmap
=
{
'red'
:
((
0.0
,
1.0
,
1.0
),
(
0.1
,
0.96
,
0.96
),
(
0.2
,
0.84
,
0.84
),
(
0.3
,
0.64
,
0.64
),
(
0.4
,
0.36
,
0.36
),
(
0.5
,
0.0
,
0.0
),
(
1.0
,
0.0
,
0.0
)),
'green'
:
((
0.0
,
0.5
,
0.5
),
'green'
:
((
0.0
,
0.5
,
0.5
),
(
0.1
,
0.32
,
0.32
),
(
0.2
,
0.18
,
0.18
),
(
0.3
,
0.08
,
0.08
),
...
...
@@ -204,18 +205,19 @@ def _register_cmaps():
(
0.8
,
0.18
,
0.18
),
(
0.9
,
0.32
,
0.32
),
(
1.0
,
0.5
,
0.5
)),
'blue'
:
((
0.0
,
0.0
,
0.0
),
'blue'
:
((
0.0
,
0.0
,
0.0
),
(
0.5
,
0.0
,
0.0
),
(
0.6
,
0.36
,
0.36
),
(
0.7
,
0.64
,
0.64
),
(
0.8
,
0.84
,
0.84
),
(
0.9
,
0.96
,
0.96
),
(
1.0
,
1.0
,
1.0
))
}
(
1.0
,
1.0
,
1.0
))}
plt
.
register_cmap
(
cmap
=
LinearSegmentedColormap
(
"Planck-like"
,
planckcmap
))
plt
.
register_cmap
(
cmap
=
LinearSegmentedColormap
(
"High Energy"
,
he_cmap
))
plt
.
register_cmap
(
cmap
=
LinearSegmentedColormap
(
"Faraday Map"
,
fd_cmap
))
plt
.
register_cmap
(
cmap
=
LinearSegmentedColormap
(
"Faraday Uncertainty"
,
fdu_cmap
))
plt
.
register_cmap
(
cmap
=
LinearSegmentedColormap
(
"Faraday Uncertainty"
,
fdu_cmap
))
plt
.
register_cmap
(
cmap
=
LinearSegmentedColormap
(
"Plus Minus"
,
pm_cmap
))
...
...
nifty2go/spaces/power_space/power_space.py
View file @
7d6c6bc5
...
...
@@ -156,8 +156,7 @@ class PowerSpace(Space):
key
=
(
harmonic_partner
,
binbounds
)
if
self
.
_powerIndexCache
.
get
(
key
)
is
None
:
distance_array
=
\
self
.
harmonic_partner
.
get_distance_array
()
distance_array
=
self
.
harmonic_partner
.
get_distance_array
()
temp_pindex
=
self
.
_compute_pindex
(
harmonic_partner
=
self
.
harmonic_partner
,
distance_array
=
distance_array
,
...
...
Write
Preview
Markdown
is supported
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