Skip to content

Commit

Permalink
Allow user to change mc3 fgamma
Browse files Browse the repository at this point in the history
  • Loading branch information
rychallener committed Oct 12, 2021
1 parent a57e3ac commit e3bbc96
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
10 changes: 10 additions & 0 deletions theresa/lib/fitclass.py
Original file line number Diff line number Diff line change
Expand Up @@ -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')
Expand Down Expand Up @@ -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')
Expand Down
3 changes: 2 additions & 1 deletion theresa/theresa.py
Original file line number Diff line number Diff line change
Expand Up @@ -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')
Expand Down Expand Up @@ -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)

Expand Down

0 comments on commit e3bbc96

Please sign in to comment.