Feature #1499

csspec to produce count spectrum

Added by Bregeon Johan almost 9 years ago. Updated about 7 years ago.

Status:NewStart date:
Priority:NormalDue date:
Assigned To:-% Done:

0%

Category:-
Target version:-
Duration:

Description

The spectrum fits file created by csspec now contains energy, flux and TS for the given source.
It would be nice to also have counts for diagnostic purpose.
Counts should probably be taken from the model npred.

Note that obsutils.py could add counts as well to the final spectrum object.

See also #1152 for quick look diagnostic plots.

plot_counts.png (91.3 KB) Bregeon Johan, 07/02/2015 04:48 PM

Plot_counts

Recurrence

No recurrence.

History

#1 Updated by Bregeon Johan almost 9 years ago

there is a plot_counts(obs) function in ctools/examples/make_survey.py
that seem to do what I need... but it seems to be broken right now.

#2 Updated by Bregeon Johan almost 9 years ago

I could have plot_counts(obs) function in ctools/examples/make_survey.py to work,
and it looks ok.
I still have a warning to get rid of before committing.

#3 Updated by Bregeon Johan almost 9 years ago

Fixing plot_counts to work within make_survey is actually more tricky than I thought, because plot_counts was not designed to really correctly handle multiple observation (one count spectrum is drawn for each observation where you would like to sum them by source).
plot_counts shall be improved within make_survey or moved out of it in a simpler example with just one observation.

Meanwhile, here are just the 3 lines to be fixed to have plot_counts not to crash:

ebounds.set_log(10, emin, emax)
(...)
off   = atom.dir().dir().dist_deg(crab)
(...)
off   = atom.dir().dir().dist_deg(crab)

#4 Updated by Bregeon Johan almost 9 years ago

Thinking about it, this plot_counts function shall probably be divided into to two functions, one to extract the counts and one to plot them... and that shall probably be a separate issue defined as preliminary work to this one.

#5 Updated by Mayer Michael over 8 years ago

This might be implemented already by csspec, where npred computed are used and written into the resulting FITS file. However, this does not yet work if we are in binned/stacked mode.

#6 Updated by Knödlseder Jürgen almost 8 years ago

  • Target version set to 1.2.0

#7 Updated by Knödlseder Jürgen about 7 years ago

  • Target version deleted (1.2.0)
  • Start date deleted (07/02/2015)

Also available in: Atom PDF