Previous topic

hyperion.densities.BipolarCavity

Next topic

hyperion.sources.PointSource

This Page

hyperion.densities.AmbientMedium

class hyperion.densities.AmbientMedium(rho=None, rmin=None, rmax=None)

This class implements the density structure for an ambient density medium defined by a constant density, and an inner and outer radius.

Once the AmbientMedium class has been instantiated, the parameters for the density structure can be set via attributes:

>>> from hyperion.util.constants import au, pc
>>> ambient = AmbientMedium()
>>> ambient.rho = 1.e-20  # cgs
>>> ambient.rmin = 0.1 * au  # cm
>>> ambient.rmax = pc  # cm

AmbientMedium instances can only be used with spherical polar grids at this time.

Attributes

rho Density of the ambient medium (g/cm^3)
rmin inner radius (cm)
rmax outer radius (cm)

Methods

density(grid) Return the density grid

Methods (detail)

density(grid)

Return the density grid

Parameters :

grid : SphericalPolarGrid instance.

The spherical polar grid object containing information about the position of the grid cells.

Returns :

rho : np.ndarray

A 3-dimensional array containing the density of the envelope inside each cell. The shape of this array is the same as grid.shape.