diff --git a/tardis/energy_input/gamma_ray_packet_source.py b/tardis/energy_input/gamma_ray_packet_source.py index 71d274091b7..888b4eb4cbb 100644 --- a/tardis/energy_input/gamma_ray_packet_source.py +++ b/tardis/energy_input/gamma_ray_packet_source.py @@ -253,7 +253,7 @@ def create_packets(self, decays_per_isotope, *args, **kwargs): Array of positron output dataframe rows """ number_of_packets = decays_per_isotope.sum().sum() - decays_per_shell = decays_per_isotope.T.sum().values + decays_per_shell = decays_per_isotope.sum().values locations = np.zeros((3, number_of_packets)) directions = np.zeros((3, number_of_packets)) diff --git a/tardis/energy_input/main_gamma_ray_loop.py b/tardis/energy_input/main_gamma_ray_loop.py index 3d8bd9badf0..4ae1ba8235c 100644 --- a/tardis/energy_input/main_gamma_ray_loop.py +++ b/tardis/energy_input/main_gamma_ray_loop.py @@ -152,7 +152,7 @@ def run_gamma_ray_loop( logger.info("Initializing packets") packet_source = RadioactivePacketSource( - energy_per_packet, + individual_packet_energy, gamma_ray_line_dict, positronium_fraction, inner_velocities, @@ -174,8 +174,8 @@ def run_gamma_ray_loop( logger.info("Creating packet list") packets = [] - total_cmf_energy = 0.0 - total_rf_energy = 0.0 + total_cmf_energy = packet_collection.energy_cmf.sum() + total_rf_energy = packet_collection.energy_rf.sum() for i in range(number_of_packets): packet = GXPacket( packet_collection.location[:, i], @@ -201,8 +201,6 @@ def run_gamma_ray_loop( 0, ] ) - total_cmf_energy += packet.energy_cmf - total_rf_energy += packet.energy_rf logger.info(f"Total cmf energy is {total_cmf_energy}") logger.info(f"Total rf energy is {total_rf_energy}")