From a8b1783c2289e112ee4d53eca050a7bed9c63ff5 Mon Sep 17 00:00:00 2001 From: Wolfgang Kerzendorf Date: Fri, 21 Jul 2023 15:10:48 -0400 Subject: [PATCH] cleanup --- tardis/montecarlo/packet_source.py | 22 ++++++++++------------ 1 file changed, 10 insertions(+), 12 deletions(-) diff --git a/tardis/montecarlo/packet_source.py b/tardis/montecarlo/packet_source.py index f054b7a2ee2..095fca194c4 100644 --- a/tardis/montecarlo/packet_source.py +++ b/tardis/montecarlo/packet_source.py @@ -233,7 +233,16 @@ def create_packet_energies(self, no_of_packets): """ return np.ones(no_of_packets) / no_of_packets - def set_temperature_from_luminosity(self, luminosity): + def set_temperature_from_luminosity(self, luminosity: u.Quantity): + """ + Set blackbody packet source temperature from luminosity + + Parameters + ---------- + + luminosity : u.Quantity + + """ self.temperature = ( (luminosity / (4 * np.pi * self.radius**2 * const.sigma_sb)) ** 0.25 @@ -351,14 +360,3 @@ def create_packet_energies(self, no_of_packets): # Thus, we can absorb the factor gamma in the packet energies, which is # more convenient. return energies * static_inner_boundary2cmf_factor / gamma - - -def convert_config_to_blackbody_packetsource(config): - if config.plasma.initial_t_inner < 0.0 * u.K: - luminosity_requested = config.supernova.luminosity_requested - t_inner = None - else: - luminosity_requested = None - t_inner = config.plasma.initial_t_inner - radius = None - return BlackBodySimpleSource(radius, t_inner), luminosity_requested