Download Hyperion Manual Release 0.9.7 Thomas Robitaille

Transcript
Hyperion Manual, Release 0.9.7
source = m.add_external_spherical_source()
source.luminosity = lsun # [ergs/s]
source.radius = pc # [cm]
source.temperature = 10000. # [K]
As for point and spherical sources, the position of the center can also be set, and defaults to the origin. External box
sources have a bounds attribute instead of radius and position:
source = m.add_external_box_source()
source.luminosity = lsun # [ergs/s]
source.bounds = [[-pc, pc], [-pc, pc], [-pc, pc]]
source.temperature = 10000. # [K]
# [cm]
where the bounds attribute is given as [[xmin, xmax], [ymin, ymax], [zmin, zmax]].
See How to set the luminosity for an external radiation field for information on setting the luminosity correctly in order
to reproduce a given intensity field.
Note: Even though these sources are referred to as ‘external’, they have to be placed inside the outermost walls of the
grid. The sources are not box-shared source or spherical source that can be placed outside the grid, but rather sources
that emit inwards instead of outwards, making it possible to simulate an external radiation field.
Plane parallel sources
Finally, it is possible to add circular plane parallel sources (essentially a circular beam with a given origin and direction):
source = m.add_plane_parallel_source()
source.luminosity = lsun # [ergs/s]
source.radius = rsun # [cm]
source.temperature = 10000. # [K]
source.position = (au, 0., 0.) # [cm]
source.direction = (45., 0.) # [degrees]
where direction is a tuple of (theta, phi) that gives the direction of the beam.
Point source collections
In cases where you want to set up more than a few dozen point sources, it may be worth instead using a point
source collection, which can contain an arbitrary number of point sources with different luminosities, and a common
temperature or spectrum. To add a point source collection, use e.g.:
source = m.add_point_source_collection()
The attributes are the same as for the Point Sources but the source.luminosity attribute should be set to an
array with as many elements as sources, and the source.position attribute should be set to a 2-d array where
the first dimension matches source.luminosity, and with 3 elements in the second dimension (x, y, and z). The
following example shows how to set up 1000 random point sources with random positions from -1au to 1au in all
directions, and with random luminosities between 0 and lsun:
N
x
y
z
=
=
=
=
1000
np.random.uniform(-1., 1, N) * au
np.random.uniform(-1., 1, N) * au
np.random.uniform(-1., 1, N) * au
3.3. Setting up models
29