PHOEBE 2.0 Documentation

2.0 Docs



phoebe.parameters package

Submodules

phoebe.parameters.component module

phoebe.parameters.component.orbit(component, **kwargs)[source]

Create parameters for a new orbit.

Generally, this will be used as an input to the kind argument in phoebe.frontend.bundle.Bundle.add_component()

Parameters:**kwargs

defaults for the values of any of the parameters

Returns:a phoebe.parameters.parameters.ParameterSet of all newly created :class:`phoebe.parameters.parameters.Parameter`s
phoebe.parameters.component.star(component, **kwargs)[source]

Create parameters for a new star.

Generally, this will be used as an input to the kind argument in phoebe.frontend.bundle.Bundle.add_component()

Parameters:**kwargs

defaults for the values of any of the parameters

Returns:a phoebe.parameters.parameters.ParameterSet of all newly created :class:`phoebe.parameters.parameters.Parameter`s
phoebe.parameters.component.envelope(component, **kwargs)[source]
Create parameters for an envelope (usually will be attached to two stars solRad
that they can share a common-envelope)

Generally, this will be used as an input to the kind argument in phoebe.frontend.bundle.Bundle.add_component()

Parameters:**kwargs

defaults for the values of any of the parameters

Returns:a phoebe.parameters.parameters.ParameterSet of all newly created :class:`phoebe.parameters.parameters.Parameter`s

phoebe.parameters.compute module

phoebe.parameters.compute.phoebe(**kwargs)[source]

Compute options for using the PHOEBE 2.0 backend.

Generally, this will be used as an input to the kind argument in phoebe.frontend.bundle.Bundle.add_compute()

Please see phoebe.backend.backends.phoebe() for a list of sources to cite when using this backend.

Parameters:**kwargs

defaults for the values of any of the parameters

Returns:a phoebe.parameters.parameters.ParameterSet of all newly created :class:`phoebe.parameters.parameters.Parameter`s
phoebe.parameters.compute.legacy(**kwargs)[source]

Compute options for using the PHOEBE 1.0 legacy backend (must be installed).

Generally, this will be used as an input to the kind argument in phoebe.frontend.bundle.Bundle.add_compute()

Please see phoebe.backend.backends.legacy() for a list of sources to cite when using this backend.

Parameters:**kwargs

defaults for the values of any of the parameters

Returns:a phoebe.parameters.parameters.ParameterSet of all newly created :class:`phoebe.parameters.parameters.Parameter`s
phoebe.parameters.compute.photodynam(**kwargs)[source]

Compute options for using Josh Carter’s ‘photodynam’ code as a backend (must be installed).

Generally, this will be used as an input to the kind argument in phoebe.frontend.bundle.Bundle.add_compute()

Please see phoebe.backend.backends.photodynam() for a list of sources to cite when using this backend.

Parameters:**kwargs

defaults for the values of any of the parameters

Returns:a phoebe.parameters.parameters.ParameterSet of all newly created :class:`phoebe.parameters.parameters.Parameter`s
phoebe.parameters.compute.jktebop(**kwargs)[source]

Compute options for using John Southworth’s ‘jktebop’ code as a backend (must be installed).

Generally, this will be used as an input to the kind argument in phoebe.frontend.bundle.Bundle.add_compute()

Please see phoebe.backend.backends.jktebop() for a list of sources to cite when using this backend.

Parameters:**kwargs

defaults for the values of any of the parameters

Returns:a phoebe.parameters.parameters.ParameterSet of all newly created :class:`phoebe.parameters.parameters.Parameter`s

phoebe.parameters.constraint module

phoebe.parameters.constraint.sin(param)[source]

Allows using the sin function in a constraint

Parameters:param – the phoebe.parameters.parameters.Parameter
Returns:the phoebe.parameters.parameters.ConstraintParameter
phoebe.parameters.constraint.cos(param)[source]

Allows using the cos function in a constraint

Parameters:param – the phoebe.parameters.parameters.Parameter
Returns:the phoebe.parameters.parameters.ConstraintParameter
phoebe.parameters.constraint.tan(param)[source]

Allows using the tan function in a constraint

Parameters:param – the phoebe.parameters.parameters.Parameter
Returns:the phoebe.parameters.parameters.ConstraintParameter
phoebe.parameters.constraint.arcsin(param)[source]

Allows using the arcsin function in a constraint

Parameters:param – the phoebe.parameters.parameters.Parameter
Returns:the phoebe.parameters.parameters.ConstraintParameter
phoebe.parameters.constraint.arccos(param)[source]

Allows using the arccos function in a constraint

Parameters:param – the phoebe.parameters.parameters.Parameter
Returns:the phoebe.parameters.parameters.ConstraintParameter
phoebe.parameters.constraint.arctan(param)[source]

Allows using the arctan function in a constraint

Parameters:param – the phoebe.parameters.parameters.Parameter
Returns:the phoebe.parameters.parameters.ConstraintParameter
phoebe.parameters.constraint.abs(param)[source]

Allows using the abs (absolute value) function in a constraint

Parameters:param – the phoebe.parameters.parameters.Parameter
Returns:the phoebe.parameters.parameters.ConstraintParameter
phoebe.parameters.constraint.sqrt(param)[source]

Allows using the sqrt (square root) function in a constraint

Parameters:param – the phoebe.parameters.parameters.Parameter
Returns:the phoebe.parameters.parameters.ConstraintParameter
phoebe.parameters.constraint.rocherpole2potential(rpole, q, e, syncpar, sma, compno=1)[source]

TODO: add documentation

phoebe.parameters.constraint.rochepotential2rpole(pot, q, e, syncpar, sma, compno=1)[source]

TODO: add documentation

phoebe.parameters.constraint.rotstarrpole2potential(rpole, rotfreq)[source]

TODO: add documentation

phoebe.parameters.constraint.rotstarpotential2rpole(pot, rotfreq)[source]

TODO: add documentation

phoebe.parameters.constraint.rochecriticalL12potential(q, e, syncpar, compno=1)[source]

TODO: add documentation

phoebe.parameters.constraint.rochecriticalL12rpole(q, e, syncpar, sma, compno=1)[source]

TODO: add documentation

phoebe.parameters.constraint.esinw2per0(ecc, esinw)[source]

TODO: add documentation

phoebe.parameters.constraint.ecosw2per0(ecc, ecosw)[source]

TODO: add documentation

phoebe.parameters.constraint.t0_perpass_to_supconj(t0_perpass, period, ecc, per0)[source]

TODO: add documentation

phoebe.parameters.constraint.t0_supconj_to_perpass(t0_supconj, period, ecc, per0)[source]

TODO: add documentation

phoebe.parameters.constraint.t0_ref_to_supconj(t0_ref, period, ecc, per0)[source]

TODO: add documentation

phoebe.parameters.constraint.t0_supconj_to_ref(t0_supconj, period, ecc, per0)[source]

TODO: add documentation

phoebe.parameters.constraint.custom(b, *args, **kwargs)[source]

[NOT IMPLEMENTED]

