# phoebe.backend package¶

## phoebe.backend.backends module¶

phoebe.backend.backends.phoebe(b, compute, times=[], as_generator=False, **kwargs)[source]

Run the PHOEBE 2.0 backend. This is the default built-in backend so no other pre-requisites are required.

When using this backend, please cite
• TODO: include list of citations
• TODO: include list of citations for reboundx

Parameters that are used by this backend:

Values that are filled by this backend:

• lc:
• times
• fluxes
• rv (dynamical only):
• times
• rvs
This function will almost always be called through the bundle, using
Parameters: b – the phoebe.frontend.bundle.Bundle containing the system and datasets compute (str) – the label of the computeoptions to use (in the bundle). These computeoptions must have a kind of ‘phoebe’. **kwargs – any temporary overrides to computeoptions a list of new synthetic :class:phoebe.parameters.parameters.ParameterSets
phoebe.backend.backends.legacy(b, compute, times=[], **kwargs)[source]

Use PHOEBE 1.0 (legacy) which is based on the Wilson-Devinney code to compute radial velocities and light curves for binary systems (>2 stars not supported). The code is available here:

http://phoebe-project.org/1.0

PHOEBE 1.0 and the ‘phoebeBackend’ python interface must be installed and available on the system in order to use this plugin.

When using this backend, please cite
• Prsa & Zwitter (2005), ApJ, 628, 426

Parameters that are used by this backend:

Values that are filled by this backend:

• lc:
• times
• fluxes
• rv (dynamical only):
• times
• rvs
This function will almost always be called through the bundle, using
Parameters: b – the phoebe.frontend.bundle.Bundle containing the system and datasets compute (str) – the label of the computeoptions to use (in the bundle). These computeoptions must have a kind of ‘legacy’. **kwargs – any temporary overrides to computeoptions a list of new synthetic :class:phoebe.parameters.parameters.ParameterSets
phoebe.backend.backends.photodynam(b, compute, times=[], **kwargs)[source]

Use Josh Carter’s photodynamical code (photodynam) to compute velocities (dynamical only), orbital positions and velocities (center of mass only), and light curves (assumes spherical stars). The code is available here:

https://github.com/dfm/photodynam

photodynam must be installed and available on the system in order to use this plugin.

• Science 4 February 2011: Vol. 331 no. 6017 pp. 562-565 DOI:10.1126/science.1201274
• MNRAS (2012) 420 (2): 1630-1635. doi: 10.1111/j.1365-2966.2011.20151.x

when using this code.

Parameters that are used by this backend:

Values that are filled by this backend:

• lc:
• times
• fluxes
• rv (dynamical only):
• times
• rvs
This function will almost always be called through the bundle, using
Parameters: b – the phoebe.frontend.bundle.Bundle containing the system and datasets compute (str) – the label of the computeoptions to use (in the bundle). These computeoptions must have a kind of ‘photodynam’. **kwargs – any temporary overrides to computeoptions a list of new synthetic :class:phoebe.parameters.parameters.ParameterSets ImportError – if the photodynam executable cannot be found or is not installed ValueError – if pblums are invalid
phoebe.backend.backends.jktebop(b, compute, times=[], **kwargs)[source]

Use John Southworth’s code (jktebop) to compute radial velocities and light curves. The code is available here:

http://www.astro.keele.ac.uk/jkt/codes/jktebop.html

jktebop must be installed and available on the system in order to use this plugin.

Please see the link above for a list of publications to cite when using this code.

According to jktebop’s website:

JKTEBOP models the two components as biaxial spheroids for the calculation of the reflection and ellipsoidal effects, and as spheres for the eclipse shapes.

Note that the wrapper around jktebop only uses its forward model. Jktebop also includes its own fitting kinds, including bootstrapping. Those capabilities cannot be accessed from PHOEBE.

Parameters that are used by this backend:

Values that are filled by this backend:

• lc:
• times
• fluxes
• rv (dynamical only):
• times
• rvs
This function will almost always be called through the bundle, using
Parameters: b – the phoebe.frontend.bundle.Bundle containing the system and datasets compute (str) – the label of the computeoptions to use (in the bundle). These computeoptions must have a kind of ‘jktebop’. **kwargs – any temporary overrides to computeoptions a list of new synthetic :class:phoebe.parameters.parameters.ParameterSets ImportError – if the jktebop executable cannot be found or is not installed ValueError – if an ld_func is not valid for the jktebop backedn

## phoebe.backend.eclipse module¶

phoebe.backend.eclipse.wd_horizon(meshes, xs, ys, zs, expose_horizon=False)[source]
phoebe.backend.eclipse.none(meshes, xs, ys, zs, expose_horizon=False)[source]
phoebe.backend.eclipse.only_horizon(meshes, xs, ys, zs, expose_horizon=False)[source]

