@pytest.mark.skipif(u'not HAS_SCIPY')
def test_blackbody_scipy():
 flux_unit = (u.Watt / ((u.m ** 2) * u.um))
 wave = (np.logspace(0, 8, 100000) * u.AA)
 temp = (100.0 * u.K)
 with np.errstate(all=u'ignore'):
  bb_nu = (blackbody_nu(wave, temp) * u.sr)
 flux = (bb_nu.to(flux_unit, u.spectral_density(wave)) / u.sr)
 lum = wave.to(u.um)
 intflux = integrate.trapz(flux.value, x=lum.value)
 ans = ((const.sigma_sb * (temp ** 4)) / np.pi)
 np.testing.assert_allclose(intflux, ans.value, rtol=0.01)

@ pytest . mark . skipif ( u'not HAS_SCIPY' ) def test_blackbody_scipy ( ) : flux_unit = ( u . Watt / ( ( u . m ** 2 ) * u . um ) ) wave = ( np . logspace ( 0 , 8 , 100000 ) * u . AA ) temp = ( 100.0 * u . K ) with np . errstate ( all = u'ignore' ) : bb_nu = ( blackbody_nu ( wave , temp ) * u . sr ) flux = ( bb_nu . to ( flux_unit , u . spectral_density ( wave ) ) / u . sr ) lum = wave . to ( u . um ) intflux = integrate . trapz ( flux . value , x = lum . value ) ans = ( ( const . sigma_sb * ( temp ** 4 ) ) / np . pi ) np . testing . assert_allclose ( intflux , ans . value , rtol = 0.01 )
test planck function .