Change request #2671

csspec skipps energy bins with non=0 but noff>0

Added by Specovius Andreas over 5 years ago. Updated over 5 years ago.

Status:ClosedStart date:09/04/2018
Priority:HighDue date:
Assigned To:Knödlseder Jürgen% Done:

100%

Category:-
Target version:1.6.0
Duration:

Description

In the current implementation of csspec, energy bins are skipped if the number of observed counts is zero.

For the onoff analysis this means that observations with zero on counts are skipped.
In case there are >0 off counts, reasonable upper limits may still be produced even if there are no on counts, hence these bins should not be skipped.

I would suggest to also check the off spectrum before skipping these bins?

(I don’t know how much 3d analysis is also affected by that?)


Recurrence

No recurrence.

History

#1 Updated by Knödlseder Jürgen over 5 years ago

  • Tracker changed from Bug to Change request
  • Assigned To set to Knödlseder Jürgen
  • Target version set to 1.6.0

Formally I agree, I added this feature when working on #2312.

Originally the code was:

# Perform maximum likelihood fit
like          = ctools.ctlike(obs)
like['edisp'] = self['edisp'].boolean()
like.run()

# Continue only if log-likelihood is non-zero
if like.obs().logL() != 0.0:

but I then switched to
# Perform maximum likelihood fit. Skip bins that have no events.
like          = ctools.ctlike(obs)
like['edisp'] = self['edisp'].boolean()
if like.obs().nobserved() > 0:
    like.run()

# Continue only if log-likelihood is non-zero
if like.obs().logL() != 0.0 and like.obs().nobserved() > 0:

Unfortunately I have no track why exactly I did the change, I think it was to avoid fitting errors. I have no problem with putting this back again, but we should do some testing to check that there are no side effects.

#2 Updated by Knödlseder Jürgen over 5 years ago

I think now to remember that the difference was having or not having a background model. As you see in #2312 the output in the log file was different, and by adding that code the output became identical (see https://cta-redmine.irap.omp.eu/issues/2312#note-4).

#3 Updated by Knödlseder Jürgen over 5 years ago

  • Status changed from New to Closed
  • % Done changed from 0 to 100

I put back the original code.

Code merged into devel.

#4 Updated by Knödlseder Jürgen over 5 years ago

  • Project changed from GammaLib to ctools
  • Target version changed from 1.6.0 to 1.6.0

Also available in: Atom PDF