From 8c7309c7d4c379938e66e63ea9386fca04c7aad3 Mon Sep 17 00:00:00 2001 From: Josh Cardenzana Date: Tue, 10 Dec 2019 09:14:27 +0100 Subject: [PATCH] Add option 'dll_freenodes' option --- cscripts/csspec.par | 1 + cscripts/csspec.py | 8 +++++--- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/cscripts/csspec.par b/cscripts/csspec.par index 8a71218..df85946 100755 --- a/cscripts/csspec.par +++ b/cscripts/csspec.par @@ -44,6 +44,7 @@ fix_srcs, b, h, yes,,, "Fix other skymodel parameters" fix_bkg, b, h, no,,, "Fix background parameters" dll_sigstep, r, h, 0,0,100, "Step size in standard deviations for log-like profiles" dll_sigmax, r, h, 5,1,100, "Maximum number of standard deviations for log-like profiles" +dll_freenodes, b, h, no,,, "Free nodes not being fit when computing log-like profiles" # # Standard parameters diff --git a/cscripts/csspec.py b/cscripts/csspec.py index a004452..511841d 100755 --- a/cscripts/csspec.py +++ b/cscripts/csspec.py @@ -182,6 +182,7 @@ class csspec(ctools.csobservation): # Setup dlog-likelihood parameters self['dll_sigstep'].real() self['dll_sigmax'].real() + self['dll_freenodes'].boolean() # Read ahead output parameters if self._read_ahead(): @@ -1004,9 +1005,10 @@ class csspec(ctools.csobservation): source.tscalc(False) # Fix all parameters in the spectral model - for par in spectral: - par.fix() - + if (self._method != 'NODES') or (not self['dll_freenodes'].boolean()): + for par in spectral: + par.fix() + # Re-compute the log-likelihood like.run() loglike = like.obs().logL() -- libgit2 0.21.4