Skip to content

Commit

Permalink
fixed units in spectrum.
Browse files Browse the repository at this point in the history
  • Loading branch information
Tyler Parsotan committed Jun 6, 2021
1 parent 63baa58 commit 17c2715
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions processmcrat/mockobservations.py
Original file line number Diff line number Diff line change
Expand Up @@ -501,9 +501,9 @@ def _energy_iterator(self, time_min, time_max, spectrum_unit, energy_min, energy
if idx[0].size > 0:
if 'erg' in spectrum_unit.to_string():
spectrum[i] = np.sum(self.detected_photons.weight[idx] * \
self.detected_photons.get_energies(unit=unit.erg)[idx])/delta_energy[i] #/ (delta_t)
self.detected_photons.get_energies(unit=unit.erg)[idx])/delta_energy[i] / (delta_t)
elif 'ct' in spectrum_unit.to_string():
spectrum[i] = np.sum(self.detected_photons.weight[idx])/delta_energy[i] #/ (delta_t)
spectrum[i] = np.sum(self.detected_photons.weight[idx])/delta_energy[i]/ (delta_t)
else:
print('The spectrum unit can only be set as erg/s/energy_unit or counts/s/energy_unit currently.')

Expand Down

0 comments on commit 17c2715

Please sign in to comment.