Fix of the previous

Former-commit-id: 74a68bb17f61a875c9f8c852820ac1252a5095cc
This commit is contained in:
Marek Nečada 2017-05-08 20:20:57 +03:00
parent d269624b68
commit f41caf6203
3 changed files with 16 additions and 14 deletions

View File

@ -7,7 +7,7 @@ import time
import scipy import scipy
import sys import sys
from qpms_c import get_mn_y, trans_calculator # TODO be explicit about what is imported from qpms_c import get_mn_y, trans_calculator # TODO be explicit about what is imported
from .qpms_p import cart2sph, nelem2lMax, Ã, B̃ # TODO be explicit about what is imported from .qpms_p import cart2sph, nelem2lMax # TODO be explicit about what is imported
def _time_b(active = True, name = None, step = None): def _time_b(active = True, name = None, step = None):
''' '''

View File

@ -159,19 +159,6 @@ def B̃(m,n,μ,ν,kdlj,θlj,φlj,r_ge_d,J):
#@jit
def nelem2lMax(nelem):
"""
Auxiliary inverse function to nelem(lMax) = (lMax + 2) * lMax. Returns 0 if
it nelem does not come from positive integer lMax.
"""
lMax = round(math.sqrt(1+nelem) - 1)
if ((lMax < 1) or ((lMax + 2) * lMax != nelem)):
return 0
else:
return lMax
#@ujit #@ujit

View File

@ -157,6 +157,21 @@ def sph_loccart_basis(sph, sphaxis=-1, cartaxis=None):
out = np.concatenate((x,y,z),axis=cartaxis) out = np.concatenate((x,y,z),axis=cartaxis)
return out return out
#@jit
def nelem2lMax(nelem):
"""
Auxiliary inverse function to nelem(lMax) = (lMax + 2) * lMax. Returns 0 if
it nelem does not come from positive integer lMax.
"""
lMax = round(math.sqrt(1+nelem) - 1)
if ((lMax < 1) or ((lMax + 2) * lMax != nelem)):
return 0
else:
return lMax
#@jit #@jit
def lpy(nmax, z): def lpy(nmax, z):
""" """