Beispiel #1
0
def compute_1(s, chi, alpha, beta, r0, theta0, robs, thetaobs, phiobs):
    start = time.time()

    info = {}
    #for phi0 in np.linspace(0, np.pi / 2, num=50):
    #    sol = solver.ODESolver(s, theta0, phi0, chi, alpha, beta, r0, stop=35)
    #    eop = better_eop.EmitterObserverProblem(sol, robs, thetaobs, phiobs)  #
    #    # above:
    #    alpha, beta, flag = eop.find_critical_angles(half='right', amin=-0.5, amax=2,
    #                                                 bmin=2, bmax=2.5)
    #    info[str(phi0)+'above'] = flag
    #    if flag:
    #        eop.save_to_csv(alpha, beta, r'D:/2021_04_13/s075/1/')

    #for phi0 in np.linspace(0, np.pi / 4, num=26):
    #    sol = solver.ODESolver(s, theta0, phi0, chi, alpha, beta, r0, stop=45)
    #    eop = better_eop.EmitterObserverProblem(sol, robs, thetaobs, phiobs)  #
    #    # above:
    #    alpha, beta, flag = eop.find_critical_angles(half='right', amin=4, amax=4.1,
    #                                                 bmin=1.37, bmax=1.45)
    #    info[str(phi0)+'below'] = flag
    #    if flag:
    #        eop.save_to_csv(alpha, beta, r'D:/2021_04_13/s075/1/')

    phis = helping(r'D:/2021_04_13/s075/1/', np.pi / 4, np.pi / 2, 25)
    print(phis)
    for phi0 in phis:
        sol = solver.ODESolver(s, theta0, phi0, chi, alpha, beta, r0, stop=45)
        eop = better_eop.EmitterObserverProblem(sol, robs, thetaobs, phiobs)  #
        # above:
        alpha, beta, flag = eop.find_critical_angles(half='right', bmax=1.07, bmin=0.98,
                                                     amax=3.8, amin=3.67)
        info[str(phi0)+'below'] = flag
        if flag:
            eop.save_to_csv(alpha, beta, r'D:/2021_04_13/s075/1/')##

    now = time.time()
    print(f'All those took {now - start}s (or {(now - start) / 60}m).')
    print('Info:')
    print(info)
    if False in info.values():
        print('THERE ARE ERRORS!')
Beispiel #2
0
def plotting(s, chi, r0, phi0, alpha, beta, phiobs=np.pi / 2, thetaobs=1.25):
    fig = pl.figure()
    ax = fig.add_subplot(111, projection='3d')
    sol = solver.ODESolver(s, np.pi / 2, phi0, chi, alpha, beta, r0, stop=45)
    plot.plot_3d(sol, ax, phiobs, thetaobs, r0, np.pi / 2, phi0)
    pl.show()
Beispiel #3
0
def compute_2(s, chi, alpha, beta, r0, theta0, robs, thetaobs, phiobs):
    start = time.time()

    info = {}
    i = 0
    for phi0 in np.linspace(np.pi / 2, np.pi, num=25):
        sol = solver.ODESolver(s, theta0, phi0, chi, alpha, beta, r0, stop=40)
        eop = better_eop.EmitterObserverProblem(sol, robs, thetaobs, phiobs)  #

        # above:
        alpha, beta, flag = eop.find_critical_angles(half='right',
                                                     amin=4.4,
                                                     amax=6,
                                                     bmin=1.6,
                                                     bmax=2.2)
        info[str(phi0) + 'above'] = flag
        if flag:
            eop.save_to_csv(alpha, beta, r'D:/2021_04_13/2/')

    for phi0 in np.linspace(3 * np.pi / 4, np.pi, num=25):
        # below:
        sol = solver.ODESolver(s, theta0, phi0, chi, alpha, beta, r0, stop=40)
        eop = better_eop.EmitterObserverProblem(sol, robs, thetaobs, phiobs)
        alpha, beta, flag = eop.find_critical_angles(half='right',
                                                     amin=2.9,
                                                     amax=3.1,
                                                     bmin=1.2,
                                                     bmax=1.4)
        info[str(phi0) + 'below'] = flag
        if flag:
            eop.save_to_csv(alpha, beta, r'D:/2021_04_13/2/')

    for phi0 in np.linspace(np.pi / 2, 3 * np.pi / 4, num=25):
        sol = solver.ODESolver(s, theta0, phi0, chi, alpha, beta, r0, stop=40)
        eop = better_eop.EmitterObserverProblem(sol, robs, thetaobs, phiobs)
        alpha, beta, flag = eop.find_critical_angles(half='right',
                                                     amin=2.95,
                                                     amax=3.4,
                                                     bmin=1,
                                                     bmax=1.3)
        info[str(phi0) + 'below'] = flag
        if flag:
            eop.save_to_csv(alpha, beta, r'D:/2021_04_13/2/')

    for phi0 in []:  #1.832595714594046 1.8653206380689396 1.8980455615438334 1.930770485018727 1.9962203319685143 2.1598449493429825
        sol = solver.ODESolver(s, theta0, phi0, chi, alpha, beta, r0, stop=40)
        eop = better_eop.EmitterObserverProblem(sol, robs, thetaobs, phiobs)
        alpha, beta, flag = eop.find_critical_angles(half='right',
                                                     amin=3.02,
                                                     amax=3.04,
                                                     bmin=1.21,
                                                     bmax=1.24)
        info[str(phi0) + 'below'] = flag
        if flag:
            eop.save_to_csv(alpha, beta, r'D:/2021_04_13/')

    now = time.time()
    print(f'All those took {now - start}s (or {(now - start) / 60}m).')
    print('Info:')
    print(info)
    if False in info.values():
        print('THERE ARE ERRORS!')