Skip to content

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
wkerzendorf committed Jul 21, 2023
1 parent 36144bb commit a8b1783
Showing 1 changed file with 10 additions and 12 deletions.
22 changes: 10 additions & 12 deletions tardis/montecarlo/packet_source.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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

0 comments on commit a8b1783

Please sign in to comment.