Commit 40d6cfa9624dbff951baebff4d270b2ce888bec0
1 parent
b58ef319
Dump photon flux before rate check and exception.
Showing
1 changed file
with
11 additions
and
11 deletions
src/ctobssim/ctobssim.cpp
| @@ -777,6 +777,16 @@ void ctobssim::simulate_source(GCTAObservation* obs, const GModels& models, | @@ -777,6 +777,16 @@ void ctobssim::simulate_source(GCTAObservation* obs, const GModels& models, | ||
| 777 | } | 777 | } |
| 778 | GTime tslice(duration, "sec"); | 778 | GTime tslice(duration, "sec"); |
| 779 | 779 | ||
| 780 | + // Dump photon rate | ||
| 781 | + if (logNormal()) { | ||
| 782 | + *wrklog << gammalib::parformat("Photon rate", indent); | ||
| 783 | + *wrklog << rate << " photons/sec"; | ||
| 784 | + if (model->name().length() > 0) { | ||
| 785 | + *wrklog << " [" << model->name() << "]"; | ||
| 786 | + } | ||
| 787 | + *wrklog << std::endl; | ||
| 788 | + } | ||
| 789 | + | ||
| 780 | // If photon rate exceeds the maximum photon rate | 790 | // If photon rate exceeds the maximum photon rate |
| 781 | // then throw an exception | 791 | // then throw an exception |
| 782 | if (rate > m_max_rate) { | 792 | if (rate > m_max_rate) { |
| @@ -797,16 +807,6 @@ void ctobssim::simulate_source(GCTAObservation* obs, const GModels& models, | @@ -797,16 +807,6 @@ void ctobssim::simulate_source(GCTAObservation* obs, const GModels& models, | ||
| 797 | throw GException::invalid_value(G_SIMULATE_SOURCE, msg); | 807 | throw GException::invalid_value(G_SIMULATE_SOURCE, msg); |
| 798 | } | 808 | } |
| 799 | 809 | ||
| 800 | - // Dump length of time slice and rate | ||
| 801 | - if (logExplicit()) { | ||
| 802 | - *wrklog << gammalib::parformat("Photon rate", indent); | ||
| 803 | - *wrklog << rate << " photons/sec"; | ||
| 804 | - if (model->name().length() > 0) { | ||
| 805 | - *wrklog << " [" << model->name() << "]"; | ||
| 806 | - } | ||
| 807 | - *wrklog << std::endl; | ||
| 808 | - } | ||
| 809 | - | ||
| 810 | // To reduce memory requirements we split long time | 810 | // To reduce memory requirements we split long time |
| 811 | // intervals into several slices. | 811 | // intervals into several slices. |
| 812 | GTime tstart = tmin; | 812 | GTime tstart = tmin; |
| @@ -916,7 +916,7 @@ void ctobssim::simulate_source(GCTAObservation* obs, const GModels& models, | @@ -916,7 +916,7 @@ void ctobssim::simulate_source(GCTAObservation* obs, const GModels& models, | ||
| 916 | *wrklog << std::endl; | 916 | *wrklog << std::endl; |
| 917 | 917 | ||
| 918 | } | 918 | } |
| 919 | - | 919 | + |
| 920 | } // endif: model was a sky model | 920 | } // endif: model was a sky model |
| 921 | 921 | ||
| 922 | } // endfor: looped over models | 922 | } // endfor: looped over models |