diff --git a/python/asteria/simulation.py b/python/asteria/simulation.py index 9084673..6b1f6e2 100644 --- a/python/asteria/simulation.py +++ b/python/asteria/simulation.py @@ -312,11 +312,14 @@ def compute_energy_per_vol(self, *, part_size=1000): idx = 0 # Perform integration over spectrum - if part_size < self.time.size: + if part_size <= self.time.size: for idx in np.arange(0, self.time.size, part_size): spectrum = self.get_combined_spectrum(self.time[idx:idx + part_size], self.energy, flavor, self._mixing) result[idx:idx + part_size] = np.trapz(spectrum, self.energy.value, axis=1) + else: + spectrum = self.get_combined_spectrum(self.time, self.energy, flavor, self._mixing) + result = np.trapz(spectrum, self.energy.value, axis=1) result *= ( H2O_in_ice * # Target Molecule (H2O) density