Check all visible or partial triangles to see if they’re behind the horizon, by checking the direction of the z-component of the normals (ie hidden if mu<0)

phoebe.backend.eclipse.native(meshes, xs, ys, zs, expose_horizon=False, horizon_method='boolean')[source]

this is the new eclipse detection method in libphoebe

phoebe.backend.eclipse.visible_partial(meshes, xs, ys, zs, expose_horizon=False)[source]
phoebe.backend.eclipse.graham(meshes, xs, ys, zs, expose_horizon=False)[source]

convex_graham

## phoebe.backend.etvs module¶

phoebe.backend.etvs.barycentric()[source]
phoebe.backend.etvs.crossing(b, component, time, dynamics_method='keplerian', ltte=True, tol=0.0001, maxiter=1000)[source]

tol in days

## phoebe.backend.horizon_analytic module¶

phoebe.backend.horizon_analytic.cartesian_to_polar(x, y, x0=0.0, y0=0.0)[source]
phoebe.backend.horizon_analytic.polar_to_cartesian(rho, theta, x0=0.0, y0=0.0)[source]
phoebe.backend.horizon_analytic.marching(q, F, d, Phi, scale, euler, pos)[source]

viewing_vector is in ROCHE coordinate system so not necessarily along z q, F, d, Phi should be body._mesh_args scale should be body._scale

phoebe.backend.horizon_analytic.wd(b, time, scale, pos)[source]

## phoebe.backend.mesh module¶

phoebe.backend.mesh.compute_volume(sizes, centers, normals)[source]

Compute the numerical volume of a convex mesh

Parameters: sizes (array) – array of sizes of triangles centers (array) – array of centers of triangles (x,y,z) normals (array) – array of normals of triangles (will normalize if not already) the volume (float)
phoebe.backend.mesh.euler_trans_matrix(etheta, elongan, eincl)[source]

Get the transformation matrix to translate/rotate a mesh according to euler angles

Parameters: etheta (float) – euler theta angle elongan (float) – euler long of asc node angle eincl (float) – euler inclination angle matrix with size 3x3
phoebe.backend.mesh.transform_position_array(array, pos, euler, is_normal, reverse=False)[source]

Transform any Nx3 position array by translating to a center-of-mass ‘pos’ and applying an euler transformation

Parameters: array (array) – numpy array of Nx3 positions in the original (star) coordinate frame pos (array) – numpy array with length 3 giving cartesian coordinates to offset all positions euler (array) – euler angles (etheta, elongan, eincl) in radians is_normal (bool) – whether each entry is a normal vector rather than position vector. If true, the quantities won’t be offset by ‘pos’ new positions array with same shape as ‘array’.
phoebe.backend.mesh.transform_velocity_array(array, pos_array, vel, euler, rotation_vel=(0, 0, 0))[source]

Transform any Nx3 velocity vector array by adding the center-of-mass ‘vel’, accounting for solid-body rotation, and applying an euler transformation.

Parameters: array (array) – numpy array of Nx3 velocity vectors in the original (star) coordinate frame pos_array (array) – positions of the elements with respect to the original (star) coordinate frame. Must be the same shape as ‘array’. vel (array) – numpy array with length 3 giving cartesian velocity offsets in the new (system) coordinate frame euler (array) – euler angles (etheta, elongan, eincl) in radians rotation_vel (array) – vector of the rotation velocity of the star in the original (star) coordinate frame new velocity array with same shape as ‘array’
phoebe.backend.mesh.wd_grid_to_mesh_dict(the_grid, q, F, d)[source]

Transform a wd-style mesh to the format used by PHOEBE. Namely this handles translating vertices from Nx9 to Nx3x3 and creating the array of indices for each triangle.

Parameters: the_grid (record-array) – output from discretize_wd_style q (float) – mass-ratio (M_this/M_sibling) F (float) – syncpar d (float) – instantaneous unitless separation the dictionary in PHOEBE’s format to be passed to a Mesh class
class phoebe.backend.mesh.ComputedColumn(mesh, value_for_computations=None, **kwargs)[source]

Bases: object

Any non-geometric column in a Mesh should be a ComputedColumn. Depending on the type of mesh (defined by mesh._compute_at_vertices), the computed column will either compute values at the vertices and return the weighted averages across a triangle when observing, OR compute at the centers and return that single value when observing.

This class simply provides a single interface with logical/intuitive (hopefully) properties for setting and retrieving values for either type of mesh.

compute_at_vertices
mesh

Returns: an instantiated Mesh, ScaledProtoMesh, or ProtoMesh object.
vertices

Returns: numpy array
vertices_per_triangle

Access to the quantities defined at the vertices, but reshaped to be in the order of triangles, with three entries each

