Professional Documents
Culture Documents
ReportGalacticDynamics Jesus Sevilla PHY3111
ReportGalacticDynamics Jesus Sevilla PHY3111
ReportGalacticDynamics Jesus Sevilla PHY3111
Abstract
The aim of this experiment was to study the differences in the geometry and properties
between barred and unbarred disc galaxies. For that purpose, the analysis of two galactic sim-
ulations has been carried out by using Pynbody, the python analysis package for astrophysical
N-body and smooth particle hydrodynamics simulations. Several images have been rendered
showing and comparing the stellar and gas components of the simulations. Then, the proper-
ties of a Peanut/Boxy bulge have been examined by taking profiles studying the stellar mass
distribution inside that region for stars at various heights above midplane and within different
age intervals. Finally, newly formed stars were considered and the observed star formation rate
inside the bulge has been contrasted with the previously presented background theory.
2. BACKGROUND THEORY
1
Figure 2: Components of a typical disk galaxy.
Adapted from [17].
2.2. Barred spiral galaxies Figure 3: Face-on view of The Milky Way.
Spiral galaxies, along with lenticular galaxies, Adapted from [6].
are disk galaxies [16] and as such, they are com-
posed of a central bulge made up of stars; a to a more random movement in the nucleus
flat rotating disk that can be separated into a of the resulting galaxy that would form the
thick (stars and gas) and a thin (only stars) com- bulge. This theory was in agreement with nu-
ponents; and a stellar halo embedding all this, merous old studies which had only found old
which is a spherical population of stars and glob- stars forming bulges [9]. These studies were
ular clusters [17]. Such a structure is presented based on photometry, a technique that might
in Figure 2. had been affected by dust obscuring important
For this project, a particular type of spiral data [15]. However, more recent studies based on
galaxies are of interest: barred spiral galaxies. infrared cameras and gravitational microlensing
These have a pronounced central bar feature [13] allow younger stars to form inside the bulge
in the disc plane composed of stars that has a (which would still be mainly composed of older
strong influence in the dynamics of the galaxy stars). This raises doubts about its formation
[2]. and is consider as evidence for a secular evo-
Barred galaxies have been found to be a ma- lution within the bulge. Recent research carried
jority, with approximately a 60% of spirals being out with high resolution galactic simulations also
barred [4]. points towards the latter theory [9].
The Milky Way, in which the Solar System is In the particular case of barred spirals, the
found, is itself a barred spiral galaxy. Figure 3 present hypothesis is that the bar feature chan-
shows a face-on view of The Milky Way, where nels gas inwards the bulge from the arms of the
its bar can be clearly identified. spiral using orbital resonance, fueling star birth
at the center of the galaxies [5].
2.3. Bulge formation and barred spirals
2.4. Peanut/Boxy/X-shaped bulges in
It has been traditionally believed that the bulges
spiral galaxies
in the galaxies’ center were formed by merging
of two more planar galactic structures. As a Several spiral galaxies display boxy, peanut or
result of the collision, the orbits of the stars X-shaped bulges when viewed side-on [3].
would be gravitationally disturbed, giving rise These components are due to disc and bar in-
2
stabilities and are composed of disc material [11]. 2.5.2. ESO 597-G036
They have recently been widely observed and
their formation and evolution has been studied Another remarkably visual example of a clear
in depth with the help of simulations (like the P/B bulge is the one of ESO 597-G036, which is
recent [10]), to understand their structure, ori- shown in Figure 5.
gin and their possible link to secular evolution.
More information on the latter concept can be
found in the references [18].
It has been observed that shortly after bars
are formed they become vertically unstable and,
that instability might lead itself to buckle out of
the equatorial plane of the galaxy. Possibly fol-
lowing this non-equilibrium state the inner parts
of the bar thicken remarkably and take the shape
of a box while the bar weakens. Posterior evo- Figure 5: Peanut/Boxy bulge in ESO 597-G036.
lution that escapes the scope of this report (but [Credit: NASA, ESA and the Hubble Heritage
that can be found at the references) can lead Team (STScI/AURA).]
with time to peanut- or X- like shape [11].
3. METHODOLOGY
3.1. Equipment
Figure 4: Contrast enhanced and zoomed-in The experiment has been completely software
Wide-Field Infrared Survey Explorer (WISE) based and the only required tool has been
image of the Milky Way’s boxy bulge. Adapted Python 3 with the packages Pynbody, Mat-
from [12]. plotlib, Numpy and Scipy, along with the results
of two simulations of different galaxies first la-
belled as Run708main and Run708mainDiff.
3
3.2. Procedure 3.2.2. Effects of the P/B bulgue on the stel-
lar density.
3.2.1. Start-up and identification of the
barred galaxy For this part of the analysis, the barred simula-
tion was first rotated so that the bar was aligned
In this section remarkable parts of the used code
with the x-axis. The rotation was applied with
or commands which were important for the pro-
the funtion rotate z().
cedure are explained. However, more technical
Then, with the aim of studying the galaxies’
details can be found in Appendix A, where a
bulge, both galaxies were set to be side-on with
script with the code used for every task is pre-
pyn.analysis.angmom.sideon() and side-on
sented.
images of the stars within a radius of 4 kpc were
After the required packages were imported,
taken (using again pyn.plot.stars.render()).
the physical units for the distances and veloc-
A first observation to the dependence of the
ities for both galaxies were set to be kpc and
stellar mass distribution inside the bulge on the
km/s, respectively. This was done by creating
age of the stars was done by repeating the same
two text files with names Run708main.units and
images for the stars grouped by the filters given
Run708mainDiff.units with the following con-
by:
tent [14]:
4
LowStars = g1.s[(abs(g1.s['z'])<=0.25)] Mass/M g1 g2
MedlowStars = Stellar 6.530110 · 1010 6.692863 · 1010
,→ g1.s[(abs(g1.s['z'])>0.25)& Gas 6.983023 · 1010 6.820270 · 1010
,→ (abs(g1.s['z'])<=0.50)] Dark matter 1.216182 · 1012 1.216182 · 1012
MedStars = g1.s[(abs(g1.s['z'])>0.50)& Total 1.351313 · 1012 1.351313 · 1012
,→ (abs(g1.s['z'])<=0.75)]
MedhighStars = Table 1: Masses of the stellar, gas and dark mat-
,→ g1.s[(abs(g1.s['z'])>0.75)& ter components of each simulation.
,→ (abs(g1.s['z'])<=1)]
HighStars = g1.s[(abs(g1.s['z'])>1)&
In Figure 8 it can be clearly distinguished the
,→ (abs(g1.s['z'])<=1.25)]
central bar feature of g1 that extends diagonally
Profiles were then repeated using the same pro- from y ∼ −2 kpc to y ∼ 2 kpc, while in Fig-
cedure above explained. ure 8b, the arms of the gas spirals are appre-
The height interval 0.75 ≤ |z| ≤ 1 kpc was ciated to be born at the regions that coincide
of particular interest since it corresponds to the with the edges of the bar, which is a common
edge of the bulge and the results for density pro- characteristic between barred galaxies.
files could be contrasted with the previously ob- On the other hand, g2 seems to be an almost
tained images. Thus, for this particular interval, perfect spirally symmetric galaxy, with its pos-
radial density profiles were taken for stars sepa- sible degree of barred galaxy being absolutely
rated by their age as before. negligible.
The stellar mass distribution is shown as a
3.2.3. Newly formed stars
profile of the stellar radial density for both sim-
ulations in Figure 7.
The rate of star formation was studied by
rendering images of the stars under 0.1 1011
Gyr in both galaxies (applying the filter g1
pyn.filt.LowPass(‘age’,‘0.1 Gyr’)) and g2
109
getting radial density profiles. The obtained
results when compared with the images of
Σ/M kpc−2
5
6 6
1010
4 4
109
2 2
ρ/M kpc−3
y/kpc
108
y/kpc
0 0
−2 107
−2
−4 −4 106
−6 −6 105
−5 0 5 −5 0 5
x/kpc x/kpc
(a) Face-on view of the stars in g1. (b) Face-on view of the gas in g1.
Figure 8: Rendered images for the stellar and gas components of g1.
6 1012
6
4 4
2 1010
2
ρ/M kpc−3
y/kpc
y/kpc
0 0
108
−2 −2
−4 −4
106
−6 −6
−5 0 5 −5 0 5
x/kpc x/kpc
(a) Face-on view of the stars in g2. (b) Face-on view of the gas in g2.
Figure 9: Rendered images for the stellar and gas components of g2.
6
r = 0 which is, however, more radially dis-
tributed. < 2 Gyr
On the other hand, g2 starts with a higher 2 ∼ 4 Gyr
density that decays slightly faster due to it hav- 108 4 ∼ 6 Gyr
ing its masscontained in a smaller circularly
ρ/M kpc−3
6 ∼ 8 Gyr
shaped region, reaching a point where its den-
> 8 Gyr
sity becomes lower than the one of g1. 106
6 ∼ 8 Gyr
the sought-after P/B shape. Figure 12g shows
> 8 Gyr
that the old-intermediate stars form a ribbon(or 106
X)/peanut shape, while the older stars from Fig-
ure 12i show a tendency to form a more boxy
shape. It is the superposition of both of them
104
what leads to the characteristic shape appreci-
ated when the entire galaxy is observed (Fig-
ure 12k). 0 2 4 6
On the other hand, a clearly spherical distri- z/kpc
bution is shown for the bulge formed by stars
of all ages in g2. This would continuously ex- Figure 11: Mass distribution of stars in g2 with
pand for older stars with its shape remaining different ages over the z-axis.
unchanged.
Profiles with the mass density of the stars with
The difference between Figures 10 and 11 lies
different ages against their height (z-axis) are
at the rate at which the density decreases with
shown in Figures 10 and 11.
the distance, which is seen to be much lower for
For both galaxies it is shown how older stars
the barred galaxy. That is, stars appear to get
get to reach higher distances over midplane, as it
greater heights above midplane without showing
was already deducted from Figure 12. It is also
a that abrupt decline in their numbers, which is
to be remarked than the lines in both graphs do
clearly a consequence of the bulge’s geometry.
not intersect each other, which means that for
The effect is present for all ages and thus ev-
any chosen height, older stars will always have a
ery density line ends in a greater value of z for
greater contribution to the total mass density of
Figure 10 than for Figure 11.
the galaxy.
7
1 1
z/kpc
z/kpc
0 0
−1 −1
−4 −2 0 2 4 −4 −2 0 2 4
x/kpc x/kpc
(a) Stars in g1 with less than 2 Gyr. (b) Stars in g2 with less than 2 Gyr.
1 1
z/kpc
z/kpc
0 0
−1 −1
−4 −2 0 2 4 −4 −2 0 2 4
x/kpc x/kpc
(c) Stars in g1 between 2 and 4 Gyr. (d) Stars in g2 between 2 and 4 Gyr.
1 1
z/kpc
z/kpc
0 0
−1 −1
−4 −2 0 2 4 −4 −2 0 2 4
x/kpc x/kpc
(e) Stars in g1 between 4 and 6 Gyr. (f) Stars in g2 between 4 and 6 Gyr.
1 1
z/kpc
z/kpc
0 0
−1 −1
−4 −2 0 2 4 −4 −2 0 2 4
x/kpc x/kpc
(g) Stars in g1 between 6 and 8 Gyr. (h) Stars in g2 between 6 and 8 Gyr.
Figure 12: Side-on view of stars with different ages for both simulations. Images at the left belong
to g1 (barred galaxy) and images at the right belong to g2 (unbarred galaxy). Subfigures 12k and
12l show the entire galaxies.
8
1 1
z/kpc
z/kpc
0 0
−1 −1
−4 −2 0 2 4 −4 −2 0 2 4
x/kpc x/kpc
(i) Stars in g1 with more than 8 Gyr. (j) Stars in g2 with more than 8 Gyr.
1 1
z/kpc
z/kpc
0 0
−1 −1
−4 −2 0 2 4 −4 −2 0 2 4
x/kpc x/kpc
(k) Side-on view of g1. (l) Side-on view of g2.
Figure 12: Side-on view of stars with different ages for both simulations. Images at the left belong
to g1 (barred galaxy) and images at the right belong to g2 (unbarred galaxy). Subfigures 12k and
12l show the entire galaxies. (cont.)
9
that the shape of the density profiles matches
|z| < 0.25 kpc
1011 perfectly with the shape of the bulge that is
0.25 < |z| < 0.5 kpc
0.5 < |z| < 0.75 kpc
found in Figure 12, particularly for stars that
10
10 0.75 < |z| < 1 kpc are more than 6 Gyr, since younger stars have
Σ/M kpc−2
1 < |z| < 1.25 kpc not enough relative density to be distinguish-
10 9 able in the rendered images. Medium age stars
are found to show a ribbon(or X)/peanut shape,
108 while, as they get older, they tend to expand
forming the sought-after boxy shape.
This supports the theoretical background
107
given in subsection 2.3, saying that this kind of
bulges appear as a consequence of the bar’s in-
0 1 2 3 4 stability, which leads to a bulking process that
r/kpc gives the X/peanut shape through secular evo-
lution. This would also explain the fact that
Figure 14: Radial density profiles for stars at older stars are found at higher distances over
different heights in g2. midplane.
> 8 Gyr
106 formation about the mass distribution of these
stars in the galaxies, radial density profiles are
shown in Figure 17.
105 In the case of g1, Figures 16a and 17a show
that recently born stars are entirely constrained
to the midplane of the disk and the majority of
104 them are concentrated inside the bulge. Addi-
0 1 2 3 4 tionally, out of it the star density remains almost
r/kpc constant along the galactic disk. This result is
not surprising when compared with Figure 8b
Figure 15: Density profile of stars in g1 with and knowing that stars are born from high gas
0.75 < |z| < 1 kpc sparated by their age. concentrations inside the galaxy, since it is ap-
preciated that the bulge keeps the highest gas
density in the galaxy. For this reason, the same
Looking at this image, it has to be remarked
patterns drawn by new stars in Figure 16a can be
that the vertical axes has been taken to be at
perfectly identified in Figure 8b. Furthermore,
logarithmic scale (as in the rest of the already
the gas matter density was already observed to
presented profiles) in order to give a better vi-
remain constant along the spirals of the galaxy,
sualization of the data for different scales. How-
which turns out to be in agreement with Fig-
ever, it has to be taken into account that the
ure 17b.
densities of stars that are less than 2 Gyr old
On the other hand, newly formed stars in g2
are various orders of magnitude less than those
and their radial density profile are shown in Fig-
of older stars.
ures 16b and 17b, respectively. As it was the
That being said, it is observed from the figure
10
z/kpc 1 1
z/kpc
0 0
−1 −1
6 6
4 4
2 2
y/kpc
y/kpc
0 0
−2 −2
−4 −4
−6 −6
−5 0 5 −5 0 5
x/kpc x/kpc
Figure 16: Newly formed stars in both galaxies (less than 0.1 Gyr).
109 109
Σ/M kpc−2
Σ/M kpc−2
107 107
105 105
0.0 2.5 5.0 7.5 10.0 0.0 2.5 5.0 7.5 10.0
r/kpc r/kpc
(a) Radial density profile for g1. (b) Radial density profile for g2.
Figure 17: Radial density profiles for newly formed stars in both galaxies.
11
case of g1, these stars can only be found at has over the mass distribution has been demon-
the midplane too. However, the main difference strated with profiles of stars at different heights
is that there is not such a big step between the above midplane.
star density that can be seen inside and out- Furthermore, a deeper study was done to the
side the bulge and, although it still gradually stars found at the height corresponding to the
decreases, it appears to be almost constant for edge of the bulge, separating the stars inside by
the entire plane (except from the very center, their age. By taking density profiles and com-
where simulations might show a singularity and paring them with the rendered images of them
one has to be careful). Again, the position of it was seen that their mass distribution already
these new stars in g2 matches perfectly the gas revealed the observed geometry of their contri-
distribution in the galaxy shown in Figure 9b. bution to the bulge.
The results studied in this section are actually Finally, newly formed stars in the galaxies
found to be in agreement with the increasingly turned out to support the hypothesis presented
more considered hypothesis presented in subsec- in the theoretical background, with the presence
tion 2.3, which states that secular evolution in- of the bar giving raise to a higher star formation
side galaxies allows new stars to be formed inside rate inside the bulge due to gas channeling.
the bulge, since both g1 and g2 contain newly On the other hand, more time available could
formed stars inside their bulges. have allowed the acquisition of further theo-
Finally, the idea of bars in barred spiral galax- retical background and a better understanding
ies acting as channels for gas to flow inside the of the features of the Pynbody package, which
bulge seems to be supported by the simulation. could have lead to deeper discussions and the
The barred galaxy shows a higher gas concentra- study of further properties beyond our current
tion in the bulge, which is equivalent to a higher knowledge.
star formation rate. Meanwhile, gas concentra-
tion in the unbarred galaxy’s bulge is not much REFERENCES
higher than in the rest of the disc, and so it the
star formation rate. 1
E. Hubble, “Extragalactic nebulae.”, ApJ 64,
Provided by the SAO/NASA Astrophysics
5. CONCLUSION Data System, 321–369 (1926).
2
J. Sellwood and A. Wilkinson, “Dynamics
Throughout this experiment, the main differ- of barred galaxies”, Reports on Progress in
ences between the barred and the unbarred spi- Physics 56, 173–256 (1993).
ral galaxy simulations have been successfully 3
found by making use of a developed python code. M. Bureau and K. C. Freeman, “The nature
First of all, face and side-on images have been of boxy/peanut-shaped bulges in spiral galax-
rendered for a straightforward identification of ies”, The Astronomical Journal 118, 126–138
the bar and the found P/B bulge. Then, the (1999).
4
slightly different stellar radial densities of the P. B. Eskridge and J. A. Frogel, “What is
two galaxies have been explained in terms of the the true fraction of barred spiral galaxies?”,
geometry of the bar. Astrophysics and Space Science 269, 427–430
The study of the distribution of stars with dif- (1999).
ferent ages along the vertical distance has shown 5
J. H. Knapen, D. Perez-Ramirez, and S. Laine,
that older stars tend to occupy higher positions “Circumnuclear regions in barred spiral galax-
above midplane, giving raise to the sought-after ies – ii. relations to host galaxies”, Monthly
peanut/boxy shape. This was found to be con- Notices of the Royal Astronomical Society
sistent with the presented background theory on 337, 808–828 (2002).
galaxy formation. The effect that this bulge
12
6 16
R. Nemirof and J. Bonnell, Apod: 2005 au- Swinburne University of Technology, Disk
gust 25 - barred spiral milky way, (Aug. 2005) galaxies — cosmos, https : / / astronomy .
https://apod.nasa.gov/apod/ap050825. swin.edu.au/cosmos/d/Disk+Galaxies.
html. 17
Swinburne University of Technology, Halo —
7
E. Aptoula, S. Lefèvre, and C. Collet, “Math- cosmos, https://astronomy.swin.edu.au/
ematical morphology applied to the segmenta- cosmos/h/halo.
tion and classification of galaxies in multispec- 18
Swinburne University of Technology, Secular
tral images”, Proceedings of the EURASIP evolution — cosmos, https : / / astronomy .
European Signal Processing Conference (EU- swin . edu . au / cosmos / s / Secular +
SIPCO) (2006). Evolution.
8
L. S. Sparke and J. S. Gallagher III, Galax-
ies in the universe: an introduction, 2nd ed.
(Cambridge University Press, 2007).
9
M. Ness, V. P. Debattista, T. Bensby, S. Feltz-
ing, R. Roškar, D. R. Cole, J. A. Johnson, and
K. Freeman, “Young stars in an old bulge: a
natural outcome of internal evolution in the
milky way”, The Astrophysical Journal 787,
L19 (2014).
10
F. Fragkoudi, E. Athanassoula, A. Bosma,
and F. Iannuzzi, “The effects of boxy/peanut
bulges on galaxy models”, Monthly Notices of
the Royal Astronomical Society 450, 229–245
(2015).
11
E. Athanassoula, “Boxy/peanut/x bulges, bar-
lenses and the thick part of galactic bars: what
are they and how did they form?”, Galactic
Bulges, 391–412 (2016).
12
M. Ness and D. Lang, “The x-shaped bulge of
the milky way revealed by wise”, The Astro-
nomical Journal 152, 14 (2016).
13
Y. Cendes, Young stars in the galactic bulge-
an outcome of internal evolution, https : / /
astrobites.org/2014/01/24/young-stars-
in- the- galactic- bulge- an- outcome- of-
internal-evolution/.
14
Pynbody Team, A walk through pynbody’s low-
level facilities, https : / / pynbody . github .
io/pynbody/tutorials/data_access.html#
a - walk - through - pynbody - s - low - level -
facilities.
15
Swinburne University of Technology, Bulges —
cosmos, https://astronomy.swin.edu.au/
cosmos/b/Bulges.
13
A. PYTHON SCRIPT
The following Python script contains the code that has been used for doing every task in this
experiment.
1 import numpy as np
2 import pynbody as pyn
3 import matplotlib.pylab as plt
4 plt.rcParams.update({
5 "text.usetex": True,
6 "font.family": "serif",
7 "font.serif": ["Latin Modern Roman"]})
8 plt.rcParams.update({'font.size': 20})
9
10 g1 = pyn.load("run708main.01000")
11 g2 = pyn.load("run708mainDiff.01000")
12 g1.physical_units()
13 g2.physical_units()
14 galaxies=[g1,g2]
15
16 M1_s = np.sum(g1.s["mass"])
17 M1_g = np.sum(g1.g["mass"])
18 M1_dm = np.sum(g1.dm["mass"])
19 M1 = M1_s+M1_g+M1_dm
20 print("Galaxy1: StellarMass = %e, GasMass = %e, DarkMatterMass = %e, TotalMass =
,→ %e"%(M1_s,M1_g,M1_dm,M1))
21
22 M2_s = np.sum(g2.s["mass"])
23 M2_g = np.sum(g2.g["mass"])
24 M2_dm = np.sum(g2.dm["mass"])
25 M2 = M2_s+M2_g+M2_dm
26 print("Galaxy2: StellarMass = %e, GasMass = %e, DarkMatterMass = %e, TotalMass =
,→ %e"%(M2_s,M2_g,M2_dm,M2))
27
28 pyn.analysis.angmom.faceon(g1)
29 pyn.analysis.angmom.faceon(g2)
30
14
41 for i in [0,1]:
42 plt.figure(i)
43 plt.figure(figsize=(5.8,5.2))
44 pyn.plot.image(galaxies[i].g,qty="rho",width=12,qtytitle=r"$\rho$");
45 plt.savefig('Galaxy%sgas.pdf'%(i+1),bbox_inches='tight')
46
54 plt.figure(figsize=(5.8,5.2))
55 plt.plot(pro1["rbins"],pro1["density"])
56 plt.plot(pro2["rbins"],pro2["density"])
57 plt.semilogy()
58 plt.xlabel('$r$/kpc')
59 plt.ylabel('$\Sigma$/M$_\odot$kpc$^{-2}$')
60 plt.legend(("g1","g2"))
61 plt.savefig('RadialDensityProfileGalaxyCOMP.pdf',bbox_inches='tight')
62
63 # Side on orientation
64 pyn.analysis.angmom.sideon(g1)
65 pyn.analysis.angmom.sideon(g2)
66
77 # Filters by AGE
78 filt=[None]*5
79 filt[0] = pyn.filt.LowPass('age', '2 Gyr')
80 filt[1] = pyn.filt.BandPass('age', '2 Gyr', '4 Gyr')
81 filt[2] = pyn.filt.BandPass('age', '4 Gyr', '6 Gyr')
82 filt[3] = pyn.filt.BandPass('age', '6 Gyr', '8 Gyr')
83 filt[4] = pyn.filt.HighPass('age', '8 Gyr')
84 new_stars_filt = pyn.filt.LowPass('age', '0.1 Gyr')
85
86 # Intervals
87 ranges=[[None for x in range(5)] for x in [0,1]]
15
88 for i in [0,1]:
89 for k in range(0,5):
90 ranges[i][k]=galaxies[i].s[filt[k]]
91
92 new_stars = g1.s[new_stars_filt]
93 new_stars2 = g2.s[new_stars_filt]
94
,→ Vprofiles[i][j]=pyn.analysis.profile.VerticalProfile(ranges[i][j],rmin=0.001,rm
111
117 plt.semilogy()
118 axes=plt.gca()
119 axes.set_xlim([-0.25,7])
120 plt.xlabel('$z$/kpc')
121 plt.ylabel(r'$\rho$/M$_\odot$kpc$^{-3}$')
122 plt.legend((r'$<2$ Gyr',r'$2\sim 4$ Gyr',r'$4\sim 6$ Gyr',r'$6\sim 8$
,→ Gyr',r'$>8$ Gyr'))
123 plt.savefig('VerticalDensityProfileGalaxy%s.pdf'%(i+1),bbox_inches='tight')
124
16
131 h[i][2] =
,→ galaxies[i].s[(abs(galaxies[i].s['z'])>0.50)&(abs(galaxies[i].s['z'])<=0.75)]
132 h[i][3] =
,→ galaxies[i].s[(abs(galaxies[i].s['z'])>0.75)&(abs(galaxies[i].s['z'])<=1)]
133 h[i][4] =
,→ galaxies[i].s[(abs(galaxies[i].s['z'])>1)&(abs(galaxies[i].s['z'])<=1.25)]
134
135 # PROFILES
136 hprofiles = [[None for x in range(5)] for x in [0,1]]
137 for i in [0,1]:
138 for j in range(5):
139
,→ hprofiles[i][j]=pyn.analysis.profile.Profile(h[i][j],ndim=2,rmin=0.001,rmax=4)
140
155 ages075_1=prof075_1=[None]*5
156
,→ prof075_1[k]=pyn.analysis.profile.Profile(ages075_1[k],ndim=2,rmin=0.001,rmax=4)
160
161 plt.figure(figsize=(6,5.2))
162
166 plt.xlabel('$r$/kpc')
167 plt.ylabel(r'$\Sigma$/M$_\odot$kpc$^{-2}$')
168 plt.legend((r'$<2$ Gyr',r'$2\sim 4$ Gyr',r'$4\sim 6$ Gyr',r'$6\sim 8$ Gyr',r'$>8$
,→ Gyr'),loc='upper right',fontsize=16)
169 plt.semilogy()
170 plt.savefig('AgesMedhigh1.pdf',bbox_inches='tight')
17
171
172
182 plt.figure(figsize=(5.8,5.2))
183 pyn.plot.stars.render(new_stars2,dynamic_range=3.0,width=12)
184 plt.xlabel('$x$/kpc')
185 plt.ylabel('$z$/kpc')
186 axes = plt.gca()
187 axes.set_ylim([-1.25,1.25])
188 plt.savefig('NewStarsGal2SideOn',bbox_inches='tight')
189
211 plt.plot(new_profile["rbins"],new_profile["density"])
212 plt.xlabel('$r$/kpc')
213 plt.ylabel(r'$\Sigma$/M$_\odot$kpc$^{-2}$')
214 plt.semilogy()
215 plt.savefig('new_densityprof',bbox_inches='tight')
216
217 plt.plot(new_profile2["rbins"],new_profile2["density"])
18
218 plt.xlabel('$r$/kpc')
219 plt.ylabel(r'$\Sigma$/M$_\odot$kpc$^{-2}$')
220 plt.semilogy()
221 plt.savefig('new_densityprof2',bbox_inches='tight')
19