Commit 8c7309c7d4c379938e66e63ea9386fca04c7aad3
1 parent
b88ee4d5
Add option 'dll_freenodes' option
This frees other nodes when computing log-likelihood profiles
Showing
2 changed files
with
6 additions
and
3 deletions
cscripts/csspec.par
| ... | ... | @@ -44,6 +44,7 @@ fix_srcs, b, h, yes,,, "Fix other skymodel parameters" |
| 44 | 44 | fix_bkg, b, h, no,,, "Fix background parameters" |
| 45 | 45 | dll_sigstep, r, h, 0,0,100, "Step size in standard deviations for log-like profiles" |
| 46 | 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 | 50 | # Standard parameters | ... | ... |
cscripts/csspec.py
| ... | ... | @@ -182,6 +182,7 @@ class csspec(ctools.csobservation): |
| 182 | 182 | # Setup dlog-likelihood parameters |
| 183 | 183 | self['dll_sigstep'].real() |
| 184 | 184 | self['dll_sigmax'].real() |
| 185 | + self['dll_freenodes'].boolean() | |
| 185 | 186 | |
| 186 | 187 | # Read ahead output parameters |
| 187 | 188 | if self._read_ahead(): |
| ... | ... | @@ -1004,9 +1005,10 @@ class csspec(ctools.csobservation): |
| 1004 | 1005 | source.tscalc(False) |
| 1005 | 1006 | |
| 1006 | 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 | 1012 | # Re-compute the log-likelihood |
| 1011 | 1013 | like.run() |
| 1012 | 1014 | loglike = like.obs().logL() | ... | ... |