示例#1
0
# 13 Brs
# 14 Psi
# 15 Sigma
# 16 beta
# 17 Bz/Brs
# 18 Pr eff
# 19 tadv
# 20 tdiff
# 21 dFlux

idNumList = [1000, 1001, 1002, 1003]
tDiff_rDz = []

for idNum in idNumList:
    # make data object
    do = reader.Data("../../output/run" + str(idNum) + "/")

    # time scales
    rDz = do.inp.rDz1
    rDzi = do.getrindex(rDz) - do.inp.nSmooth
    ti = do.gettindex(do.inp.tWait)
    #plt.loglog(do.r, do.data[20][ti])
    #plt.axvline(do.r[rDzi])
    #plt.show()
    tDiff_rDz.append()

    #plt.axvline(do.inp.rDz1, linestyle='--', color='k')
    #plt.savefig(do.savePath + "timeScales.png", bbox_inches='tight'); plt.clf()

    #print(do.data[0].shape)
    #print(do.data[1][10,100])
示例#2
0
# 9  mdot
# 10 vadv
# 11 vdiff
# 12 Bz
# 13 Brs
# 14 Psi
# 15 Sigma
# 16 beta
# 17 Bz/Brs
# 18 Pr eff
# 19 tadv
# 20 tdiff
# 21 dFlux

# make data object
do = reader.Data("../output/run" + str(sys.argv[1]) + "/")

print do.nt
#print do.data[19][10,86-5]
#print do.data[19][10,168-5]
#print do.data[20][10,86-5]
#print do.data[20][10,168-5]

# all time scales on the same plot
n = 0
plt.loglog(do.r, do.tOrbit, label="tOrbit")
plt.loglog(do.r, do.data[19][n], label="tAdv")
plt.loglog(do.r, do.data[20][n], label="tDiff")
plt.legend(bbox_to_anchor=(1.02, 1), loc=2, borderaxespad=0.)
plt.ylim(1.e-4, 1.e5)
plt.ylabel("timescale (code units)")
# 17 Bz/Brs
# 18 Pr eff
# 19 tadv 
# 20 tdiff
# 21 dFlux

# avaliable routines
# profile(self, col, time, vLineCoords=[1.0, 50.0], hLineCoords=[], logOption=0, save=None, savePath=None, legendLabel=None, ymin=None, ymax=None)
# multiProfile(self, col, nProfiles, spacing="log", vLineCoords1=[1.0,50.0], hLineCoords1=[], logOption=0, save=None, savePath=None, ymin=None, ymax=None)
# makeMultiAnim(self, timeCutFactor=10, lengthInSeconds=20, savePath=None, show=None, save=None)
# timeEvo(self, col, r, logOption=0, save=None, savePath=None, legendLabel=None, ymin=None, ymax=None)
# stPlot(self, col, cmapType="viridis", logOption=0, save=None, savePath=None, clim1=None, clim2=None)

for idNum in sys.argv[2:]:
	# make data object
	do = reader.Data("../output/run" + str(idNum) + "/", nRead=4000)
	print(do.data[1].shape)

#	for i in range(do.nr):
#		print(i, do.r[i], do.tOrbit[i], do.data[20][0,i], do.data[19][0,i])

	#do.makeAnimFrames()

	# initial conditions
	do.icPlots()
	
	# 4 pannel space-time plots
	do.multiStPlot1(10, vLineCoords1=[50, 50+float(sys.argv[1])/2.0])

	# all time scales on the same plot (at t=0)
	n=0
示例#4
0
# 16 beta
# 17 Bz/Brs
# 18 Pr eff
# 19 tadv
# 20 tdiff
# 21 dFlux


def saveAndClear(figNum=0):
    plt.figure(figNum)
    plt.savefig(pdfName, format='pdf', bbox_inches='tight')
    plt.clf()


for idNum in sys.argv[1:]:
    do = reader.Data("../../outputLargeDisk/run" + str(idNum) + "/",
                     nRead=8000)
    savePath = "./plots/" + str(idNum) + "/"
    if not os.path.exists(savePath): os.makedirs(savePath)
    pdfName = PdfPages(savePath + "all.pdf")
    ######################################################################################
    for col in range(0, 22):
        x, y = reader.getProfileData(do, col, 0.1)
        index = np.log10(y[do.getrindex(10)] / y[do.getrindex(1)])
        print(do.header[col] + ' power law index: ' + str(index))
    ######################################################################################
    reader.profilePlot(do, 19, 1, color='r', label='header')
    reader.profilePlot(do, 20, 1, color='b', label='header')
    plt.legend(loc='best')
    saveAndClear()
    reader.multiProfilePlot(do, 17, 10, logOption='semilogx')
    plt.ylim(-2, 2)