Skip to content

Astropy time is slow

Calculating the antenna response (and by extension the simple likelihood) is being dominated by converting from geocenter time to sidereal time.

I feel like this shouldn't need to be slow. @sylvia.biscoveanu would you be happy to dig into astropy/LAL and see if there's a faster way to do this?

If not I'll reassign it to myself.

%timeit likelihood.logL(time, params)
100 loops, best of 3: 4.19 ms per loop

%timeit IFO.antenna_response(params['ra'], params['dec'], params['geocent_time'], params['psi'], 'plus')
100 loops, best of 3: 3.88 ms per loop

%timeit astropy.time.Time(params['geocent_time'], format='gps', scale='utc').sidereal_time('mean', 'greenwich')
100 loops, best of 3: 3.74 ms per loop