Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove an assert from modshift #58

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions exovetter/modshift/modshift.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
from scipy import integrate as spint

import exovetter.modshift.plotmodshift as plotmodshift
import warnings

__all__ = ['compute_modshift_metrics', 'fold_and_bin_data',
'compute_false_alarm_threshold', 'compute_event_significances',
Expand Down Expand Up @@ -400,8 +401,11 @@ def estimate_scatter(phi_days, flux, phi_pri_days, phi_sec_days,
# Measure rms of all other points
idx = ~(idx1 | idx2)
if not np.any(idx):
raise ValueError('RMS calculation failed')
rms = np.std(flux[idx])
warnings.warn('RMS calculation failed. No points remain. \
Including all flux values near primary and secondary.')
rms = np.std(flux)
else:
rms = np.std(flux[idx])
return rms


Expand Down