colorimetry.py 文件源码

python
阅读 25 收藏 0 点赞 0 评论 0

项目:prysm 作者: brandondube 项目源码 文件源码
def normalize_spectrum(spectrum):
    ''' Normalizes a spectrum to have unit peak within the visible band.
    Args:
        spectrum (`Spectrum`): object with iterable wavelength, value fields.

    Returns:
        `Spectrum`: new spectrum object.

    '''
    wvl, vals = spectrum['wvl'], spectrum['values']
    low, high = np.searchsorted(wvl, 400), np.searchsorted(wvl, 700)
    vis_values_max = vals[low:high].max()
    return {
        'wvl': wvl,
        'values': vals / vis_values_max,
    }
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号