Feature #807

Add check of number of events to simulate in ctobssim

Added by Martin Pierrick about 11 years ago. Updated about 9 years ago.

Status:ClosedStart date:03/22/2013
Priority:HighDue date:
Assigned To:Knödlseder Jürgen% Done:

100%

Category:-Estimated time:2.00 hours
Target version:1.0.0
Duration:

Description

It could be useful to make a check of the number of events to simulate with ctobssim before actually running the simulation. The problem at the moment is that if you mess up with the spectral parameters of a source or of the background (prefactors or pivot energies or...), the code runs the simulation even if the number of events to throw is huge and will lead to excessive memory requirements. In the worst cases, the job ends up on a bad_alloc().


Recurrence

No recurrence.

History

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

  • Status changed from New to In Progress
  • Assigned To set to Knödlseder Jürgen
  • % Done changed from 0 to 20

ctobssim now determines the length of a time slice from the photon flux, limiting the number of photons simulated in one slice to 1000000. This avoids a core dump due to a memory allocation problem.

Still, no warning is issues if the flux is higher than expected.

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

  • Priority changed from Normal to High
  • Target version set to 1.0.0

We want to have a warning for release version 1.0.0

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

  • Status changed from In Progress to Closed
  • % Done changed from 20 to 100

I added a hidden maxrate parameter that leads to an exception in case that the model requires a photon rate above that value. By default the maxrate parameter is set to 1e6 which should be okay for realistic VHE sources, and thus prevents getting stuck by hugh memory requirements for ctobssim.

Also available in: Atom PDF