A better way to create a response function for CSD

This implementation includes the recursive calibration of the response function for CSD, Using an FA threshold is not a very robust method.It is dependent on the dataset (non-informed used subjectivity), and still depends on the diffusion tensor (FA and first eigenvector), which has low accuracy at high b-value. This function recursively calibrates the response function, for more information see Tax et al. NeuroImage 2014.

This implementation is slow only on one line (788) which calls real_sph_harm. I would appreciate any help to optimize this function. Thx!
@pv, @stefanv @ken-sakaie, many thanks for providing possible improvements on the sph_harm function. I tried the alternative sph_harm function assuming that it had the same convention as used in scipy, and make sure it is real:

```
def real_sph_harm2(m, n, theta, phi):
    m = np.abs(m)
    x = np.cos(phi)
    val = lpmv(abs(m), n, x).astype(complex)
    val *= np.sqrt((2*n + 1) / 4.0 / np.pi)
    val *= np.exp(0.5*(gammaln(n-m+1)-gammaln(n+m+1)))
    val = val * np.exp(1j * m * theta)
    real_sh = np.where(m > 0, val.imag, val.real)
    real_sh *= np.where(m == 0, 1., np.sqrt(2))
    return real_sh
```

however, this gives me different results from the real_sph_harm we currently use. Could you perhaps help on this? Thanks in advance