Skip to content

Commit

Permalink
updated _calculate_cf function to adjust lnf calculation for radial v…
Browse files Browse the repository at this point in the history
…elocities.
  • Loading branch information
kmhambleton authored and kecnry committed Jun 21, 2024
1 parent 57624e9 commit d1e2ccd
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion phoebe/parameters/parameters.py
Original file line number Diff line number Diff line change
Expand Up @@ -3854,11 +3854,16 @@ def _calculate_cf(self, model=None, dataset=None, component=None,
sigmas = sigmas[inds]

sigmas_lnf = ds_ps.get_value(qualifier='sigmas_lnf', component=ds_comp, default=-np.inf, **_skip_filter_checks)
dataset_kind = ds_ps.kind

if len(sigmas):
sigmas2 = sigmas**2

if cf == 'lnf' and sigmas_lnf != -np.inf:
sigmas2 += model_interp.value**2 * np.exp(2 * sigmas_lnf)
if dataset_kind == 'rv':
sigmas2 += np.exp(2 * sigmas_lnf)
else:
sigmas2 += model_interp.value**2 * np.exp(2 * sigmas_lnf)

if cf == 'lnf':
ret += np.sum((residuals.value**2 / sigmas2) + np.log(2*np.pi*sigmas2))
Expand Down

0 comments on commit d1e2ccd

Please sign in to comment.