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