def querypoints(axis, label, hostname):
    tem = leginondata.InstrumentData(hostname=hostname)
    sm = leginondata.StageMeasurementData(label=label, axis=axis, tem=tem)
    points = sm.query()
    xy = []
    for point in points:
        x = point[axis]
        y = math.hypot(point['imagex'], point['imagey']) / abs(point['delta'])
        xy.append((x, y))
    return xy
Ejemplo n.º 2
0
	def writeData(self, label, ht, mag, axis, gonx, gony, delta, imx, imy):
		stagedata = leginondata.StageMeasurementData()
		stagedata['label'] = label
		stagedata['magnification'] = mag
		stagedata['axis'] = axis
		stagedata['high tension'] = ht
		stagedata['x'] = gonx
		stagedata['y'] = gony
		stagedata['delta'] = delta
		stagedata['imagex'] = imx
		stagedata['imagey'] = imy
		stagedata['tem'] = self.instrument.getTEMData()
		stagedata['ccdcamera'] = self.instrument.getCCDCameraData()
		self.publish(stagedata, database=True, dbforce=True)
#!/usr/bin/env python

from leginon import leginondata
import sys

label = sys.argv[1]
db = leginondata.db

sm = leginondata.StageMeasurementData(label=label, axis='x')
points = db.query(sm)
for point in points:
    print '%(label)s        %(magnification)s       %(axis)s        %(x)s   %(y)s   %(delta)s       %(imagex)s      %(imagey)s' % point