Returns: numpy array
centers

Access to the quantities at the centers of each triangles. In the case where the quantities are provided at the vertices, this will return the average of those values.

Returns: numpy array
for_computations

Access to the quantities as they should be used for computations (either .vertices or .centers depending on the value of mesh._compute_at_vertices)

Returns: numpy array
averages

Access to the average of the values at the vertices for each triangle. If the quantities are defined at centers instead of vertices, this will return None. Also see :method:centers.

Returns: numpy array or None
weighted_averages

Access to the weighted averages of the values at the vertices for each triangle based on the weights provided by mesh.weights. This is most useful for partially visible triangles when using libphoebe’s eclipse detection that returns weights for each vertex.

Note that weights by default are set to 1/3 for each vertex, meaning that this will provide the same values as averages() unless the weights are overridden within the mesh.

If the quantities are defined at centers instead of vertices, this will return None.

Returns: numpy array or None
for_observations

Access to the quantities as they should be used for observations. When defined at centers, this will return centers(), when defined at vertices, this will return weighted_averages().

Returns: numpy array
set_for_computations(value)[source]

Set the quantities, either at the vertices or centers depending on the settings of the mesh (mesh._compute_at_vertices)

class phoebe.backend.mesh.ProtoMesh(compute_at_vertices=True, **kwargs)[source]

Bases: object

ProtoMesh is in units of d with the origin at the COM of the STAR.

Because there is no orbital, scale, or orientation information, those fields are not available until the mesh is scaled and/or placed in orbit (by using the class constructors on ScaledProtoMesh or Mesh respectively).

Parameters: compute_at_vertices (bool) – whether all ComputedColumn (physical quantities) should be computed at the vertices and then averaged or computed at the centers. Generally this should be decided based on whether the vertices or centers of the elements are placed on the surface of the equipotential.
keys()[source]

values()[source]

items()[source]

copy()[source]

Make a deepcopy of this Mesh object

update_columns_dict(kwargs)[source]

Update the value of a column or multiple columns by passing as a dict. For observable columns, provide the label of the observable itself and it will be found (so long as it does not conflict with an existing non-observable column).

update_columns(**kwargs)[source]

Update the value of a column or multiple columns by passing as kwargs. For observable columns, provide the label of the observable itself and it will be found (so long as it does not conflict with an existing non-observable column).

compute_at_vertices

Access (read-only) to the setting of whether computations should be done at the vertices (and then averaged) or at the centers of each triangle

Returns: bool
Ntriangles

Return the number of TRIANGLES/ELEMENTS in the mesh.

Simply a shortcut to len(self.triangles)

Nvertices

Return the number of VERTICES in the mesh.

Simply a shortcut to len(self.vertices)

pvertices

Return the array of vertices on the potential, where each item is a triplet representing cartesian coordinates.

(Vx3)

vertices

Return the array of vertices, where each item is a triplet representing cartesian coordinates.

(Vx3)

pvertices_per_triangle

TODO: confirm shape (Nx3x3)

vertices_per_triangle

TODO: confirm shape (Nx3x3)

triangles

Return the array of triangles, where each item is a triplet of indices pointing to vertices.

(Nx3)

centers

Return the array of centers, where each item is a triplet representing cartesian coordinates.

(Nx3)

coords_for_observations

Return the coordinates from the center of the star for each element (either centers or vertices depending on the setting in the mesh) after perturbations (either by features or by offsetting to get the correct volume). NOTE: this is NOT necessarily where the physical parameters were computed, but IS where eclipse detection, etc, is handled.

coords_for_computations

Return the coordinates from the center of the star for each element (either centers or vertices depending on the setting in the mesh).

normals_for_computations

Return the normals for each element (either centers or vertices depending on the setting in the mesh).

rs

Return the radius of each element (either vertices or centers depending on the setting in the mesh) with respect to the center of the star.

(ComputedColumn)

rprojs

Return the projected (in x,y plane) radius of each element (either vertices or centers depending on the setting in the mesh) with respect to the center of the star.

(ComputedColumn)

cosbetas

(ComputedColumn)

areas

Return the array of areas, where each item is a scalar/float.

TODO: UNIT?

(Nx1)

tareas

Return the array of triangle areas, where each item is a scalar/float.

TODO: UNIT?

(Nx1)

areas_si

velocities

Return the array of velocities, where each item is a scalar/float.

TODO: UNIT?

(Nx1)

vnormals

(Vx3)

tnormals

Return the array of tnormals (normals for each triangle face), where each items is a triplet representing a cartesian normaled vector.

(Nx3)

normgrads

(ComputedColumn)

volume

Return the volume of the ENTIRE MESH.

(scalar/float)

phis

thetas

env_comp

env_comp3

loggs

