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
LAMBERT Jean-charles
uns_projects
Commits
00831b9e
Commit
00831b9e
authored
Jul 11, 2017
by
LAMBERT Jean-charles
Browse files
change colormap value for disk and bndry
parent
3682e23f
Changes
1
Hide whitespace changes
Inline
Side-by-side
py/modules/simulations/c2dplot.py
View file @
00831b9e
...
...
@@ -313,8 +313,8 @@ class C2dplot:
comp_cmap
[
'all'
]
=
'jet'
comp_cmap
[
'gas'
]
=
'jet'
comp_cmap
[
'stars'
]
=
'Paired'
comp_cmap
[
'disk'
]
=
'
Paired
'
comp_cmap
[
'bndry'
]
=
'
Paired
'
comp_cmap
[
'disk'
]
=
'
Set3
'
comp_cmap
[
'bndry'
]
=
'
hsv
'
comp_cmap
[
'halo'
]
=
'RdBu'
if
len
(
cmap
.
split
(
","
))
==
1
and
len
(
cmap
.
split
(
":"
))
==
1
:
# set same cmap for all components
...
...
@@ -456,17 +456,6 @@ class C2dplot:
y
=
pos
[:,
2
]
# z coordinates
nbody
=
x
.
size
## if (rho.size > 0) :
## rho = np.log(rho)
## else:
## rho = z
# center according COM
xcom
=
np
.
average
(
x
.
astype
(
np
.
float64
),
weights
=
mass
)
ycom
=
np
.
average
(
y
.
astype
(
np
.
float64
),
weights
=
mass
)
#zcom=np.average(z.astype(np.float64),weights=mass)
if
self
.
__vdebug
:
print
(
"COM = "
,
xcom
,
ycom
)
if
ok_center
:
x
-=
center_xy
[
0
]
...
...
@@ -475,9 +464,13 @@ class C2dplot:
else
:
y
-=
center_xz
[
1
]
else
:
# center according COM or COD if RHO exist
xcom
=
np
.
average
(
x
.
astype
(
np
.
float64
),
weights
=
mass
*
rho
)
ycom
=
np
.
average
(
y
.
astype
(
np
.
float64
),
weights
=
mass
*
rho
)
if
self
.
__vdebug
:
print
(
"COM = "
,
xcom
,
ycom
)
x
-=
xcom
y
-=
ycom
#z -= zcom
else
:
# there are no particles
x
=
np
.
empty
(
0
)
...
...
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