Skip to content

Commit

Permalink
ebai wide eclipse bugfix (2.3.13 release) (#399)
Browse files Browse the repository at this point in the history
* fix bug that raised internal error when running ebai on an eclipse with width larger than 0.25 in phase. Note that these systems will still return nans as ebai is not well-suited to these systems, but the internal error will no longer occur.
  • Loading branch information
kecnry authored Jan 13, 2021
1 parent 1a39123 commit 76e3d8a
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 11 deletions.
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,10 @@ To understand how to use PHOEBE, please consult the [tutorials, scripts and manu
CHANGELOG
----------

### 2.3.13 - estimator.ebai with wide eclipse fix

* fix bug that raised internal error when running ebai on an eclipse with width larger than 0.25 in phase. Note that these systems will still return nans as ebai is not well-suited to these systems, but the internal error will no longer occur.

### 2.3.12 - plot univariate distributions latex label fix

* fix bug in the latex labels on plots when converting from multivariate to univariate distributions.
Expand Down
2 changes: 1 addition & 1 deletion phoebe/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"""

__version__ = '2.3.12'
__version__ = '2.3.13'

import os as _os
import sys as _sys
Expand Down
14 changes: 7 additions & 7 deletions phoebe/solverbackends/solverbackends.py
Original file line number Diff line number Diff line change
Expand Up @@ -1027,6 +1027,13 @@ def run_worker(self, b, solver, compute=None, **kwargs):

times, phases, fluxes, sigmas = _get_combined_lc(b, lc_datasets, lc_combine, phase_component=orbit, mask=True, normalize=True, phase_sorted=True, phase_bin=phase_bin)

teffratio_param = orbit_ps.get_parameter(qualifier='teffratio', **_skip_filter_checks)
requivsumfrac_param = orbit_ps.get_parameter(qualifier='requivsumfrac', **_skip_filter_checks)
esinw_param = orbit_ps.get_parameter(qualifier='esinw', **_skip_filter_checks)
ecosw_param = orbit_ps.get_parameter(qualifier='ecosw', **_skip_filter_checks)
incl_param = orbit_ps.get_parameter(qualifier='incl', **_skip_filter_checks)
t0_supconj_param = orbit_ps.get_parameter(qualifier='t0_supconj', **_skip_filter_checks)

# TODO: cleanup this logic a bit
lc_geom_dict = lc_geometry.estimate_eclipse_positions_widths(phases, fluxes)
if np.max(lc_geom_dict.get('ecl_widths', [])) > 0.25:
Expand All @@ -1049,18 +1056,11 @@ def run_worker(self, b, solver, compute=None, **kwargs):
ebai_fluxes /= ebai_fluxes.max()

# update to t0_supconj based on pshift
t0_supconj_param = orbit_ps.get_parameter(qualifier='t0_supconj', **_skip_filter_checks)
t0_supconj = t0_supconj_param.get_value(unit=u.d) + (pshift * orbit_ps.get_value(qualifier='period', unit=u.d, **_skip_filter_checks))

# run ebai on polyfit sampled fluxes
teffratio, requivsumfrac, esinw, ecosw, sini = ebai_forward(ebai_fluxes)

teffratio_param = orbit_ps.get_parameter(qualifier='teffratio', **_skip_filter_checks)
requivsumfrac_param = orbit_ps.get_parameter(qualifier='requivsumfrac', **_skip_filter_checks)
esinw_param = orbit_ps.get_parameter(qualifier='esinw', **_skip_filter_checks)
ecosw_param = orbit_ps.get_parameter(qualifier='ecosw', **_skip_filter_checks)
incl_param = orbit_ps.get_parameter(qualifier='incl', **_skip_filter_checks)

fitted_params = [t0_supconj_param, teffratio_param, requivsumfrac_param, esinw_param, ecosw_param, incl_param]
fitted_uniqueids = [p.uniqueid for p in fitted_params]
fitted_twigs = [p.twig for p in fitted_params]
Expand Down
6 changes: 3 additions & 3 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -346,8 +346,8 @@ def _env_variable_bool(key, default):
long_description = "\n".join(long_description_s[long_description_s.index("INTRODUCTION"):])

setup (name = 'phoebe',
version = '2.3.12',
description = 'PHOEBE 2.3.12',
version = '2.3.13',
description = 'PHOEBE 2.3.13',
long_description=long_description,
author = 'PHOEBE development team',
author_email = '[email protected]',
Expand All @@ -367,7 +367,7 @@ def _env_variable_bool(key, default):
'Programming Language :: Python :: 3 :: Only',
],
python_requires='>=3.6, <4',
download_url = 'https://github.com/phoebe-project/phoebe2/tarball/2.3.12',
download_url = 'https://github.com/phoebe-project/phoebe2/tarball/2.3.13',
packages = ['phoebe', 'phoebe.parameters', 'phoebe.parameters.solver', 'phoebe.parameters.figure', 'phoebe.frontend', 'phoebe.constraints', 'phoebe.dynamics', 'phoebe.distortions', 'phoebe.algorithms', 'phoebe.atmospheres', 'phoebe.backend', 'phoebe.solverbackends', 'phoebe.solverbackends.ebai', 'phoebe.utils', 'phoebe.helpers', 'phoebe.pool', 'phoebe.dependencies', 'phoebe.dependencies.autofig', 'phoebe.dependencies.nparray', 'phoebe.dependencies.distl', 'phoebe.dependencies.unitsiau2015'],
install_requires=['numpy>=1.12','scipy>=1.2','astropy>=1.0', 'corner', 'pytest', 'requests', 'python-socketio[client]']+['flask', 'flask-cors', 'flask-socketio', 'gevent-websocket'],
package_data={'phoebe.atmospheres':['tables/wd/*', 'tables/passbands/*'],
Expand Down

0 comments on commit 76e3d8a

Please sign in to comment.