Return the array of loggs, where each item is a scalar/float.

(ComputedColumn)

gravs

Return the array of gravs, where each item is a scalar/float.

TODO: UNIT?

(ComputedColumn)

teffs

Return the array of teffs, where each item is a scalar/float.

Unit: K

(ComputedColum)

abuns

Return the array of abuns, where each item is a scalar/float.

TODO: UNIT?

(ComputedColumn)

frac_refls

Return the array of frac_refls, where each item is a scalar/float

(ComputedColumn)

class phoebe.backend.mesh.ScaledProtoMesh(**kwargs)[source]

ScaledProtoMesh is in real units (in whatever is provided for scale), but still with the origin at the COM of the STAR.

Because there is no orbital or orientation information, those fields are not available until the mesh is placed in orbit (by using the class constructor on Mesh).

classmethod from_proto(proto_mesh, scale)[source]

roche_vertices

Return the array of vertices in Roche coordinates, where each item is a triplet represeting cartesian coordinates.

(Vx3)

roche_vertices_per_triangle

TODO: confirm shape (Nx3x3)

roche_centers

Access to the quantities at the centers of each triangles in Roche coordinates.

Returns: numpy array
roche_cvelocities

Access to the velocities (compute at the centers of each triangle) in Roche coordinates

Returns: numpy array
roche_tnormals

Returns: numpy array
class phoebe.backend.mesh.Mesh(**kwargs)[source]

Mesh is in real units (in whatever is provided for scale) with the origin at the COM of the system (the coordinate system that should be used when passing pos, vel, euler).

Now that the mesh is in orbit and has viewing orientation information, observables can be attached.

classmethod from_proto(proto_mesh, scale, pos, vel, euler, rotation_vel=(0, 0, 0))[source]

Turn a ProtoMesh into a Mesh scaled and placed in orbit.

Update all geometry fields from the proto reference frame, to the current system reference frame, given the current position, velocitiy, euler angles, and rotational velocity of THIS mesh.

Parameters: pos (list) – current position (x, y, z) vel (list) – current velocity (vx, vy, vz) euler (list) – current euler angles (etheta, elongan, eincl) rotation_vel (list) – rotation velocity vector (polar_dir*freq_rot)
classmethod from_scaledproto(scaledproto_mesh, pos, vel, euler, rotation_vel=(0, 0, 0))[source]

mus

Return the array of mus (z-coordinate of tnormals), where each item is a scalar/float.

(Nx1)

mus_for_computations

(Nx1 or Vx1)

visibilities

Return the array of visibilities, where each item is a scalar/float between 0 (completely hidden/invisible) and 1 (completely visible).

(Nx1)

weights

(Nx3)

observables

Return the dictionary of observables

(ComputedColumn)

get_observable(label)[source]

Retrieve the array of an observable by its label.

(ComputedColumn)

fill_observable(label, value)[source]

Fill the array of an observable by its label. The provided value MUST be either a scalar (applied for all triangles), or an array with length N. This IS NOT checked, but failing to provide the correct shape could have dire consequences.

update_columns_dict(kwargs)[source]

class phoebe.backend.mesh.Meshes(items, parent_envelope_of={})[source]

Bases: object

This is just a class to allow easy access to meshes at the system-level. This allows eclipse detection and subdivision to work at the system-level in an efficient and clean way.

In effect this has the same structure as the system, but allows passing only the meshes and dropping all the Body methods/attributes.

Parameters: items (list) –
items()[source]

keys()[source]

values()[source]

component_by_no(comp_no)[source]

update_columns(field, value_dict, inds=None, computed_type=None)[source]

update the columns of all meshes

Parameters: field (str) – name of the mesh columnname value_dict (dict or value (array or float)) – dictionary with component as keys and new data as values. If value_dict is not a dictionary, it will be applied to all components
get_column(field, components=None, computed_type='for_observations')[source]

return a dictionary for a single column, with component as keys and the column array as values

Parameters: field (str) – name of the mesh columnname components –
get_column_flat(field, components=None, computed_type='for_observations')[source]

return a single merged value (hstacked) from all meshes

Parameters: field (str) – name of the mesh columnname components –
pack_column_flat(value, components=None, offset=False)[source]

unpack_column_flat(value, components=None, offset=False, computed_type=None)[source]

TODO: add documentation TODO: needs testing

set_column_flat(field, value, components=None, computed_type=None)[source]

TODO: add documentation TODO: needs testing

replace_elements(inds, new_submesh, component)[source]

TODO: add documentation TODO: remove this method???

## phoebe.backend.oc_geometry module¶

phoebe.backend.oc_geometry.BinaryRoche(r, D, q, F, Omega=0.0)[source]

Computes a value of the asynchronous, eccentric Roche potential.

