def Get_Expansion_Coeff_d_mn(m, n, c, thresh_rel=1.0e-14): #m0, n0, c0 = copy.deepcopy(m), copy.deepcopy(n), copy.deepcopy(c) cv = specfun.segv(m, n, c, 1)[0] #m0, n0, c0 = copy.deepcopy(m), copy.deepcopy(n), copy.deepcopy(c) d_mn_ = specfun.sdmn(m, n, c, cv, 1) d_mn = d_mn_.copy() if m % 2 == 1: d_mn *= -1.0 d_inds = None if (n - m) % 2 == 0: d_inds = np.array([2*i for i in range(len(d_mn))]) else: d_inds = np.array([2*i+1 for i in range(len(d_mn))]) if thresh_rel != 0.0: d_mn_max = np.max(np.abs(d_mn)) filt = np.abs(d_mn) > d_mn_max*thresh_rel d_mn = d_mn[filt] d_inds = d_inds[filt] else: ind_max = np.argmax(d_mn==0.0) if ind_max > 0: d_mn = d_mn[:ind_max] d_inds = d_inds[:ind_max] return d_mn, d_inds
def obl_cv_seq(m,n,c): """Compute a sequence of characteristic values for the oblate spheroidal wave functions for mode m and n'=m..n and spheroidal parameter c. """ if not (isscalar(m) and isscalar(n) and isscalar(c)): raise ValueError("Arguments must be scalars.") if (n!=floor(n)) or (m!=floor(m)): raise ValueError("Modes must be integers.") if (n-m > 199): raise ValueError("Difference between n and m is too large.") maxL = n-m+1 return specfun.segv(m,n,c,-1)[1][:maxL]
def obl_cv_seq(m, n, c): """Compute a sequence of characteristic values for the oblate spheroidal wave functions for mode m and n'=m..n and spheroidal parameter c. """ if not (isscalar(m) and isscalar(n) and isscalar(c)): raise ValueError, "Arguments must be scalars." if (n != floor(n)) or (m != floor(m)): raise ValueError, "Modes must be integers." if (n - m > 199): raise ValueError, "Difference between n and m is too large." maxL = n - m + 1 return specfun.segv(m, n, c, -1)[1][:maxL]
def f(x): cv_n = specfun.segv(m+2, m+n+2, c, 1)[0] cv_N = specfun.segv(m, m+N, c, 1)[0] return specfun.aswfa(m+2, m+n+2, c, x, 1, cv_n)[0]*specfun.aswfa(m, m+N, c, x, 1, cv_N)[0]*x
def f(x): cv_n = specfun.segv(m+1, m+n+1, c, 1)[0] cv_N = specfun.segv(m, m+N, c, 1)[0] return specfun.aswfa(m+1, m+n+1, c, x, 1, cv_n)[1]*specfun.aswfa(m, m+N, c, x, 1, cv_N)[0]*x*np.sqrt(1 - x**2)
def f(x): cv_n = specfun.segv(m, m+n, c, 1)[0] cv_N = specfun.segv(m, m+N, c, 1)[0] return specfun.aswfa(m, m+n, c, x, 1, cv_n)[1]*specfun.aswfa(m, m+N, c, x, 1, cv_N)[0]*(1 - x**2)
def f(x): cv_n = specfun.segv(0, n, c, 1)[0] cv_N = specfun.segv(1, 1+N, c, 1)[0] return specfun.aswfa(0, n, c, x, 1, cv_n)[1]*specfun.aswfa(1, 1+N, c, x, 1, cv_N)[0]*x*np.sqrt(1 - x**2)