bmorris3 / kelp

Photometric phase curves of exoplanets
https://kelp.readthedocs.io/en/latest/
7 stars 2 forks source link

Going to large \ell #29

Closed bmorris3 closed 3 years ago

bmorris3 commented 3 years ago

An improvement is implemented here for the Cython implementation, which goes up to lmax = 51. I used scipy.special.hermite to generate the polynomial coefficients with the following code:

import numpy as np
from scipy.special import hermite

for n in range(1, 51):
    print(f"elif l == {n}:")
    exp = []
    for h, j in zip(list(hermite(n=n))[::2], np.arange(n+1)[::-1][::2]):
        exp.append("{:.1f}*tilda_mu(theta, alpha)**{:d}".format(h, j))

    print('    return ('+ ' + \n\t\t'.join(exp)+')')

With such large lmax, we can now reproduce even subtle features in GCM temperature maps.