repository_name
stringlengths
7
55
func_path_in_repository
stringlengths
4
223
func_name
stringlengths
1
134
whole_func_string
stringlengths
75
104k
language
stringclasses
1 value
func_code_string
stringlengths
75
104k
func_code_tokens
listlengths
19
28.4k
func_documentation_string
stringlengths
1
46.9k
func_documentation_tokens
listlengths
1
1.97k
split_name
stringclasses
1 value
func_code_url
stringlengths
87
315
phoebe-project/phoebe2
phoebe/utils/__init__.py
get_basic_logger
def get_basic_logger(clevel='WARNING',flevel='DEBUG', style="default",filename=None,filemode='w'): """ Return a basic logger via a log file and/or terminal. Example 1: log only to the console, accepting levels "INFO" and above >>> logger = utils.get_basic_logger() Example 2: ...
python
def get_basic_logger(clevel='WARNING',flevel='DEBUG', style="default",filename=None,filemode='w'): """ Return a basic logger via a log file and/or terminal. Example 1: log only to the console, accepting levels "INFO" and above >>> logger = utils.get_basic_logger() Example 2: ...
[ "def", "get_basic_logger", "(", "clevel", "=", "'WARNING'", ",", "flevel", "=", "'DEBUG'", ",", "style", "=", "\"default\"", ",", "filename", "=", "None", ",", "filemode", "=", "'w'", ")", ":", "name", "=", "\"\"", "#-- define formats", "if", "style", "=="...
Return a basic logger via a log file and/or terminal. Example 1: log only to the console, accepting levels "INFO" and above >>> logger = utils.get_basic_logger() Example 2: log only to the console, accepting levels "DEBUG" and above >>> logger = utils.get_basic_logger(clevel='DEBUG') Example 3:...
[ "Return", "a", "basic", "logger", "via", "a", "log", "file", "and", "/", "or", "terminal", "." ]
train
https://github.com/phoebe-project/phoebe2/blob/e64b8be683977064e2d55dd1b3ac400f64c3e379/phoebe/utils/__init__.py#L3-L97
phoebe-project/phoebe2
phoebe/utils/__init__.py
parse_json
def parse_json(pairs): """ modified from: https://stackoverflow.com/questions/956867/how-to-get-string-objects-instead-of-unicode-from-json#34796078 pass this to the object_pairs_hook kwarg of json.load/loads """ new_pairs = [] for key, value in pairs: if isinstance(value, unicode):...
python
def parse_json(pairs): """ modified from: https://stackoverflow.com/questions/956867/how-to-get-string-objects-instead-of-unicode-from-json#34796078 pass this to the object_pairs_hook kwarg of json.load/loads """ new_pairs = [] for key, value in pairs: if isinstance(value, unicode):...
[ "def", "parse_json", "(", "pairs", ")", ":", "new_pairs", "=", "[", "]", "for", "key", ",", "value", "in", "pairs", ":", "if", "isinstance", "(", "value", ",", "unicode", ")", ":", "value", "=", "value", ".", "encode", "(", "'utf-8'", ")", "if", "i...
modified from: https://stackoverflow.com/questions/956867/how-to-get-string-objects-instead-of-unicode-from-json#34796078 pass this to the object_pairs_hook kwarg of json.load/loads
[ "modified", "from", ":", "https", ":", "//", "stackoverflow", ".", "com", "/", "questions", "/", "956867", "/", "how", "-", "to", "-", "get", "-", "string", "-", "objects", "-", "instead", "-", "of", "-", "unicode", "-", "from", "-", "json#34796078" ]
train
https://github.com/phoebe-project/phoebe2/blob/e64b8be683977064e2d55dd1b3ac400f64c3e379/phoebe/utils/__init__.py#L136-L150
phoebe-project/phoebe2
phoebe/dependencies/autofig/call.py
CallDimension.direction
def direction(self, direction): """ set the direction """ if not isinstance(direction, str): raise TypeError("direction must be of type str") accepted_values = ['i', 'x', 'y', 'z', 's', 'c'] if direction not in accepted_values: raise ValueError("m...
python
def direction(self, direction): """ set the direction """ if not isinstance(direction, str): raise TypeError("direction must be of type str") accepted_values = ['i', 'x', 'y', 'z', 's', 'c'] if direction not in accepted_values: raise ValueError("m...
[ "def", "direction", "(", "self", ",", "direction", ")", ":", "if", "not", "isinstance", "(", "direction", ",", "str", ")", ":", "raise", "TypeError", "(", "\"direction must be of type str\"", ")", "accepted_values", "=", "[", "'i'", ",", "'x'", ",", "'y'", ...
set the direction
[ "set", "the", "direction" ]
train
https://github.com/phoebe-project/phoebe2/blob/e64b8be683977064e2d55dd1b3ac400f64c3e379/phoebe/dependencies/autofig/call.py#L1397-L1408
phoebe-project/phoebe2
phoebe/dependencies/autofig/call.py
CallDimension.interpolate_at_i
def interpolate_at_i(self, i, unit=None): """ access the interpolated value at a give value of i (independent-variable) """ if isinstance(self.call.i._value, float): if self.call.i._value==i: return self._to_unit(self._value, unit) else: ...
python
def interpolate_at_i(self, i, unit=None): """ access the interpolated value at a give value of i (independent-variable) """ if isinstance(self.call.i._value, float): if self.call.i._value==i: return self._to_unit(self._value, unit) else: ...
[ "def", "interpolate_at_i", "(", "self", ",", "i", ",", "unit", "=", "None", ")", ":", "if", "isinstance", "(", "self", ".", "call", ".", "i", ".", "_value", ",", "float", ")", ":", "if", "self", ".", "call", ".", "i", ".", "_value", "==", "i", ...
access the interpolated value at a give value of i (independent-variable)
[ "access", "the", "interpolated", "value", "at", "a", "give", "value", "of", "i", "(", "independent", "-", "variable", ")" ]
train
https://github.com/phoebe-project/phoebe2/blob/e64b8be683977064e2d55dd1b3ac400f64c3e379/phoebe/dependencies/autofig/call.py#L1422-L1441
phoebe-project/phoebe2
phoebe/dependencies/autofig/call.py
CallDimension._sort_by_indep
def _sort_by_indep(self, func='get_value', i=None, iunit=None, unit=None, uncover=None, trail=None, linebreak=None, sort_by_indep=None): """ must be called before (or within) _do_linebreak """ if sort_by_indep is None: # TODO: a...
python
def _sort_by_indep(self, func='get_value', i=None, iunit=None, unit=None, uncover=None, trail=None, linebreak=None, sort_by_indep=None): """ must be called before (or within) _do_linebreak """ if sort_by_indep is None: # TODO: a...
[ "def", "_sort_by_indep", "(", "self", ",", "func", "=", "'get_value'", ",", "i", "=", "None", ",", "iunit", "=", "None", ",", "unit", "=", "None", ",", "uncover", "=", "None", ",", "trail", "=", "None", ",", "linebreak", "=", "None", ",", "sort_by_in...
must be called before (or within) _do_linebreak
[ "must", "be", "called", "before", "(", "or", "within", ")", "_do_linebreak" ]
train
https://github.com/phoebe-project/phoebe2/blob/e64b8be683977064e2d55dd1b3ac400f64c3e379/phoebe/dependencies/autofig/call.py#L1491-L1526
phoebe-project/phoebe2
phoebe/dependencies/autofig/call.py
CallDimension.get_value
def get_value(self, i=None, unit=None, uncover=None, trail=None, linebreak=None, sort_by_indep=None, attr='_value'): """ access the value for a given value of i (independent-variable) depending on which effects (i.e. uncover) are enabled. ...
python
def get_value(self, i=None, unit=None, uncover=None, trail=None, linebreak=None, sort_by_indep=None, attr='_value'): """ access the value for a given value of i (independent-variable) depending on which effects (i.e. uncover) are enabled. ...
[ "def", "get_value", "(", "self", ",", "i", "=", "None", ",", "unit", "=", "None", ",", "uncover", "=", "None", ",", "trail", "=", "None", ",", "linebreak", "=", "None", ",", "sort_by_indep", "=", "None", ",", "attr", "=", "'_value'", ")", ":", "val...
access the value for a given value of i (independent-variable) depending on which effects (i.e. uncover) are enabled. If uncover, trail, or linebreak are None (default), then the value from the parent Call will be used.
[ "access", "the", "value", "for", "a", "given", "value", "of", "i", "(", "independent", "-", "variable", ")", "depending", "on", "which", "effects", "(", "i", ".", "e", ".", "uncover", ")", "are", "enabled", "." ]
train
https://github.com/phoebe-project/phoebe2/blob/e64b8be683977064e2d55dd1b3ac400f64c3e379/phoebe/dependencies/autofig/call.py#L1582-L1708
phoebe-project/phoebe2
phoebe/dependencies/autofig/call.py
CallDimension._set_value
def _set_value(self, value): """ set the value """ if value is None: self._value = value return # handle casting to acceptable types if isinstance(value, list) or isinstance(value, tuple): value = np.array(value) if isinstance(...
python
def _set_value(self, value): """ set the value """ if value is None: self._value = value return # handle casting to acceptable types if isinstance(value, list) or isinstance(value, tuple): value = np.array(value) if isinstance(...
[ "def", "_set_value", "(", "self", ",", "value", ")", ":", "if", "value", "is", "None", ":", "self", ".", "_value", "=", "value", "return", "# handle casting to acceptable types", "if", "isinstance", "(", "value", ",", "list", ")", "or", "isinstance", "(", ...
set the value
[ "set", "the", "value" ]
train
https://github.com/phoebe-project/phoebe2/blob/e64b8be683977064e2d55dd1b3ac400f64c3e379/phoebe/dependencies/autofig/call.py#L1720-L1758
phoebe-project/phoebe2
phoebe/dependencies/autofig/call.py
CallDimension.get_error
def get_error(self, i=None, unit=None, uncover=None, trail=None, linebreak=None, sort_by_indep=None): """ access the error for a given value of i (independent-variable) depending on which effects (i.e. uncover) are enabled. """ return self.get_...
python
def get_error(self, i=None, unit=None, uncover=None, trail=None, linebreak=None, sort_by_indep=None): """ access the error for a given value of i (independent-variable) depending on which effects (i.e. uncover) are enabled. """ return self.get_...
[ "def", "get_error", "(", "self", ",", "i", "=", "None", ",", "unit", "=", "None", ",", "uncover", "=", "None", ",", "trail", "=", "None", ",", "linebreak", "=", "None", ",", "sort_by_indep", "=", "None", ")", ":", "return", "self", ".", "get_value", ...
access the error for a given value of i (independent-variable) depending on which effects (i.e. uncover) are enabled.
[ "access", "the", "error", "for", "a", "given", "value", "of", "i", "(", "independent", "-", "variable", ")", "depending", "on", "which", "effects", "(", "i", ".", "e", ".", "uncover", ")", "are", "enabled", "." ]
train
https://github.com/phoebe-project/phoebe2/blob/e64b8be683977064e2d55dd1b3ac400f64c3e379/phoebe/dependencies/autofig/call.py#L1762-L1772
phoebe-project/phoebe2
phoebe/dependencies/autofig/call.py
CallDimension.error
def error(self, error): """ set the error """ # TODO: check length with value? # TODO: type checks (similar to value) if self.direction not in ['x', 'y', 'z'] and error is not None: raise ValueError("error only accepted for x, y, z dimensions") if isi...
python
def error(self, error): """ set the error """ # TODO: check length with value? # TODO: type checks (similar to value) if self.direction not in ['x', 'y', 'z'] and error is not None: raise ValueError("error only accepted for x, y, z dimensions") if isi...
[ "def", "error", "(", "self", ",", "error", ")", ":", "# TODO: check length with value?", "# TODO: type checks (similar to value)", "if", "self", ".", "direction", "not", "in", "[", "'x'", ",", "'y'", ",", "'z'", "]", "and", "error", "is", "not", "None", ":", ...
set the error
[ "set", "the", "error" ]
train
https://github.com/phoebe-project/phoebe2/blob/e64b8be683977064e2d55dd1b3ac400f64c3e379/phoebe/dependencies/autofig/call.py#L1783-L1795
phoebe-project/phoebe2
phoebe/dependencies/autofig/call.py
CallDimension.label
def label(self, label): """ set the label """ if self.direction in ['i'] and label is not None: raise ValueError("label not accepted for indep dimension") if label is None: self._label = label return if not isinstance(label, str): ...
python
def label(self, label): """ set the label """ if self.direction in ['i'] and label is not None: raise ValueError("label not accepted for indep dimension") if label is None: self._label = label return if not isinstance(label, str): ...
[ "def", "label", "(", "self", ",", "label", ")", ":", "if", "self", ".", "direction", "in", "[", "'i'", "]", "and", "label", "is", "not", "None", ":", "raise", "ValueError", "(", "\"label not accepted for indep dimension\"", ")", "if", "label", "is", "None"...
set the label
[ "set", "the", "label" ]
train
https://github.com/phoebe-project/phoebe2/blob/e64b8be683977064e2d55dd1b3ac400f64c3e379/phoebe/dependencies/autofig/call.py#L1820-L1838
phoebe-project/phoebe2
phoebe/dependencies/autofig/call.py
CallDimensionI.value
def value(self): """ access the value """ if isinstance(self._value, str): dimension = self._value return getattr(self.call, dimension).value return super(CallDimensionI, self)._get_value()
python
def value(self): """ access the value """ if isinstance(self._value, str): dimension = self._value return getattr(self.call, dimension).value return super(CallDimensionI, self)._get_value()
[ "def", "value", "(", "self", ")", ":", "if", "isinstance", "(", "self", ".", "_value", ",", "str", ")", ":", "dimension", "=", "self", ".", "_value", "return", "getattr", "(", "self", ".", "call", ",", "dimension", ")", ".", "value", "return", "super...
access the value
[ "access", "the", "value" ]
train
https://github.com/phoebe-project/phoebe2/blob/e64b8be683977064e2d55dd1b3ac400f64c3e379/phoebe/dependencies/autofig/call.py#L1865-L1873
phoebe-project/phoebe2
phoebe/dependencies/autofig/call.py
CallDimensionI.value
def value(self, value): """ set the value """ # for the indep direction we also allow a string which points to one # of the other available dimensions # TODO: support c, fc, ec? if isinstance(value, common.basestring) and value in ['x', 'y', 'z']: # we...
python
def value(self, value): """ set the value """ # for the indep direction we also allow a string which points to one # of the other available dimensions # TODO: support c, fc, ec? if isinstance(value, common.basestring) and value in ['x', 'y', 'z']: # we...
[ "def", "value", "(", "self", ",", "value", ")", ":", "# for the indep direction we also allow a string which points to one", "# of the other available dimensions", "# TODO: support c, fc, ec?", "if", "isinstance", "(", "value", ",", "common", ".", "basestring", ")", "and", ...
set the value
[ "set", "the", "value" ]
train
https://github.com/phoebe-project/phoebe2/blob/e64b8be683977064e2d55dd1b3ac400f64c3e379/phoebe/dependencies/autofig/call.py#L1876-L1893
phoebe-project/phoebe2
phoebe/distortions/rotstar.py
rotfreq_to_omega
def rotfreq_to_omega(rotfreq, scale=c.R_sun.si.value, solar_units=False): """ TODO: add documentation NOTE: everything MUST be in consistent units according to solar_units bool """ if solar_units: omega = rotfreq / (2*np.pi) / np.sqrt(c.GM_sun.to(u.solRad**3/u.d**2).value/scale**3) else...
python
def rotfreq_to_omega(rotfreq, scale=c.R_sun.si.value, solar_units=False): """ TODO: add documentation NOTE: everything MUST be in consistent units according to solar_units bool """ if solar_units: omega = rotfreq / (2*np.pi) / np.sqrt(c.GM_sun.to(u.solRad**3/u.d**2).value/scale**3) else...
[ "def", "rotfreq_to_omega", "(", "rotfreq", ",", "scale", "=", "c", ".", "R_sun", ".", "si", ".", "value", ",", "solar_units", "=", "False", ")", ":", "if", "solar_units", ":", "omega", "=", "rotfreq", "/", "(", "2", "*", "np", ".", "pi", ")", "/", ...
TODO: add documentation NOTE: everything MUST be in consistent units according to solar_units bool
[ "TODO", ":", "add", "documentation" ]
train
https://github.com/phoebe-project/phoebe2/blob/e64b8be683977064e2d55dd1b3ac400f64c3e379/phoebe/distortions/rotstar.py#L8-L22
phoebe-project/phoebe2
phoebe/dynamics/nbody.py
_ensure_tuple
def _ensure_tuple(item): """ Simply ensure that the passed item is a tuple. If it is not, then convert it if possible, or raise a NotImplementedError Args: item: the item that needs to become a tuple Returns: the item casted as a tuple Raises: NotImplementedError: if ...
python
def _ensure_tuple(item): """ Simply ensure that the passed item is a tuple. If it is not, then convert it if possible, or raise a NotImplementedError Args: item: the item that needs to become a tuple Returns: the item casted as a tuple Raises: NotImplementedError: if ...
[ "def", "_ensure_tuple", "(", "item", ")", ":", "if", "isinstance", "(", "item", ",", "tuple", ")", ":", "return", "item", "elif", "isinstance", "(", "item", ",", "list", ")", ":", "return", "tuple", "(", "item", ")", "elif", "isinstance", "(", "item", ...
Simply ensure that the passed item is a tuple. If it is not, then convert it if possible, or raise a NotImplementedError Args: item: the item that needs to become a tuple Returns: the item casted as a tuple Raises: NotImplementedError: if converting the given item to a tuple ...
[ "Simply", "ensure", "that", "the", "passed", "item", "is", "a", "tuple", ".", "If", "it", "is", "not", "then", "convert", "it", "if", "possible", "or", "raise", "a", "NotImplementedError" ]
train
https://github.com/phoebe-project/phoebe2/blob/e64b8be683977064e2d55dd1b3ac400f64c3e379/phoebe/dynamics/nbody.py#L36-L58
phoebe-project/phoebe2
phoebe/dynamics/nbody.py
dynamics_from_bundle
def dynamics_from_bundle(b, times, compute=None, return_roche_euler=False, use_kepcart=False, **kwargs): """ Parse parameters in the bundle and call :func:`dynamics`. See :func:`dynamics` for more detailed information. NOTE: you must either provide compute (the label) OR all relevant options as kw...
python
def dynamics_from_bundle(b, times, compute=None, return_roche_euler=False, use_kepcart=False, **kwargs): """ Parse parameters in the bundle and call :func:`dynamics`. See :func:`dynamics` for more detailed information. NOTE: you must either provide compute (the label) OR all relevant options as kw...
[ "def", "dynamics_from_bundle", "(", "b", ",", "times", ",", "compute", "=", "None", ",", "return_roche_euler", "=", "False", ",", "use_kepcart", "=", "False", ",", "*", "*", "kwargs", ")", ":", "b", ".", "run_delayed_constraints", "(", ")", "hier", "=", ...
Parse parameters in the bundle and call :func:`dynamics`. See :func:`dynamics` for more detailed information. NOTE: you must either provide compute (the label) OR all relevant options as kwargs (ltte, stepsize, gr, integrator) Args: b: (Bundle) the bundle with a set hierarchy times: (...
[ "Parse", "parameters", "in", "the", "bundle", "and", "call", ":", "func", ":", "dynamics", "." ]
train
https://github.com/phoebe-project/phoebe2/blob/e64b8be683977064e2d55dd1b3ac400f64c3e379/phoebe/dynamics/nbody.py#L60-L129
phoebe-project/phoebe2
phoebe/dynamics/nbody.py
dynamics_from_bundle_bs
def dynamics_from_bundle_bs(b, times, compute=None, return_roche_euler=False, **kwargs): """ Parse parameters in the bundle and call :func:`dynamics`. See :func:`dynamics` for more detailed information. NOTE: you must either provide compute (the label) OR all relevant options as kwargs (ltte) ...
python
def dynamics_from_bundle_bs(b, times, compute=None, return_roche_euler=False, **kwargs): """ Parse parameters in the bundle and call :func:`dynamics`. See :func:`dynamics` for more detailed information. NOTE: you must either provide compute (the label) OR all relevant options as kwargs (ltte) ...
[ "def", "dynamics_from_bundle_bs", "(", "b", ",", "times", ",", "compute", "=", "None", ",", "return_roche_euler", "=", "False", ",", "*", "*", "kwargs", ")", ":", "stepsize", "=", "0.01", "orbiterror", "=", "1e-16", "computeps", "=", "b", ".", "get_compute...
Parse parameters in the bundle and call :func:`dynamics`. See :func:`dynamics` for more detailed information. NOTE: you must either provide compute (the label) OR all relevant options as kwargs (ltte) Args: b: (Bundle) the bundle with a set hierarchy times: (list or array) times at wh...
[ "Parse", "parameters", "in", "the", "bundle", "and", "call", ":", "func", ":", "dynamics", "." ]
train
https://github.com/phoebe-project/phoebe2/blob/e64b8be683977064e2d55dd1b3ac400f64c3e379/phoebe/dynamics/nbody.py#L321-L381
phoebe-project/phoebe2
phoebe/dynamics/nbody.py
dynamics_bs
def dynamics_bs(times, masses, smas, eccs, incls, per0s, long_ans, mean_anoms, t0=0.0, vgamma=0.0, stepsize=0.01, orbiterror=1e-16, ltte=False, return_roche_euler=False): """ Burlisch-Stoer integration of orbits to give positions and velocities of any given number of stars in hierarchical or...
python
def dynamics_bs(times, masses, smas, eccs, incls, per0s, long_ans, mean_anoms, t0=0.0, vgamma=0.0, stepsize=0.01, orbiterror=1e-16, ltte=False, return_roche_euler=False): """ Burlisch-Stoer integration of orbits to give positions and velocities of any given number of stars in hierarchical or...
[ "def", "dynamics_bs", "(", "times", ",", "masses", ",", "smas", ",", "eccs", ",", "incls", ",", "per0s", ",", "long_ans", ",", "mean_anoms", ",", "t0", "=", "0.0", ",", "vgamma", "=", "0.0", ",", "stepsize", "=", "0.01", ",", "orbiterror", "=", "1e-1...
Burlisch-Stoer integration of orbits to give positions and velocities of any given number of stars in hierarchical orbits. This code currently uses the NBody code in Josh Carter's photodynam code available here: [[TODO: include link]] If using the Nbody mode in PHOEBE, please cite him as well: ...
[ "Burlisch", "-", "Stoer", "integration", "of", "orbits", "to", "give", "positions", "and", "velocities", "of", "any", "given", "number", "of", "stars", "in", "hierarchical", "orbits", ".", "This", "code", "currently", "uses", "the", "NBody", "code", "in", "J...
train
https://github.com/phoebe-project/phoebe2/blob/e64b8be683977064e2d55dd1b3ac400f64c3e379/phoebe/dynamics/nbody.py#L386-L493
phoebe-project/phoebe2
phoebe/backend/eclipse.py
only_horizon
def only_horizon(meshes, xs, ys, zs, expose_horizon=False): """ 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) """ # if visibility == 0, it should remain 0 # if visibility == 0.5, it sh...
python
def only_horizon(meshes, xs, ys, zs, expose_horizon=False): """ 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) """ # if visibility == 0, it should remain 0 # if visibility == 0.5, it sh...
[ "def", "only_horizon", "(", "meshes", ",", "xs", ",", "ys", ",", "zs", ",", "expose_horizon", "=", "False", ")", ":", "# if visibility == 0, it should remain 0", "# if visibility == 0.5, it should stay 0.5 if mu > 0 else it should become 0", "# if visibility == 1, it should stay ...
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)
[ "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", ")"...
train
https://github.com/phoebe-project/phoebe2/blob/e64b8be683977064e2d55dd1b3ac400f64c3e379/phoebe/backend/eclipse.py#L125-L137
phoebe-project/phoebe2
phoebe/backend/eclipse.py
native
def native(meshes, xs, ys, zs, expose_horizon=False, horizon_method='boolean'): """ TODO: add documentation this is the new eclipse detection method in libphoebe """ centers_flat = meshes.get_column_flat('centers') vertices_flat = meshes.get_column_flat('vertices') triangles_flat = meshes....
python
def native(meshes, xs, ys, zs, expose_horizon=False, horizon_method='boolean'): """ TODO: add documentation this is the new eclipse detection method in libphoebe """ centers_flat = meshes.get_column_flat('centers') vertices_flat = meshes.get_column_flat('vertices') triangles_flat = meshes....
[ "def", "native", "(", "meshes", ",", "xs", ",", "ys", ",", "zs", ",", "expose_horizon", "=", "False", ",", "horizon_method", "=", "'boolean'", ")", ":", "centers_flat", "=", "meshes", ".", "get_column_flat", "(", "'centers'", ")", "vertices_flat", "=", "me...
TODO: add documentation this is the new eclipse detection method in libphoebe
[ "TODO", ":", "add", "documentation" ]
train
https://github.com/phoebe-project/phoebe2/blob/e64b8be683977064e2d55dd1b3ac400f64c3e379/phoebe/backend/eclipse.py#L139-L185
phoebe-project/phoebe2
phoebe/backend/eclipse.py
graham
def graham(meshes, xs, ys, zs, expose_horizon=False): """ convex_graham """ distance_factor = 1.0 # TODO: make this an option (what does it even do)? # first lets handle the horizon visibilities, weights, horizon = only_horizon(meshes, xs, ys, zs) # Order the bodies from front to back. ...
python
def graham(meshes, xs, ys, zs, expose_horizon=False): """ convex_graham """ distance_factor = 1.0 # TODO: make this an option (what does it even do)? # first lets handle the horizon visibilities, weights, horizon = only_horizon(meshes, xs, ys, zs) # Order the bodies from front to back. ...
[ "def", "graham", "(", "meshes", ",", "xs", ",", "ys", ",", "zs", ",", "expose_horizon", "=", "False", ")", ":", "distance_factor", "=", "1.0", "# TODO: make this an option (what does it even do)?", "# first lets handle the horizon", "visibilities", ",", "weights", ","...
convex_graham
[ "convex_graham" ]
train
https://github.com/phoebe-project/phoebe2/blob/e64b8be683977064e2d55dd1b3ac400f64c3e379/phoebe/backend/eclipse.py#L208-L302
phoebe-project/phoebe2
phoebe/parameters/constraint.py
_get_system_ps
def _get_system_ps(b, item, context='component'): """ parses the input arg (either twig or PS) to retrieve the actual parametersets """ # TODO: make this a decorator? if isinstance(item, list) and len(item)==1: item = item[0] if isinstance(item, ParameterSet): return item.filter...
python
def _get_system_ps(b, item, context='component'): """ parses the input arg (either twig or PS) to retrieve the actual parametersets """ # TODO: make this a decorator? if isinstance(item, list) and len(item)==1: item = item[0] if isinstance(item, ParameterSet): return item.filter...
[ "def", "_get_system_ps", "(", "b", ",", "item", ",", "context", "=", "'component'", ")", ":", "# TODO: make this a decorator?", "if", "isinstance", "(", "item", ",", "list", ")", "and", "len", "(", "item", ")", "==", "1", ":", "item", "=", "item", "[", ...
parses the input arg (either twig or PS) to retrieve the actual parametersets
[ "parses", "the", "input", "arg", "(", "either", "twig", "or", "PS", ")", "to", "retrieve", "the", "actual", "parametersets" ]
train
https://github.com/phoebe-project/phoebe2/blob/e64b8be683977064e2d55dd1b3ac400f64c3e379/phoebe/parameters/constraint.py#L14-L28
phoebe-project/phoebe2
phoebe/parameters/constraint.py
roche_requiv_L1
def roche_requiv_L1(q, syncpar, ecc, sma, incl_star, long_an_star, incl_orb, long_an_orb, compno=1): """ TODO: add documentation """ return ConstraintParameter(q._bundle, "requiv_L1(%s, %d)" % (", ".join(["{%s}" % (param.uniquetwig if hasattr(param, 'uniquetwig') else param.expr) for param in (q, syncpa...
python
def roche_requiv_L1(q, syncpar, ecc, sma, incl_star, long_an_star, incl_orb, long_an_orb, compno=1): """ TODO: add documentation """ return ConstraintParameter(q._bundle, "requiv_L1(%s, %d)" % (", ".join(["{%s}" % (param.uniquetwig if hasattr(param, 'uniquetwig') else param.expr) for param in (q, syncpa...
[ "def", "roche_requiv_L1", "(", "q", ",", "syncpar", ",", "ecc", ",", "sma", ",", "incl_star", ",", "long_an_star", ",", "incl_orb", ",", "long_an_orb", ",", "compno", "=", "1", ")", ":", "return", "ConstraintParameter", "(", "q", ".", "_bundle", ",", "\"...
TODO: add documentation
[ "TODO", ":", "add", "documentation" ]
train
https://github.com/phoebe-project/phoebe2/blob/e64b8be683977064e2d55dd1b3ac400f64c3e379/phoebe/parameters/constraint.py#L120-L124
phoebe-project/phoebe2
phoebe/parameters/constraint.py
roche_requiv_contact_L1
def roche_requiv_contact_L1(q, sma, compno=1): """ TODO: add documentation """ return ConstraintParameter(q._bundle, "requiv_contact_L1(%s, %d)" % (", ".join(["{%s}" % (param.uniquetwig if hasattr(param, 'uniquetwig') else param.expr) for param in (q, sma)]), compno))
python
def roche_requiv_contact_L1(q, sma, compno=1): """ TODO: add documentation """ return ConstraintParameter(q._bundle, "requiv_contact_L1(%s, %d)" % (", ".join(["{%s}" % (param.uniquetwig if hasattr(param, 'uniquetwig') else param.expr) for param in (q, sma)]), compno))
[ "def", "roche_requiv_contact_L1", "(", "q", ",", "sma", ",", "compno", "=", "1", ")", ":", "return", "ConstraintParameter", "(", "q", ".", "_bundle", ",", "\"requiv_contact_L1(%s, %d)\"", "%", "(", "\", \"", ".", "join", "(", "[", "\"{%s}\"", "%", "(", "pa...
TODO: add documentation
[ "TODO", ":", "add", "documentation" ]
train
https://github.com/phoebe-project/phoebe2/blob/e64b8be683977064e2d55dd1b3ac400f64c3e379/phoebe/parameters/constraint.py#L126-L130
phoebe-project/phoebe2
phoebe/parameters/constraint.py
requiv_to_pot_contact
def requiv_to_pot_contact(requiv, q, sma, compno=1): """ TODO: add documentation """ return ConstraintParameter(requiv._bundle, "requiv_to_pot_contact({}, {}, {}, {})".format(_get_expr(requiv), _get_expr(q), _get_expr(sma), compno))
python
def requiv_to_pot_contact(requiv, q, sma, compno=1): """ TODO: add documentation """ return ConstraintParameter(requiv._bundle, "requiv_to_pot_contact({}, {}, {}, {})".format(_get_expr(requiv), _get_expr(q), _get_expr(sma), compno))
[ "def", "requiv_to_pot_contact", "(", "requiv", ",", "q", ",", "sma", ",", "compno", "=", "1", ")", ":", "return", "ConstraintParameter", "(", "requiv", ".", "_bundle", ",", "\"requiv_to_pot_contact({}, {}, {}, {})\"", ".", "format", "(", "_get_expr", "(", "requi...
TODO: add documentation
[ "TODO", ":", "add", "documentation" ]
train
https://github.com/phoebe-project/phoebe2/blob/e64b8be683977064e2d55dd1b3ac400f64c3e379/phoebe/parameters/constraint.py#L158-L162
phoebe-project/phoebe2
phoebe/parameters/constraint.py
pot_to_requiv_contact
def pot_to_requiv_contact(pot, q, sma, compno=1): """ TODO: add documentation """ return ConstraintParameter(pot._bundle, "pot_to_requiv_contact({}, {}, {}, {})".format(_get_expr(pot), _get_expr(q), _get_expr(sma), compno))
python
def pot_to_requiv_contact(pot, q, sma, compno=1): """ TODO: add documentation """ return ConstraintParameter(pot._bundle, "pot_to_requiv_contact({}, {}, {}, {})".format(_get_expr(pot), _get_expr(q), _get_expr(sma), compno))
[ "def", "pot_to_requiv_contact", "(", "pot", ",", "q", ",", "sma", ",", "compno", "=", "1", ")", ":", "return", "ConstraintParameter", "(", "pot", ".", "_bundle", ",", "\"pot_to_requiv_contact({}, {}, {}, {})\"", ".", "format", "(", "_get_expr", "(", "pot", ")"...
TODO: add documentation
[ "TODO", ":", "add", "documentation" ]
train
https://github.com/phoebe-project/phoebe2/blob/e64b8be683977064e2d55dd1b3ac400f64c3e379/phoebe/parameters/constraint.py#L164-L168
phoebe-project/phoebe2
phoebe/parameters/constraint.py
esinw2per0
def esinw2per0(ecc, esinw): """ TODO: add documentation """ return ConstraintParameter(ecc._bundle, "esinw2per0({}, {})".format(_get_expr(ecc), _get_expr(esinw)))
python
def esinw2per0(ecc, esinw): """ TODO: add documentation """ return ConstraintParameter(ecc._bundle, "esinw2per0({}, {})".format(_get_expr(ecc), _get_expr(esinw)))
[ "def", "esinw2per0", "(", "ecc", ",", "esinw", ")", ":", "return", "ConstraintParameter", "(", "ecc", ".", "_bundle", ",", "\"esinw2per0({}, {})\"", ".", "format", "(", "_get_expr", "(", "ecc", ")", ",", "_get_expr", "(", "esinw", ")", ")", ")" ]
TODO: add documentation
[ "TODO", ":", "add", "documentation" ]
train
https://github.com/phoebe-project/phoebe2/blob/e64b8be683977064e2d55dd1b3ac400f64c3e379/phoebe/parameters/constraint.py#L170-L174
phoebe-project/phoebe2
phoebe/parameters/constraint.py
ecosw2per0
def ecosw2per0(ecc, ecosw): """ TODO: add documentation """ # print "***", "ecosw2per0({}, {})".format(_get_expr(ecc), _get_expr(ecosw)) return ConstraintParameter(ecc._bundle, "ecosw2per0({}, {})".format(_get_expr(ecc), _get_expr(ecosw)))
python
def ecosw2per0(ecc, ecosw): """ TODO: add documentation """ # print "***", "ecosw2per0({}, {})".format(_get_expr(ecc), _get_expr(ecosw)) return ConstraintParameter(ecc._bundle, "ecosw2per0({}, {})".format(_get_expr(ecc), _get_expr(ecosw)))
[ "def", "ecosw2per0", "(", "ecc", ",", "ecosw", ")", ":", "# print \"***\", \"ecosw2per0({}, {})\".format(_get_expr(ecc), _get_expr(ecosw))", "return", "ConstraintParameter", "(", "ecc", ".", "_bundle", ",", "\"ecosw2per0({}, {})\"", ".", "format", "(", "_get_expr", "(", "...
TODO: add documentation
[ "TODO", ":", "add", "documentation" ]
train
https://github.com/phoebe-project/phoebe2/blob/e64b8be683977064e2d55dd1b3ac400f64c3e379/phoebe/parameters/constraint.py#L176-L181
phoebe-project/phoebe2
phoebe/parameters/constraint.py
t0_perpass_to_supconj
def t0_perpass_to_supconj(t0_perpass, period, ecc, per0): """ TODO: add documentation """ return ConstraintParameter(t0_perpass._bundle, "t0_perpass_to_supconj({}, {}, {}, {})".format(_get_expr(t0_perpass), _get_expr(period), _get_expr(ecc), _get_expr(per0)))
python
def t0_perpass_to_supconj(t0_perpass, period, ecc, per0): """ TODO: add documentation """ return ConstraintParameter(t0_perpass._bundle, "t0_perpass_to_supconj({}, {}, {}, {})".format(_get_expr(t0_perpass), _get_expr(period), _get_expr(ecc), _get_expr(per0)))
[ "def", "t0_perpass_to_supconj", "(", "t0_perpass", ",", "period", ",", "ecc", ",", "per0", ")", ":", "return", "ConstraintParameter", "(", "t0_perpass", ".", "_bundle", ",", "\"t0_perpass_to_supconj({}, {}, {}, {})\"", ".", "format", "(", "_get_expr", "(", "t0_perpa...
TODO: add documentation
[ "TODO", ":", "add", "documentation" ]
train
https://github.com/phoebe-project/phoebe2/blob/e64b8be683977064e2d55dd1b3ac400f64c3e379/phoebe/parameters/constraint.py#L183-L187
phoebe-project/phoebe2
phoebe/parameters/constraint.py
t0_supconj_to_perpass
def t0_supconj_to_perpass(t0_supconj, period, ecc, per0): """ TODO: add documentation """ return ConstraintParameter(t0_supconj._bundle, "t0_supconj_to_perpass({}, {}, {}, {})".format(_get_expr(t0_supconj), _get_expr(period), _get_expr(ecc), _get_expr(per0)))
python
def t0_supconj_to_perpass(t0_supconj, period, ecc, per0): """ TODO: add documentation """ return ConstraintParameter(t0_supconj._bundle, "t0_supconj_to_perpass({}, {}, {}, {})".format(_get_expr(t0_supconj), _get_expr(period), _get_expr(ecc), _get_expr(per0)))
[ "def", "t0_supconj_to_perpass", "(", "t0_supconj", ",", "period", ",", "ecc", ",", "per0", ")", ":", "return", "ConstraintParameter", "(", "t0_supconj", ".", "_bundle", ",", "\"t0_supconj_to_perpass({}, {}, {}, {})\"", ".", "format", "(", "_get_expr", "(", "t0_supco...
TODO: add documentation
[ "TODO", ":", "add", "documentation" ]
train
https://github.com/phoebe-project/phoebe2/blob/e64b8be683977064e2d55dd1b3ac400f64c3e379/phoebe/parameters/constraint.py#L189-L193
phoebe-project/phoebe2
phoebe/parameters/constraint.py
t0_ref_to_supconj
def t0_ref_to_supconj(t0_ref, period, ecc, per0): """ TODO: add documentation """ return ConstraintParameter(t0_ref._bundle, "t0_ref_to_supconj({}, {}, {}, {})".format(_get_expr(t0_ref), _get_expr(period), _get_expr(ecc), _get_expr(per0)))
python
def t0_ref_to_supconj(t0_ref, period, ecc, per0): """ TODO: add documentation """ return ConstraintParameter(t0_ref._bundle, "t0_ref_to_supconj({}, {}, {}, {})".format(_get_expr(t0_ref), _get_expr(period), _get_expr(ecc), _get_expr(per0)))
[ "def", "t0_ref_to_supconj", "(", "t0_ref", ",", "period", ",", "ecc", ",", "per0", ")", ":", "return", "ConstraintParameter", "(", "t0_ref", ".", "_bundle", ",", "\"t0_ref_to_supconj({}, {}, {}, {})\"", ".", "format", "(", "_get_expr", "(", "t0_ref", ")", ",", ...
TODO: add documentation
[ "TODO", ":", "add", "documentation" ]
train
https://github.com/phoebe-project/phoebe2/blob/e64b8be683977064e2d55dd1b3ac400f64c3e379/phoebe/parameters/constraint.py#L195-L199
phoebe-project/phoebe2
phoebe/parameters/constraint.py
asini
def asini(b, orbit, solve_for=None): """ 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. :parameter b: the :class:`phoebe.frontend.bundle.Bundle` :parameter str orbit: the label of the orbit ...
python
def asini(b, orbit, solve_for=None): """ 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. :parameter b: the :class:`phoebe.frontend.bundle.Bundle` :parameter str orbit: the label of the orbit ...
[ "def", "asini", "(", "b", ",", "orbit", ",", "solve_for", "=", "None", ")", ":", "orbit_ps", "=", "_get_system_ps", "(", "b", ",", "orbit", ")", "# We want to get the parameters in THIS orbit, but calling through", "# the bundle in case we need to create it.", "# To do th...
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. :parameter b: the :class:`phoebe.frontend.bundle.Bundle` :parameter str orbit: the label of the orbit in which this constraint should be built ...
[ "Create", "a", "constraint", "for", "asini", "in", "an", "orbit", "." ]
train
https://github.com/phoebe-project/phoebe2/blob/e64b8be683977064e2d55dd1b3ac400f64c3e379/phoebe/parameters/constraint.py#L236-L287
phoebe-project/phoebe2
phoebe/parameters/constraint.py
esinw
def esinw(b, orbit, solve_for=None, **kwargs): """ Create a constraint for esinw in an orbit. If 'esinw' does not exist in the orbit, it will be created :parameter b: the :class:`phoebe.frontend.bundle.Bundle` :parameter str orbit: the label of the orbit in which this constraint should be ...
python
def esinw(b, orbit, solve_for=None, **kwargs): """ Create a constraint for esinw in an orbit. If 'esinw' does not exist in the orbit, it will be created :parameter b: the :class:`phoebe.frontend.bundle.Bundle` :parameter str orbit: the label of the orbit in which this constraint should be ...
[ "def", "esinw", "(", "b", ",", "orbit", ",", "solve_for", "=", "None", ",", "*", "*", "kwargs", ")", ":", "orbit_ps", "=", "_get_system_ps", "(", "b", ",", "orbit", ")", "metawargs", "=", "orbit_ps", ".", "meta", "metawargs", ".", "pop", "(", "'quali...
Create a constraint for esinw in an orbit. If 'esinw' does not exist in the orbit, it will be created :parameter b: the :class:`phoebe.frontend.bundle.Bundle` :parameter str orbit: the label of the orbit in which this constraint should be built :parameter str solve_for: if 'esinw' should not ...
[ "Create", "a", "constraint", "for", "esinw", "in", "an", "orbit", "." ]
train
https://github.com/phoebe-project/phoebe2/blob/e64b8be683977064e2d55dd1b3ac400f64c3e379/phoebe/parameters/constraint.py#L289-L329
phoebe-project/phoebe2
phoebe/parameters/constraint.py
ecosw
def ecosw(b, orbit, solve_for=None, **kwargs): """ Create a constraint for ecosw in an orbit. If 'ecosw' does not exist in the orbit, it will be created :parameter b: the :class:`phoebe.frontend.bundle.Bundle` :parameter str orbit: the label of the orbit in which this constraint should be ...
python
def ecosw(b, orbit, solve_for=None, **kwargs): """ Create a constraint for ecosw in an orbit. If 'ecosw' does not exist in the orbit, it will be created :parameter b: the :class:`phoebe.frontend.bundle.Bundle` :parameter str orbit: the label of the orbit in which this constraint should be ...
[ "def", "ecosw", "(", "b", ",", "orbit", ",", "solve_for", "=", "None", ",", "*", "*", "kwargs", ")", ":", "orbit_ps", "=", "_get_system_ps", "(", "b", ",", "orbit", ")", "metawargs", "=", "orbit_ps", ".", "meta", "metawargs", ".", "pop", "(", "'quali...
Create a constraint for ecosw in an orbit. If 'ecosw' does not exist in the orbit, it will be created :parameter b: the :class:`phoebe.frontend.bundle.Bundle` :parameter str orbit: the label of the orbit in which this constraint should be built :parameter str solve_for: if 'ecosw' should not ...
[ "Create", "a", "constraint", "for", "ecosw", "in", "an", "orbit", "." ]
train
https://github.com/phoebe-project/phoebe2/blob/e64b8be683977064e2d55dd1b3ac400f64c3e379/phoebe/parameters/constraint.py#L331-L371
phoebe-project/phoebe2
phoebe/parameters/constraint.py
t0_perpass_supconj
def t0_perpass_supconj(b, orbit, solve_for=None, **kwargs): """ Create a constraint for t0_perpass in an orbit - allowing translating between t0_perpass and t0_supconj. :parameter b: the :class:`phoebe.frontend.bundle.Bundle` :parameter str orbit: the label of the orbit in which this constr...
python
def t0_perpass_supconj(b, orbit, solve_for=None, **kwargs): """ Create a constraint for t0_perpass in an orbit - allowing translating between t0_perpass and t0_supconj. :parameter b: the :class:`phoebe.frontend.bundle.Bundle` :parameter str orbit: the label of the orbit in which this constr...
[ "def", "t0_perpass_supconj", "(", "b", ",", "orbit", ",", "solve_for", "=", "None", ",", "*", "*", "kwargs", ")", ":", "orbit_ps", "=", "_get_system_ps", "(", "b", ",", "orbit", ")", "metawargs", "=", "orbit_ps", ".", "meta", "metawargs", ".", "pop", "...
Create a constraint for t0_perpass in an orbit - allowing translating between t0_perpass and t0_supconj. :parameter b: the :class:`phoebe.frontend.bundle.Bundle` :parameter str orbit: the label of the orbit in which this constraint should be built :parameter str solve_for: if 't0_perpass' shou...
[ "Create", "a", "constraint", "for", "t0_perpass", "in", "an", "orbit", "-", "allowing", "translating", "between", "t0_perpass", "and", "t0_supconj", "." ]
train
https://github.com/phoebe-project/phoebe2/blob/e64b8be683977064e2d55dd1b3ac400f64c3e379/phoebe/parameters/constraint.py#L373-L413
phoebe-project/phoebe2
phoebe/parameters/constraint.py
t0_ref_supconj
def t0_ref_supconj(b, orbit, solve_for=None, **kwargs): """ Create a constraint for t0_ref in an orbit - allowing translating between t0_ref and t0_supconj. :parameter b: the :class:`phoebe.frontend.bundle.Bundle` :parameter str orbit: the label of the orbit in which this constraint should ...
python
def t0_ref_supconj(b, orbit, solve_for=None, **kwargs): """ Create a constraint for t0_ref in an orbit - allowing translating between t0_ref and t0_supconj. :parameter b: the :class:`phoebe.frontend.bundle.Bundle` :parameter str orbit: the label of the orbit in which this constraint should ...
[ "def", "t0_ref_supconj", "(", "b", ",", "orbit", ",", "solve_for", "=", "None", ",", "*", "*", "kwargs", ")", ":", "orbit_ps", "=", "_get_system_ps", "(", "b", ",", "orbit", ")", "metawargs", "=", "orbit_ps", ".", "meta", "metawargs", ".", "pop", "(", ...
Create a constraint for t0_ref in an orbit - allowing translating between t0_ref and t0_supconj. :parameter b: the :class:`phoebe.frontend.bundle.Bundle` :parameter str orbit: the label of the orbit in which this constraint should be built :parameter str solve_for: if 't0_ref' should not be th...
[ "Create", "a", "constraint", "for", "t0_ref", "in", "an", "orbit", "-", "allowing", "translating", "between", "t0_ref", "and", "t0_supconj", "." ]
train
https://github.com/phoebe-project/phoebe2/blob/e64b8be683977064e2d55dd1b3ac400f64c3e379/phoebe/parameters/constraint.py#L421-L459
phoebe-project/phoebe2
phoebe/parameters/constraint.py
_true_anom_to_phase
def _true_anom_to_phase(true_anom, period, ecc, per0): """ TODO: add documentation """ phshift = 0 mean_anom = true_anom - (ecc*sin(true_anom))*u.deg Phi = (mean_anom + per0) / (360*u.deg) - 1./4 # phase = Phi - (phshift - 0.25 + per0/(360*u.deg)) * period phase = (Phi*u.d - (phshift ...
python
def _true_anom_to_phase(true_anom, period, ecc, per0): """ TODO: add documentation """ phshift = 0 mean_anom = true_anom - (ecc*sin(true_anom))*u.deg Phi = (mean_anom + per0) / (360*u.deg) - 1./4 # phase = Phi - (phshift - 0.25 + per0/(360*u.deg)) * period phase = (Phi*u.d - (phshift ...
[ "def", "_true_anom_to_phase", "(", "true_anom", ",", "period", ",", "ecc", ",", "per0", ")", ":", "phshift", "=", "0", "mean_anom", "=", "true_anom", "-", "(", "ecc", "*", "sin", "(", "true_anom", ")", ")", "*", "u", ".", "deg", "Phi", "=", "(", "m...
TODO: add documentation
[ "TODO", ":", "add", "documentation" ]
train
https://github.com/phoebe-project/phoebe2/blob/e64b8be683977064e2d55dd1b3ac400f64c3e379/phoebe/parameters/constraint.py#L484-L497
phoebe-project/phoebe2
phoebe/parameters/constraint.py
ph_supconj
def ph_supconj(b, orbit, solve_for=None, **kwargs): """ TODO: add documentation """ orbit_ps = _get_system_ps(b, orbit) # metawargs = orbit_ps.meta #metawargs.pop('qualifier') # t0_ph0 and phshift both exist by default, so we don't have to worry about creating either # t0_ph0 = orbit_p...
python
def ph_supconj(b, orbit, solve_for=None, **kwargs): """ TODO: add documentation """ orbit_ps = _get_system_ps(b, orbit) # metawargs = orbit_ps.meta #metawargs.pop('qualifier') # t0_ph0 and phshift both exist by default, so we don't have to worry about creating either # t0_ph0 = orbit_p...
[ "def", "ph_supconj", "(", "b", ",", "orbit", ",", "solve_for", "=", "None", ",", "*", "*", "kwargs", ")", ":", "orbit_ps", "=", "_get_system_ps", "(", "b", ",", "orbit", ")", "# metawargs = orbit_ps.meta", "#metawargs.pop('qualifier')", "# t0_ph0 and phshift both ...
TODO: add documentation
[ "TODO", ":", "add", "documentation" ]
train
https://github.com/phoebe-project/phoebe2/blob/e64b8be683977064e2d55dd1b3ac400f64c3e379/phoebe/parameters/constraint.py#L499-L533
phoebe-project/phoebe2
phoebe/parameters/constraint.py
freq
def freq(b, component, solve_for=None, **kwargs): """ Create a constraint for frequency (either orbital or rotational) given a period. freq = 2 * pi / period :parameter b: the :class:`phoebe.frontend.bundle.Bundle` :parameter str component: the label of the orbit or component in which this ...
python
def freq(b, component, solve_for=None, **kwargs): """ Create a constraint for frequency (either orbital or rotational) given a period. freq = 2 * pi / period :parameter b: the :class:`phoebe.frontend.bundle.Bundle` :parameter str component: the label of the orbit or component in which this ...
[ "def", "freq", "(", "b", ",", "component", ",", "solve_for", "=", "None", ",", "*", "*", "kwargs", ")", ":", "component_ps", "=", "_get_system_ps", "(", "b", ",", "component", ")", "#metawargs = component_ps.meta", "#metawargs.pop('qualifier')", "period", "=", ...
Create a constraint for frequency (either orbital or rotational) given a period. freq = 2 * pi / period :parameter b: the :class:`phoebe.frontend.bundle.Bundle` :parameter str component: the label of the orbit or component in which this constraint should be built :parameter str solve_for: if ...
[ "Create", "a", "constraint", "for", "frequency", "(", "either", "orbital", "or", "rotational", ")", "given", "a", "period", "." ]
train
https://github.com/phoebe-project/phoebe2/blob/e64b8be683977064e2d55dd1b3ac400f64c3e379/phoebe/parameters/constraint.py#L588-L623
phoebe-project/phoebe2
phoebe/parameters/constraint.py
keplers_third_law_hierarchical
def keplers_third_law_hierarchical(b, orbit1, orbit2, solve_for=None, **kwargs): """ TODO: add documentation """ hier = b.hierarchy orbit1_ps = _get_system_ps(b, orbit1) orbit2_ps = _get_system_ps(b, orbit2) sma1 = orbit1_ps.get_parameter(qualifier='sma') sma2 = orbit2_ps.get_paramete...
python
def keplers_third_law_hierarchical(b, orbit1, orbit2, solve_for=None, **kwargs): """ TODO: add documentation """ hier = b.hierarchy orbit1_ps = _get_system_ps(b, orbit1) orbit2_ps = _get_system_ps(b, orbit2) sma1 = orbit1_ps.get_parameter(qualifier='sma') sma2 = orbit2_ps.get_paramete...
[ "def", "keplers_third_law_hierarchical", "(", "b", ",", "orbit1", ",", "orbit2", ",", "solve_for", "=", "None", ",", "*", "*", "kwargs", ")", ":", "hier", "=", "b", ".", "hierarchy", "orbit1_ps", "=", "_get_system_ps", "(", "b", ",", "orbit1", ")", "orbi...
TODO: add documentation
[ "TODO", ":", "add", "documentation" ]
train
https://github.com/phoebe-project/phoebe2/blob/e64b8be683977064e2d55dd1b3ac400f64c3e379/phoebe/parameters/constraint.py#L628-L661
phoebe-project/phoebe2
phoebe/parameters/constraint.py
irrad_frac
def irrad_frac(b, component, solve_for=None, **kwargs): """ Create a constraint to ensure that energy is conserved and all incident light is accounted for. """ comp_ps = b.get_component(component=component) irrad_frac_refl_bol = comp_ps.get_parameter(qualifier='irrad_frac_refl_bol') irrad_...
python
def irrad_frac(b, component, solve_for=None, **kwargs): """ Create a constraint to ensure that energy is conserved and all incident light is accounted for. """ comp_ps = b.get_component(component=component) irrad_frac_refl_bol = comp_ps.get_parameter(qualifier='irrad_frac_refl_bol') irrad_...
[ "def", "irrad_frac", "(", "b", ",", "component", ",", "solve_for", "=", "None", ",", "*", "*", "kwargs", ")", ":", "comp_ps", "=", "b", ".", "get_component", "(", "component", "=", "component", ")", "irrad_frac_refl_bol", "=", "comp_ps", ".", "get_paramete...
Create a constraint to ensure that energy is conserved and all incident light is accounted for.
[ "Create", "a", "constraint", "to", "ensure", "that", "energy", "is", "conserved", "and", "all", "incident", "light", "is", "accounted", "for", "." ]
train
https://github.com/phoebe-project/phoebe2/blob/e64b8be683977064e2d55dd1b3ac400f64c3e379/phoebe/parameters/constraint.py#L666-L686
phoebe-project/phoebe2
phoebe/parameters/constraint.py
semidetached
def semidetached(b, component, solve_for=None, **kwargs): """ Create a constraint to force requiv to be semidetached """ comp_ps = b.get_component(component=component) requiv = comp_ps.get_parameter(qualifier='requiv') requiv_critical = comp_ps.get_parameter(qualifier='requiv_max') if solv...
python
def semidetached(b, component, solve_for=None, **kwargs): """ Create a constraint to force requiv to be semidetached """ comp_ps = b.get_component(component=component) requiv = comp_ps.get_parameter(qualifier='requiv') requiv_critical = comp_ps.get_parameter(qualifier='requiv_max') if solv...
[ "def", "semidetached", "(", "b", ",", "component", ",", "solve_for", "=", "None", ",", "*", "*", "kwargs", ")", ":", "comp_ps", "=", "b", ".", "get_component", "(", "component", "=", "component", ")", "requiv", "=", "comp_ps", ".", "get_parameter", "(", ...
Create a constraint to force requiv to be semidetached
[ "Create", "a", "constraint", "to", "force", "requiv", "to", "be", "semidetached" ]
train
https://github.com/phoebe-project/phoebe2/blob/e64b8be683977064e2d55dd1b3ac400f64c3e379/phoebe/parameters/constraint.py#L688-L703
phoebe-project/phoebe2
phoebe/parameters/constraint.py
mass
def mass(b, component, solve_for=None, **kwargs): """ 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 :parameter b: the :class:`phoebe.frontend.bundle.Bundle` :parameter str component: t...
python
def mass(b, component, solve_for=None, **kwargs): """ 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 :parameter b: the :class:`phoebe.frontend.bundle.Bundle` :parameter str component: t...
[ "def", "mass", "(", "b", ",", "component", ",", "solve_for", "=", "None", ",", "*", "*", "kwargs", ")", ":", "# TODO: optimize this - this is currently by far the most expensive constraint (due mostly to the parameter multiplication)", "hier", "=", "b", ".", "get_hierarchy"...
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 :parameter b: the :class:`phoebe.frontend.bundle.Bundle` :parameter str component: the label of the star in which this constraint should b...
[ "Create", "a", "constraint", "for", "the", "mass", "of", "a", "star", "based", "on", "Kepler", "s", "third", "law", "from", "its", "parent", "orbit", "." ]
train
https://github.com/phoebe-project/phoebe2/blob/e64b8be683977064e2d55dd1b3ac400f64c3e379/phoebe/parameters/constraint.py#L719-L795
phoebe-project/phoebe2
phoebe/parameters/constraint.py
comp_sma
def comp_sma(b, component, solve_for=None, **kwargs): """ 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 :parameter b: the :class:`phoebe.f...
python
def comp_sma(b, component, solve_for=None, **kwargs): """ 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 :parameter b: the :class:`phoebe.f...
[ "def", "comp_sma", "(", "b", ",", "component", ",", "solve_for", "=", "None", ",", "*", "*", "kwargs", ")", ":", "hier", "=", "b", ".", "get_hierarchy", "(", ")", "if", "not", "len", "(", "hier", ".", "get_value", "(", ")", ")", ":", "# TODO: chang...
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 :parameter b: the :class:`phoebe.frontend.bundle.Bundle` :parameter str component: the label of ...
[ "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" ]
train
https://github.com/phoebe-project/phoebe2/blob/e64b8be683977064e2d55dd1b3ac400f64c3e379/phoebe/parameters/constraint.py#L798-L857
phoebe-project/phoebe2
phoebe/parameters/constraint.py
requiv_detached_max
def requiv_detached_max(b, component, solve_for=None, **kwargs): """ Create a constraint to determine the critical (at L1) value of requiv. :parameter b: the :class:`phoebe.frontend.bundle.Bundle` :parameter str component: the label of the star in which this constraint should be built :...
python
def requiv_detached_max(b, component, solve_for=None, **kwargs): """ Create a constraint to determine the critical (at L1) value of requiv. :parameter b: the :class:`phoebe.frontend.bundle.Bundle` :parameter str component: the label of the star in which this constraint should be built :...
[ "def", "requiv_detached_max", "(", "b", ",", "component", ",", "solve_for", "=", "None", ",", "*", "*", "kwargs", ")", ":", "hier", "=", "b", ".", "get_hierarchy", "(", ")", "if", "not", "len", "(", "hier", ".", "get_value", "(", ")", ")", ":", "# ...
Create a constraint to determine the critical (at L1) value of requiv. :parameter b: the :class:`phoebe.frontend.bundle.Bundle` :parameter str component: the label of the star in which this constraint should be built :parameter str solve_for: if 'requiv_max' should not be the derived/constrain...
[ "Create", "a", "constraint", "to", "determine", "the", "critical", "(", "at", "L1", ")", "value", "of", "requiv", "." ]
train
https://github.com/phoebe-project/phoebe2/blob/e64b8be683977064e2d55dd1b3ac400f64c3e379/phoebe/parameters/constraint.py#L860-L911
phoebe-project/phoebe2
phoebe/parameters/constraint.py
potential_contact_min
def potential_contact_min(b, component, solve_for=None, **kwargs): """ Create a constraint to determine the critical (at L23) value of potential at which a constact will underflow. This will only be used for contacts for pot_min :parameter b: the :class:`phoebe.frontend.bundle.Bundle` :paramet...
python
def potential_contact_min(b, component, solve_for=None, **kwargs): """ Create a constraint to determine the critical (at L23) value of potential at which a constact will underflow. This will only be used for contacts for pot_min :parameter b: the :class:`phoebe.frontend.bundle.Bundle` :paramet...
[ "def", "potential_contact_min", "(", "b", ",", "component", ",", "solve_for", "=", "None", ",", "*", "*", "kwargs", ")", ":", "hier", "=", "b", ".", "get_hierarchy", "(", ")", "if", "not", "len", "(", "hier", ".", "get_value", "(", ")", ")", ":", "...
Create a constraint to determine the critical (at L23) value of potential at which a constact will underflow. This will only be used for contacts for pot_min :parameter b: the :class:`phoebe.frontend.bundle.Bundle` :parameter str component: the label of the star in which this constraint should...
[ "Create", "a", "constraint", "to", "determine", "the", "critical", "(", "at", "L23", ")", "value", "of", "potential", "at", "which", "a", "constact", "will", "underflow", ".", "This", "will", "only", "be", "used", "for", "contacts", "for", "pot_min" ]
train
https://github.com/phoebe-project/phoebe2/blob/e64b8be683977064e2d55dd1b3ac400f64c3e379/phoebe/parameters/constraint.py#L913-L949
phoebe-project/phoebe2
phoebe/parameters/constraint.py
potential_contact_max
def potential_contact_max(b, component, solve_for=None, **kwargs): """ Create a constraint to determine the critical (at L1) value of potential at which a constact will underflow. This will only be used for contacts for pot_min :parameter b: the :class:`phoebe.frontend.bundle.Bundle` :paramete...
python
def potential_contact_max(b, component, solve_for=None, **kwargs): """ Create a constraint to determine the critical (at L1) value of potential at which a constact will underflow. This will only be used for contacts for pot_min :parameter b: the :class:`phoebe.frontend.bundle.Bundle` :paramete...
[ "def", "potential_contact_max", "(", "b", ",", "component", ",", "solve_for", "=", "None", ",", "*", "*", "kwargs", ")", ":", "hier", "=", "b", ".", "get_hierarchy", "(", ")", "if", "not", "len", "(", "hier", ".", "get_value", "(", ")", ")", ":", "...
Create a constraint to determine the critical (at L1) value of potential at which a constact will underflow. This will only be used for contacts for pot_min :parameter b: the :class:`phoebe.frontend.bundle.Bundle` :parameter str component: the label of the star in which this constraint should ...
[ "Create", "a", "constraint", "to", "determine", "the", "critical", "(", "at", "L1", ")", "value", "of", "potential", "at", "which", "a", "constact", "will", "underflow", ".", "This", "will", "only", "be", "used", "for", "contacts", "for", "pot_min" ]
train
https://github.com/phoebe-project/phoebe2/blob/e64b8be683977064e2d55dd1b3ac400f64c3e379/phoebe/parameters/constraint.py#L951-L987
phoebe-project/phoebe2
phoebe/parameters/constraint.py
requiv_contact_min
def requiv_contact_min(b, component, solve_for=None, **kwargs): """ Create a constraint to determine the critical (at L1) value of requiv at which a constact will underflow. This will only be used for contacts for requiv_min :parameter b: the :class:`phoebe.frontend.bundle.Bundle` :parameter s...
python
def requiv_contact_min(b, component, solve_for=None, **kwargs): """ Create a constraint to determine the critical (at L1) value of requiv at which a constact will underflow. This will only be used for contacts for requiv_min :parameter b: the :class:`phoebe.frontend.bundle.Bundle` :parameter s...
[ "def", "requiv_contact_min", "(", "b", ",", "component", ",", "solve_for", "=", "None", ",", "*", "*", "kwargs", ")", ":", "hier", "=", "b", ".", "get_hierarchy", "(", ")", "if", "not", "len", "(", "hier", ".", "get_value", "(", ")", ")", ":", "# T...
Create a constraint to determine the critical (at L1) value of requiv at which a constact will underflow. This will only be used for contacts for requiv_min :parameter b: the :class:`phoebe.frontend.bundle.Bundle` :parameter str component: the label of the star in which this constraint should ...
[ "Create", "a", "constraint", "to", "determine", "the", "critical", "(", "at", "L1", ")", "value", "of", "requiv", "at", "which", "a", "constact", "will", "underflow", ".", "This", "will", "only", "be", "used", "for", "contacts", "for", "requiv_min" ]
train
https://github.com/phoebe-project/phoebe2/blob/e64b8be683977064e2d55dd1b3ac400f64c3e379/phoebe/parameters/constraint.py#L989-L1026
phoebe-project/phoebe2
phoebe/parameters/constraint.py
requiv_contact_max
def requiv_contact_max(b, component, solve_for=None, **kwargs): """ Create a constraint to determine the critical (at L2/3) value of requiv at which a constact will overflow. This will only be used for contacts for requiv_max :parameter b: the :class:`phoebe.frontend.bundle.Bundle` :parameter ...
python
def requiv_contact_max(b, component, solve_for=None, **kwargs): """ Create a constraint to determine the critical (at L2/3) value of requiv at which a constact will overflow. This will only be used for contacts for requiv_max :parameter b: the :class:`phoebe.frontend.bundle.Bundle` :parameter ...
[ "def", "requiv_contact_max", "(", "b", ",", "component", ",", "solve_for", "=", "None", ",", "*", "*", "kwargs", ")", ":", "hier", "=", "b", ".", "get_hierarchy", "(", ")", "if", "not", "len", "(", "hier", ".", "get_value", "(", ")", ")", ":", "# T...
Create a constraint to determine the critical (at L2/3) value of requiv at which a constact will overflow. This will only be used for contacts for requiv_max :parameter b: the :class:`phoebe.frontend.bundle.Bundle` :parameter str component: the label of the star in which this constraint should...
[ "Create", "a", "constraint", "to", "determine", "the", "critical", "(", "at", "L2", "/", "3", ")", "value", "of", "requiv", "at", "which", "a", "constact", "will", "overflow", ".", "This", "will", "only", "be", "used", "for", "contacts", "for", "requiv_m...
train
https://github.com/phoebe-project/phoebe2/blob/e64b8be683977064e2d55dd1b3ac400f64c3e379/phoebe/parameters/constraint.py#L1028-L1065
phoebe-project/phoebe2
phoebe/parameters/constraint.py
fillout_factor
def fillout_factor(b, component, solve_for=None, **kwargs): """ Create a constraint to determine the fillout factor of a contact envelope. :parameter b: the :class:`phoebe.frontend.bundle.Bundle` :parameter str component: the label of the star in which this constraint should be built :param...
python
def fillout_factor(b, component, solve_for=None, **kwargs): """ Create a constraint to determine the fillout factor of a contact envelope. :parameter b: the :class:`phoebe.frontend.bundle.Bundle` :parameter str component: the label of the star in which this constraint should be built :param...
[ "def", "fillout_factor", "(", "b", ",", "component", ",", "solve_for", "=", "None", ",", "*", "*", "kwargs", ")", ":", "hier", "=", "b", ".", "get_hierarchy", "(", ")", "if", "not", "len", "(", "hier", ".", "get_value", "(", ")", ")", ":", "# TODO:...
Create a constraint to determine the fillout factor of a contact envelope. :parameter b: the :class:`phoebe.frontend.bundle.Bundle` :parameter str component: the label of the star in which this constraint should be built :parameter str solve_for: if 'requiv_max' should not be the derived/constrain...
[ "Create", "a", "constraint", "to", "determine", "the", "fillout", "factor", "of", "a", "contact", "envelope", "." ]
train
https://github.com/phoebe-project/phoebe2/blob/e64b8be683977064e2d55dd1b3ac400f64c3e379/phoebe/parameters/constraint.py#L1067-L1106
phoebe-project/phoebe2
phoebe/parameters/constraint.py
rotation_period
def rotation_period(b, component, solve_for=None, **kwargs): """ Create a constraint for the rotation period of a star given its orbital period and synchronicity parameters. :parameter b: the :class:`phoebe.frontend.bundle.Bundle` :parameter str component: the label of the star in which this ...
python
def rotation_period(b, component, solve_for=None, **kwargs): """ Create a constraint for the rotation period of a star given its orbital period and synchronicity parameters. :parameter b: the :class:`phoebe.frontend.bundle.Bundle` :parameter str component: the label of the star in which this ...
[ "def", "rotation_period", "(", "b", ",", "component", ",", "solve_for", "=", "None", ",", "*", "*", "kwargs", ")", ":", "hier", "=", "b", ".", "get_hierarchy", "(", ")", "if", "not", "len", "(", "hier", ".", "get_value", "(", ")", ")", ":", "# TODO...
Create a constraint for the rotation period of a star given its orbital period and synchronicity parameters. :parameter b: the :class:`phoebe.frontend.bundle.Bundle` :parameter str component: the label of the star in which this constraint should be built :parameter str solve_for: if 'period@st...
[ "Create", "a", "constraint", "for", "the", "rotation", "period", "of", "a", "star", "given", "its", "orbital", "period", "and", "synchronicity", "parameters", "." ]
train
https://github.com/phoebe-project/phoebe2/blob/e64b8be683977064e2d55dd1b3ac400f64c3e379/phoebe/parameters/constraint.py#L1108-L1158
phoebe-project/phoebe2
phoebe/parameters/constraint.py
pitch
def pitch(b, component, solve_for=None, **kwargs): """ Create a constraint for the inclination of a star relative to its parent orbit :parameter b: the :class:`phoebe.frontend.bundle.Bundle` :parameter str component: the label of the star in which this constraint should be built :parameter ...
python
def pitch(b, component, solve_for=None, **kwargs): """ Create a constraint for the inclination of a star relative to its parent orbit :parameter b: the :class:`phoebe.frontend.bundle.Bundle` :parameter str component: the label of the star in which this constraint should be built :parameter ...
[ "def", "pitch", "(", "b", ",", "component", ",", "solve_for", "=", "None", ",", "*", "*", "kwargs", ")", ":", "hier", "=", "b", ".", "get_hierarchy", "(", ")", "if", "not", "len", "(", "hier", ".", "get_value", "(", ")", ")", ":", "# TODO: change t...
Create a constraint for the inclination of a star relative to its parent orbit :parameter b: the :class:`phoebe.frontend.bundle.Bundle` :parameter str component: the label of the star in which this constraint should be built :parameter str solve_for: if 'incl@star' should not be the derived/constr...
[ "Create", "a", "constraint", "for", "the", "inclination", "of", "a", "star", "relative", "to", "its", "parent", "orbit" ]
train
https://github.com/phoebe-project/phoebe2/blob/e64b8be683977064e2d55dd1b3ac400f64c3e379/phoebe/parameters/constraint.py#L1160-L1204
phoebe-project/phoebe2
phoebe/parameters/constraint.py
yaw
def yaw(b, component, solve_for=None, **kwargs): """ Create a constraint for the inclination of a star relative to its parent orbit :parameter b: the :class:`phoebe.frontend.bundle.Bundle` :parameter str component: the label of the star in which this constraint should be built :parameter st...
python
def yaw(b, component, solve_for=None, **kwargs): """ Create a constraint for the inclination of a star relative to its parent orbit :parameter b: the :class:`phoebe.frontend.bundle.Bundle` :parameter str component: the label of the star in which this constraint should be built :parameter st...
[ "def", "yaw", "(", "b", ",", "component", ",", "solve_for", "=", "None", ",", "*", "*", "kwargs", ")", ":", "hier", "=", "b", ".", "get_hierarchy", "(", ")", "if", "not", "len", "(", "hier", ".", "get_value", "(", ")", ")", ":", "# TODO: change to ...
Create a constraint for the inclination of a star relative to its parent orbit :parameter b: the :class:`phoebe.frontend.bundle.Bundle` :parameter str component: the label of the star in which this constraint should be built :parameter str solve_for: if 'long_an@star' should not be the derived/con...
[ "Create", "a", "constraint", "for", "the", "inclination", "of", "a", "star", "relative", "to", "its", "parent", "orbit" ]
train
https://github.com/phoebe-project/phoebe2/blob/e64b8be683977064e2d55dd1b3ac400f64c3e379/phoebe/parameters/constraint.py#L1206-L1250
phoebe-project/phoebe2
phoebe/parameters/constraint.py
time_ephem
def time_ephem(b, component, dataset, solve_for=None, **kwargs): """ use the ephemeris of component to predict the expected times of eclipse (used in the ETV dataset) """ hier = b.get_hierarchy() if not len(hier.get_value()): # TODO: change to custom error type to catch in bundle.add...
python
def time_ephem(b, component, dataset, solve_for=None, **kwargs): """ use the ephemeris of component to predict the expected times of eclipse (used in the ETV dataset) """ hier = b.get_hierarchy() if not len(hier.get_value()): # TODO: change to custom error type to catch in bundle.add...
[ "def", "time_ephem", "(", "b", ",", "component", ",", "dataset", ",", "solve_for", "=", "None", ",", "*", "*", "kwargs", ")", ":", "hier", "=", "b", ".", "get_hierarchy", "(", ")", "if", "not", "len", "(", "hier", ".", "get_value", "(", ")", ")", ...
use the ephemeris of component to predict the expected times of eclipse (used in the ETV dataset)
[ "use", "the", "ephemeris", "of", "component", "to", "predict", "the", "expected", "times", "of", "eclipse", "(", "used", "in", "the", "ETV", "dataset", ")" ]
train
https://github.com/phoebe-project/phoebe2/blob/e64b8be683977064e2d55dd1b3ac400f64c3e379/phoebe/parameters/constraint.py#L1267-L1319
phoebe-project/phoebe2
phoebe/parameters/constraint.py
etv
def etv(b, component, dataset, solve_for=None, **kwargs): """ compute the ETV column from the time_ephem and time_ecl columns (used in the ETV dataset) """ time_ephem = b.get_parameter(qualifier='time_ephems', component=component, dataset=dataset, context=['dataset', 'model']) # need to provid...
python
def etv(b, component, dataset, solve_for=None, **kwargs): """ compute the ETV column from the time_ephem and time_ecl columns (used in the ETV dataset) """ time_ephem = b.get_parameter(qualifier='time_ephems', component=component, dataset=dataset, context=['dataset', 'model']) # need to provid...
[ "def", "etv", "(", "b", ",", "component", ",", "dataset", ",", "solve_for", "=", "None", ",", "*", "*", "kwargs", ")", ":", "time_ephem", "=", "b", ".", "get_parameter", "(", "qualifier", "=", "'time_ephems'", ",", "component", "=", "component", ",", "...
compute the ETV column from the time_ephem and time_ecl columns (used in the ETV dataset)
[ "compute", "the", "ETV", "column", "from", "the", "time_ephem", "and", "time_ecl", "columns", "(", "used", "in", "the", "ETV", "dataset", ")" ]
train
https://github.com/phoebe-project/phoebe2/blob/e64b8be683977064e2d55dd1b3ac400f64c3e379/phoebe/parameters/constraint.py#L1321-L1337
phoebe-project/phoebe2
phoebe/dependencies/nparray/nparray.py
is_unit
def is_unit(value): """must be an astropy unit""" if not _has_astropy: raise ImportError("astropy must be installed for unit support") if (isinstance(value, units.Unit) or isinstance(value, units.IrreducibleUnit) or isinstance(value, units.CompositeUnit)): return True, value else: ...
python
def is_unit(value): """must be an astropy unit""" if not _has_astropy: raise ImportError("astropy must be installed for unit support") if (isinstance(value, units.Unit) or isinstance(value, units.IrreducibleUnit) or isinstance(value, units.CompositeUnit)): return True, value else: ...
[ "def", "is_unit", "(", "value", ")", ":", "if", "not", "_has_astropy", ":", "raise", "ImportError", "(", "\"astropy must be installed for unit support\"", ")", "if", "(", "isinstance", "(", "value", ",", "units", ".", "Unit", ")", "or", "isinstance", "(", "val...
must be an astropy unit
[ "must", "be", "an", "astropy", "unit" ]
train
https://github.com/phoebe-project/phoebe2/blob/e64b8be683977064e2d55dd1b3ac400f64c3e379/phoebe/dependencies/nparray/nparray.py#L17-L24
phoebe-project/phoebe2
phoebe/dependencies/nparray/nparray.py
is_unit_or_unitstring
def is_unit_or_unitstring(value): """must be an astropy.unit""" if is_unit(value)[0]: return True, value try: unit = units.Unit(value) except: return False, value else: return True, unit
python
def is_unit_or_unitstring(value): """must be an astropy.unit""" if is_unit(value)[0]: return True, value try: unit = units.Unit(value) except: return False, value else: return True, unit
[ "def", "is_unit_or_unitstring", "(", "value", ")", ":", "if", "is_unit", "(", "value", ")", "[", "0", "]", ":", "return", "True", ",", "value", "try", ":", "unit", "=", "units", ".", "Unit", "(", "value", ")", "except", ":", "return", "False", ",", ...
must be an astropy.unit
[ "must", "be", "an", "astropy", ".", "unit" ]
train
https://github.com/phoebe-project/phoebe2/blob/e64b8be683977064e2d55dd1b3ac400f64c3e379/phoebe/dependencies/nparray/nparray.py#L26-L35
phoebe-project/phoebe2
phoebe/dependencies/nparray/nparray.py
is_float
def is_float(value): """must be a float""" return isinstance(value, float) or isinstance(value, int) or isinstance(value, np.float64), float(value)
python
def is_float(value): """must be a float""" return isinstance(value, float) or isinstance(value, int) or isinstance(value, np.float64), float(value)
[ "def", "is_float", "(", "value", ")", ":", "return", "isinstance", "(", "value", ",", "float", ")", "or", "isinstance", "(", "value", ",", "int", ")", "or", "isinstance", "(", "value", ",", "np", ".", "float64", ")", ",", "float", "(", "value", ")" ]
must be a float
[ "must", "be", "a", "float" ]
train
https://github.com/phoebe-project/phoebe2/blob/e64b8be683977064e2d55dd1b3ac400f64c3e379/phoebe/dependencies/nparray/nparray.py#L47-L49
phoebe-project/phoebe2
phoebe/dependencies/nparray/nparray.py
is_valid_shape
def is_valid_shape(value): """must be a positive integer or a tuple/list of positive integers""" if is_int_positive(value): return True, value elif isinstance(value, tuple) or isinstance(value, list): for v in value: if not is_int_positive(v): return False, value ...
python
def is_valid_shape(value): """must be a positive integer or a tuple/list of positive integers""" if is_int_positive(value): return True, value elif isinstance(value, tuple) or isinstance(value, list): for v in value: if not is_int_positive(v): return False, value ...
[ "def", "is_valid_shape", "(", "value", ")", ":", "if", "is_int_positive", "(", "value", ")", ":", "return", "True", ",", "value", "elif", "isinstance", "(", "value", ",", "tuple", ")", "or", "isinstance", "(", "value", ",", "list", ")", ":", "for", "v"...
must be a positive integer or a tuple/list of positive integers
[ "must", "be", "a", "positive", "integer", "or", "a", "tuple", "/", "list", "of", "positive", "integers" ]
train
https://github.com/phoebe-project/phoebe2/blob/e64b8be683977064e2d55dd1b3ac400f64c3e379/phoebe/dependencies/nparray/nparray.py#L63-L73
phoebe-project/phoebe2
phoebe/dependencies/nparray/nparray.py
is_iterable
def is_iterable(value): """must be an iterable (list, array, tuple)""" return isinstance(value, np.ndarray) or isinstance(value, list) or isinstance(value, tuple), value
python
def is_iterable(value): """must be an iterable (list, array, tuple)""" return isinstance(value, np.ndarray) or isinstance(value, list) or isinstance(value, tuple), value
[ "def", "is_iterable", "(", "value", ")", ":", "return", "isinstance", "(", "value", ",", "np", ".", "ndarray", ")", "or", "isinstance", "(", "value", ",", "list", ")", "or", "isinstance", "(", "value", ",", "tuple", ")", ",", "value" ]
must be an iterable (list, array, tuple)
[ "must", "be", "an", "iterable", "(", "list", "array", "tuple", ")" ]
train
https://github.com/phoebe-project/phoebe2/blob/e64b8be683977064e2d55dd1b3ac400f64c3e379/phoebe/dependencies/nparray/nparray.py#L75-L77
phoebe-project/phoebe2
phoebe/dependencies/nparray/nparray.py
ArrayWrapper.quantity
def quantity(self): """ return the underlying astropy quantity (if astropy is installed) """ if not _has_astropy: raise ImportError("astropy must be installed for unit/quantity support") if self.unit is None: raise ValueError("unit is not set, cannot conv...
python
def quantity(self): """ return the underlying astropy quantity (if astropy is installed) """ if not _has_astropy: raise ImportError("astropy must be installed for unit/quantity support") if self.unit is None: raise ValueError("unit is not set, cannot conv...
[ "def", "quantity", "(", "self", ")", ":", "if", "not", "_has_astropy", ":", "raise", "ImportError", "(", "\"astropy must be installed for unit/quantity support\"", ")", "if", "self", ".", "unit", "is", "None", ":", "raise", "ValueError", "(", "\"unit is not set, can...
return the underlying astropy quantity (if astropy is installed)
[ "return", "the", "underlying", "astropy", "quantity", "(", "if", "astropy", "is", "installed", ")" ]
train
https://github.com/phoebe-project/phoebe2/blob/e64b8be683977064e2d55dd1b3ac400f64c3e379/phoebe/dependencies/nparray/nparray.py#L124-L134
phoebe-project/phoebe2
phoebe/dependencies/nparray/nparray.py
ArrayWrapper.to
def to(self, unit): """ convert between units. Returns a new nparray object with the new units """ if not _has_astropy: raise ImportError("astropy must be installed for unit/quantity support") if self.unit is None: raise ValueError("no units currently se...
python
def to(self, unit): """ convert between units. Returns a new nparray object with the new units """ if not _has_astropy: raise ImportError("astropy must be installed for unit/quantity support") if self.unit is None: raise ValueError("no units currently se...
[ "def", "to", "(", "self", ",", "unit", ")", ":", "if", "not", "_has_astropy", ":", "raise", "ImportError", "(", "\"astropy must be installed for unit/quantity support\"", ")", "if", "self", ".", "unit", "is", "None", ":", "raise", "ValueError", "(", "\"no units ...
convert between units. Returns a new nparray object with the new units
[ "convert", "between", "units", ".", "Returns", "a", "new", "nparray", "object", "with", "the", "new", "units" ]
train
https://github.com/phoebe-project/phoebe2/blob/e64b8be683977064e2d55dd1b3ac400f64c3e379/phoebe/dependencies/nparray/nparray.py#L136-L152
phoebe-project/phoebe2
phoebe/dependencies/nparray/nparray.py
ArrayWrapper.to_dict
def to_dict(self): """ dump a representation of the nparray object to a dictionary. The nparray object should then be able to be fully restored via nparray.from_dict """ def _json_safe(v): if isinstance(v, np.ndarray): return v.tolist() ...
python
def to_dict(self): """ dump a representation of the nparray object to a dictionary. The nparray object should then be able to be fully restored via nparray.from_dict """ def _json_safe(v): if isinstance(v, np.ndarray): return v.tolist() ...
[ "def", "to_dict", "(", "self", ")", ":", "def", "_json_safe", "(", "v", ")", ":", "if", "isinstance", "(", "v", ",", "np", ".", "ndarray", ")", ":", "return", "v", ".", "tolist", "(", ")", "elif", "is_unit", "(", "v", ")", "[", "0", "]", ":", ...
dump a representation of the nparray object to a dictionary. The nparray object should then be able to be fully restored via nparray.from_dict
[ "dump", "a", "representation", "of", "the", "nparray", "object", "to", "a", "dictionary", ".", "The", "nparray", "object", "should", "then", "be", "able", "to", "be", "fully", "restored", "via", "nparray", ".", "from_dict" ]
train
https://github.com/phoebe-project/phoebe2/blob/e64b8be683977064e2d55dd1b3ac400f64c3e379/phoebe/dependencies/nparray/nparray.py#L224-L239
phoebe-project/phoebe2
phoebe/dependencies/nparray/nparray.py
ArrayWrapper.to_file
def to_file(self, filename, **kwargs): """ dump a representation of the nparray object to a json-formatted file. The nparray object should then be able to be fully restored via nparray.from_file @parameter str filename: path to the file to be created (will overwrite ...
python
def to_file(self, filename, **kwargs): """ dump a representation of the nparray object to a json-formatted file. The nparray object should then be able to be fully restored via nparray.from_file @parameter str filename: path to the file to be created (will overwrite ...
[ "def", "to_file", "(", "self", ",", "filename", ",", "*", "*", "kwargs", ")", ":", "f", "=", "open", "(", "filename", ",", "'w'", ")", "f", ".", "write", "(", "self", ".", "to_json", "(", "*", "*", "kwargs", ")", ")", "f", ".", "close", "(", ...
dump a representation of the nparray object to a json-formatted file. The nparray object should then be able to be fully restored via nparray.from_file @parameter str filename: path to the file to be created (will overwrite if already exists) @rtype: str @returns: th...
[ "dump", "a", "representation", "of", "the", "nparray", "object", "to", "a", "json", "-", "formatted", "file", ".", "The", "nparray", "object", "should", "then", "be", "able", "to", "be", "fully", "restored", "via", "nparray", ".", "from_file" ]
train
https://github.com/phoebe-project/phoebe2/blob/e64b8be683977064e2d55dd1b3ac400f64c3e379/phoebe/dependencies/nparray/nparray.py#L249-L263
phoebe-project/phoebe2
phoebe/dependencies/nparray/nparray.py
Arange.array
def array(self): """ return the underlying numpy array """ return np.arange(self.start, self.stop, self.step)
python
def array(self): """ return the underlying numpy array """ return np.arange(self.start, self.stop, self.step)
[ "def", "array", "(", "self", ")", ":", "return", "np", ".", "arange", "(", "self", ".", "start", ",", "self", ".", "stop", ",", "self", ".", "step", ")" ]
return the underlying numpy array
[ "return", "the", "underlying", "numpy", "array" ]
train
https://github.com/phoebe-project/phoebe2/blob/e64b8be683977064e2d55dd1b3ac400f64c3e379/phoebe/dependencies/nparray/nparray.py#L376-L380
phoebe-project/phoebe2
phoebe/dependencies/nparray/nparray.py
Arange.to_linspace
def to_linspace(self): """ convert from arange to linspace """ num = int((self.stop-self.start)/(self.step)) return Linspace(self.start, self.stop-self.step, num)
python
def to_linspace(self): """ convert from arange to linspace """ num = int((self.stop-self.start)/(self.step)) return Linspace(self.start, self.stop-self.step, num)
[ "def", "to_linspace", "(", "self", ")", ":", "num", "=", "int", "(", "(", "self", ".", "stop", "-", "self", ".", "start", ")", "/", "(", "self", ".", "step", ")", ")", "return", "Linspace", "(", "self", ".", "start", ",", "self", ".", "stop", "...
convert from arange to linspace
[ "convert", "from", "arange", "to", "linspace" ]
train
https://github.com/phoebe-project/phoebe2/blob/e64b8be683977064e2d55dd1b3ac400f64c3e379/phoebe/dependencies/nparray/nparray.py#L382-L387
phoebe-project/phoebe2
phoebe/dependencies/nparray/nparray.py
Linspace.array
def array(self): """ return the underlying numpy array """ return np.linspace(self.start, self.stop, self.num, self.endpoint)
python
def array(self): """ return the underlying numpy array """ return np.linspace(self.start, self.stop, self.num, self.endpoint)
[ "def", "array", "(", "self", ")", ":", "return", "np", ".", "linspace", "(", "self", ".", "start", ",", "self", ".", "stop", ",", "self", ".", "num", ",", "self", ".", "endpoint", ")" ]
return the underlying numpy array
[ "return", "the", "underlying", "numpy", "array" ]
train
https://github.com/phoebe-project/phoebe2/blob/e64b8be683977064e2d55dd1b3ac400f64c3e379/phoebe/dependencies/nparray/nparray.py#L421-L425
phoebe-project/phoebe2
phoebe/dependencies/nparray/nparray.py
Linspace.to_arange
def to_arange(self): """ convert from linspace to arange """ arr, step = np.linspace(self.start, self.stop, self.num, self.endpoint, retstep=True) return Arange(self.start, self.stop+step, step)
python
def to_arange(self): """ convert from linspace to arange """ arr, step = np.linspace(self.start, self.stop, self.num, self.endpoint, retstep=True) return Arange(self.start, self.stop+step, step)
[ "def", "to_arange", "(", "self", ")", ":", "arr", ",", "step", "=", "np", ".", "linspace", "(", "self", ".", "start", ",", "self", ".", "stop", ",", "self", ".", "num", ",", "self", ".", "endpoint", ",", "retstep", "=", "True", ")", "return", "Ar...
convert from linspace to arange
[ "convert", "from", "linspace", "to", "arange" ]
train
https://github.com/phoebe-project/phoebe2/blob/e64b8be683977064e2d55dd1b3ac400f64c3e379/phoebe/dependencies/nparray/nparray.py#L427-L432
phoebe-project/phoebe2
phoebe/dependencies/nparray/nparray.py
Logspace.array
def array(self): """ return the underlying numpy array """ return np.logspace(self.start, self.stop, self.num, self.endpoint, self.base)
python
def array(self): """ return the underlying numpy array """ return np.logspace(self.start, self.stop, self.num, self.endpoint, self.base)
[ "def", "array", "(", "self", ")", ":", "return", "np", ".", "logspace", "(", "self", ".", "start", ",", "self", ".", "stop", ",", "self", ".", "num", ",", "self", ".", "endpoint", ",", "self", ".", "base", ")" ]
return the underlying numpy array
[ "return", "the", "underlying", "numpy", "array" ]
train
https://github.com/phoebe-project/phoebe2/blob/e64b8be683977064e2d55dd1b3ac400f64c3e379/phoebe/dependencies/nparray/nparray.py#L461-L465
phoebe-project/phoebe2
phoebe/dependencies/nparray/nparray.py
Geomspace.array
def array(self): """ return the underlying numpy array """ return np.geomspace(self.start, self.stop, self.num, self.endpoint)
python
def array(self): """ return the underlying numpy array """ return np.geomspace(self.start, self.stop, self.num, self.endpoint)
[ "def", "array", "(", "self", ")", ":", "return", "np", ".", "geomspace", "(", "self", ".", "start", ",", "self", ".", "stop", ",", "self", ".", "num", ",", "self", ".", "endpoint", ")" ]
return the underlying numpy array
[ "return", "the", "underlying", "numpy", "array" ]
train
https://github.com/phoebe-project/phoebe2/blob/e64b8be683977064e2d55dd1b3ac400f64c3e379/phoebe/dependencies/nparray/nparray.py#L489-L493
phoebe-project/phoebe2
phoebe/dependencies/nparray/nparray.py
Full.to_linspace
def to_linspace(self): """ convert from full to linspace """ if hasattr(self.shape, '__len__'): raise NotImplementedError("can only convert flat Full arrays to linspace") return Linspace(self.fill_value, self.fill_value, self.shape)
python
def to_linspace(self): """ convert from full to linspace """ if hasattr(self.shape, '__len__'): raise NotImplementedError("can only convert flat Full arrays to linspace") return Linspace(self.fill_value, self.fill_value, self.shape)
[ "def", "to_linspace", "(", "self", ")", ":", "if", "hasattr", "(", "self", ".", "shape", ",", "'__len__'", ")", ":", "raise", "NotImplementedError", "(", "\"can only convert flat Full arrays to linspace\"", ")", "return", "Linspace", "(", "self", ".", "fill_value"...
convert from full to linspace
[ "convert", "from", "full", "to", "linspace" ]
train
https://github.com/phoebe-project/phoebe2/blob/e64b8be683977064e2d55dd1b3ac400f64c3e379/phoebe/dependencies/nparray/nparray.py#L525-L531
phoebe-project/phoebe2
phoebe/dependencies/nparray/nparray.py
Eye.array
def array(self): """ return the underlying numpy array """ return np.eye(self.M, self.N, self.k)
python
def array(self): """ return the underlying numpy array """ return np.eye(self.M, self.N, self.k)
[ "def", "array", "(", "self", ")", ":", "return", "np", ".", "eye", "(", "self", ".", "M", ",", "self", ".", "N", ",", "self", ".", "k", ")" ]
return the underlying numpy array
[ "return", "the", "underlying", "numpy", "array" ]
train
https://github.com/phoebe-project/phoebe2/blob/e64b8be683977064e2d55dd1b3ac400f64c3e379/phoebe/dependencies/nparray/nparray.py#L668-L672
phoebe-project/phoebe2
phoebe/backend/etvs.py
crossing
def crossing(b, component, time, dynamics_method='keplerian', ltte=True, tol=1e-4, maxiter=1000): """ tol in days """ def projected_separation_sq(time, b, dynamics_method, cind1, cind2, ltte=True): """ """ #print "*** projected_separation_sq", time, dynamics_method, cind1, cind...
python
def crossing(b, component, time, dynamics_method='keplerian', ltte=True, tol=1e-4, maxiter=1000): """ tol in days """ def projected_separation_sq(time, b, dynamics_method, cind1, cind2, ltte=True): """ """ #print "*** projected_separation_sq", time, dynamics_method, cind1, cind...
[ "def", "crossing", "(", "b", ",", "component", ",", "time", ",", "dynamics_method", "=", "'keplerian'", ",", "ltte", "=", "True", ",", "tol", "=", "1e-4", ",", "maxiter", "=", "1000", ")", ":", "def", "projected_separation_sq", "(", "time", ",", "b", "...
tol in days
[ "tol", "in", "days" ]
train
https://github.com/phoebe-project/phoebe2/blob/e64b8be683977064e2d55dd1b3ac400f64c3e379/phoebe/backend/etvs.py#L15-L53
phoebe-project/phoebe2
phoebe/constraints/builtin.py
requiv_contact_L1
def requiv_contact_L1(q, sma, compno, **kwargs): """ for the contact case we can make the assumption of aligned, synchronous, and circular """ return requiv_L1(q=q, syncpar=1, ecc=0, sma=sma, incl_star=0, long_an_star=0, incl_orb=0, long_an_orb=0, compno=compno, **kwargs)
python
def requiv_contact_L1(q, sma, compno, **kwargs): """ for the contact case we can make the assumption of aligned, synchronous, and circular """ return requiv_L1(q=q, syncpar=1, ecc=0, sma=sma, incl_star=0, long_an_star=0, incl_orb=0, long_an_orb=0, compno=compno, **kwargs)
[ "def", "requiv_contact_L1", "(", "q", ",", "sma", ",", "compno", ",", "*", "*", "kwargs", ")", ":", "return", "requiv_L1", "(", "q", "=", "q", ",", "syncpar", "=", "1", ",", "ecc", "=", "0", ",", "sma", "=", "sma", ",", "incl_star", "=", "0", "...
for the contact case we can make the assumption of aligned, synchronous, and circular
[ "for", "the", "contact", "case", "we", "can", "make", "the", "assumption", "of", "aligned", "synchronous", "and", "circular" ]
train
https://github.com/phoebe-project/phoebe2/blob/e64b8be683977064e2d55dd1b3ac400f64c3e379/phoebe/constraints/builtin.py#L41-L45
phoebe-project/phoebe2
phoebe/constraints/builtin.py
requiv_contact_L23
def requiv_contact_L23(q, sma, compno, **kwargs): """ for the contact case we can make the assumption of aligned, synchronous, and circular """ logger.debug("requiv_contact_L23(q={}, sma={}, compno={})".format(q, sma, compno)) crit_pot_L23 = potential_contact_L23(q) logger.debug("libphoebe.roch...
python
def requiv_contact_L23(q, sma, compno, **kwargs): """ for the contact case we can make the assumption of aligned, synchronous, and circular """ logger.debug("requiv_contact_L23(q={}, sma={}, compno={})".format(q, sma, compno)) crit_pot_L23 = potential_contact_L23(q) logger.debug("libphoebe.roch...
[ "def", "requiv_contact_L23", "(", "q", ",", "sma", ",", "compno", ",", "*", "*", "kwargs", ")", ":", "logger", ".", "debug", "(", "\"requiv_contact_L23(q={}, sma={}, compno={})\"", ".", "format", "(", "q", ",", "sma", ",", "compno", ")", ")", "crit_pot_L23",...
for the contact case we can make the assumption of aligned, synchronous, and circular
[ "for", "the", "contact", "case", "we", "can", "make", "the", "assumption", "of", "aligned", "synchronous", "and", "circular" ]
train
https://github.com/phoebe-project/phoebe2/blob/e64b8be683977064e2d55dd1b3ac400f64c3e379/phoebe/constraints/builtin.py#L47-L62
phoebe-project/phoebe2
phoebe/constraints/builtin.py
_delta_t_supconj_perpass
def _delta_t_supconj_perpass(period, ecc, per0): """ time shift between superior conjuction and periastron passage """ ups_sc = np.pi/2-per0 E_sc = 2*np.arctan( np.sqrt((1-ecc)/(1+ecc)) * np.tan(ups_sc/2) ) M_sc = E_sc - ecc*np.sin(E_sc) return period*(M_sc/2./np.pi)
python
def _delta_t_supconj_perpass(period, ecc, per0): """ time shift between superior conjuction and periastron passage """ ups_sc = np.pi/2-per0 E_sc = 2*np.arctan( np.sqrt((1-ecc)/(1+ecc)) * np.tan(ups_sc/2) ) M_sc = E_sc - ecc*np.sin(E_sc) return period*(M_sc/2./np.pi)
[ "def", "_delta_t_supconj_perpass", "(", "period", ",", "ecc", ",", "per0", ")", ":", "ups_sc", "=", "np", ".", "pi", "/", "2", "-", "per0", "E_sc", "=", "2", "*", "np", ".", "arctan", "(", "np", ".", "sqrt", "(", "(", "1", "-", "ecc", ")", "/",...
time shift between superior conjuction and periastron passage
[ "time", "shift", "between", "superior", "conjuction", "and", "periastron", "passage" ]
train
https://github.com/phoebe-project/phoebe2/blob/e64b8be683977064e2d55dd1b3ac400f64c3e379/phoebe/constraints/builtin.py#L106-L113
phoebe-project/phoebe2
phoebe/constraints/builtin.py
requiv_to_pot_contact
def requiv_to_pot_contact(requiv, q, sma, compno=1): """ :param requiv: user-provided equivalent radius :param q: mass ratio :param sma: semi-major axis (d = sma because we explicitly assume circular orbits for contacts) :param compno: 1 for primary, 2 for secondary :return: potential and fillou...
python
def requiv_to_pot_contact(requiv, q, sma, compno=1): """ :param requiv: user-provided equivalent radius :param q: mass ratio :param sma: semi-major axis (d = sma because we explicitly assume circular orbits for contacts) :param compno: 1 for primary, 2 for secondary :return: potential and fillou...
[ "def", "requiv_to_pot_contact", "(", "requiv", ",", "q", ",", "sma", ",", "compno", "=", "1", ")", ":", "logger", ".", "debug", "(", "\"requiv_to_pot_contact(requiv={}, q={}, sma={}, compno={})\"", ".", "format", "(", "requiv", ",", "q", ",", "sma", ",", "comp...
:param requiv: user-provided equivalent radius :param q: mass ratio :param sma: semi-major axis (d = sma because we explicitly assume circular orbits for contacts) :param compno: 1 for primary, 2 for secondary :return: potential and fillout factor
[ ":", "param", "requiv", ":", "user", "-", "provided", "equivalent", "radius", ":", "param", "q", ":", "mass", "ratio", ":", "param", "sma", ":", "semi", "-", "major", "axis", "(", "d", "=", "sma", "because", "we", "explicitly", "assume", "circular", "o...
train
https://github.com/phoebe-project/phoebe2/blob/e64b8be683977064e2d55dd1b3ac400f64c3e379/phoebe/constraints/builtin.py#L145-L163
phoebe-project/phoebe2
phoebe/dependencies/nparray/__init__.py
from_dict
def from_dict(d): """ load an nparray object from a dictionary @parameter str d: dictionary representing the nparray object """ if isinstance(d, str): return from_json(d) if not isinstance(d, dict): raise TypeError("argument must be of type dict") if 'nparray' not in d.keys...
python
def from_dict(d): """ load an nparray object from a dictionary @parameter str d: dictionary representing the nparray object """ if isinstance(d, str): return from_json(d) if not isinstance(d, dict): raise TypeError("argument must be of type dict") if 'nparray' not in d.keys...
[ "def", "from_dict", "(", "d", ")", ":", "if", "isinstance", "(", "d", ",", "str", ")", ":", "return", "from_json", "(", "d", ")", "if", "not", "isinstance", "(", "d", ",", "dict", ")", ":", "raise", "TypeError", "(", "\"argument must be of type dict\"", ...
load an nparray object from a dictionary @parameter str d: dictionary representing the nparray object
[ "load", "an", "nparray", "object", "from", "a", "dictionary" ]
train
https://github.com/phoebe-project/phoebe2/blob/e64b8be683977064e2d55dd1b3ac400f64c3e379/phoebe/dependencies/nparray/__init__.py#L106-L121
phoebe-project/phoebe2
phoebe/dependencies/nparray/__init__.py
from_json
def from_json(j): """ load an nparray object from a json-formatted string @parameter str j: json-formatted string """ if isinstance(j, dict): return from_dict(j) if not (isinstance(j, str) or isinstance(j, unicode)): raise TypeError("argument must be of type str") return f...
python
def from_json(j): """ load an nparray object from a json-formatted string @parameter str j: json-formatted string """ if isinstance(j, dict): return from_dict(j) if not (isinstance(j, str) or isinstance(j, unicode)): raise TypeError("argument must be of type str") return f...
[ "def", "from_json", "(", "j", ")", ":", "if", "isinstance", "(", "j", ",", "dict", ")", ":", "return", "from_dict", "(", "j", ")", "if", "not", "(", "isinstance", "(", "j", ",", "str", ")", "or", "isinstance", "(", "j", ",", "unicode", ")", ")", ...
load an nparray object from a json-formatted string @parameter str j: json-formatted string
[ "load", "an", "nparray", "object", "from", "a", "json", "-", "formatted", "string" ]
train
https://github.com/phoebe-project/phoebe2/blob/e64b8be683977064e2d55dd1b3ac400f64c3e379/phoebe/dependencies/nparray/__init__.py#L123-L135
phoebe-project/phoebe2
phoebe/dependencies/nparray/__init__.py
from_file
def from_file(filename): """ load an nparray object from a json filename @parameter str filename: path to the file """ f = open(filename, 'r') j = json.load(f) f.close() return from_dict(j)
python
def from_file(filename): """ load an nparray object from a json filename @parameter str filename: path to the file """ f = open(filename, 'r') j = json.load(f) f.close() return from_dict(j)
[ "def", "from_file", "(", "filename", ")", ":", "f", "=", "open", "(", "filename", ",", "'r'", ")", "j", "=", "json", ".", "load", "(", "f", ")", "f", ".", "close", "(", ")", "return", "from_dict", "(", "j", ")" ]
load an nparray object from a json filename @parameter str filename: path to the file
[ "load", "an", "nparray", "object", "from", "a", "json", "filename" ]
train
https://github.com/phoebe-project/phoebe2/blob/e64b8be683977064e2d55dd1b3ac400f64c3e379/phoebe/dependencies/nparray/__init__.py#L137-L147
phoebe-project/phoebe2
phoebe/dependencies/nparray/__init__.py
monkeypatch
def monkeypatch(): """ monkeypath built-in numpy functions to call those provided by nparray instead. """ np.array = array np.arange = arange np.linspace = linspace np.logspace = logspace np.geomspace = geomspace np.full = full np.full_like = full_like np.zeros = zeros np...
python
def monkeypatch(): """ monkeypath built-in numpy functions to call those provided by nparray instead. """ np.array = array np.arange = arange np.linspace = linspace np.logspace = logspace np.geomspace = geomspace np.full = full np.full_like = full_like np.zeros = zeros np...
[ "def", "monkeypatch", "(", ")", ":", "np", ".", "array", "=", "array", "np", ".", "arange", "=", "arange", "np", ".", "linspace", "=", "linspace", "np", ".", "logspace", "=", "logspace", "np", ".", "geomspace", "=", "geomspace", "np", ".", "full", "=...
monkeypath built-in numpy functions to call those provided by nparray instead.
[ "monkeypath", "built", "-", "in", "numpy", "functions", "to", "call", "those", "provided", "by", "nparray", "instead", "." ]
train
https://github.com/phoebe-project/phoebe2/blob/e64b8be683977064e2d55dd1b3ac400f64c3e379/phoebe/dependencies/nparray/__init__.py#L149-L164
phoebe-project/phoebe2
phoebe/atmospheres/passbands.py
init_passbands
def init_passbands(refresh=False): """ This function should be called only once, at import time. It traverses the passbands directory and builds a lookup table of passband names qualified as 'pbset:pbname' and corresponding files and atmosphere content within. """ global _initialized if...
python
def init_passbands(refresh=False): """ This function should be called only once, at import time. It traverses the passbands directory and builds a lookup table of passband names qualified as 'pbset:pbname' and corresponding files and atmosphere content within. """ global _initialized if...
[ "def", "init_passbands", "(", "refresh", "=", "False", ")", ":", "global", "_initialized", "if", "not", "_initialized", "or", "refresh", ":", "# load information from online passbands first so that any that are", "# available locally will override", "online_passbands", "=", "...
This function should be called only once, at import time. It traverses the passbands directory and builds a lookup table of passband names qualified as 'pbset:pbname' and corresponding files and atmosphere content within.
[ "This", "function", "should", "be", "called", "only", "once", "at", "import", "time", ".", "It", "traverses", "the", "passbands", "directory", "and", "builds", "a", "lookup", "table", "of", "passband", "names", "qualified", "as", "pbset", ":", "pbname", "and...
train
https://github.com/phoebe-project/phoebe2/blob/e64b8be683977064e2d55dd1b3ac400f64c3e379/phoebe/atmospheres/passbands.py#L1125-L1159
phoebe-project/phoebe2
phoebe/atmospheres/passbands.py
install_passband
def install_passband(fname, local=True): """ Install a passband from a local file. This simply copies the file into the install path - but beware that clearing the installation will clear the passband as well If local=False, you must have permissions to access the installation directory """ ...
python
def install_passband(fname, local=True): """ Install a passband from a local file. This simply copies the file into the install path - but beware that clearing the installation will clear the passband as well If local=False, you must have permissions to access the installation directory """ ...
[ "def", "install_passband", "(", "fname", ",", "local", "=", "True", ")", ":", "pbdir", "=", "_pbdir_local", "if", "local", "else", "_pbdir_global", "shutil", ".", "copy", "(", "fname", ",", "pbdir", ")", "init_passband", "(", "os", ".", "path", ".", "joi...
Install a passband from a local file. This simply copies the file into the install path - but beware that clearing the installation will clear the passband as well If local=False, you must have permissions to access the installation directory
[ "Install", "a", "passband", "from", "a", "local", "file", ".", "This", "simply", "copies", "the", "file", "into", "the", "install", "path", "-", "but", "beware", "that", "clearing", "the", "installation", "will", "clear", "the", "passband", "as", "well" ]
train
https://github.com/phoebe-project/phoebe2/blob/e64b8be683977064e2d55dd1b3ac400f64c3e379/phoebe/atmospheres/passbands.py#L1161-L1171
phoebe-project/phoebe2
phoebe/atmospheres/passbands.py
uninstall_all_passbands
def uninstall_all_passbands(local=True): """ Uninstall all passbands, either globally or locally (need to call twice to delete ALL passbands) If local=False, you must have permission to access the installation directory """ pbdir = _pbdir_local if local else _pbdir_global for f in os.listdi...
python
def uninstall_all_passbands(local=True): """ Uninstall all passbands, either globally or locally (need to call twice to delete ALL passbands) If local=False, you must have permission to access the installation directory """ pbdir = _pbdir_local if local else _pbdir_global for f in os.listdi...
[ "def", "uninstall_all_passbands", "(", "local", "=", "True", ")", ":", "pbdir", "=", "_pbdir_local", "if", "local", "else", "_pbdir_global", "for", "f", "in", "os", ".", "listdir", "(", "pbdir", ")", ":", "pbpath", "=", "os", ".", "path", ".", "join", ...
Uninstall all passbands, either globally or locally (need to call twice to delete ALL passbands) If local=False, you must have permission to access the installation directory
[ "Uninstall", "all", "passbands", "either", "globally", "or", "locally", "(", "need", "to", "call", "twice", "to", "delete", "ALL", "passbands", ")" ]
train
https://github.com/phoebe-project/phoebe2/blob/e64b8be683977064e2d55dd1b3ac400f64c3e379/phoebe/atmospheres/passbands.py#L1173-L1184
phoebe-project/phoebe2
phoebe/atmospheres/passbands.py
download_passband
def download_passband(passband, local=True): """ Download and install a given passband from the repository. If local=False, you must have permission to access the installation directory """ if passband not in list_online_passbands(): raise ValueError("passband '{}' not available".format(pas...
python
def download_passband(passband, local=True): """ Download and install a given passband from the repository. If local=False, you must have permission to access the installation directory """ if passband not in list_online_passbands(): raise ValueError("passband '{}' not available".format(pas...
[ "def", "download_passband", "(", "passband", ",", "local", "=", "True", ")", ":", "if", "passband", "not", "in", "list_online_passbands", "(", ")", ":", "raise", "ValueError", "(", "\"passband '{}' not available\"", ".", "format", "(", "passband", ")", ")", "p...
Download and install a given passband from the repository. If local=False, you must have permission to access the installation directory
[ "Download", "and", "install", "a", "given", "passband", "from", "the", "repository", "." ]
train
https://github.com/phoebe-project/phoebe2/blob/e64b8be683977064e2d55dd1b3ac400f64c3e379/phoebe/atmospheres/passbands.py#L1186-L1206
phoebe-project/phoebe2
phoebe/atmospheres/passbands.py
Inorm_bol_bb
def Inorm_bol_bb(Teff=5772., logg=4.43, abun=0.0, atm='blackbody', photon_weighted=False): """ @Teff: value or array of effective temperatures @logg: surface gravity; not used, for class compatibility only @abun: abundances; not used, for class compatibility only @atm: atmosphere model, must be blac...
python
def Inorm_bol_bb(Teff=5772., logg=4.43, abun=0.0, atm='blackbody', photon_weighted=False): """ @Teff: value or array of effective temperatures @logg: surface gravity; not used, for class compatibility only @abun: abundances; not used, for class compatibility only @atm: atmosphere model, must be blac...
[ "def", "Inorm_bol_bb", "(", "Teff", "=", "5772.", ",", "logg", "=", "4.43", ",", "abun", "=", "0.0", ",", "atm", "=", "'blackbody'", ",", "photon_weighted", "=", "False", ")", ":", "if", "atm", "!=", "'blackbody'", ":", "raise", "ValueError", "(", "'at...
@Teff: value or array of effective temperatures @logg: surface gravity; not used, for class compatibility only @abun: abundances; not used, for class compatibility only @atm: atmosphere model, must be blackbody, otherwise exception is raised @photon_weighted: intensity weighting scheme; must be False, o...
[ "@Teff", ":", "value", "or", "array", "of", "effective", "temperatures", "@logg", ":", "surface", "gravity", ";", "not", "used", "for", "class", "compatibility", "only", "@abun", ":", "abundances", ";", "not", "used", "for", "class", "compatibility", "only", ...
train
https://github.com/phoebe-project/phoebe2/blob/e64b8be683977064e2d55dd1b3ac400f64c3e379/phoebe/atmospheres/passbands.py#L1265-L1294
phoebe-project/phoebe2
phoebe/atmospheres/passbands.py
Passband._planck
def _planck(self, lam, Teff): """ Computes monochromatic blackbody intensity in W/m^3 using the Planck function. @lam: wavelength in m @Teff: effective temperature in K Returns: monochromatic blackbody intensity """ return 2*self.h*self.c*self.c/lam**5 ...
python
def _planck(self, lam, Teff): """ Computes monochromatic blackbody intensity in W/m^3 using the Planck function. @lam: wavelength in m @Teff: effective temperature in K Returns: monochromatic blackbody intensity """ return 2*self.h*self.c*self.c/lam**5 ...
[ "def", "_planck", "(", "self", ",", "lam", ",", "Teff", ")", ":", "return", "2", "*", "self", ".", "h", "*", "self", ".", "c", "*", "self", ".", "c", "/", "lam", "**", "5", "*", "1.", "/", "(", "np", ".", "exp", "(", "self", ".", "h", "*"...
Computes monochromatic blackbody intensity in W/m^3 using the Planck function. @lam: wavelength in m @Teff: effective temperature in K Returns: monochromatic blackbody intensity
[ "Computes", "monochromatic", "blackbody", "intensity", "in", "W", "/", "m^3", "using", "the", "Planck", "function", "." ]
train
https://github.com/phoebe-project/phoebe2/blob/e64b8be683977064e2d55dd1b3ac400f64c3e379/phoebe/atmospheres/passbands.py#L313-L324
phoebe-project/phoebe2
phoebe/atmospheres/passbands.py
Passband._planck_deriv
def _planck_deriv(self, lam, Teff): """ Computes the derivative of the monochromatic blackbody intensity using the Planck function. @lam: wavelength in m @Teff: effective temperature in K Returns: the derivative of monochromatic blackbody intensity """ ...
python
def _planck_deriv(self, lam, Teff): """ Computes the derivative of the monochromatic blackbody intensity using the Planck function. @lam: wavelength in m @Teff: effective temperature in K Returns: the derivative of monochromatic blackbody intensity """ ...
[ "def", "_planck_deriv", "(", "self", ",", "lam", ",", "Teff", ")", ":", "expterm", "=", "np", ".", "exp", "(", "self", ".", "h", "*", "self", ".", "c", "/", "lam", "/", "self", ".", "k", "/", "Teff", ")", "return", "2", "*", "self", ".", "h",...
Computes the derivative of the monochromatic blackbody intensity using the Planck function. @lam: wavelength in m @Teff: effective temperature in K Returns: the derivative of monochromatic blackbody intensity
[ "Computes", "the", "derivative", "of", "the", "monochromatic", "blackbody", "intensity", "using", "the", "Planck", "function", "." ]
train
https://github.com/phoebe-project/phoebe2/blob/e64b8be683977064e2d55dd1b3ac400f64c3e379/phoebe/atmospheres/passbands.py#L326-L338
phoebe-project/phoebe2
phoebe/atmospheres/passbands.py
Passband._planck_spi
def _planck_spi(self, lam, Teff): """ Computes the spectral index of the monochromatic blackbody intensity using the Planck function. The spectral index is defined as: B(lambda) = 5 + d(log I)/d(log lambda), where I is the Planck function. @lam: wavelength in m ...
python
def _planck_spi(self, lam, Teff): """ Computes the spectral index of the monochromatic blackbody intensity using the Planck function. The spectral index is defined as: B(lambda) = 5 + d(log I)/d(log lambda), where I is the Planck function. @lam: wavelength in m ...
[ "def", "_planck_spi", "(", "self", ",", "lam", ",", "Teff", ")", ":", "hclkt", "=", "self", ".", "h", "*", "self", ".", "c", "/", "lam", "/", "self", ".", "k", "/", "Teff", "expterm", "=", "np", ".", "exp", "(", "hclkt", ")", "return", "hclkt",...
Computes the spectral index of the monochromatic blackbody intensity using the Planck function. The spectral index is defined as: B(lambda) = 5 + d(log I)/d(log lambda), where I is the Planck function. @lam: wavelength in m @Teff: effective temperature in K Return...
[ "Computes", "the", "spectral", "index", "of", "the", "monochromatic", "blackbody", "intensity", "using", "the", "Planck", "function", ".", "The", "spectral", "index", "is", "defined", "as", ":" ]
train
https://github.com/phoebe-project/phoebe2/blob/e64b8be683977064e2d55dd1b3ac400f64c3e379/phoebe/atmospheres/passbands.py#L340-L357
phoebe-project/phoebe2
phoebe/atmospheres/passbands.py
Passband._bb_intensity
def _bb_intensity(self, Teff, photon_weighted=False): """ Computes mean passband intensity using blackbody atmosphere: I_pb^E = \int_\lambda I(\lambda) P(\lambda) d\lambda / \int_\lambda P(\lambda) d\lambda I_pb^P = \int_\lambda \lambda I(\lambda) P(\lambda) d\lambda / \int_\lambda \lam...
python
def _bb_intensity(self, Teff, photon_weighted=False): """ Computes mean passband intensity using blackbody atmosphere: I_pb^E = \int_\lambda I(\lambda) P(\lambda) d\lambda / \int_\lambda P(\lambda) d\lambda I_pb^P = \int_\lambda \lambda I(\lambda) P(\lambda) d\lambda / \int_\lambda \lam...
[ "def", "_bb_intensity", "(", "self", ",", "Teff", ",", "photon_weighted", "=", "False", ")", ":", "if", "photon_weighted", ":", "pb", "=", "lambda", "w", ":", "w", "*", "self", ".", "_planck", "(", "w", ",", "Teff", ")", "*", "self", ".", "ptf", "(...
Computes mean passband intensity using blackbody atmosphere: I_pb^E = \int_\lambda I(\lambda) P(\lambda) d\lambda / \int_\lambda P(\lambda) d\lambda I_pb^P = \int_\lambda \lambda I(\lambda) P(\lambda) d\lambda / \int_\lambda \lambda P(\lambda) d\lambda Superscripts E and P stand for energy and...
[ "Computes", "mean", "passband", "intensity", "using", "blackbody", "atmosphere", ":" ]
train
https://github.com/phoebe-project/phoebe2/blob/e64b8be683977064e2d55dd1b3ac400f64c3e379/phoebe/atmospheres/passbands.py#L359-L379
phoebe-project/phoebe2
phoebe/atmospheres/passbands.py
Passband._bindex_blackbody
def _bindex_blackbody(self, Teff, photon_weighted=False): """ Computes the mean boosting index using blackbody atmosphere: B_pb^E = \int_\lambda I(\lambda) P(\lambda) B(\lambda) d\lambda / \int_\lambda I(\lambda) P(\lambda) d\lambda B_pb^P = \int_\lambda \lambda I(\lambda) P(\lambda) B(...
python
def _bindex_blackbody(self, Teff, photon_weighted=False): """ Computes the mean boosting index using blackbody atmosphere: B_pb^E = \int_\lambda I(\lambda) P(\lambda) B(\lambda) d\lambda / \int_\lambda I(\lambda) P(\lambda) d\lambda B_pb^P = \int_\lambda \lambda I(\lambda) P(\lambda) B(...
[ "def", "_bindex_blackbody", "(", "self", ",", "Teff", ",", "photon_weighted", "=", "False", ")", ":", "if", "photon_weighted", ":", "num", "=", "lambda", "w", ":", "w", "*", "self", ".", "_planck", "(", "w", ",", "Teff", ")", "*", "self", ".", "ptf",...
Computes the mean boosting index using blackbody atmosphere: B_pb^E = \int_\lambda I(\lambda) P(\lambda) B(\lambda) d\lambda / \int_\lambda I(\lambda) P(\lambda) d\lambda B_pb^P = \int_\lambda \lambda I(\lambda) P(\lambda) B(\lambda) d\lambda / \int_\lambda \lambda I(\lambda) P(\lambda) d\lambda ...
[ "Computes", "the", "mean", "boosting", "index", "using", "blackbody", "atmosphere", ":" ]
train
https://github.com/phoebe-project/phoebe2/blob/e64b8be683977064e2d55dd1b3ac400f64c3e379/phoebe/atmospheres/passbands.py#L381-L403
phoebe-project/phoebe2
phoebe/atmospheres/passbands.py
Passband.compute_blackbody_response
def compute_blackbody_response(self, Teffs=None): """ Computes blackbody intensities across the entire range of effective temperatures. It does this for two regimes, energy-weighted and photon-weighted. It then fits a cubic spline to the log(I)-Teff values and exports the interpo...
python
def compute_blackbody_response(self, Teffs=None): """ Computes blackbody intensities across the entire range of effective temperatures. It does this for two regimes, energy-weighted and photon-weighted. It then fits a cubic spline to the log(I)-Teff values and exports the interpo...
[ "def", "compute_blackbody_response", "(", "self", ",", "Teffs", "=", "None", ")", ":", "if", "Teffs", "is", "None", ":", "log10Teffs", "=", "np", ".", "linspace", "(", "2.5", ",", "5.7", ",", "97", ")", "# this corresponds to the 316K-501187K range.", "Teffs",...
Computes blackbody intensities across the entire range of effective temperatures. It does this for two regimes, energy-weighted and photon-weighted. It then fits a cubic spline to the log(I)-Teff values and exports the interpolation functions _log10_Inorm_bb_energy and _log10_Inorm_bb_ph...
[ "Computes", "blackbody", "intensities", "across", "the", "entire", "range", "of", "effective", "temperatures", ".", "It", "does", "this", "for", "two", "regimes", "energy", "-", "weighted", "and", "photon", "-", "weighted", ".", "It", "then", "fits", "a", "c...
train
https://github.com/phoebe-project/phoebe2/blob/e64b8be683977064e2d55dd1b3ac400f64c3e379/phoebe/atmospheres/passbands.py#L405-L435
phoebe-project/phoebe2
phoebe/atmospheres/passbands.py
Passband.compute_ck2004_response
def compute_ck2004_response(self, path, verbose=False): """ Computes Castelli & Kurucz (2004) intensities across the entire range of model atmospheres. @path: path to the directory containing ck2004 SEDs @verbose: switch to determine whether computing progress should be ...
python
def compute_ck2004_response(self, path, verbose=False): """ Computes Castelli & Kurucz (2004) intensities across the entire range of model atmospheres. @path: path to the directory containing ck2004 SEDs @verbose: switch to determine whether computing progress should be ...
[ "def", "compute_ck2004_response", "(", "self", ",", "path", ",", "verbose", "=", "False", ")", ":", "models", "=", "glob", ".", "glob", "(", "path", "+", "'/*M1.000*'", ")", "Nmodels", "=", "len", "(", "models", ")", "# Store the length of the filename extensi...
Computes Castelli & Kurucz (2004) intensities across the entire range of model atmospheres. @path: path to the directory containing ck2004 SEDs @verbose: switch to determine whether computing progress should be printed on screen Returns: n/a
[ "Computes", "Castelli", "&", "Kurucz", "(", "2004", ")", "intensities", "across", "the", "entire", "range", "of", "model", "atmospheres", "." ]
train
https://github.com/phoebe-project/phoebe2/blob/e64b8be683977064e2d55dd1b3ac400f64c3e379/phoebe/atmospheres/passbands.py#L437-L496
phoebe-project/phoebe2
phoebe/atmospheres/passbands.py
Passband.compute_ck2004_intensities
def compute_ck2004_intensities(self, path, particular=None, verbose=False): """ Computes direction-dependent passband intensities using Castelli & Kurucz (2004) model atmospheres. @path: path to the directory with SEDs @particular: particular file in @path to be processed; if No...
python
def compute_ck2004_intensities(self, path, particular=None, verbose=False): """ Computes direction-dependent passband intensities using Castelli & Kurucz (2004) model atmospheres. @path: path to the directory with SEDs @particular: particular file in @path to be processed; if No...
[ "def", "compute_ck2004_intensities", "(", "self", ",", "path", ",", "particular", "=", "None", ",", "verbose", "=", "False", ")", ":", "models", "=", "os", ".", "listdir", "(", "path", ")", "if", "particular", "!=", "None", ":", "models", "=", "[", "pa...
Computes direction-dependent passband intensities using Castelli & Kurucz (2004) model atmospheres. @path: path to the directory with SEDs @particular: particular file in @path to be processed; if None, all files in the directory are processed. @verbose: set to True...
[ "Computes", "direction", "-", "dependent", "passband", "intensities", "using", "Castelli", "&", "Kurucz", "(", "2004", ")", "model", "atmospheres", "." ]
train
https://github.com/phoebe-project/phoebe2/blob/e64b8be683977064e2d55dd1b3ac400f64c3e379/phoebe/atmospheres/passbands.py#L498-L627
phoebe-project/phoebe2
phoebe/atmospheres/passbands.py
Passband.export_legacy_ldcoeffs
def export_legacy_ldcoeffs(self, models, filename=None, photon_weighted=True): """ @models: the path (including the filename) of legacy's models.list @filename: output filename for storing the table Exports CK2004 limb darkening coefficients to a PHOEBE legacy compatible format....
python
def export_legacy_ldcoeffs(self, models, filename=None, photon_weighted=True): """ @models: the path (including the filename) of legacy's models.list @filename: output filename for storing the table Exports CK2004 limb darkening coefficients to a PHOEBE legacy compatible format....
[ "def", "export_legacy_ldcoeffs", "(", "self", ",", "models", ",", "filename", "=", "None", ",", "photon_weighted", "=", "True", ")", ":", "if", "photon_weighted", ":", "grid", "=", "self", ".", "_ck2004_ld_photon_grid", "else", ":", "grid", "=", "self", ".",...
@models: the path (including the filename) of legacy's models.list @filename: output filename for storing the table Exports CK2004 limb darkening coefficients to a PHOEBE legacy compatible format.
[ "@models", ":", "the", "path", "(", "including", "the", "filename", ")", "of", "legacy", "s", "models", ".", "list", "@filename", ":", "output", "filename", "for", "storing", "the", "table" ]
train
https://github.com/phoebe-project/phoebe2/blob/e64b8be683977064e2d55dd1b3ac400f64c3e379/phoebe/atmospheres/passbands.py#L711-L745
phoebe-project/phoebe2
phoebe/atmospheres/passbands.py
Passband.compute_ck2004_ldints
def compute_ck2004_ldints(self): """ Computes integrated limb darkening profiles for ck2004 atmospheres. These are used for intensity-to-flux transformations. The evaluated integral is: ldint = 2 \pi \int_0^1 Imu mu dmu """ if 'ck2004_all' not in self.content: ...
python
def compute_ck2004_ldints(self): """ Computes integrated limb darkening profiles for ck2004 atmospheres. These are used for intensity-to-flux transformations. The evaluated integral is: ldint = 2 \pi \int_0^1 Imu mu dmu """ if 'ck2004_all' not in self.content: ...
[ "def", "compute_ck2004_ldints", "(", "self", ")", ":", "if", "'ck2004_all'", "not", "in", "self", ".", "content", ":", "print", "(", "'Castelli & Kurucz (2004) intensities are not computed yet. Please compute those first.'", ")", "return", "None", "ldaxes", "=", "self", ...
Computes integrated limb darkening profiles for ck2004 atmospheres. These are used for intensity-to-flux transformations. The evaluated integral is: ldint = 2 \pi \int_0^1 Imu mu dmu
[ "Computes", "integrated", "limb", "darkening", "profiles", "for", "ck2004", "atmospheres", ".", "These", "are", "used", "for", "intensity", "-", "to", "-", "flux", "transformations", ".", "The", "evaluated", "integral", "is", ":" ]
train
https://github.com/phoebe-project/phoebe2/blob/e64b8be683977064e2d55dd1b3ac400f64c3e379/phoebe/atmospheres/passbands.py#L747-L791
phoebe-project/phoebe2
phoebe/atmospheres/passbands.py
Passband.interpolate_ck2004_ldcoeffs
def interpolate_ck2004_ldcoeffs(self, Teff=5772., logg=4.43, abun=0.0, atm='ck2004', ld_func='power', photon_weighted=False): """ Interpolate the passband-stored table of LD model coefficients. """ if 'ck2004_ld' not in self.content: print('Castelli & Kurucz (2004) limb dark...
python
def interpolate_ck2004_ldcoeffs(self, Teff=5772., logg=4.43, abun=0.0, atm='ck2004', ld_func='power', photon_weighted=False): """ Interpolate the passband-stored table of LD model coefficients. """ if 'ck2004_ld' not in self.content: print('Castelli & Kurucz (2004) limb dark...
[ "def", "interpolate_ck2004_ldcoeffs", "(", "self", ",", "Teff", "=", "5772.", ",", "logg", "=", "4.43", ",", "abun", "=", "0.0", ",", "atm", "=", "'ck2004'", ",", "ld_func", "=", "'power'", ",", "photon_weighted", "=", "False", ")", ":", "if", "'ck2004_l...
Interpolate the passband-stored table of LD model coefficients.
[ "Interpolate", "the", "passband", "-", "stored", "table", "of", "LD", "model", "coefficients", "." ]
train
https://github.com/phoebe-project/phoebe2/blob/e64b8be683977064e2d55dd1b3ac400f64c3e379/phoebe/atmospheres/passbands.py#L793-L828
phoebe-project/phoebe2
phoebe/atmospheres/passbands.py
Passband.import_wd_atmcof
def import_wd_atmcof(self, plfile, atmfile, wdidx, Nabun=19, Nlogg=11, Npb=25, Nints=4): """ Parses WD's atmcof and reads in all Legendre polynomials for the given passband. @plfile: path and filename of atmcofplanck.dat @atmfile: path and filename of atmcof.dat @wdidx: ...
python
def import_wd_atmcof(self, plfile, atmfile, wdidx, Nabun=19, Nlogg=11, Npb=25, Nints=4): """ Parses WD's atmcof and reads in all Legendre polynomials for the given passband. @plfile: path and filename of atmcofplanck.dat @atmfile: path and filename of atmcof.dat @wdidx: ...
[ "def", "import_wd_atmcof", "(", "self", ",", "plfile", ",", "atmfile", ",", "wdidx", ",", "Nabun", "=", "19", ",", "Nlogg", "=", "11", ",", "Npb", "=", "25", ",", "Nints", "=", "4", ")", ":", "# Initialize the external atmcof module if necessary:", "# PERHAP...
Parses WD's atmcof and reads in all Legendre polynomials for the given passband. @plfile: path and filename of atmcofplanck.dat @atmfile: path and filename of atmcof.dat @wdidx: WD index of the passed passband. This can be automated but it's not a high priority. ...
[ "Parses", "WD", "s", "atmcof", "and", "reads", "in", "all", "Legendre", "polynomials", "for", "the", "given", "passband", "." ]
train
https://github.com/phoebe-project/phoebe2/blob/e64b8be683977064e2d55dd1b3ac400f64c3e379/phoebe/atmospheres/passbands.py#L830-L869
phoebe-project/phoebe2
phoebe/atmospheres/passbands.py
Passband._log10_Inorm_extern_planckint
def _log10_Inorm_extern_planckint(self, Teff): """ Internal function to compute normal passband intensities using the external WD machinery that employs blackbody approximation. @Teff: effective temperature in K Returns: log10(Inorm) """ log10_Inorm = libphoebe...
python
def _log10_Inorm_extern_planckint(self, Teff): """ Internal function to compute normal passband intensities using the external WD machinery that employs blackbody approximation. @Teff: effective temperature in K Returns: log10(Inorm) """ log10_Inorm = libphoebe...
[ "def", "_log10_Inorm_extern_planckint", "(", "self", ",", "Teff", ")", ":", "log10_Inorm", "=", "libphoebe", ".", "wd_planckint", "(", "Teff", ",", "self", ".", "extern_wd_idx", ",", "self", ".", "wd_data", "[", "\"planck_table\"", "]", ")", "return", "log10_I...
Internal function to compute normal passband intensities using the external WD machinery that employs blackbody approximation. @Teff: effective temperature in K Returns: log10(Inorm)
[ "Internal", "function", "to", "compute", "normal", "passband", "intensities", "using", "the", "external", "WD", "machinery", "that", "employs", "blackbody", "approximation", "." ]
train
https://github.com/phoebe-project/phoebe2/blob/e64b8be683977064e2d55dd1b3ac400f64c3e379/phoebe/atmospheres/passbands.py#L871-L883
phoebe-project/phoebe2
phoebe/atmospheres/passbands.py
Passband._log10_Inorm_extern_atmx
def _log10_Inorm_extern_atmx(self, Teff, logg, abun): """ Internal function to compute normal passband intensities using the external WD machinery that employs model atmospheres and ramps. @Teff: effective temperature in K @logg: surface gravity in cgs @abun: met...
python
def _log10_Inorm_extern_atmx(self, Teff, logg, abun): """ Internal function to compute normal passband intensities using the external WD machinery that employs model atmospheres and ramps. @Teff: effective temperature in K @logg: surface gravity in cgs @abun: met...
[ "def", "_log10_Inorm_extern_atmx", "(", "self", ",", "Teff", ",", "logg", ",", "abun", ")", ":", "log10_Inorm", "=", "libphoebe", ".", "wd_atmint", "(", "Teff", ",", "logg", ",", "abun", ",", "self", ".", "extern_wd_idx", ",", "self", ".", "wd_data", "["...
Internal function to compute normal passband intensities using the external WD machinery that employs model atmospheres and ramps. @Teff: effective temperature in K @logg: surface gravity in cgs @abun: metallicity in dex, Solar=0.0 Returns: log10(Inorm)
[ "Internal", "function", "to", "compute", "normal", "passband", "intensities", "using", "the", "external", "WD", "machinery", "that", "employs", "model", "atmospheres", "and", "ramps", "." ]
train
https://github.com/phoebe-project/phoebe2/blob/e64b8be683977064e2d55dd1b3ac400f64c3e379/phoebe/atmospheres/passbands.py#L885-L900
driftx/Telephus
telephus/protocol.py
ManagedCassandraClientFactory.set_keyspace
def set_keyspace(self, keyspace): """ switch all connections to another keyspace """ self.keyspace = keyspace dfrds = [] for p in self._protos: dfrds.append(p.submitRequest(ManagedThriftRequest( 'set_keyspace', keyspace))) return defer.gatherResults(df...
python
def set_keyspace(self, keyspace): """ switch all connections to another keyspace """ self.keyspace = keyspace dfrds = [] for p in self._protos: dfrds.append(p.submitRequest(ManagedThriftRequest( 'set_keyspace', keyspace))) return defer.gatherResults(df...
[ "def", "set_keyspace", "(", "self", ",", "keyspace", ")", ":", "self", ".", "keyspace", "=", "keyspace", "dfrds", "=", "[", "]", "for", "p", "in", "self", ".", "_protos", ":", "dfrds", ".", "append", "(", "p", ".", "submitRequest", "(", "ManagedThriftR...
switch all connections to another keyspace
[ "switch", "all", "connections", "to", "another", "keyspace" ]
train
https://github.com/driftx/Telephus/blob/860a03a0fafe71605e1a4316dfdd8d0c29094703/telephus/protocol.py#L195-L202