From e3bbc9655f61c1e6e4762d58bc039318793bd53b Mon Sep 17 00:00:00 2001 From: Ryan Challener Date: Tue, 12 Oct 2021 11:48:51 -0400 Subject: [PATCH] Allow user to change mc3 fgamma --- theresa/lib/fitclass.py | 10 ++++++++++ theresa/theresa.py | 3 ++- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/theresa/lib/fitclass.py b/theresa/lib/fitclass.py index 3b420bb..6aaf956 100644 --- a/theresa/lib/fitclass.py +++ b/theresa/lib/fitclass.py @@ -73,6 +73,11 @@ def read_config(self, cfile): self.cfg.twod.leastsq == 'False'): self.cfg.twod.leastsq = None + if self.cfg.cfg.has_option('2D', 'fgamma'): + self.cfg.twod.fgamma = self.cfg.cfg.getfloat('2D', 'fgamma') + else: + self.cfg.twod.fgamma = 1.0 + # 3D options self.cfg.threed.ncpu = self.cfg.cfg.getint('3D', 'ncpu') self.cfg.threed.nsamples = self.cfg.cfg.getint('3D', 'nsamples') @@ -125,6 +130,11 @@ def read_config(self, cfile): self.cfg.cfg.get('3D', 'pnames').split() self.cfg.threed.resume = self.cfg.cfg.getboolean('3D', 'resume') + + if self.cfg.cfg.has_option('3D', 'fgamma'): + self.cfg.threed.fgamma = self.cfg.cfg.getfloat('3D', 'fgamma') + else: + self.cfg.threed.fgamma = 1.0 # Star options self.cfg.star.m = self.cfg.cfg.getfloat('Star', 'm') diff --git a/theresa/theresa.py b/theresa/theresa.py index fe179e7..f3595de 100755 --- a/theresa/theresa.py +++ b/theresa/theresa.py @@ -174,7 +174,7 @@ def map2d(cfile): params=params, indparams=indparams, pstep=pstep, leastsq=cfg.twod.leastsq, plots=cfg.twod.plots, pmin=pmin, pmax=pmax, - thinning=10) + thinning=10, fgamma=cfg.twod.fgamma) # MC3 doesn't clear its plots >:( plt.close('all') @@ -397,6 +397,7 @@ def map3d(fit, system): pmax=pmax, pnames=pnames, leastsq=cfg.threed.leastsq, grbreak=cfg.threed.grbreak, + fgamma=cfg.threed.fgamma, plots=cfg.threed.plots, resume=cfg.threed.resume)