args can be - 2 ConstraintParameters (or parameters which need param.to_constraint()) (lhs, rhs) - 2 parsable strings (lhs, rhs) - single parsable string (lhs, rhs = args[0].split(‘=’)

Raises:NotImplementedError – because it isn’t
phoebe.parameters.constraint.asini(b, orbit, solve_for=None)[source]

Create a constraint for asini in an orbit.

If any of the required parameters (‘asini’, ‘sma’, ‘incl’) do not exist in the orbit, they will be created.

Parameters:
  • b – the phoebe.frontend.bundle.Bundle
  • orbit (str) – the label of the orbit in which this constraint should be built
  • solve_for (str) – if ‘asini’ should not be the derived/constrained parameter, provide which other parameter should be derived (ie ‘sma’ or ‘incl’)
Returns:

lhs (Parameter), rhs (ConstraintParameter), args (list of arguments that were passed to this function)

phoebe.parameters.constraint.esinw(b, orbit, solve_for=None, **kwargs)[source]

Create a constraint for esinw in an orbit.

If ‘esinw’ does not exist in the orbit, it will be created

Parameters:
  • b – the phoebe.frontend.bundle.Bundle
  • orbit (str) – the label of the orbit in which this constraint should be built
  • solve_for (str) – if ‘esinw’ should not be the derived/constrained parameter, provide which other parameter should be derived (ie ‘ecc’, ‘per0’)
Returns:

lhs (Parameter), rhs (ConstraintParameter), args (list of arguments that were passed to this function)

phoebe.parameters.constraint.ecosw(b, orbit, solve_for=None, **kwargs)[source]

Create a constraint for ecosw in an orbit.

If ‘ecosw’ does not exist in the orbit, it will be created

Parameters:
  • b – the phoebe.frontend.bundle.Bundle
  • orbit (str) – the label of the orbit in which this constraint should be built
  • solve_for (str) – if ‘ecosw’ should not be the derived/constrained parameter, provide which other parameter should be derived (ie ‘ecc’ or ‘per0’)
Returns:

lhs (Parameter), rhs (ConstraintParameter), args (list of arguments that were passed to this function)

phoebe.parameters.constraint.t0_perpass_supconj(b, orbit, solve_for=None, **kwargs)[source]

Create a constraint for t0_perpass in an orbit - allowing translating between t0_perpass and t0_supconj.

Parameters:
  • b – the phoebe.frontend.bundle.Bundle
  • orbit (str) – the label of the orbit in which this constraint should be built
  • solve_for (str) – if ‘t0_perpass’ should not be the derived/constrained parameter, provide which other parameter should be derived (ie ‘t0_supconj’, ‘per0’, ‘period’)
Returns:

lhs (Parameter), rhs (ConstraintParameter), args (list of arguments that were passed to this function)

phoebe.parameters.constraint.t0(*args, **kwargs)[source]

shortcut to t0_perpass for backwards compatibility

phoebe.parameters.constraint.t0_ref_supconj(b, orbit, solve_for=None, **kwargs)[source]

Create a constraint for t0_ref in an orbit - allowing translating between t0_ref and t0_supconj.

Parameters:
  • b – the phoebe.frontend.bundle.Bundle
  • orbit (str) – the label of the orbit in which this constraint should be built
  • solve_for (str) – if ‘t0_ref’ should not be the derived/constrained parameter, provide which other parameter should be derived (ie ‘t0_supconj’, ‘per0’, ‘period’)
Returns:

lhs (Parameter), rhs (ConstraintParameter), args (list of arguments that were passed to this function)

phoebe.parameters.constraint.mean_anom(b, orbit, solve_for=None, **kwargs)[source]
phoebe.parameters.constraint.ph_supconj(b, orbit, solve_for=None, **kwargs)[source]

TODO: add documentation

phoebe.parameters.constraint.ph_infconj(b, orbit, solve_for=None, **kwargs)[source]

TODO: add documentation

phoebe.parameters.constraint.ph_perpass(b, orbit, solve_for=None, **kwargs)[source]

TODO: add documentation

phoebe.parameters.constraint.freq(b, component, solve_for=None, **kwargs)[source]

Create a constraint for frequency (either orbital or rotational) given a period.

freq = 2 * pi / period

Parameters:
  • b – the phoebe.frontend.bundle.Bundle
  • component (str) – the label of the orbit or component in which this constraint should be built
  • solve_for (str) – if ‘freq’ should not be the derived/constrained parameter, provide which other parameter should be derived (ie ‘period’)
Returns:

lhs (Parameter), rhs (ConstraintParameter), args (list of arguments that were passed to this function)

phoebe.parameters.constraint.keplers_third_law_hierarchical(b, orbit1, orbit2, solve_for=None, **kwargs)[source]

TODO: add documentation

phoebe.parameters.constraint.irrad_frac(b, component, solve_for=None, **kwargs)[source]

Create a constraint to ensure that energy is conserved and all incident light is accounted for.

phoebe.parameters.constraint.reflredist(b, component, solve_for=None, **kwargs)[source]

Create a constraint to ensure that all reflected light is considered under the available redistribution schemes

phoebe.parameters.constraint.teffratio(b, comp1, comp2, **kwargs)[source]
Raises:NotImplementedError – because this isn’t yet
phoebe.parameters.constraint.mass(b, component, solve_for=None, **kwargs)[source]

Create a constraint for the mass of a star based on Kepler’s third law from its parent orbit.

If ‘mass’ does not exist in the component, it will be created

Parameters:
  • b – the phoebe.frontend.bundle.Bundle
  • component (str) – the label of the star in which this constraint should be built
  • solve_for (str) – if ‘mass’ should not be the derived/constrained parameter, provide which other parameter should be derived (ie ‘q’, sma’, ‘period’)
Returns:

lhs (Parameter), rhs (ConstraintParameter), args (list of arguments that were passed to this function)

Raises:
phoebe.parameters.constraint.comp_sma(b, component, solve_for=None, **kwargs)[source]

Create a constraint for the star’s semi-major axes WITHIN its parent orbit. This is NOT the same as the semi-major axes OF the parent orbit

If ‘sma’ does not exist in the component, it will be created

Parameters:
  • b – the phoebe.frontend.bundle.Bundle
  • component (str) – the label of the star in which this constraint should be built
  • solve_for (str) – if 'sma@star‘ should not be the derived/constrained parameter, provide which other parameter should be derived (ie 'sma@orbit‘, ‘q’)
Returns:

lhs (Parameter), rhs (ConstraintParameter), args (list of arguments that were passed to this function)

phoebe.parameters.constraint.potential(b, component, solve_for=None, **kwargs)[source]

Create a constraint for the potential of a star.

Parameters:
  • b – the phoebe.frontend.bundle.Bundle
  • component (str) – the label of the star in which this constraint should be built
  • solve_for (str) – if ‘pot’ should not be the derived/constrained parameter, provide which other parameter should be derived (ie ‘rpole’)
Returns:

lhs (Parameter), rhs (ConstraintParameter), args (list of arguments that were passed to this function)

phoebe.parameters.constraint.critical_potential(b, component, solve_for=None, **kwargs)[source]

Create a constraint for the potential of a star to match the critical potential at L1

Parameters:
  • b – the phoebe.frontend.bundle.Bundle
  • component (str) – the label of the star in which this constraint should be built
  • solve_for (str) – if ‘pot’ should not be the derived/constrained parameter, provide which other parameter should be derived
Returns:

lhs (Parameter), rhs (ConstraintParameter), args (list of arguments that were passed to this function)

phoebe.parameters.constraint.critical_rpole(b, component, solve_for=None, **kwargs)[source]

Create a constraint for the rpole of a star to match the critical rpole at L1

Parameters:
  • b – the phoebe.frontend.bundle.Bundle
  • component (str) – the label of the star in which this constraint should be built
  • solve_for (str) – if ‘rpole’ should not be the derived/constrained parameter, provide which other parameter should be derived
Returns:

lhs (Parameter), rhs (ConstraintParameter), args (list of arguments that were passed to this function)

phoebe.parameters.constraint.rotation_period(b, component, solve_for=None, **kwargs)[source]

Create a constraint for the rotation period of a star given its orbital period and synchronicity parameters.

Parameters:
Returns:

lhs (Parameter), rhs (ConstraintParameter), args (list of arguments that were passed to this function)

phoebe.parameters.constraint.incl_aligned(b, component, solve_for=None, **kwargs)[source]

Create a constraint for the inclination of a star to be the same as its parent orbit (ie aligned).

Parameters:
Returns:

lhs (Parameter), rhs (ConstraintParameter), args (list of arguments that were passed to this function)

phoebe.parameters.constraint.passband_ratio(b, *args, **kwargs)[source]

ability to constraint pblum ratios (for colors)

Raises:NotImplementedError – because it isn’t, yet
phoebe.parameters.constraint.time_ephem(b, component, dataset, solve_for=None, **kwargs)[source]
use the ephemeris of component to predict the expected times of eclipse (used
in the ETV dataset)
phoebe.parameters.constraint.etv(b, component, dataset, solve_for=None, **kwargs)[source]
compute the ETV column from the time_ephem and time_ecl columns (used in the
ETV dataset)

phoebe.parameters.dataset module

phoebe.parameters.dataset.lc(**kwargs)[source]

Create parameters for a new light curve dataset.

Generally, this will be used as an input to the kind argument in phoebe.frontend.bundle.Bundle.add_dataset()

Parameters:**kwargs

defaults for the values of any of the parameters

Returns:a phoebe.parameters.parameters.ParameterSet of all newly created :class:`phoebe.parameters.parameters.Parameter`s
phoebe.parameters.dataset.lc_syn(syn=True, **kwargs)[source]
phoebe.parameters.dataset.lc_dep(is_lc=True, **kwargs)[source]
phoebe.parameters.dataset.rv(**kwargs)[source]

