本文整理汇总了Python中snapshot.Snapshot.read_snapshot方法的典型用法代码示例。如果您正苦于以下问题:Python Snapshot.read_snapshot方法的具体用法?Python Snapshot.read_snapshot怎么用?Python Snapshot.read_snapshot使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类snapshot.Snapshot
的用法示例。
在下文中一共展示了Snapshot.read_snapshot方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: rc
# 需要导入模块: from snapshot import Snapshot [as 别名]
# 或者: from snapshot.Snapshot import read_snapshot [as 别名]
from matplotlib import rc
rc('text', usetex=True)
import sys
import numpy as np
import os
import matplotlib.pyplot as plt
from pylab import *
from snapshot import Snapshot
from make_histogram import make_histograms
import string
def getnum(fname):
return "".join([i for i in fname if not str.isalpha(i)])[:-1]
fig = plt.figure()
ax = fig.add_subplot(1, 1, 1)
datas = [ Snapshot.read_snapshot(fname) for fname in sys.argv[1:] ]
make_histograms(datas, "temperature", map(getnum, sys.argv[1:]))
print datas
示例2:
# 需要导入模块: from snapshot import Snapshot [as 别名]
# 或者: from snapshot.Snapshot import read_snapshot [as 别名]
import sys
from snapshot import Snapshot
from make_histogram import make_histogram
for fname in sys.argv[1:]:
snap = Snapshot.read_snapshot(fname)
make_histogram(snap, "temperature", fname)
make_histogram(snap, "max_temperature", fname)
make_histogram(snap, "ionization", fname)
make_histogram(snap, "kinetic_energy", fname, scalar=6.24150974e18)