import numpy as np import os import sys from scipy.integrate import simps #import matplotlib.pyplot as plt cwd = os.getcwd() sys.path.append(cwd) # importing files containing the global variables import globalvars as GV # reading global variables --- user-dependent gvar = GV.globalVars() cwd = os.getcwd() sd = f'{gvar.eigdir}' #storage directory if (os.path.isdir(sd) == False): os.mkdir(sd) nl = np.loadtxt(f'{gvar.snrnmais}/data_files/nl.dat') U_list = np.loadtxt(f'{gvar.snrnmais}/data_files/eigU.dat') V_list = np.loadtxt(f'{gvar.snrnmais}/data_files/eigV.dat') r = np.loadtxt(f'{gvar.snrnmais}/data_files/r.dat') mode_count = len(nl) l_pres = 0 l_prev = -1 for i in range(mode_count): l_pres = int(nl[i][1]) if (l_prev != l_pres): print('l = ' + str(l_pres))
# {{{ reading arguments from command line parser = argparse.ArgumentParser() parser.add_argument("--n0", help="radial order", type=int) parser.add_argument("--l0", help="angular degree", type=int) args = parser.parse_args() # }}} argparse # {{{ Reading global variables rmin, rmax = 0.0, 1.0 # (Since we are using lmax = 300, 0.45*300 \approx 150) SMAX = 5 # maximum s for constructing supermatrix FWINDOW = 150 # microHz gvar = globalvars.globalVars(rmin, rmax, SMAX, FWINDOW, args) # }}} global variables ells_list = np.array([50, 100, 150, 200, 250, 300]) plt.figure() for ell in ells_list: args.l0 = ell gvar = globalvars.globalVars(rmin, rmax, SMAX, FWINDOW, args) analysis_modes = qdcls.qdptMode(gvar) super_matrix = analysis_modes.create_supermatrix() eigvals_dpt_unsorted = super_matrix.get_eigvals(type='DPT', sorted=False) max_idx = 2*ell + 1 fdpt = eigvals_dpt_unsorted[:max_idx].real/2/analysis_modes.omega0 fdpt *= gvar.OM * 1e9 m_arr = np.arange(-ell, ell+1)