Create parameters for a new radial velocity dataset.

Generally, this will be used as an input to the kind argument in phoebe.frontend.bundle.Bundle.add_dataset()

Parameters:**kwargs

defaults for the values of any of the parameters

Returns:a phoebe.parameters.parameters.ParameterSet of all newly created :class:`phoebe.parameters.parameters.Parameter`s
phoebe.parameters.dataset.rv_syn(syn=True, **kwargs)[source]
phoebe.parameters.dataset.rv_dep(**kwargs)[source]
phoebe.parameters.dataset.etv(**kwargs)[source]

Create parameters for a new eclipse timing variations dataset.

Generally, this will be used as an input to the kind argument in phoebe.frontend.bundle.Bundle.add_dataset()

Parameters:**kwargs

default for the values of any of the ParameterSet

Returns:a phoebe.parameters.parameters.ParameterSet of all newly created :class:`phoebe.parameters.parameters.Parameter`s
phoebe.parameters.dataset.etv_syn(syn=True, **kwargs)[source]
phoebe.parameters.dataset.etv_dep(**kwargs)[source]
phoebe.parameters.dataset.orb(**kwargs)[source]

Create parameters for a new orbit dataset.

Generally, this will be used as an input to the kind argument in phoebe.frontend.bundle.Bundle.add_dataset()

Parameters:**kwargs

defaults for the values of any of the parameters

Returns:a phoebe.parameters.parameters.ParameterSet of all newly created :class:`phoebe.parameters.parameters.Parameter`s
phoebe.parameters.dataset.orb_syn(syn=True, **kwargs)[source]
phoebe.parameters.dataset.orb_dep(**kwargs)[source]
phoebe.parameters.dataset.mesh(**kwargs)[source]

Create parameters for a new mesh dataset.

Generally, this will be used as an input to the kind argument in phoebe.frontend.bundle.Bundle.add_dataset()

Parameters:**kwargs

defaults for the values of any of the parameters

Returns:a phoebe.parameters.parameters.ParameterSet of all newly created :class:`phoebe.parameters.parameters.Parameter`s
phoebe.parameters.dataset.mesh_syn(syn=True, **kwargs)[source]
phoebe.parameters.dataset.mesh_dep(**kwargs)[source]

phoebe.parameters.feature module

phoebe.parameters.feature.spot(feature, **kwargs)[source]

Create parameters for a spot

Generally, this will be used as input to the method argument in phoebe.frontend.bundle.Bundle.add_feature()

Parameters:**kwargs

defaults for the values of any of the parameters

Returns:a phoebe.parameters.parameters.ParameterSet
phoebe.parameters.feature.pulsation(feature, **kwargs)[source]

Create parameters for a pulsation feature

Generally, this will be used as input to the method argument in phoebe.frontend.bundle.Bundle.add_feature()

Parameters:**kwargs

defaults for the values of any of the parameters

Returns:a phoebe.parameters.parameters.ParameterSet

phoebe.parameters.hierarchy module

phoebe.parameters.hierarchy.binaryorbit(orbit, comp1, comp2, envelope=None)[source]

Build the string representation of a hierarchy containing a binary orbit with 2 components.

Generally, this will be used as an input to the kind argument in phoebe.frontend.bundle.Bundle.set_hierarchy()

Parameters:
  • comp1 – an existing hierarchy string, Parameter, or ParameterSet
  • comp2 – an existing hierarchy string, Parameter, or ParameterSet
Returns:

the string representation of the hierarchy

phoebe.parameters.hierarchy.component(*args)[source]

Build the string representation of a hierarchy that groups multiple objects without a parent orbit (ie a disk around a planet).

Generally, this will be used as an input to the kind argument in phoebe.frontend.bundle.Bundle.set_hierarchy()

Parameters:*args
Returns:the string representation of the hierarchy
phoebe.parameters.hierarchy.blank(*args)[source]

Build the string representation of a blank hierarchy.

Generally, this will be used as an input to Bundle.set_hierarchy()

Generally, this will be used as an input to the kind argument in phoebe.frontend.bundle.Bundle.set_hierarchy()

Parameters:**kwargs

defaults for the values of any of the parameters

Returns:the string representation of the hierarchy

phoebe.parameters.parameters module

Parameters and ParameterSets.

General logic for all Parameters and ParameterSets which makeup the overall framework of the PHOEBE 2.0 frontend.

phoebe.parameters.parameters.send_if_client(fctn)[source]

Intercept and send to the server if bundle is in client mode.

phoebe.parameters.parameters.update_if_client(fctn)[source]

Intercept and check updates from server if bundle is in client mode.

phoebe.parameters.parameters.parameter_from_json(dictionary, bundle=None)[source]

Load a single parameter from a JSON dictionary.

Parameters:
  • dictionary (dict) – the dictionary containing the parameter information
  • bundle – (optional)
Returns:

instantiated Parameter object

class phoebe.parameters.parameters.ParameterSet(params=[])[source]

Bases: object

ParameterSet.

The ParameterSet is an abstract list of Parameters which can then be filtered into another ParameterSet or Parameter by filtering on set tags of the Parameter or on “twig” notation (a single string using ‘@’ symbols to separate these same tags).

Initialize a new ParameterSet.

Parameters:params (list) – list of Parameter to create the ParameterSet (optional)
Returns:instantiated ParameterSet
meta

Dictionary of all meta-tags.

See all the meta-tag properties that are shared by ALL Parameters. If a given value is ‘None’, that means that it is not shared among ALL Parameters. To see the different values among the Parameters, you can access that attribute.

For example: if ps.meta[‘context’] == None, you can see all values through ps.contexts

See get_meta() for the ability to ignore certain keys

Returns:an ordered dictionary of all tag properties
get_meta(ignore=['uniqueid'])[source]

Dictionary of all meta-tags, with option to ignore certain tags.

See all the meta-tag properties that are shared by ALL Parameters. If a given value is ‘None’, that means that it is not shared among ALL Parameters. To see the different values among the Parameters, you can access that attribute.

Parameters:ignore (list) – list of keys to exclude from the returned dictionary
Returns:an ordered dictionary of tag properties
set_meta(**kwargs)[source]

Set the value of tags for all Parameters in this ParameterSet.

tags

Returns a dictionary that lists all available tags that can be used for further filtering

uniqueids

Return a list of all uniqueids in this ParameterSet.

Returns:a list of uniqueids for each Parameter in this ParameterSet
twigs

Return a list of all twigs in this ParameterSet.

Returns:a list of twigs of each Parameter in this ParameterSet
qualifier

Return the value for qualifier if shared by ALL Parameters.

If the value is not shared by ALL, then None will be returned. To see all the qualifiers of all parameters, see qualifiers().

Returns:str or None
qualifiers

Return a list of all qualifiers in this ParameterSet.

Returns:list of strings
time

Return the value for time if shared by ALL Parameters.

If the value is not shared by ALL, then None will be returned. To see all the times of all parameters, see times().

Returns:str or None
times

Return a list of all the times of the Parameters.

Returns:list of strings
history

Return the value for history if shared by ALL Parameters.

If the value is not shared by ALL, then None will be returned. To see all the histories of all parameters, see histories().

Returns:str or None
histories

Return a list of all the histories of the Parameters.

Returns:list of strings
historys

Return a list of all the histories of the Parameters.

Shortcut to histories()

Returns:list of strings
features

Return a list of all this features of teh Parameters.

Returns:list of string
feature

Return the value for feature if shared by ALL Parameters.

If the value is not shared by ALL, then None will be returned. To see all this properties of all parameters, see properties().

Returns:str or None
properties

Return a list of all the properties of the Parameters.

Returns:list of strings
component

Return the value for component if shared by ALL Parameters.

If the value is not shared by ALL, then None will be returned. To see all the components of all parameters, see components().

Returns:str or None
components

Return a list of all the components of the Parameters.

Returns:list of strings
dataset

Return the value for dataset if shared by ALL Parameters.

If the value is not shared by ALL, then None will be returned. To see all the datasets of all parameters, see datasets().

Returns:str or None
datasets

Return a list of all the datasets of the Parameters.

Returns:list of strings
constraint

Return the value for constraint if shared by ALL Parameters.

