from scan_credentials import conn sdb = scandb.ScanDB(**conn) def asciikeys(adict): """ensure a dictionary has ASCII keys (and so can be an **kwargs)""" return dict((k.encode('ascii'), v) for k, v in adict.items()) def list_scans(stype='slew'): cls, table = sdb.get_table('scandefs') all = table.select(whereclause="type='%s'" % stype).execute().fetchall() for s in all: print(s.name) larchserver = LarchScanDBServer(sdb, fileroot='/cars5/Data/xas_user') larchserver.load_macros() # list_scans('linear') # scan = sdb.make_scan('line1', larch=larchserver.larch) scan = sdb.make_scan('bmap', larch=larchserver.larch) # print("Scan:: ", scan, scan.scantype, scan.detmode) #, scan.dimension) ## print("======================================") # scan = sdb.make_scan('Fe_QXAFS') # print("Scan:: ", scan, scan.scantype, scan.detmode) #, scan.dimension)
sdb = scandb.ScanDB(**conn) def asciikeys(adict): """ensure a dictionary has ASCII keys (and so can be an **kwargs)""" return dict((k.encode('ascii'), v) for k, v in adict.items()) def list_scans(stype='slew'): cls, table = sdb.get_table('scandefs') all = table.select(whereclause="type='%s'" % stype).execute().fetchall() for s in all: print(s.name) larchserver = LarchScanDBServer(sdb, fileroot='/cars5/Data/xas_user') larchserver.load_macros() # list_scans('linear') # scan = sdb.make_scan('line1', larch=larchserver.larch) scan = sdb.make_scan('bmap', larch=larchserver.larch) # print("Scan:: ", scan, scan.scantype, scan.detmode) #, scan.dimension) ## print("======================================") # scan = sdb.make_scan('Fe_QXAFS') # print("Scan:: ", scan, scan.scantype, scan.detmode) #, scan.dimension) # print 'Mode = ', scan.detmode
from lib import scandb # from lib.station_config import StationConfig # from lib.server import run_scan # from lib.detectors import get_detector from lib.larch_interface import LarchScanDBServer import epics p = epics.PV('13IDE:SIS1:mca1') print p.get() import json from scan_credentials import conn sdb = scandb.ScanDB(**conn) _larch = LarchScanDBServer(sdb) _larch.load_plugins() _larch.load_modules() scandef = sdb.get_scandef('testmap') print scandef