hyperion.model.AnalyticalYSOModel#

AnalyticalYSOModel inherits from Model, so all methods and attributes present in the latter can be used with the former, but they are not listed here.

class hyperion.model.AnalyticalYSOModel(name=None)#

Adding density structures

add_flared_disk()

Add a flared disk to the model

add_alpha_disk()

Add an alpha disk to the geometry

add_power_law_envelope()

Add a spherically symmetric power-law envelope to the model

add_ulrich_envelope()

Add an infalling rotationally flatted envelope to the model

add_ambient_medium([subtract])

Add an ambient density medium to the model

Setting the grid automatically

set_spherical_polar_grid_auto(n_r, n_theta, ...)

Set the grid to be spherical polar with automated resolution.

set_cylindrical_polar_grid_auto(n_w, n_z, n_phi)

Set the grid to be cylindrical polar with automated resolution.

Miscellaneous

setup_magnetospheric_accretion(mdot, rtrunc, ...)

Set up the model for magnetospheric accretion

Writing

write([filename, compression, copy, ...])

Write the model input parameters to an HDF5 file

Methods (detail)

add_flared_disk()#

Add a flared disk to the model

Returns:
diskFlaredDisk

A FlaredDisk instance.

Examples

To add a flared disk to the model, you can do:

>>> disk = m.add_flared_disk()

then set the disk properties using e.g.:

>>> disk.mass = 1.e30  # g
>>> disk.rmin = 1e10  # cm
>>> disk.rmax = 1e14  # cm

See the FlaredDisk documentation to see which parameters can be set.

add_alpha_disk()#

Add an alpha disk to the geometry

This is similar to a flared disk, but with accretion luminosity. See AlphaDisk for more details.

Returns:
diskAlphaDisk

A AlphaDisk instance.

Examples

To add an alpha disk to the model, you can do:

>>> disk = m.add_alpha_disk()

then set the disk properties using e.g.:

>>> disk.mass = 1.e30  # g
>>> disk.rmin = 1e10  # cm
>>> disk.rmax = 1e14  # cm

See the AlphaDisk documentation to see which parameters can be set.

add_power_law_envelope()#

Add a spherically symmetric power-law envelope to the model

Returns:
envPowerLawEnvelope

A PowerLawEnvelope instance.

Examples

To add a power-law envelope to the model, you can do:

>>> env = m.add_power_law_envelope()

then set the envelope properties using e.g.:

>>> from hyperion.util.constants import msun, au
>>> env.mass = 0.1 * msun  # g/s
>>> env.rmin = 0.1 * au  # cm
>>> env.rmax = 10000. * au  # cm

See the PowerLawEnvelope documentation to see which parameters can be set.

add_ulrich_envelope()#

Add an infalling rotationally flatted envelope to the model

Returns:
envUlrichEnvelope

An UlrichEnvelope instance.

Examples

To add an infalling envelope to the model, you can do:

>>> env = m.add_ulrich_envelope()

then set the envelope properties using e.g.:

>>> from hyperion.util.constants import msun, yr, au
>>> env.mdot = 1.e-6 * msun / yr  # g/s
>>> env.rmin = 0.1 * au  # cm
>>> env.rmax = 10000. * au  # cm

See the UlrichEnvelope documentation to see which parameters can be set.

add_ambient_medium(subtract=[])#

Add an ambient density medium to the model

Parameters:
subtractlist

Components to subtract from the ambient density medium (see notes below).

Returns:
ambientAmbientMedium

An AmbientMedium instance.

Notes

By default, the ambient medium simply adds a constant density rho of 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 the subtract= argument. In the following example:

>>> e = m.add_power_law_envelope()
>>> m.add_ambient_medium(subtract=[e])

the ambient medium does not simply add a constant density rho of dust everywhere, but it adds dust such that the density never falls below rho between rmin and rmax - that is, it subtracts the density of component e from the rho, with a minimum of zero. In regions where the density of component of e is larger than rho, no dust is added.

Examples

To add an ambient medium to the model, you can do:

>>> ambient = m.add_ambient_medium()

then set the ambient medium properties using e.g.:

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

See the AmbientMedium documentation to see which parameters can be set.

set_spherical_polar_grid_auto(n_r, n_theta, n_phi, rmax=None, min_spacing=1e-08)#

Set the grid to be spherical polar with automated resolution.

Parameters:
n_r, n_theta, n_phiint

Number of cells to use in the radial, theta, and azimuthal directions.

rmaxfloat, optional

The maximum radius to extend out to. If not specified, this is set to the maximum spherical radius of the dust geometry in the mid-plane. Note that if you are including a disk with a cylindrical outer edge, this should be set to a value larger than the disk radius, otherwise the disk will be truncated with a spherical edge.

min_spacingfloat, optional

The minimum spacing (in relative terms) for the inner cell walls. The spacing from rmin to the next cell wall cannot be smaller than rmin * (1 + min_spacing).

set_cylindrical_polar_grid_auto(n_w, n_z, n_phi, wmin=None, wmax=None, zmin=None, zmax=None, min_spacing=1e-08)#

Set the grid to be cylindrical polar with automated resolution.

Parameters:
n_w, n_z, n_phiint

Number of cells to use in the radial, vertical, and azimuthal directions.

wmaxfloat, optional

The maximum radius to extend out to. If not specified, this is set to the maximum cylindrical radius of the dust geometry in the mid-plane.

zmaxfloat, optional

The maximum height above and below the midplane to extend to. If not specified, this is set to the maximum cylindrical radius of the dust geometry.

min_spacingfloat, optional

The minimum spacing (in relative terms) for the inner cell walls. The spacing from rmin to the next cell wall cannot be smaller than rmin * (1 + min_spacing).

setup_magnetospheric_accretion(mdot, rtrunc, fspot, xwav_min=0.001, xwav_max=0.01)#

Set up the model for magnetospheric accretion

Parameters:
mdotfloat

The accretion rate onto the star in cgs

rtruncfloat

The magnetospheric truncation radius of the disk in cgs

fspotfloat

The spot coverage fraction. Photons will be emitted uniformly from the star, the coverage fraction fspot will determine the spectrum of the hot spot emission (smaller covering fractions will lead to a hotter spectrum).

Notes

This method only takes into account the hot spot and X-ray emission from the stellar surface. To simulate the viscous accretion luminosity in the disk, add an AlphaDisk to the model using add_alpha_disk() and set the accretion rate or luminosity accordingly.

write(filename=None, compression=True, copy=True, absolute_paths=False, wall_dtype=<class 'float'>, physics_dtype=<class 'float'>, overwrite=True, merge_if_possible=True)#

Write the model input parameters to an HDF5 file

Parameters:
filenamestr

The name of the input file to write. If no name is specified, the filename is constructed from the model name.

compressionbool

Whether to compress the datasets inside the HDF5 file.

copybool

Whether to copy all external content into the input file, or whether to just link to external content.

absolute_pathsbool

If copy=False, then if absolute_paths is True, absolute filenames are used in the link, otherwise the path relative to the input file is used.

wall_dtypetype

Numerical type to use for wall positions.

physics_dtypetype

Numerical type to use for physical grids.

overwritebool

Whether to overwrite any pre-existing file

merge_if_possiblebool

Whether to merge density arrays that have the same dust type