(fbase+"/LN-LN_LaR_expo_t%d"%(time+1), fbase+"/LN-SN_LaR_expo_t%d"%(time+1),
                  fbase+"/SN-LN_LaR_expo_t%d"%(time+1), fbase+"/SN-SN_LaR_expo_t%d"%(time+1)),
                 (fbase+"/LN-LN_LaR_wall_t%d"%(time+1), fbase+"/LN-SN_LaR_wall_t%d"%(time+1),
                  fbase+"/SN-LN_LaR_wall_t%d"%(time+1), fbase+"/SN-SN_LaR_wall_t%d"%(time+1))
                 ]
             ]
         ]
     )
 
 Nch  = len(ifiles[0,0,0,:]) / 2
 Nsrc = len(ifiles[0,0,:,0])
 Nt   = len(ifiles[:,0,0,0])
 
 Neq  = Nt * Nsrc
 
 tmp_yData, xData, dummy = input_bin_data(ifiles[0, 0, 0, 0])
 
 Ndata = len(tmp_yData[:, 0])
 Nconf = len(tmp_yData[0, :])
 
 del tmp_yData
 del dummy
 
 print("#")
 print("# N.ch   = "),; print Nch
 print("# N.src  = "),; print Nsrc
 print("# N.t    = "),; print Nt
 print("# N.eq   = "),; print Neq
 print("# N.data = "),; print Ndata
 print("# N.conf = "),; print Nconf
 print("#")
Exemple #2
0
###### Main part
if __name__ == "__main__":
    from numpy import empty

    argv = sys.argv
    argc = len(argv)

    if (argc < 5 or (argc - 1) % 2 != 0):
        usage(argv)

    set_args(
        argc, argv
    )  #; print oFname; print factor; print Nmlt; print opera; print iFname; quit()

    yData, xData, Dummy = input_bin_data(iFname[0])
    if (xData is yData is Dummy is None):
        quit()

    Nconf = len(yData[0, :])
    Ndata = len(yData[:, 0])
    del yData
    yData = empty((Ndata, Nconf))

    for idata in range(Ndata):
        for iconf in range(Nconf):
            yData[idata, iconf] = factor

    for imlt in range(Nmlt):
        tmpyData, tmpxData, Dummy = input_bin_data(iFname[imlt])
        if (tmpxData is tmpyData is Dummy is None):
Exemple #3
0
    set_args(argc, argv)

    tmpNeq1 = len(Fname_Pot)
    tmpNeq2 = len(Fname_Rcorr)
    tmpNeq3 = len(Fname_LapRcorr)

    if (not (tmpNeq1 == tmpNeq2 == tmpNeq3)):
        print("\nERROR: #.eq is different, exit.\n")
        quit()

    check_args()

    Neq = tmpNeq1

    tmpPot, xData, dummy = input_bin_data(Fname_Pot[0])
    if (tmpPot is xData is dummy is None):
        quit()
    Ndata = len(tmpPot[:, 0])
    Nconf = len(tmpPot[0, :])

    Pot = np.empty((1, 1, Ndata, Neq, Nconf))
    Rcorr = np.empty((1, 1, Ndata, Neq, Nconf))
    LapRcorr = np.empty((1, 1, Ndata, Neq, Nconf))

    for ieq in range(Neq):
        tmpPot, xDataTmp, dummy = input_bin_data(Fname_Pot[ieq])
        for idata in range(Ndata):
            if (xData[idata] != xDataTmp[idata]):
                print("\nERROR: x-data is different, exit.\n")
                quit()
 
 if (argc < 6):
     usage(argv)
 
 set_args(argc, argv)
 check_args()
 
 Fname, Params = input_params(iFname_fit)
 if (Fname is Params is None):
     quit()
 
 Nconf   = len(Params[0, :])
 Nparam  = len(Params[:, 0])
 FitFunc = set_fitfunc_from_fname(Fname)
 
 yData1, xData1, Dummy = input_bin_data(iFname_bin1)
 if (xData1 is yData1 is Dummy is None):
     quit()
 if (Nconf != len(yData1[0, :])):
     print("\nERROR: #.conf is differ, exit.\n"); quit()
 
 yData2, xData2, Dummy = input_bin_data(iFname_bin2)
 if (xData2 is yData2 is Dummy is None):
     quit()
 if (Nconf != len(yData2[0, :])):
     print("\nERROR: #.conf is differ, exit.\n"); quit()
 
 yData3, xData3, Dummy = input_bin_data(iFname_bin3)
 if (xData3 is yData3 is Dummy is None):
     quit()
 if (Nconf != len(yData3[0, :])):
    iFname2 = ARGV[2].strip()


###### Main part
if __name__ == "__main__":
    from numpy import empty

    argv = sys.argv
    argc = len(argv)

    if (argc != 3):
        usage(argv)

    set_args(argc, argv)

    yData1, xData1, Dummy = input_bin_data(iFname1)
    if (xData1 is yData1 is Dummy is None):
        quit()
    yData2, xData2, Dummy = input_bin_data(iFname2)
    if (xData2 is yData2 is Dummy is None):
        quit()

    if (len(xData1) != len(xData2)):
        print("ERROR: The lengths of each file are differ, exit.\n")
        quit()

    Ndata = len(xData1)

    for i in range(Ndata):
        if (xData1[i] != xData2[i]):
            print("ERROR: The x-data of each file are differ, exit.\n")
    print
    quit()


def set_args(ARGC, ARGV):
    global iFname

    iFname = ARGV[1].strip()


###### Main part
if __name__ == "__main__":
    argv = sys.argv
    argc = len(argv)

    if (argc != 2):
        usage(argv)

    set_args(argc, argv)

    yData, xData, eData = input_bin_data(iFname)
    if (xData is yData is eData is None):
        quit()

    for idata in range(len(xData)):
        mean, err = make_mean_err(yData[idata, :])
        print("%lf %1.16e %1.16e" % (xData[idata], mean, err)),
        for iconf in range(len(yData[idata, :])):
            print(" %1.16e" % yData[idata, iconf]),
        print
Exemple #7
0

###### Main part
if __name__ == "__main__":
    from numpy import empty

    argv = sys.argv
    argc = len(argv)

    if (argc == 1 or argc > 3):
        usage(argv)

    set_args(argc, argv)
    print("# r_max = %lf" % r_max)

    yData, xData, Dummy = input_bin_data(iFname)
    if (xData is yData is Dummy is None):
        quit()

    Nconf = len(yData[0, :])
    Ndata = len(yData[:, 0])

    r2V = empty(Nconf)

    for iconf in range(Nconf):
        r2V[iconf] = 0.0
        for idata in range(Ndata):
            if (r_max > xData[idata]):
                r2V[iconf] += yData[idata, iconf] * xData[idata]**2

    mean, err = make_mean_err(r2V)