If Omega is passed, it computes the difference.

The asynchronous, eccentric Roche potential is given by [Wilson1979]

$\Omega = \frac{1}{\sqrt{x^2 + y^2 + z^2}} + q\left(\frac{1}{\sqrt{(x-D)^2+y^2+z^2}} - \frac{x}{D^2}\right) + \frac{1}{2}F^2(1+q)(x^2+y^2)$

@param r: relative radius vector (3 components) @type r: 3-tuple @param D: instantaneous separation @type D: float @param q: mass ratio @type q: float @param F: synchronicity parameter @type F: float @param Omega: value of the potential @type Omega: float

phoebe.backend.oc_geometry.dBinaryRochedx(r, D, q, F)[source]

Computes a derivative of the potential with respect to x.

@param r: relative radius vector (3 components) @param D: instantaneous separation @param q: mass ratio @param F: synchronicity parameter

phoebe.backend.oc_geometry.d2BinaryRochedx2(r, D, q, F)[source]

Computes second derivative of the potential with respect to x.

@param r: relative radius vector (3 components) @param D: instantaneous separation @param q: mass ratio @param F: synchronicity parameter

phoebe.backend.oc_geometry.dBinaryRochedy(r, D, q, F)[source]

Computes a derivative of the potential with respect to y.

@param r: relative radius vector (3 components) @param D: instantaneous separation @param q: mass ratio @param F: synchronicity parameter

phoebe.backend.oc_geometry.dBinaryRochedz(r, D, q, F)[source]

Computes a derivative of the potential with respect to z.

@param r: relative radius vector (3 components) @param D: instantaneous separation @param q: mass ratio @param F: synchronicity parameter

phoebe.backend.oc_geometry.dBinaryRochedr(r, D, q, F)[source]

Computes a derivative of the potential with respect to r.

@param r: relative radius vector (3 components) @param D: instantaneous separation @param q: mass ratio @param F: synchronicity parameter

class phoebe.backend.oc_geometry.MeshVertex(r, dpdx, dpdy, dpdz, *args)[source]
phoebe.backend.oc_geometry.project_onto_potential(r, pot_name, *args)[source]

phoebe.backend.oc_geometry.nekmin(omega_in, q, x0=0.5, z0=0.5)[source]

Computes the position of the neck (minimal radius) in an contact_binary star1

phoebe.backend.oc_geometry.compute_frac_areas(new_mesh, xmin)[source]

Computes fractional areas belonging to each triangle vertex that are a result of the intersection with the neck plane and assigns them to each vertex per triangle.

phoebe.backend.oc_geometry.wd_mesh_fill(xmin, y1, z1, r1, r2, r3, r4)[source]
phoebe.backend.oc_geometry.wd_recompute_neck(r0, xmin, y1, z1, r01, r02, r03, r04, theta, dtheta, potential, d, q, F, Phi)[source]

## phoebe.backend.potentials module¶

phoebe.backend.potentials.BinaryRoche(r, D, q, F, Omega=0.0)[source]

Computes a value of the asynchronous, eccentric Roche potential.

If Omega is passed, it computes the difference.

The asynchronous, eccentric Roche potential is given by [Wilson1979]

$\Omega = \frac{1}{\sqrt{x^2 + y^2 + z^2}} + q\left(\frac{1}{\sqrt{(x-D)^2+y^2+z^2}} - \frac{x}{D^2}\right) + \frac{1}{2}F^2(1+q)(x^2+y^2)$

@param r: relative radius vector (3 components) @type r: 3-tuple @param D: instantaneous separation @type D: float @param q: mass ratio @type q: float @param F: synchronicity parameter @type F: float @param Omega: value of the potential @type Omega: float

phoebe.backend.potentials.dBinaryRochedx(r, D, q, F)[source]

Computes a derivative of the potential with respect to x.

@param r: relative radius vector (3 components) @param D: instantaneous separation @param q: mass ratio @param F: synchronicity parameter

phoebe.backend.potentials.d2BinaryRochedx2(r, D, q, F)[source]

Computes second derivative of the potential with respect to x.

@param r: relative radius vector (3 components) @param D: instantaneous separation @param q: mass ratio @param F: synchronicity parameter

phoebe.backend.potentials.dBinaryRochedy(r, D, q, F)[source]

Computes a derivative of the potential with respect to y.

@param r: relative radius vector (3 components) @param D: instantaneous separation @param q: mass ratio @param F: synchronicity parameter

phoebe.backend.potentials.dBinaryRochedz(r, D, q, F)[source]

Computes a derivative of the potential with respect to z.

@param r: relative radius vector (3 components) @param D: instantaneous separation @param q: mass ratio @param F: synchronicity parameter

phoebe.backend.potentials.dBinaryRochedr(r, D, q, F)[source]

