hyperion.densities.AmbientMedium¶
-
class
hyperion.densities.AmbientMedium(rho=None, rmin=None, rmax=None, subtract=[])¶ This class implements the density structure for an ambient density medium defined by a constant density, and an inner and outer radius.
Once the
AmbientMediumclass has been instantiated, the parameters for the density structure can be set via attributes:>>> from hyperion.util.constants import au, pc >>> from hyperion.densities.ambient_medium import AmbientMedium >>> ambient = AmbientMedium() >>> ambient.rho = 1.e-20 # cgs >>> ambient.rmin = 0.1 * au # cm >>> ambient.rmax = pc # cm
AmbientMediuminstances can only be used with spherical polar grids at this time.By default, the ambient medium simply adds a constant density
rhoof dust to the whole model between the inner and outer radius. However, it is possible to pass components that should be subtracted from the constant density using thesubtract=argument. In the following example:>>> e = PowerLawEnvelope() >>> AmbientMedium(subtract=[e])
the ambient medium does not simply add a constant density
rhoof dust everywhere, but it adds dust such that the density never falls belowrhobetweenrminandrmax- that is, it subtracts the density of componentefrom therho, with a minimum of zero. In regions where the density of component ofeis larger thanrho, no dust is added.Attributes
rhoDensity of the ambient medium (g/cm^3)
rmininner radius (cm)
rmaxouter radius (cm)
Methods
density(self, grid)Return the density grid
Methods (detail)
-
density(self, grid)¶ Return the density grid
- Parameters
- grid
SphericalPolarGridinstance. The spherical polar grid object containing information about the position of the grid cells.
- grid
- Returns
- rhonp.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.
-