Skip to content

Commit

Permalink
docs
Browse files Browse the repository at this point in the history
  • Loading branch information
abhisrkckl committed Oct 2, 2023
1 parent d20d761 commit 5743db1
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions src/pint/residuals.py
Original file line number Diff line number Diff line change
Expand Up @@ -560,8 +560,8 @@ def _calc_gls_chi2(self, lognorm=False):
logdet_Sigma = (

Check warning on line 560 in src/pint/residuals.py

View check run for this annotation

Codecov / codecov/patch

src/pint/residuals.py#L558-L560

Added lines #L558 - L560 were not covered by tests
np.sum(np.log(np.diag(c[0]))) if not svd else np.sum(np.abs(np.log(s)))
)
lognorm = logdet_N + logdet_Phiinv + logdet_Sigma
return chi2, lognorm
log_norm = logdet_N + logdet_Phiinv + logdet_Sigma
return chi2, log_norm

Check warning on line 564 in src/pint/residuals.py

View check run for this annotation

Codecov / codecov/patch

src/pint/residuals.py#L563-L564

Added lines #L563 - L564 were not covered by tests

def calc_chi2(self, lognorm=False):
"""Return the weighted chi-squared for the model and toas.
Expand Down Expand Up @@ -592,7 +592,9 @@ def calc_chi2(self, lognorm=False):
function along with the chi2 value.
Returns
-------
chi2 if lognorm is False
(chi2, log_norm) if lognorm is True
"""
if self.model.has_correlated_errors:
return self._calc_gls_chi2(lognorm=lognorm)
Expand Down Expand Up @@ -620,8 +622,8 @@ def calc_chi2(self, lognorm=False):
if not lognorm:
return chi2
else:
lognorm = np.sum(np.log(err.value))
return chi2, lognorm
log_norm = np.sum(np.log(err.value))
return chi2, log_norm

def ecorr_average(self, use_noise_model=True):
"""Uses the ECORR noise model time-binning to compute "epoch-averaged" residuals.
Expand Down

0 comments on commit 5743db1

Please sign in to comment.