If the value is not shared by ALL, then None will be returned. To see all the constraints of all parameters, see constraints().

Returns:str or None
constraints

Return a list of all the constraints of the Parameters.

Returns:list of strings
compute

Return the value for compute if shared by ALL Parameters.

If the value is not shared by ALL, then None will be returned. To see all the computes of all parameters, see computes().

Returns:str or None
computes

Return a list of all the computes of the Parameters.

Returns:list of strings
model

Return the value for model if shared by ALL Parameters.

If the value is not shared by ALL, then None will be returned. To see all the models of all parameters, see models().

Returns:str or None
models

Return a list of all the models of the Parameters.

Returns:list of strings
fitting

Return the value for fitting if shared by ALL Parameters.

If the value is not shared by ALL, then None will be returned. To see all the fittings of all parameters, see fittings().

Returns:str or None
fittings

Return a list of all the fittings of the Parameters.

Returns:list of strings
feedback

Return the value for feedback if shared by ALL Parameters.

If the value is not shared by ALL, then None will be returned. To see all the feedbacks of all parameters, see feedbacks().

Returns:str or None
feedbacks

Return a list of all the feedbacks of the Parameters.

Returns:list of strings
plugin

Return the value for plugin if shared by ALL Parameters.

If the value is not shared by ALL, then None will be returned. To see all the plugins of all parameters, see plugins().

Returns:str or None
plugins

Return a list of all the plugins of the Parameters.

Returns:list of strings
kind

Return the value for kind if shared by ALL Parameters.

If the value is not shared by ALL, then None will be returned. To see all the kinds of all parameters, see kinds().

Returns:str or None
kinds

Return a list of all the kinds of the Parameters.

Returns:list of strings
context

Return the value for context if shared by ALL Parameters.

If the value is not shared by ALL, then None will be returned. To see all the contexts of all parameters, see contexts().

Returns:str or None
contexts

Return a list of all the contexts of the Parameters.

Returns:list of strings
classmethod open(filename)[source]

Open a ParameterSet from a JSON-formatted file. This is a constructor so should be called as:

>>> b = ParameterSet.open('test.json')
Parameters:filename (str) – relative or full path to the file
Returns:instantiated ParameterSet object
save(filename, incl_uniqueid=False, compact=False)[source]

Save the ParameterSet to a JSON-formatted ASCII file

Parameters:
  • filename (str) – relative or fullpath to the file
  • incl_uniqueid (bool) – whether to including uniqueids in the file (only needed if its necessary to maintain the uniqueids when reloading)
  • compact (bool) – whether to use compact file-formatting (maybe be quicker to save/load, but not as easily readable)
Returns:

filename

Return type:

str

ui(client='http://localhost:4200', **kwargs)[source]

[NOT IMPLEMENTED]

The bundle must be in client mode in order to open the web-interface. See Bundle:as_client() to switch to client mode.

Parameters:client (str) – URL of the running client which must be connected to the same server as the bundle
Returns:URL of the parameterset of this bundle in the client (will also attempt to open webbrowser)
Return type:str
to_list(**kwargs)[source]

Convert the ParameterSet to a list of :class:`Parameter`s

Returns:list of class:Parameter objects
tolist(**kwargs)[source]

Alias of to_list()

to_list_of_dicts(**kwargs)[source]

Convert the ParameterSet to a list of the dictionary representation of each Parameter

Returns:list of dicts
to_flat_dict(**kwargs)[source]

Convert the ParameterSet to a flat dictionary, with keys being uniquetwigs to access the parameter and values being the Parameter objects themselves.

Returns:dict of :class:`Parameter`s
to_dict(field=None, **kwargs)[source]

Convert the ParameterSet to a structured (nested) dictionary to allow traversing the structure from the bottom up

Parameters:field (str) – (optional) build the dictionary with keys at a given level/field. Can be any of the keys in meta(). If None, the keys will be the lowest level in which Parameters have different values.
Returns:dict of :class:`Parameter`s or :class:`ParameterSet`s
keys()[source]

Return the keys from to_dict()

Returns:list of strings
values()[source]

Return the values from to_dict()

Returns:list of :class:`Parameter`s or :class:`ParameterSet`s
items()[source]

Returns the items (key, value pairs) from to_dict()

Returns:string, Parameter or ParameterSet pairs
set(key, value, **kwargs)[source]

Set the value of a Parameter in the ParameterSet.

If get() would retrieve a Parameter, this will set the value of that parameter.

Or you can provide ‘value@...’ or ‘default_unit@...’, etc to specify what attribute to set.

Parameters:
  • key (str) – the twig (called key here to be analagous to a normal dict)
  • value – value to set
  • **kwargs

    other filter parameters (must result in returning a single Parameter)

Returns:

the value of the Parameter after setting the new value (including converting units if applicable)

to_json(incl_uniqueid=False)[source]

Convert the ParameterSet to a json-compatible dictionary

Returns:list of dictionaries
filter(twig=None, check_visible=True, check_default=True, **kwargs)[source]

Filter the ParameterSet based on the meta-tags of the Parameters and return another ParameterSet.

Because another ParameterSet is returned, these filter calls are chainable.

