Optimize the evaluation of beam pattern functions
This MR is to speed up the evaluation of beam pattern functions, which partially eases #576 (closed), but does not solve it fully as the speed-up gain is not large enough.
This MR
- reduces the number of computations of cosine and sine by storing their values at the first stage of computations, and
- enables
ifo.antenna_pattern
to compute the beam patterns forplus
andcross
simultaneously so that the vectorsu
,v
,m
andn
inbilby.gw.utils.get_polarization_tensor
do not need to be calculated twice.
I found that this change speeds up the evaluations of plus and cross beam patterns by a factor of ~1.5.
Edited by Soichiro Morisaki