Commit 8c7309c7d4c379938e66e63ea9386fca04c7aad3

Authored by Josh Cardenzana
1 parent b88ee4d5

Add option 'dll_freenodes' option

This frees other nodes when computing log-likelihood profiles
cscripts/csspec.par
@@ -44,6 +44,7 @@ fix_srcs, b, h, yes,,, "Fix other skymodel parameters" @@ -44,6 +44,7 @@ fix_srcs, b, h, yes,,, "Fix other skymodel parameters"
44 fix_bkg, b, h, no,,, "Fix background parameters" 44 fix_bkg, b, h, no,,, "Fix background parameters"
45 dll_sigstep, r, h, 0,0,100, "Step size in standard deviations for log-like profiles" 45 dll_sigstep, r, h, 0,0,100, "Step size in standard deviations for log-like profiles"
46 dll_sigmax, r, h, 5,1,100, "Maximum number of standard deviations for log-like profiles" 46 dll_sigmax, r, h, 5,1,100, "Maximum number of standard deviations for log-like profiles"
  47 +dll_freenodes, b, h, no,,, "Free nodes not being fit when computing log-like profiles"
47 48
48 # 49 #
49 # Standard parameters 50 # Standard parameters
cscripts/csspec.py
@@ -182,6 +182,7 @@ class csspec(ctools.csobservation): @@ -182,6 +182,7 @@ class csspec(ctools.csobservation):
182 # Setup dlog-likelihood parameters 182 # Setup dlog-likelihood parameters
183 self['dll_sigstep'].real() 183 self['dll_sigstep'].real()
184 self['dll_sigmax'].real() 184 self['dll_sigmax'].real()
  185 + self['dll_freenodes'].boolean()
185 186
186 # Read ahead output parameters 187 # Read ahead output parameters
187 if self._read_ahead(): 188 if self._read_ahead():
@@ -1004,9 +1005,10 @@ class csspec(ctools.csobservation): @@ -1004,9 +1005,10 @@ class csspec(ctools.csobservation):
1004 source.tscalc(False) 1005 source.tscalc(False)
1005 1006
1006 # Fix all parameters in the spectral model 1007 # Fix all parameters in the spectral model
1007 - for par in spectral:  
1008 - par.fix()  
1009 - 1008 + if (self._method != 'NODES') or (not self['dll_freenodes'].boolean()):
  1009 + for par in spectral:
  1010 + par.fix()
  1011 +
1010 # Re-compute the log-likelihood 1012 # Re-compute the log-likelihood
1011 like.run() 1013 like.run()
1012 loglike = like.obs().logL() 1014 loglike = like.obs().logL()