def test_blackbody_overflow():
 photlam = (u.photon / (((u.cm ** 2) * u.s) * u.AA))
 wave = [0, 1000.0, 100000.0, 1e+55]
 temp = 10000.0
 with np.errstate(all=u'ignore'):
  bb_lam = (blackbody_lambda(wave, temp) * u.sr)
 flux = (bb_lam.to(photlam, u.spectral_density((wave * u.AA))) / u.sr)
 assert np.isnan(flux[0])
 assert (np.log10(flux[(-1)].value) < (-134))
 np.testing.assert_allclose(flux.value[1:(-1)], [3.38131732e+16, 3874513170000000.0], rtol=0.001)
 with np.errstate(all=u'ignore'):
  flux = blackbody_lambda(1, 10000.0)
 assert (flux.value == 0)

def test_blackbody_overflow ( ) : photlam = ( u . photon / ( ( ( u . cm ** 2 ) * u . s ) * u . AA ) ) wave = [ 0 , 1000.0 , 100000.0 , 1e+55 ] temp = 10000.0 with np . errstate ( all = u'ignore' ) : bb_lam = ( blackbody_lambda ( wave , temp ) * u . sr ) flux = ( bb_lam . to ( photlam , u . spectral_density ( ( wave * u . AA ) ) ) / u . sr ) assert np . isnan ( flux [ 0 ] ) assert ( np . log10 ( flux [ ( - 1 ) ] . value ) < ( - 134 ) ) np . testing . assert_allclose ( flux . value [ 1 : ( - 1 ) ] , [ 3.38131732e+16 , 3874513170000000.0 ] , rtol = 0.001 ) with np . errstate ( all = u'ignore' ) : flux = blackbody_lambda ( 1 , 10000.0 ) assert ( flux . value == 0 )
test planck function with overflow .