-
Notifications
You must be signed in to change notification settings - Fork 0
/
sed_origin.py
37 lines (29 loc) · 1.1 KB
/
sed_origin.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
import matplotlib as mpl
mpl.use('Agg')
import matplotlib.pyplot as plt
from hyperion.model import ModelOutput
from hyperion.util.constants import pc
m = ModelOutput('tutorial_model.rtout')
fig = plt.figure()
ax = fig.add_subplot(1, 1, 1)
# Direct stellar photons
wav, nufnu = m.get_sed(inclination=0, aperture=-1, distance=300 * pc,
component='source_emit')
ax.loglog(wav, nufnu, color='blue')
# Scattered stellar photons
wav, nufnu = m.get_sed(inclination=0, aperture=-1, distance=300 * pc,
component='source_scat')
ax.loglog(wav, nufnu, color='teal')
# Direct dust photons
wav, nufnu = m.get_sed(inclination=0, aperture=-1, distance=300 * pc,
component='dust_emit')
ax.loglog(wav, nufnu, color='red')
# Scattered dust photons
wav, nufnu = m.get_sed(inclination=0, aperture=-1, distance=300 * pc,
component='dust_scat')
ax.loglog(wav, nufnu, color='orange')
ax.set_xlabel(r'$\lambda$ [$\mu$m]')
ax.set_ylabel(r'$\lambda F_\lambda$ [ergs/s/cm$^2$]')
ax.set_xlim(0.1, 5000.)
ax.set_ylim(1.e-12, 2.e-6)
fig.savefig('sed_origin.png')