Computes a derivative of the potential with respect to r.

@param r: relative radius vector (3 components) @param D: instantaneous separation @param q: mass ratio @param F: synchronicity parameter

phoebe.backend.potentials.Lag1(q)[source]
class phoebe.backend.potentials.MeshVertex(r, dpdx, dpdy, dpdz, *args)[source]
phoebe.backend.potentials.project_onto_potential(r, pot_name, *args)[source]

phoebe.backend.potentials.discretize_wd_style(N, q, F, d, Phi)[source]

New implementation. I’ll make this work first, then document.

phoebe.backend.potentials.discretize_wd_style_oc(N, q, F, d, Phi, recompute_neck=True)[source]

## phoebe.backend.universe module¶

class phoebe.backend.universe.System(bodies_dict, eclipse_method='graham', horizon_method='boolean', dynamics_method='keplerian', irrad_method='none', boosting_method='none', parent_envelope_of={})[source]

Bases: object

Parameters: bodies_dict (dict) – dictionary of component names and Bodies (or subclass of Body)
copy()[source]

Make a deepcopy of this Mesh object

classmethod from_bundle(b, compute=None, datasets=[], **kwargs)[source]

Build a system from the phoebe.frontend.bundle.Bundle and its hierarchy.

Parameters: b – the phoebe.frontend.bundle.Bundle compute (str) – name of the computeoptions in the bundle datasets (list) – list of names of datasets **kwargs – temporary overrides for computeoptions an instantiated System object, including its children :class:Bodys
items()[source]

keys()[source]

values()[source]

bodies

get_body(component)[source]

meshes

initialize_meshes()[source]

update_positions(time, xs, ys, zs, vxs, vys, vzs, ethetas, elongans, eincls, ds=None, Fs=None, ignore_effects=False)[source]

all arrays should be for the current time, but iterable over all bodies

populate_observables(time, kinds, datasets, ignore_effects=False)[source]

ignore_effects: whether to ignore reflection and features (useful for computing luminosities)

handle_reflection(**kwargs)[source]
handle_eclipses(expose_horizon=True, **kwargs)[source]

Detect the triangles at the horizon and the eclipsed triangles, handling any necessary subdivision.

Parameters: eclipse_method (str) – name of the algorithm to use to detect the horizon or eclipses (defaults to the value set by computeoptions) subdiv_alg (str) – name of the algorithm to use for subdivision (defaults to the value set by computeoptions) subdiv_num (int) – number of subdivision iterations (defaults the value set by computeoptions)
observe(dataset, kind, components=None, distance=1.0, l3=0.0)[source]

Integrate over visible surface elements and return a dictionary of observable values

distance (m)

class phoebe.backend.universe.Body(comp_no, ind_self, ind_sibling, masses, ecc, atm='blackbody', datasets=[], passband={}, intens_weighting='energy', ld_func={}, ld_coeffs={}, dynamics_method='keplerian', mesh_init_phi=0.0)[source]

Bases: object

copy()[source]

Make a deepcopy of this Mesh object

mesh

is_convex
Returns: whether the mesh can be assumed to be convex bool
mesh_initialized
Returns: whether the mesh has already been initialized bool
needs_recompute_instantaneous

needs_volume_conservation

volume

Compute volume of a mesh AT ITS CURRENT TIME/PROJECTION - this should be subclassed as needed for optimization or special cases

Returns: the current volume float
max_r

Recall the maximum r (triangle furthest from the center of the star) of this star at periastron (when it is most deformed)

Returns: maximum r float
mass
instantaneous_distance(xs, ys, zs, sma)[source]

initialize_mesh(**kwargs)[source]

optional kwargs for BRS marching if time-dependent: (masses, sma)

save_as_standard_mesh(protomesh, theta=0.0)[source]

get_standard_mesh(theta=0.0, scaled=True)[source]

reset_time(time)[source]

update_position(time, xs, ys, zs, vxs, vys, vzs, ethetas, elongans, eincls, ds=None, Fs=None, ignore_effects=False, **kwargs)[source]

Update the position of the star into its orbit

Parameters: time (float) – the current time xs (list) – a list/array of x-positions of ALL COMPONENTS in the System ys (list) – a list/array of y-positions of ALL COMPONENTS in the System zs (list) – a list/array of z-positions of ALL COMPONENTS in the System vxs (list) – a list/array of x-velocities of ALL COMPONENTS in the System vys (list) – a list/array of y-velocities of ALL COMPONENTS in the System vzs (list) – a list/array of z-velocities of ALL COMPONENTS in the System ethetas (list) – a list/array of euler-thetas of ALL COMPONENTS in the System elongans (list) – a list/array of euler-longans of ALL COMPONENTS in the System eincls (list) – a list/array of euler-incls of ALL COMPONENTS in the System ds (list) – (optional) a list/array of instantaneous distances of ALL COMPONENTS in the System Fs (list) – (optional) a list/array of instantaneous syncpars of ALL COMPONENTS in the System NotImplementedError – if the dynamics_method is not supported
compute_luminosity(dataset, **kwargs)[source]
compute_pblum_scale(dataset, pblum, **kwargs)[source]

