# Path: prospect/sources/constants.py



import numpy as np
    from sedpy.observate import getSED
from .constants import lsun, pc, kboltz, hplanck

        spec = cpars['mass'] * modified_BB(wave, **cpars)
        phot = 10**(-0.4 * getSED(wave*1e4, spec, filters))
        return spec, phot, None

    def normalization(self):
        """This method computes the normalization (due do distance dimming,
        unit conversions, etc.) based on the content of the params dictionary.
        """
        return 1


def modified_BB(wave, T=20, beta=2.0, kappa0=1.92, lambda0=350, **extras):
    """Return a modified blackbody.

    the normalization of the emissivity curve can be given as kappa0 and
    lambda0 in units of cm^2/g and microns, default = (1.92, 350).  Ouput units
    are erg/s/micron/g.
    """
    term = (lambda0 / wave)**beta
    return planck(wave, T=T, **extras) * term * kappa0


def planck(wave, T=20.0, **extras):
    """Return planck function B_lambda (erg/s/micron) for a given T (in Kelvin) and
    wave (in microns)
    """
    # Return B_lambda in erg/s/micron
    w = wave * 1e4 #convert from microns to cm
    conv = 2 * hplank * lightspeed**2 / w**5 / 1e4

# Path: prospect/sources/constants.py



# Path: prospect/sources/dust_basis.py
import numpy as np
    from sedpy.observate import getSED
from .constants import lsun, pc, kboltz, hplanck


        spec = cpars['mass'] * modified_BB(wave, **cpars)
        phot = 10**(-0.4 * getSED(wave*1e4, spec, filters))
        return spec, phot, None

    def normalization(self):
        """This method computes the normalization (due do distance dimming,
        unit conversions, etc.) based on the content of the params dictionary.
        """
        return 1


def modified_BB(wave, T=20, beta=2.0, kappa0=1.92, lambda0=350, **extras):
    """Return a modified blackbody.

    the normalization of the emissivity curve can be given as kappa0 and
    lambda0 in units of cm^2/g and microns, default = (1.92, 350).  Ouput units
    are erg/s/micron/g.
    """
    term = (lambda0 / wave)**beta
    return planck(wave, T=T, **extras) * term * kappa0


def planck(wave, T=20.0, **extras):
    """Return planck function B_lambda (erg/s/micron) for a given T (in Kelvin) and
    wave (in microns)
    """
    # Return B_lambda in erg/s/micron
    w = wave * 1e4 #convert from microns to cm
    conv = 2 * hplank * lightspeed**2 / w**5 / 1e4

    denom = (np.exp(hplanck * lightspeed / (kboltz * T)) - 1)