コード例 #1
0
def single_E_calc(gamma, scan, scan_dir, fwd_ic, bwd_ic):

    loadsuf = ["K_{33}", "k_{24}", "\\Lambda", "\\omega", "\\gamma_s"]
    savesuf = ["K_{33}", "k_{24}", "\\Lambda", "\\omega"]

    scan['\\gamma_s'] = str(gamma)

    ic_dict = {}

    if scan_dir == "scanforward":

        ic_dict = fwd_ic

    elif scan_dir == "scanbackward":

        ic_dict = bwd_ic

    scan['Rguess'] = str(ic_dict['Rguess0'])
    scan['Rupper'] = str(ic_dict['Rupper0'])
    scan['Rlower'] = str(ic_dict['Rlower0'])

    scan['etaguess'] = str(ic_dict['etaguess0'])
    scan['etaupper'] = str(ic_dict['etaupper0'])
    scan['etalower'] = str(ic_dict['etalower0'])

    scan['deltaguess'] = str(ic_dict['deltaguess0'])
    scan['deltaupper'] = str(ic_dict['deltaupper0'])
    scan['deltalower'] = str(ic_dict['deltalower0'])

    # read in file name info
    rp = ReadParams(scan=scan, loadsuf=loadsuf, savesuf=savesuf)

    # create a class to do calculations with current parameters in scan.
    run = SingleRun(rp, scan_dir=scan_dir)

    # run C executable.
    run.run_exe()

    # move file written by C executable from temporary data path to true data path
    run.mv_file('observables')

    # load the final values of E, R, eta, delta, and surface twist.
    Ei, Ri, etai, deltai, surftwisti = run.get_all_observables('observables',
                                                               str2float=True)

    run.concatenate_observables(["\\gamma_s"])

    return Ei, Ri, etai, deltai
コード例 #2
0
        user_input = input("input string of a gamma,k24,Lambda,omega values, "
                           "using comma as delimiter: ")
        gamma, k24, Lambda, omega = user_input.split(',')

    else:
        gamma, k24, Lambda, omega = sys.argv[1], sys.argv[2], sys.argv[
            3], sys.argv[4]

    scan = {}
    scan['k_{24}'] = k24
    scan['\\gamma_s'] = gamma
    scan['\\Lambda'] = Lambda
    scan['\\omega'] = omega

    loadsuf = ["K_{33}", "k_{24}", "\\Lambda", "\\omega", "\\gamma_s"]

    # read in file name info
    rp = ReadParams(scan=scan, loadsuf=loadsuf, savesuf=loadsuf)

    # create a class to do calculations with current parameters in scan.
    run = SingleRun(rp,
                    executable="../../../bin/full4var_psivsr",
                    valgrind=True)
    # run C executable.
    run.run_exe()

    # move file written by C executable from temporary data path to true data path
    run.mv_file('observables')
    run.mv_file('psivsr')
コード例 #3
0
def single_E_calc(gamma, scan, loadsuf, savesuf, scan_dir):

    scan['\\gamma_s'] = str(gamma)

    if scan_dir == "scanforward":

        Rguess0 = 0.044
        Rlower0 = 0.04
        Rupper0 = 0.05

        etaguess0 = 6.29
        etalower0 = 6.3
        etaupper0 = 6.287

        deltaguess0 = 0.74
        deltalower0 = 0.72
        deltaupper0 = 0.8

    else:

        Rguess0 = 1.5
        Rlower0 = 1.0
        Rupper0 = 2.0

        etaguess0 = 6.4
        etalower0 = 6.38
        etaupper0 = 6.42

        deltaguess0 = 0.815
        deltalower0 = 0.813
        deltaupper0 = 0.816

    scan['Rguess'] = str(Rguess0)
    scan['Rupper'] = str(Rupper0)
    scan['Rlower'] = str(Rlower0)

    scan['etaguess'] = str(etaguess0)
    scan['etaupper'] = str(etaupper0)
    scan['etalower'] = str(etalower0)

    scan['deltaguess'] = str(deltaguess0)
    scan['deltaupper'] = str(deltaupper0)
    scan['deltalower'] = str(deltalower0)

    # read in file name info
    rp = ReadParams(scan=scan, loadsuf=loadsuf, savesuf=savesuf)

    # create a class to do calculations with current parameters in scan.
    run = SingleRun(rp, scan_dir=scan_dir)

    # run C executable.
    run.run_exe()

    # move file written by C executable from temporary data path to true data path
    run.mv_file('observables')

    # load the final values of E, R, eta, delta, and surface twist.
    Ei, Ri, etai, deltai, surftwisti = run.get_all_observables('observables',
                                                               str2float=True)

    run.concatenate_observables(["\\gamma_s"])

    return Ei, Ri
def single_E_calc(gamma,scan,loadsuf,savesuf,scan_dir):

    scan['\\gamma_s'] = str(gamma)

    k240 = 0.33

    k24 = float(scan['k_{24}'])

    t = (k24-k240)/k240

    if scan_dir == "scanforward":

        #Rguess0 = 0.045
        #Rupper0 = 0.6
        #Rlower0 = 0.4

        Rguess0 = lower_Rguess(t)
        Rupper0 = Rguess0*1.1
        Rlower0 = Rguess0*0.9

        etaguess0 = 6.295
        etalower0 = 6.29
        etaupper0 = 6.3

        deltaguess0 = 0.8
        deltalower0 = 0.799
        deltaupper0 = 0.805

    else:

        #Rguess0 = 0.7
        #Rupper0 = 0.9
        #Rlower0 = 0.6

        Rguess0 = upper_Rguess(t)
        Rupper0 = Rguess0*1.1
        Rlower0 = Rguess0*0.9

        etaguess0 = 6.34
        etalower0 = 6.32
        etaupper0 = 6.36

        deltaguess0 = 0.813
        deltalower0 = 0.808
        deltaupper0 = 0.816


    scan['Rguess'] = str(Rguess0)
    scan['Rupper'] = str(Rupper0)
    scan['Rlower'] = str(Rlower0)

    scan['etaguess'] = str(etaguess0)
    scan['etaupper'] = str(etaupper0)
    scan['etalower'] = str(etalower0)

    scan['deltaguess'] = str(deltaguess0)
    scan['deltaupper'] = str(deltaupper0)
    scan['deltalower'] = str(deltalower0)


    # read in file name info
    rp = ReadParams(scan=scan,loadsuf=loadsuf,savesuf=savesuf)

    # create a class to do calculations with current parameters in scan.
    run = SingleRun(rp,scan_dir=scan_dir)

    # run C executable.
    run.run_exe()

    # move file written by C executable from temporary data path to true data path
    run.mv_file('observables')

    # load the final values of E, R, eta, delta, and surface twist.
    Ei,Ri,etai,deltai,surftwisti = run.get_all_observables('observables',str2float=True)

    run.concatenate_observables(["\\gamma_s"])

    return Ei,Ri