>>> b.filter(context='component').filter(component='starA')
Parameters:
  • twig (str) – (optional) the search twig - essentially a single string with any delimiter (ie ‘@’) that will be parsed into any of the meta-tags. Example: instead of b.filter(context=’component’, component=’starA’), you could do b.filter('starA@component‘).
  • check_visible (bool) – whether to hide invisible parameters. These are usually parameters that do not play a role unless the value of another parameter meets some condition.
  • check_default (bool) – whether to exclude parameters which have a _default tag (these are parameters which solely exist to provide defaults for when new parameters or datasets are added and the parameter needs to be copied appropriately). Defaults to True.
  • **kwargs

    meta-tags to search (ie. ‘context’, ‘component’, ‘model’, etc). See meta() for all possible options.

Returns:

the resulting ParameterSet

get(twig=None, check_visible=True, check_default=True, **kwargs)[source]

Get a single parameter from this ParameterSet. This works exactly the same as filter except there must be only a single result, and the Parameter itself is returned instead of a ParameterSet.

Also see get_parameter() (which is simply an alias of this method)

Parameters:
  • twig (str) – (optional) the search twig - essentially a single string with any delimiter (ie ‘@’) that will be parsed into any of the meta-tags. Example: instead of b.filter(context=’component’, component=’starA’), you could do b.filter('starA@component‘).
  • check_visible (bool) – whether to hide invisible parameters. These are usually parameters that do not play a role unless the value of another parameter meets some condition.
  • check_default (bool) – whether to exclude parameters which have a _default tag (these are parameters which solely exist to provide defaults for when new parameters or datasets are added and the parameter needs to be copied appropriately). Defaults to True.
  • **kwargs

    meta-tags to search (ie. ‘context’, ‘component’, ‘model’, etc). See meta() for all possible options.

Returns:

the resulting Parameter

Raises:

ValueError – if either 0 or more than 1 results are found matching the search.

filter_or_get(twig=None, autocomplete=False, force_ps=False, check_visible=True, check_default=True, **kwargs)[source]

Filter the ParameterSet based on the meta-tags of its Parameters and return another ParameterSet unless there is exactly 1 result, in which case the Parameter itself is returned (set force_ps=True to avoid this from happening or call filter instead).

In the case when another ParameterSet is returned, these filter calls are chainable.

>>> b.filter_or_get(context='component').filter_or_get(component='starA')
Parameters:
  • twig (str) – (optional) the search twig - essentially a single string with any delimiter (ie ‘@’) that will be parsed into any of the meta-tags. Example: instead of b.filter(context=’component’, component=’starA’), you could do b.filter('starA@component‘).
  • force_ps (bool) – whether to force a ParameterSet to be returned even if only a single result is found. This is helpful if you want to write generic code that chains filter calls (since Parameter does not have a filter method).
  • check_visible (bool) – whether to hide invisible parameters. These are usually parameters that do not play a role unless the value of another parameter meets some condition.
  • check_default (bool) – whether to exclude parameters which have a _default tag (these are parameters which solely exist to provide defaults for when new parameters or datasets are added and the parameter needs to be copied appropriately). Defaults to True.
  • **kwargs

    meta-tags to search (ie. ‘context’, ‘component’, ‘model’, etc). See meta() for all possible options.

Returns:

Parameter if length of results is exactly 1 and force_ps==False. Otherwise another ParameterSet will be returned.

exclude(twig=None, check_visible=True, **kwargs)[source]

Exclude the results from this filter from the current ParameterSet.

See filter() for options.

get_parameter(twig=None, **kwargs)[source]

Get a Parameter from this ParameterSet. This simply calls get

Parameters:
  • twig (str) – (optional) the search twig - essentially a single string with any delimiter (ie ‘@’) that will be parsed into any of the meta-tags. Example: instead of b.filter(context=’component’, component=’starA’), you could do b.filter('starA@component‘).
  • check_visible (bool) – whether to hide invisible parameters. These are usually parameters that do not play a role unless the value of another parameter meets some condition.
  • **kwargs

    meta-tags to search (ie. ‘context’, ‘component’, ‘model’, etc). See meta() for all possible options.

Returns:

the resulting Parameter

Raises:

ValueError – if either 0 or more than 1 results are found matching the search.

get_or_create(qualifier, new_parameter, **kwargs)[source]

Get a Parameter from the ParameterSet, if it does not exist, create and attach it.

Note: running this on a ParameterSet that is NOT a phoebe.frontend.bundle.Bundle, will NOT add the Parameter to the bundle, but only the temporary ParameterSet

Parameters:
  • qualifier (str) – the qualifier of the Parameter (note, not the twig)
  • new_parameter (Parameter) – the parameter to attach if no result is found
  • **kwargs

    meta-tags to search - will also be applied to new_parameter if it is attached.

Returns:

Parameter, created

Return type:

Parameter, bool

Raises:

ValueError – if more than 1 result was found using the search criteria.

remove_parameter(twig=None, **kwargs)[source]

Remove a Parameter from the ParameterSet

Note: removing Parameters from a ParameterSet will not remove them from any parent ParameterSets (including the phoebe.frontend.bundle.Bundle)

Parameters:
  • twig (str) – the twig to search for the parameter
  • **kwargs

    meta-tags to search

Raises:

ValueError – if 0 or more than 1 results are found using the provided search criteria.

remove_parameters_all(twig=None, **kwargs)[source]

Remove all :class:`Parameter`s that match the search from the ParameterSet.

Any Parameter that would be included in the resulting ParameterSet from a filter() call with the same arguments will be removed from this ParameterSet.

Note: removing Parameters from a ParameterSet will not remove them from any parent ParameterSets (including the phoebe.frontend.bundle.Bundle)

Parameters:
  • twig (str) – the twig to search for the parameter
  • **kwargs

    meta-tags to search

get_quantity(twig=None, unit=None, default=None, t=None, **kwargs)[source]

TODO: add documentation

set_quantity(twig=None, value=None, **kwargs)[source]

TODO: add documentation

get_value(twig=None, unit=None, default=None, t=None, **kwargs)[source]

Get the value of a Parameter in this ParameterSet

Parameters:
  • twig (str) – the twig to search for the parameter
  • unit (str or astropy.units.Unit) – units for the returned result (if applicable). If None or not provided, the value will be returned in that Parameter’s default_unit (if applicable)
  • default – what to return if the parameter cannot be found. If this is None (default) then an error will be raised instead. Note that the units of default will not be converted.
  • time – time at which to compute the value (will only affect time-dependent parameters). If provided as a float it is assumed that the units are the same as t0. NOTE: this is not fully supported yet, use with caution.
  • **kwargs

    meta-tags to search

Returns:

value (type depeding on the type of the Parameter)

set_value(twig=None, value=None, **kwargs)[source]

Set the value of a Parameter in this ParameterSet

Note: setting the value of a Parameter in a ParameterSet WILL change that Parameter across any parent ParameterSets (including the phoebe.frontend.bundle.Bundle)

Parameters:
  • twig (set) – the twig to search for the parameter
  • value – the value to set. Provide units, if necessary, by sending a Quantity object (ie 2.4*u.rad)
  • **kwargs

    meta-tags to search

Raises:

ValueError – if 0 or more than 1 results are found matching the search criteria.

set_value_all(twig=None, value=None, check_default=False, **kwargs)[source]

Set the value of all returned :class:`Parameter`s in this ParameterSet.

Any Parameter that would be included in the resulting ParameterSet from a filter() call with the same arguments will have their value set.

Note: setting the value of a Parameter in a ParameterSet WILL change that Parameter across any parent ParameterSets (including the phoebe.frontend.bundle.Bundle)

Parameters:
  • twig (str) – the twig to search for the parameter
  • value – the value to set. Provide units, if necessary, by sending a Quantity object (ie 2.4*u.rad)
  • check_default (bool) – whether to exclude any default values. Defaults to False (unlike all filtering). Note that this acts on the current ParameterSet so any filtering done before this call will EXCLUDE defaults by default.
  • **kwargs

    meta-tags to search

get_default_unit(twig=None, **kwargs)[source]

TODO: add documentation

set_default_unit(twig=None, unit=None, **kwargs)[source]

TODO: add documentation

set_default_unit_all(twig=None, unit=None, **kwargs)[source]

TODO: add documentation

get_adjust(twig=None, **kwargs)[source]

[NOT IMPLEMENTED]

raises NotImplementedError: because it isn’t

set_adjust()[source]

[NOT IMPLEMENTED]

raises NotImplementedError: because it isn’t

set_adjust_all()[source]

[NOT IMPLEMENTED]

raises NotImplementedError: because it isn’t

get_enabled(twig=None, **kwargs)[source]

[NOT IMPLEMENTED]

raises NotImplementedError: because it isn’t

set_enabled()[source]

[NOT IMPLEMENTED]

raises NotImplementedError: because it isn’t

get_description(twig=None, **kwargs)[source]

TODO: add documentation

get_prior(twig=None, **kwargs)[source]

[NOT IMPLEMENTED]

raises NotImplementedError: because it isn’t

set_prior()[source]

[NOT IMPLEMENTED]

raises NotImplementedError: because it isn’t

remove_prior()[source]

[NOT IMPLEMENTED]

raises NotImplementedError: because it isn’t

get_posterior(twig=None, **kwargs)[source]

[NOT IMPLEMENTED]

raises NotImplementedError: because it isn’t

remove_posterior()[source]

[NOT IMPLEMENTED]

raises NotImplementedError: because it isn’t

get_plotting_info(twig=None, **kwargs)[source]

[ADD DOCUMENTATION]

plot(*args, **kwargs)[source]

High-level wrapper around matplotlib (by default, but also has some support for other plotting backends). This function smartly makes one or multiple calls to the plotting backend based on the type of data.

Individual lines are each given a label (automatic if not provided). To see these in a legend simply call ax.legend([options])

>>> ax = ps.plot()
>>> ax.legend()
>>> plt.show()
Parameters:
  • *args

    either a twig pointing to a dataset, or dictionaries, where each dictionary gets passed back to plot()

  • time (float) – Current time. For spectra and meshes, time is required to determine at which time to draw. For other types, time will only be used for higlight and uncover (if enabled)
  • backend (str) – Plotting backend to use. Will default to ‘plotting_backend’ from the phoebe.frontend.bundle.Bundle settings if not provided.
  • highlight (bool) – whether to highlight the current time (defaults to True)
  • highlight_marker (str) – if highlight==True - what marker-type to use for highlighting the current time (defaults to ‘o’)
  • highlight_ms (int) – if highlight==Ture - what marker-size to use for highlighting the current time
  • highlight_color (str) – if highlight==True: what marker-color to use for highlighting the current time
  • uncover (bool) – whether to only show data up to the current time (defaults to False)
  • ax (mpl.axes) – axes to plot on (defaults to plt.gca())
  • x (str) – qualifier or twig of the array to plot on the x-axis (will default based on the kind if not provided). Must be a valid qualifier with the exception of phase. To plot phase along the x-axis set x to ‘phases’ or ‘phases:[component]’. This will use the ephemeris from phoebe.frontend.bundle.Bundle.get_ephemeris() if possible.
  • y (str) – qualifier or twig of the array to plot on the y-axis (see details for x above)
  • z (str) – qualifier or twig of the array to plot on the z-axis if both the backend and ax support 3d plotting (see details for x above)
  • t0 (string or float) – qualifier or float of the t0 that should be used for phasing, if applicable
  • xerrors (str) – qualifier of the array to plot as x-errors (will default based on x if not provided)
  • yerrors (str) – qualifier of the array to plot as y-errors (will default based on y if not provided)
  • zerrors (str) – qualifier of the array to plot as z-errors (will default based on z if not provided)
  • xunit (str or astropy.unit.Unit) – unit to plot the x-array (will default based on x if not provided)
  • yunit (str or astropy.unit.Unit) – unit to plot the y-array (will default based on y if not provided)
  • zunit (str or astropy.unit.Unit) – unit to plot the z-array (will default based on z if not provided)
  • xlabel (str) – label for the x-axis (will default based on x if not provided, but will not set if ax already has an xlabel)
  • ylabel (str) – label for the y-axis (will default based on y if not provided, but will not set if ax already has an ylabel)
  • zlabel (str) – label for the z-axis (will default based on z if not provided, but will not set if ax already has an zlabel)
  • xlim (tuple) – limits for the x-axis (will default based on data if not provided)
  • ylim (tuple) – limits for the x-axis (will default based on data if not provided)
  • zlim (tuple) – limits for the x-axis (will default based on data if not provided)
  • label (str) – label to give to ALL lines in this single plotting call (each line with get automatic default labels if not provided)
  • color (str) – matplotlib recognized color string or the qualifier/twig of an array to use for color (will apply to facecolor and edgecolor for meshes unless those are provided)
  • cmap (str) – matplotlib recognized cmap to use if color is a qualifier pointing to an array (will be ignored otherwise)
  • colorbar (bool) – whether to display the colorbar (will default to False)
  • colorunit (str or astropy.unit.Unit) – unit to plot the color-array (will default based on color if not provided)
  • colorlim (tuple) – limit for the colorbar (in same units as colorunit)
  • colorlabel (str) – label for the colorbar, if applicable (will default based on color if not provided)
  • facecolor (str) – matplotlib recognized color string or the qualifier/twig of an array to use for facecolor (mesh plots only - takes precedence over color)
  • facecmap (str) – matplotlib recognized cmap to use if facecolor is a qualifier pointing to an array (will be ignored otherwise)
  • facecolorbar – whether to display the facecolorbar (will default to False - takes precedence over colorbar)
  • facecolorunit (str or astropy.unit.Unit) – unit to plot the facecolor-array (will default based on facecolor if not provided)
  • facecolorlim (tuple) – limit for the facecolorbar (in same units as facecolorunit)
  • facecolorlabel (str) – label for the facecolorbar, if applicable (will default based on facecolor if not provided)
  • edgecolor (str) – matplotlib recognized color string or the qualifier/twig of an array to use for edgecolor (mesh plots only - takes precedence over color)
  • edgecmap (str) – matplotlib recognized cmap to use if edgecolor is a qualifier pointing to an array (will be ignored otherwise
  • edgecolorunit (str or astropy.unit.Unit) – unit to plot the edgecolor-array (will default based on edgecolor if not provided)
  • facecolorlim – limit for the facecolorbar (in same units as facecolorunit)
  • edgecolorlabel (str) – label for the edgecolorbar, if applicable (will default based on edgecolor if not provided)
  • save (str) – filename of the resulting animation. If provided, the animation will be saved automatically. Either way, the animation object is returned (so you can always call anim.save(fname)).
  • show (bool) – whether to automatically show the animation (defaults to False). Either way, the animation object is returned (so you can always call b.show() or plt.show())
  • **kwargs

    additional kwargs to filter the ParameterSet OR to pass along to the backend plotting call

Returns:

the matplotlib axes (or equivalent for other backends)

show(**kwargs)[source]

Show the plot. This is really just a very generic wrapper based on the chosen plotting backend. For matplotlib it is probably just as, if not even more, convenient to simply import matplotlib yourself and call the show method. However, other backends require saving to temporary html files and opening a webbrowser - so this method provides the ability for a generic call that should work if you choose to change the plotting backend.

Parameters:backend (str) – which plotting backend to use. Will default to ‘plotting_backend’ from settings in the phoebe.frontend.bundle.Bundle if not provided.
savefig(fname, **kwargs)[source]

Save the plot. This is really just a very generic wrapper based on the chosen plotting backend. For matplotlib it is probably just as, if not even more, convenient to simply import matplotlib yourself and call the savefig method.

Parameters:
  • filename (str) – filename to save to. Be careful of extensions here... matplotlib accepts many different image formats while other backends will only export to html.
  • backend (str) – which plotting backend to use. Will default to ‘plotting_backend’ from settings in the phoebe.frontend.bundle.Bundle if not provided.
animate(*args, **kwargs)[source]

NOTE: any drawing done to the figure (or its children axes) before calling animate will remain on every frame and will not update.

NOTE: if show and save provided, the live plot will be shown first, as soon as the plot is closed the animation will be re-compiled and saved to disk, and then the anim object will be returned.

NOTE: during ‘show’ the plotting speed may be slower than the provided interval - especially if plotting meshes.

Parameters:
  • *args

    either a twig pointing to a dataset, or dictionaries, where each dictionary gets passed to plot() for each frame (see example scripts for more details).

  • times – list of times - each time will create a single frame in the animation
  • fixed_limits (bool) – whether all the axes should have the same limits for each frame (if True), or resizing limits based on the contents of that individual frame (if False). Note: if False, limits will be automatically set at each frame - meaning manually zooming in the matplotlib will revert at the next drawn frame.
  • interval (int) – time interval in ms between each frame (default: 100)
  • save (str) – filename of the resulting animation. If provided, the animation will be saved automatically. Either way, the animation object is returned (so you can always call anim.save(fname)).
  • save_args (list) – any additional arguments that need to be sent to the anim.save call (as extra_args=save_args, see https://matplotlib.org/2.0.0/api/_as_gen/matplotlib.animation.Animation.save.html#matplotlib.animation.Animation.save)
  • save_kwargs (dict) – any additional keyword arguments that need to be sent to the anim.save call (as **save_kwargs, see https://matplotlib.org/2.0.0/api/_as_gen/matplotlib.animation.Animation.save.html#matplotlib.animation.Animation.save)
  • show (bool) – whether to automatically show the animation (defaults to False). Either way, the animation object is returned (so you can always call b.show() or plt.show())
  • kwargs – any additional arguments will be passed along to each call of plot(), unless they are already specified
Return fname:

returns the created filename

class phoebe.parameters.parameters.Parameter(qualifier, value=None, description='', **kwargs)[source]

Bases: object

This is a generic class for a Parameter. Any Parameter that will actually be usable will be a subclass of this class.

Parameters are the base of PHOEBE and hold, at the minimum, the value of the parameter, a description, and meta-tags which are used to collect and filter a list of Parameters inside a ParameterSet.

Some subclasses of Parameter can add additional methods or attributes. For example FloatParameter handles converting units and storing a default_unit.

Any subclass of Parameter must (at the minimum): - method for get_value - method for set_value, - call to set_value in the overload of __init__ - self._dict_fields_other defined in __init__ - self._dict_fields = _meta_fields_all + self._dict_fields_other in __init__

Parameters:
  • value – value to initialize the parameter
  • description (str) – description of the parameter
  • bundle – (optional) parent phoebe.frontend.bundle.Bundle
  • uniqueid (str) – uniqueid for the parameter (suggested to leave blank and a random string will be generated)
  • time (float) – (optional) value for the time tag
  • history (str) – (optional) label for the history tag
  • feature (str) – (optional) label for the feature tag
  • component (str) – (optional) label for the component tag
  • dataset (str) – (optional) label for the dataset tag
  • constraint (str) – (optional) label for the constraint tag
  • compute (str) – (optional) label for the compute tag
  • model (str) – (optional) label for the model tag
  • fitting (str) – (optional) label for the fitting tag
  • feedback (str) – (optional) label for the feedback tag
  • plugin (str) – (optional) label for the plugin tag
  • kind (str) – (optional) label for the kind tag
  • context (str) – (optional) which context this parameter belongs in
  • copy_for (dict or False) – (optional) dictionary of filter arguments for which this parameter must be copied (use with caution)
  • visible_if (str) – (optional) string to check the value of another parameter holding the same meta-tags (except qualifier) to determine whether this parameter is visible and therefore shown in filters (example: visible_if=’otherqualifier:True’)
copy()[source]

Deepcopy the parameter (with a new uniqueid). All other tags will remain the same... so some other tag should be changed before attaching back to a ParameterSet or Bundle.

Returns:the copied Parameter object
to_string()[source]

see also to_string_short()

Returns:the string representation of the parameter
to_string_short()[source]

see also to_string()

Returns:a shorter abreviated string reprentation of the parameter
to_dict()[source]
Returns:the dictionary representation of the parameter
classmethod open(filename)[source]

Open a Parameter from a JSON-formatted file. This is a constructor so should be called as:

>>> b = Parameter.open('test.json')
Parameters:filename (str) – relative or full path to the file
Returns:instantiated Parameter object
save(filename, incl_uniqueid=False)[source]

Save the Parameter to a JSON-formatted ASCII file

Parameters:filename (str) – relative or fullpath to the file
Returns:filename
Return type:str
to_json(incl_uniqueid=False)[source]
Returns:a JSON-ready dictionary holding all information for this parameter
attributes
get_attributes()[source]
meta

See all the meta-tag properties for this Parameter

See get_meta() for the ability to ignore certain keys

Returns:an ordered dictionary of all tag properties
get_meta(ignore=['uniqueid'])[source]

See all the meta-tag properties for this Parameter

Parameters:ignore (list) – list of keys to exclude from the returned dictionary
Returns:an ordered dictionary of tag properties
qualifier
Returns:qualifier tag of this Parameter
time
Returns:time tag of this Parameter
history
Returns:history tag of this Parameter
feature
Returns:feature tag of this Parameter
component
Returns:component tag of this Parameter
dataset
Returns:dataset tag of this Parameter
constraint
Returns:constraint tag of this Parameter
compute
Returns:compute tag of this Parameter
model
Returns:model tag of this Parameter
fitting
Returns:fitting tag of this Parameter
feedback
Returns:feedback tag of this Parameter
plugin
Returns:plugin tag of this Parameter
kind
Returns:kind tag of this Parameter
context
Returns:context tag of this Parameter
uniqueid
Returns:uniqueid of this Parameter
uniquetwig_trunc

Uniquetwig but truncated if necessary to be <=12 characters

uniquetwig

see also twig()

Determine the shortest (more-or-less) twig which will point to this single Parameter in a given parent ParameterSet

Parameters:psParameterSet in which the returned uniquetwig will point to this Parameter. If not provided or None this will default to the parent phoebe.frontend.bundle.Bundle, if available.
Returns:uniquetwig
Return type:str
twig

The twig of a Parameter is a single string with the individual meta() tags separated by ‘@’ symbols. This twig gives a single string which can point back to this Parameter.

see also uniquetwig()

Returns:twig (full) of this Parameter
visible_if
Returns:the visible_if expression for this Parameter
is_visible

see also visible_if()

Returns:whether this parameter is currently visible (and therefore shown in ParameterSets and visible to ParameterSet.filter())
Return type:bool
copy_for
description
Returns:the description of this parameter
get_description()[source]
Returns:the description of this parameter
value

return the value

see get_value() for more options, including units when applicable

Returns:the value
get_parent_ps()[source]

Return a ParameterSet of all Parameters in the same phoebe.frontend.bundle.Bundle which share the same meta-tags (except qualifier, twig, uniquetwig)

Returns:the parent ParameterSet
to_constraint()[source]

Convert this Parameter to a ConstraintParameter. Use with caution.

Returns:the ConstraintParameter
set_uniqueid(uniqueid)[source]

Set the uniqueid of this Parameter. There is no real need for a user to call this unless there is some conflict or they manually want to set the uniqueids.

NOTE: this does not check for conflicts, and having two parameters without the same uniqueid (not really unique anymore is it) will surely cause unexpected results. Use with caution.

Parameters:uniqueid (str) – the new uniqueid
get_value(*args, **kwargs)[source]

This method should be overriden by any subclass of Parameter, and should be decorated with the @update_if_client decorator. Please see the individual classes documentation:

If subclassing, this method needs to:
  • cast to the correct type/units, handling defaults
Raises:NotImplementedError – because this must be subclassed
set_value(*args, **kwargs)[source]

This method should be overriden by any subclass of Parameter, and should be decorated with the @send_if_client decorator Please see the individual classes for documentation:

If subclassing, this method needs to:
  • check the inputs for the correct format/agreement/cast_type
  • make sure that converting back to default_unit will work (if applicable)
  • make sure that in choices (if a choose)
  • make sure that not out of limits
  • make sure that not out of prior ??
Raises:NotImplementedError – because this must be subclassed
class phoebe.parameters.parameters.StringParameter(*args, **kwargs)[source]

Bases: phoebe.parameters.parameters.Parameter

Parameter that accepts any string for the value

see Parameter.__init__()

get_value(*args, **kwargs)[source]
set_value(*args, **kwargs)[source]
class phoebe.parameters.parameters.TwigParameter(bundle, *args, **kwargs)[source]

Bases: phoebe.parameters.parameters.Parameter

Parameter that handles referencing any other parameter by twig (must exist) This stores the uniqueid but will display as the current uniquetwig for that item

see Parameter.__init__()

get_parameter()[source]

return the parameter that this points to

get_value(*args, **kwargs)[source]
set_value(*args, **kwargs)[source]

kwargs are passed on to filter

class phoebe.parameters.parameters.ChoiceParameter(*args, **kwargs)[source]

Bases: phoebe.parameters.parameters.Parameter

Parameter in which the value has to match one of the pre-defined choices

see Parameter.__init__()

choices
get_choices()[source]
get_value(*args, **kwargs)[source]
set_value(*args, **kwargs)[source]
class phoebe.parameters.parameters.SelectParameter(*args, **kwargs)[source]

Bases: phoebe.parameters.parameters.Parameter

Parameter in which the value is a list of pre-defined choices

see Parameter.__init__()

choices
get_choices()[source]
valid_selection(value)[source]
get_value(*args, **kwargs)[source]
expand_value(**kwargs)[source]

expand the selection to account for wildcards

set_value(*args, **kwargs)[source]
remove_not_valid_selections()[source]

update the value to remove any that are (no longer) valid

class phoebe.parameters.parameters.BoolParameter(*args, **kwargs)[source]

Bases: phoebe.parameters.parameters.Parameter

see Parameter.__init__()

get_value(*args, **kwargs)[source]
set_value(*args, **kwargs)[source]
class phoebe.parameters.parameters.DictParameter(*args, **kwargs)[source]

Bases: phoebe.parameters.parameters.Parameter

see Parameter.__init__()

get_value(*args, **kwargs)[source]
set_value(*args, **kwargs)[source]
class phoebe.parameters.parameters.IntParameter(*args, **kwargs)[source]

Bases: phoebe.parameters.parameters.Parameter

see Parameter.__init__()

limits
get_limits()[source]
set_limits(limits=(None, None))[source]
within_limits(value)[source]

check whether a value falls within the set limits

Parameters:value – float or Quantity to test. If value is a float, it is assumed that it has the same units as default_units
get_value(*args, **kwargs)[source]
set_value(*args, **kwargs)[source]
class phoebe.parameters.parameters.FloatParameter(*args, **kwargs)[source]

Bases: phoebe.parameters.parameters.Parameter

see Parameter.__init__()

additional options: default_unit

default_unit
get_default_unit()[source]
set_default_unit(unit)[source]
limits
get_limits()[source]
set_limits(limits=(None, None))[source]
within_limits(value)[source]

check whether a value falls within the set limits

Parameters:value – float or Quantity to test. If value is a float, it is assumed that it has the same units as default_units
timederiv
quantity
get_timederiv()[source]
set_timederiv(timederiv)[source]
get_value(unit=None, t=None, **kwargs)[source]

@param unit: astropy unit @type unit: astropy.units.Unit @param time: time at which to compute the value (will only affect

time-dependent parameters)
@type time: float (assumes days in same convention as t0) or astropy.Quantity
(will handle appropriate unit conversion)

@return: value in requested unit @rtype: depends on cast_type

get_quantity(*args, **kwargs)[source]

@param unit: astropy unit @type unit: astropy.units.Unit @param time: time at which to compute the value (will only affect

time-dependent parameters)
@type time: float (assumes days in same convention as t0) or astropy.Quantity
(will handle appropriate unit conversion)

@return: value in requested unit @rtype: depends on cast_type

set_value(value, unit=None, force=False, run_checks=None, **kwargs)[source]
set_quantity(*args, **kwargs)[source]

If unit is not provided, will default to self.default_unit. Units can either be provided by passing a astropy.Quantity (value * astropy.units.Unit) as value, or by passing the astropy.units.Unit to unit. If units are provided with both but do not agree, an error will be raised.

Parameters:
  • value (depends on cast_type) – new value
  • unit (astropy.units.Unit) – unit of the provided value (will not change default_unit)
  • run_checks (bool) – whether to see if the new value will be expected to cause the system to be non-computable (will not raise an error, but will cause a warning in the logger)
is_constraint

returns the expression of the constraint that constrains this parameter

constrained_by

returns a list of parameters that constrain this parameter

in_constraints

returns a list of the expressions in which this parameter constrains another

constrains

returns a list of parameters that are constrained by this parameter

related_to

returns a list of all parameters that are either constrained by or constrain this parameter

class phoebe.parameters.parameters.FloatArrayParameter(*args, **kwargs)[source]

Bases: phoebe.parameters.parameters.FloatParameter

see Parameter.__init__()

allow_none
to_string_short()[source]

see also to_string()

Returns:a shorter abreviated string reprentation of the parameter
interp_value(**kwargs)[source]

Interpolate to find the value in THIS array given a value from ANOTHER array in the SAME parent ParameterSet

This currently only supports simple 1d linear interpolation (via numpy.interp) and does no checks to make sure you’re interpolating with respect to an independent parameter - so use with caution.

>>> print this_param.get_parent_ps().qualifiers
>>> 'other_qualifier' in this_param.get_parent_ps().qualifiers
True
>>> this_param.interp_value(other_qualifier=5)

where other_qualifier must be in this_param.get_parent_ps().qualifiers AND must point to another FloatArrayParameter.

Example:

>>> b['flux@lc01@model'].interp_value(times=10.2)

NOTE: Interpolation by phase is not currently supported - but you can use phoebe.frontend.bundle.Bundle.to_time() to convert to a valid time first (just make sure its in the bounds of the time array).

NOTE: this method does not currently support units. You must provide the interpolating value in its default units and are returned the value in the default units (no support for quantities).

Parameters:

**kwargs

see examples above, must provide a single qualifier-value pair to use for interpolation. In most cases this will probably be time=value or wavelength=value.

Raises:
append(value)[source]
set_index_value(index, value, **kwargs)[source]
start

Access the ‘start’ value of an array if set as phoebe.arange or phoebe.linspace

set_start(start)[source]

Change the ‘start’ value of an array if set as phoebe.arange or phoebe.linspace

stop

Access the ‘stop’ value of an array if set as phoebe.arange or phoebe.linspace

set_stop(stop)[source]

Change the ‘stop’ value of an array if set as phoebe.arange or phoebe.linspace

step

Access the ‘step’ value of an array if set as phoebe.arange

set_step(step)[source]

Change the ‘stop’ value of an array if set as phoebe.arange

num

Access the ‘num’ value of an array if set as phoebe.linspace

set_num(num)[source]

Change the ‘stop’ value of an array if set as phoebe.linspace

convert_to_arange()[source]

Convert a value stored as phoebe.linspace to phoebe.arange

convert_to_linspace()[source]

Convert a value stored as phoebe.arange to phoebe.linspace

class phoebe.parameters.parameters.ArrayParameter(*args, **kwargs)[source]

Bases: phoebe.parameters.parameters.Parameter

see Parameter.__init__()

append(value)[source]
get_value(*args, **kwargs)[source]
set_value(*args, **kwargs)[source]
class phoebe.parameters.parameters.IntArrayParameter(*args, **kwargs)[source]

Bases: phoebe.parameters.parameters.FloatArrayParameter

quantity
get_quantity(*args, **kwargs)[source]

IntParameters don’t have units, but we may want a Quantity object returned nonetheless

set_value(*args, **kwargs)[source]
class phoebe.parameters.parameters.HierarchyParameter(value, **kwargs)[source]

Bases: phoebe.parameters.parameters.StringParameter

see Parameter.__init__()

set_value(*args, **kwargs)[source]
change_component(old_component, new_component)[source]
get_components()[source]
get_top()[source]
get_stars()[source]

get ‘component’ of all stars in order primary -> secondary

get_orbits()[source]

get ‘component’ of all orbits in order primary -> secondary

get_parent_of(component)[source]
get_sibling_of(component, kind=None)[source]
get_siblings_of(component, kind=None)[source]
get_stars_of_sibling_of(component)[source]

same as get_sibling_of except if the sibling is an orbit, this will recursively follow the tree to return a list of all stars under that orbit

get_children_of(component, kind=None)[source]

get to component labels of the children of a given component

get_stars_of_children_of(component)[source]

same as get_children_of except if any of the children are orbits, this will recursively follow the tree to return a list of all children (grandchildren, etc) stars under that orbit

get_child_of(component, ind, kind=None)[source]

get a child (by index) of a given component

get_primary_or_secondary(component, return_ind=False)[source]

return whether a given component is the ‘primary’ or ‘secondary’ component in its parent orbit

get_meshables()[source]
return a list of components that are meshable (generally stars, but handles
the envelope for an contact_binary)
get_kind_of(component)[source]
is_contact_binary(component)[source]

especially useful for constraints

tells whether any component (star, envelope) is part of a contact_binary by checking its siblings for an envelope

is_binary(component)[source]

especially useful for constraints

tells whether any component (star, envelope) is part of a binary by checking its parent

class phoebe.parameters.parameters.ConstraintParameter(bundle, value, **kwargs)[source]

Bases: phoebe.parameters.parameters.Parameter

One side of a constraint (not an equality)

qualifier: constrained parameter value: expression

see Parameter.__init__()

is_visible
constraint_func
constraint_kwargs
vars

return all the variables in a PS

constrained_parameter
get_constrained_parameter()[source]
get_parameter(twig=None, **kwargs)[source]

get a parameter from those that are variables

default_unit
get_default_unit()[source]
set_default_unit(unit)[source]
set_value(value, **kwargs)[source]

kwargs are passed on to filter

expr
get_value()[source]
result

get the current value (as a quantity) of this expression

get_result(t=None)[source]
flip_for(twig=None, expression=None, **kwargs)[source]

flip the constraint to solve for for any of the parameters in the expression

expression (optional if sympy available, required if not)

class phoebe.parameters.parameters.HistoryParameter(bundle, redo_func, redo_kwargs, undo_func, undo_kwargs, **kwargs)[source]

Bases: phoebe.parameters.parameters.Parameter

see Parameter.__init__()

to_string_short()[source]
undo_str
redo_str
redo_func
redo_kwargs
undo_func
undo_kwargs
affected_params
get_affected_params(return_twigs=False)[source]
redo()[source]
undo()[source]
class phoebe.parameters.parameters.JobParameter(b, location, status_method, retrieve_method, server_status=None, **kwargs)[source]

Bases: phoebe.parameters.parameters.Parameter

Parameter that tracks a submitted job (detached run_compute or run_fitting)

see Parameter.__init__()

get_value()[source]

JobParameter doesn’t really have a value, but for the sake of Parameter representations, we’ll provide the current status.

Also see:
set_value(*args, **kwargs)[source]

JobParameter is read-only

Raises:NotImplementedError – because this never will be
server_status
location
status_method
retrieve_method
status
Raises:NotImplementedError – if status isn’t implemented for the given :meth:`status_method
get_status()[source]

[NOT IMPLEMENTED]

attach(sleep=5, cleanup=True)[source]
Parameters:
  • sleep (int) – number of seconds to sleep between status checks
  • cleanup (bool) – whether to delete this parameter and any temporary files once the results are loaded (default: True)
Raises:

phoebe.parameters.setting module

phoebe.parameters.setting.settings(**kwargs)[source]

Generally, this will automatically be added to a newly initialized phoebe.frontend.bundle.Bundle

Parameters:**kwargs

defaults for the values of any of the parameters

Returns:a phoebe.parameters.parameters.ParameterSet of all newly created :class:`phoebe.parameters.parameters.Parameter`s

phoebe.parameters.system module

phoebe.parameters.system.system(**kwargs)[source]

Generally, this will automatically be added to a newly initialized phoebe.frontend.bundle.Bundle

Parameters:**kwargs

defaults for the values of any of the parameters

Returns:a phoebe.parameters.parameters.ParameterSet of all newly created :class:`phoebe.parameters.parameters.Parameter`s

phoebe.parameters.twighelpers module

Module contents

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