Did I find the right examples for you? yes no

All Samples(6)  |  Call(4)  |  Derive(0)  |  Import(2)

src/t/a/tardis-sn-0.9.1/tardis/model.py   tardis-sn(Download)
from tardis import packet_source, plasma_array
import montecarlo
from util import intensity_black_body
 
 
        if radiative_rates_type == 'lte':
            logger.info('Calculating J_blues for radiative_rates_type=lte')
            j_blues = intensity_black_body(nus[np.newaxis].T, self.t_rads.value)
            self.j_blues = pd.DataFrame(j_blues, index=self.atom_data.lines.index, columns=np.arange(len(self.t_rads)))
        elif radiative_rates_type == 'dilute-blackbody' or init_detailed_j_blues:
            logger.info('Calculating J_blues for radiative_rates_type=dilute-blackbody')
            j_blues = self.ws * intensity_black_body(nus[np.newaxis].T, self.t_rads.value)
                zero_j_blues = self.j_blues[i] == 0.0
                self.j_blues[i][zero_j_blues] = w_epsilon * intensity_black_body(
                    self.atom_data.lines.nu.values[zero_j_blues], self.t_rads.value[i])
 
        else:

src/t/a/tardis-sn-0.9.1/tardis/packet_source.py   tardis-sn(Download)
 
import logging
from util import intensity_black_body
 
logger = logging.getLogger(__name__)
        logger.info('Calculating %d packets for t_inner=%.2f', number_of_packets, T)
        nu = np.linspace(self.nu_start, self.nu_end, num=self.blackbody_sampling)
        intensity = intensity_black_body(nu, T)
        cum_blackbody = np.cumsum(intensity)
        norm_cum_blackbody = cum_blackbody / cum_blackbody.max()