intensities should already be computed for this dataset at the time for which pblum is being provided

set_pblum_scale(dataset, pblum_scale, **kwargs)[source]
get_pblum_scale(dataset, **kwargs)[source]
set_ptfarea(dataset, ptfarea, **kwargs)[source]
get_ptfarea(dataset, **kwargs)[source]
populate_observable(time, kind, dataset, **kwargs)[source]

class phoebe.backend.universe.CustomBody(masses, sma, ecc, freq_rot, teff, abun, dynamics_method='keplerian', ind_self=0, ind_sibling=1, comp_no=1, atm='blackbody', datasets=[], passband={}, intens_weighting={}, ld_func={}, ld_coeffs={}, **kwargs)[source]

[NOT IMPLEMENTED]

Parameters: masses (list of floats) – mass of each component (solMass) sma (float) – sma of this component’s parent orbit (solRad) freq_rot (float) – rotation frequency (1/d) abun (float) – abundance of this star ind_self (int) – index in all arrays (positions, masses, etc) for this object ind_sibling (int) – index in all arrays (positions, masses, etc) for the sibling of this object instantiated CustomBody object NotImplementedError – because it isn’t
classmethod from_bundle(b, component, compute=None, dynamics_method='keplerian', datasets=[], **kwargs)[source]

[NOT IMPLEMENTED]

Raises: NotImplementedError – because it isn’t
needs_recompute_instantaneous

CustomBody has all values fixed by default, so this always returns False

Returns: False
needs_volume_conservation

CustomBody will never reproject to handle volume conservation

Returns: False
class phoebe.backend.universe.Star(F, Phi, masses, sma, ecc, freq_rot, teff, gravb_bol, abun, irrad_frac_refl, mesh_method='marching', dynamics_method='keplerian', mesh_init_phi=0.0, ind_self=0, ind_sibling=1, comp_no=1, is_single=False, atm='blackbody', datasets=[], passband={}, intens_weighting={}, ld_func={}, ld_coeffs={}, do_rv_grav=False, features=[], do_mesh_offset=True, **kwargs)[source]
Parameters: F (float) – syncpar Phi (float) – equipotential of this star at periastron masses (list of floats) – mass of each component in the system (solMass) sma (float) – sma of this component’s parent orbit (solRad) freq_rot (float) – rotation frequency (rad/d) abun (float) – abundance of this star ind_self (int) – index in all arrays (positions, masses, etc) for this object ind_sibling (int) – index in all arrays (positions, masses, etc) for the sibling of this object instantiated Star object
classmethod from_bundle(b, component, compute=None, dynamics_method='keplerian', mesh_init_phi=0.0, datasets=[], **kwargs)[source]

Build a star from the phoebe.frontend.bundle.Bundle and its hierarchy.

Usually it makes more sense to call System.from_bundle() directly.

Parameters: b – the phoebe.frontend.bundle.Bundle component (str) – label of the component in the bundle compute (str) – name of the computeoptions in the bundle dynamics_method (str) – method to use for computing the position of this star in the orbit datasets (list) – list of names of datasets **kwargs – temporary overrides for computeoptions an instantiated Star object
spots
needs_recompute_instantaneous

needs_volume_conservation

we can skip volume conservation only for circular orbits even for circular orbits - if we’re using nbody but roche distortion, we must remesh to handle instantaneous changes to d or F

get_target_volume(etheta, scaled=False)[source]

get the volume that the BRS should have at a given euler theta

class phoebe.backend.universe.Envelope(Phi, masses, sma, ecc, freq_rot, teff1, teff2, abun, irrad_frac_refl1, irrad_frac_refl2, gravb_bol1, gravb_bol2, mesh_method='marching', dynamics_method='keplerian', mesh_init_phi=0.0, ind_self=0, ind_sibling=1, comp_no=1, atm='blackbody', datasets=[], passband={}, intens_weighting={}, ld_func={}, ld_coeffs={}, do_rv_grav=False, features=[], do_mesh_offset=True, label_envelope='contact_envelope', label_primary='primary', label_secondary='secondary', **kwargs)[source]

[NOT IMPLEMENTED]

