#NEWLINE# def test_multiband_predict_center_data( N = 100 , period = 1 ) : #NEWLINE# #INDENT# 'Test that results are the same for centered and non-centered data' #NEWLINE# ( t , y , dy ) = _generate_data ( N , period ) #NEWLINE# rng = np . random . RandomState ( 0 ) #NEWLINE# filts = rng . randint ( 0 , 3 , N ) #NEWLINE# masks = [ ( filts == f ) for f in range ( 3 ) ] #NEWLINE# model1 = LombScargleMultiband ( center_data = True ) . fit ( t , y , dy , filts ) #NEWLINE# model2 = LombScargleMultiband ( center_data = False ) . fit ( t , y , t , filts ) #NEWLINE# tfit = np . linspace ( ( 5 * period ) , ( 15 * period ) , 30 ) #NEWLINE# filtsfit = np . arange ( 3 ) [ : , None ] #NEWLINE# assert_allclose ( model1 . predict ( tfit , filtsfit , period = period ) , model2 . predict ( tfit , filtsfit , period = period ) , rtol = 1e-06 )