示例#1
0
文件: eres.py 项目: piti118/Crystal
import matplotlib
batchmode = '-w' not in sys.argv
matplotlib.use('Agg') if batchmode else None
from matplotlib.pyplot import figure, show, rc, grid
import plotapp
import pymongo
import numpy as np

import math

def invp(x): return 100*(1-x)

db = pymongo.Connection().crystal
summaries = db.summary.find(sort=[('angle',1)])
t = ((x['e3x3']['mean'],x['angle']) for x in summaries)
fig, ax = plotapp.radplot(t=t,label='3x3',title='Mean Energy Deposited(MeV)',subplot=131,width=21, height=7)#,rtrans=invp)
summaries = db.summary.find(sort=[('angle',1)])
t = ((x['e5x5']['mean'],x['angle']) for x in summaries)
plotapp.radplot(t=t,fig=fig,ax=ax,color='red',label='5x5')
summaries = db.summary.find(sort=[('angle',1)])
t = ((x['dedx']['mean'],x['angle']) for x in summaries)
plotapp.radplot(t=t,fig=fig,ax=ax,color='blue',label='all',legendloc='lower right')#,rtrans=invp)

summaries = db.summary.find(sort=[('angle',1)])
t = ((x['e3x3']['sd'],x['angle']) for x in summaries)
fig, ax = plotapp.radplot(t=t,fig=fig,label='3x3',title='RMS Energy Deposited(MeV)',subplot=132)#,rtrans=invp)
summaries = db.summary.find(sort=[('angle',1)])
t = ((x['e5x5']['sd'],x['angle']) for x in summaries)
plotapp.radplot(t=t,fig=fig,ax=ax,color='red',label='5x5')
summaries = db.summary.find(sort=[('angle',1)])
t = ((x['dedx']['sd'],x['angle']) for x in summaries)
import plotapp
import pymongo
import numpy as np

import math


def invp(x):
    return 100 * (1 - x)


db = pymongo.Connection().crystal

summaries = db.summary.find(sort=[("angle", 1)])
t = ((x["x3x3"]["mean"], x["angle"]) for x in summaries)
fig, ax = plotapp.radplot(t=t, label="x 3x3 linear", title="Mean Shift(cm)", subplot=121, width=14, height=7)
summaries = db.summary.find(sort=[("angle", 1)])
t = ((x["y3x3"]["mean"], x["angle"]) for x in summaries)
plotapp.radplot(t=t, fig=fig, ax=ax, label="y 3x3 linear", ls="--")
summaries = db.summary.find(sort=[("angle", 1)])
t = ((x["r3x3"]["mean"], x["angle"]) for x in summaries)
plotapp.radplot(t=t, fig=fig, ax=ax, label="r 3x3 linear", legendloc="lower right", ls="-.")

summaries = db.summary.find(sort=[("angle", 1)])
t = ((x["x5x5"]["mean"], x["angle"]) for x in summaries)
plotapp.radplot(t=t, fig=fig, ax=ax, label="x 5x5 linear", color="red")
summaries = db.summary.find(sort=[("angle", 1)])
t = ((x["y5x5"]["mean"], x["angle"]) for x in summaries)
plotapp.radplot(t=t, fig=fig, ax=ax, label="y 5x5 linear", ls="--", color="red")
summaries = db.summary.find(sort=[("angle", 1)])
t = ((x["r5x5"]["mean"], x["angle"]) for x in summaries)
示例#3
0
import sys
import matplotlib
batchmode = '-w' not in sys.argv
matplotlib.use('Agg') if batchmode else None
from matplotlib.pyplot import figure, show, rc, grid
import plotapp
import pymongo
import numpy as np

import math

def invp(x): return 100*(1-x)

db = pymongo.Connection().crystal
summaries = db.summary.find()
t = ((x['x3x3']['mean'],x['angle']) for x in summaries)
fig, ax = plotapp.radplot(t=t,write=False,display=False,label='xres')#,rtrans=invp)
summaries = db.summary.find()
t = ((x['y3x3']['mean'],x['angle']) for x in summaries)
plotapp.radplot(t=t,fig=fig,ax=ax,write=False,display=False,color='red',label='yres')#,rtrans=invp)
summaries = db.summary.find()
t = ((x['r3x3']['mean'],x['angle']) for x in summaries)
plotapp.radplot(t=t,fig=fig,ax=ax,color='blue',label='rres')#,rtrans=invp)