Skip to content

Commit b3f9c35

Browse files
authored
Normalize composition image for massive star (#3325)
fix color contrast add back link underlining
1 parent c1a89a1 commit b3f9c35

File tree

1 file changed

+14
-6
lines changed

1 file changed

+14
-6
lines changed

Exec/science/massive_star/analysis/massive_star_composition.py

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,13 @@
11
#!/usr/bin/env python
22

3+
'''
4+
This script creates a single PNG from a pltfile/
5+
coloring regions by RGB code for composition.
6+
Red is proportional to iron group elements,
7+
blue is proportional to silicon group,
8+
green is proportional to Mg24 and lighter elements.
9+
'''
10+
311
import matplotlib
412
matplotlib.use('agg')
513

@@ -84,17 +92,17 @@ def _light_nuclei(field, data):
8492

8593

8694
fig = plt.figure()
87-
fig.set_size_inches(12.0, 9.0)
95+
fig.set_size_inches(12.0, 6.0)
8896

89-
width_frac = 0.1
97+
# set this to 0.1 instead to zoom in to the core
98+
width_frac = 1
9099

91-
center=[xmin + 0.25*width_frac*L_x, yctr, 0.0*cm]
92-
width=[0.5*width_frac*L_x, width_frac*L_y]
100+
center=[xmin + 0.5*width_frac*L_x, yctr, 0.0*cm]
101+
width=[width_frac*L_x, width_frac*L_y, 0.0*cm]
93102

94103
slc = yt.SlicePlot(ds, "theta",
95104
fields=[("gas", "iron_group"), ("gas", "si_group"), ("gas", "light_nuclei")],
96-
center=[xmin + 0.25*width_frac*L_x, yctr, 0.0*cm],
97-
width=[0.5*width_frac*L_x, width_frac*L_y, 0.0*cm], fontsize="12")
105+
center=center, width=width, fontsize="12")
98106

99107
res = (1024, 512)
100108
frb = slc.data_source.to_frb(width[0], res, height=width[1]) #width, res)#, center=center)

0 commit comments

Comments
 (0)