Skip to content

Commit

Permalink
Add option to skip chain and correlations in fit results
Browse files Browse the repository at this point in the history
  • Loading branch information
andreicuceu committed Nov 25, 2024
1 parent 2a452a3 commit 3c2650c
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions vega/postprocess/fit_results.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ class CorrelationOutput:


class FitResults:
def __init__(self, path):
def __init__(self, path, results_only=False):
hdul = fits.open(find_file(path))

self.chisq = hdul[2].header['FVAL']
Expand All @@ -33,12 +33,15 @@ def __init__(self, path):
self.cov = hdul[2].data['covariance']
self.params = {name: value for name, value in zip(self.names, self.mean)}
self.sigmas = {name: value for name, value in zip(self.names, hdul[2].data['errors'])}

self.num_pars = len(self.names)
self.read_correlations(hdul[1])

if not results_only:
self.read_correlations(hdul[1])

hdul.close()

self.chain = self.make_chain(self.names, self.mean, self.cov)
if not results_only:
self.chain = self.make_chain(self.names, self.mean, self.cov)

@staticmethod
def make_chain(names, mean, cov):
Expand Down

0 comments on commit 3c2650c

Please sign in to comment.