Parameters: Phi (float) – equipotential of this star at periastron masses (list of floats) – mass of each component in the system (solMass) sma (float) – sma of this component’s parent orbit (solRad) abun (float) – abundance of this star ind_self (int) – index in all arrays (positions, masses, etc) for the primary star in this contact_binary envelope ind_sibling (int) – index in all arrays (positions, masses, etc) for the secondary star in this contact_binary envelope instantiated Envelope object
classmethod from_bundle(b, component, compute=None, dynamics_method='keplerian', mesh_init_phi=0.0, datasets=[], **kwargs)[source]

[NOT IMPLEMENTED]

Build an contact_binary from the phoebe.frontend.bundle.Bundle and its hierarchy.

Usually it makes more sense to call System.from_bundle() directly.

Parameters: b – the phoebe.frontend.bundle.Bundle component (str) – label of the component in the bundle compute (str) – name of the computeoptions in the bundle dynamics_method (str) – method to use for computing the position of this star in the orbit datasets (list) – list of names of datasets **kwargs – temporary overrides for computeoptions an instantiated Envelope object
needs_recompute_instantaneous

needs_volume_conservation

we can skip volume conservation only for circular orbits

get_target_volume(etheta)[source]

get the volume that the BRS should have at a given euler theta

compute_luminosity(dataset, component=None, **kwargs)[source]
compute_pblum_scale(dataset, pblum, component=None, **kwargs)[source]

intensities should already be computed for this dataset at the time for which pblum is being provided

set_pblum_scale(dataset, pblum_scale, component=None, **kwargs)[source]
get_pblum_scale(dataset, component=None)[source]
class phoebe.backend.universe.Feature(*args, **kwargs)[source]

Bases: object

Note that for all features, each of the methods below will be called. So changing the coordinates WILL affect the original/intrinsic loggs which will then be used as input for that method call.

In other words, its probably safest if each feature only overrides a SINGLE one of the methods. Overriding multiple methods should be done with great care.

proto_coords

Override this to True if all methods (except process_coords*... those ALWAYS expect protomesh coordinates) are expecting coordinates in the protomesh (star) frame-of-reference rather than the current in-orbit system frame-of-reference.

process_coords_for_computations(coords_for_computations, t)[source]

Method for a feature to process the coordinates. Coordinates are processed AFTER scaling but BEFORE being placed in orbit.

NOTE: coords_for_computations affect physical properties only and not geometric properties (areas, eclipse detection, etc). If you want to override geometric properties, use the hook for process_coords_for_observations as well.

Features that affect coordinates_for_computations should override this method

process_coords_for_observations(coords_for_computations, coords_for_observations, t)[source]

Method for a feature to process the coordinates. Coordinates are processed AFTER scaling but BEFORE being placed in orbit.

NOTE: coords_for_observations affect the geometry only (areas of each element and eclipse detection) but WILL NOT affect any physical parameters (loggs, teffs, intensities). If you want to override physical parameters, use the hook for process_coords_for_computations as well.

Features that affect coordinates_for_observations should override this method.

process_loggs(loggs, coords, t=None)[source]

Method for a feature to process the loggs.

Features that affect loggs should override this method

process_teffs(teffs, coords, t=None)[source]

Method for a feature to process the teffs.

Features that affect teffs should override this method

class phoebe.backend.universe.Spot(colat, longitude, dlongdt, radius, relteff, t0, **kwargs)[source]

Initialize a Spot feature

classmethod from_bundle(b, feature)[source]

Initialize a Spot feature from the bundle.

proto_coords
pointing_vector(time)[source]
process_teffs(teffs, coords, t=None)[source]

Change the local effective temperatures for any values within the “cone” defined by the spot. Any teff within the spot will have its current value multiplied by the “relteff” factor

Parameters: teffs (array) – array of teffs for computations coords (array) – array of coords for computations current time
class phoebe.backend.universe.Pulsation(radamp, freq, l=0, m=0, tanamp=0.0, teffext=False, **kwargs)[source]
classmethod from_bundle(b, feature)[source]

Initialize a Pulsation feature from the bundle.

proto_coords
dYdtheta(m, l, theta, phi)[source]
dYdphi(m, l, theta, phi)[source]
process_coords_for_computations(coords_for_computations, t)[source]
process_coords_for_observations(coords_for_computations, coords_for_observations, t)[source]

Displacement equations:

xi_r(r, theta, phi) = a(r) Y_lm (theta, phi) exp(-i*2*pi*f*t) xi_theta(r, theta, phi) = b(r) dY_lm/dtheta (theta, phi) exp(-i*2*pi*f*t) xi_phi(r, theta, phi) = b(r)/sin(theta) dY_lm/dphi (theta, phi) exp(-i*2*pi*f*t)

where:

b(r) = a(r) GM/(R^3*f^2)
process_teffs(teffs, coords, t=None)[source]

## Module contents¶

Last update: 06/07/2017 11:30 a.m. (CET)