hyperion.densities.BipolarCavity¶
-
class
hyperion.densities.BipolarCavity(theta_0=None, power=None, r_0=None, rho_0=None, rho_exp=0.0, cap_to_envelope_density=False, dust=None)¶ This class implements the density structure for a bipolar cavity in an envelope, with a density given by:

inside a volume defined by two parabolic surfaces with half-opening angle
theta_0atr_0.Once the
BipolarCavityclass has been instantiated, the parameters for the density structure can be set via attributes:>>> from hyperion.densities.bipolar_cavity import BipolarCavity >>> cavity = BipolarCavity() >>> cavity.theta_0 = 10. >>> cavity.power = 0.
In most cases however, you should not have to instantiate a BipolarCavity class directly, but instead you should use the
add_bipolar_cavitymethod on the Envelope classes (see for exampleUlrichEnvelopeorPowerLawEnvelopeclasses).Attributes
r_0radius at which
theta_0andrho_0are defined (cm)theta_0Cavity half-opening angle at
r_0rho_0density at
r_0(g/cm^3)powerPower of the cavity shape
rho_expdensity power-law exponent
dustdust properties (filename or dust object)
Methods
density(self, grid)Return the density grid
mask(self, grid)Compute the shape of the bipolar cavity.
Methods (detail)
-
density(self, grid)¶ Return the density grid
- Parameters
- grid
SphericalPolarGridorCylindricalPolarGridinstance. The spherical or cylindrical 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 bipolar cavity inside each cell. The shape of this array is the same as
grid.shape.
-
mask(self, grid)¶ Compute the shape of the bipolar cavity.
- Parameters
- grid
SphericalPolarGridorCylindricalPolarGridinstance. The spherical or cylindrical polar grid object containing information about the position of the grid cells.
- grid
- Returns
- masknp.ndarray
A 3-dimensional booleand array indicating whether we are inside or outside the bipolar cavity (True is inside). The shape of this array is the same as
grid.shape.
-