A Crash Course in Neutron Scattering Beam Optics Sample n Detectors A “canonical” experimental recipe (scanning): while not done: exp_parameters_set( λ ;T,P,B) accumulate_statistics(t,N) O A K R IDG E N ATIONA L L ABORATORY U . S . D EPART M ENT O F E NERG Y
Thermoelectric materials refrigeration power space probes Cooled surface Cool side capture “waste heat” O.Delaire, J. Ma, K. Marty, A. May, M. McGuire, M.-H. Du, D. Singh, A. Podlesnyak, G. Ehlers, M. Lumsden, and B. Sales, Nature Materials, 2011, doi:10.1038/nmat3035 O A K R IDG E N ATIONA L L ABORATORY U . S . D EPART M ENT O F E NERG Y
Spallation Neutron Source O A K R IDG E N ATIONA L L ABORATORY U . S . D EPART M ENT O F E NERG Y
SNS Instruments O A K R IDG E N ATIONA L L ABORATORY U . S . D EPART M ENT O F E NERG Y
SNS Data Acquisition SNS Data Acquisition System System Timing Real Time Control & Events Slow Controls O A K R IDG E N ATIONA L L ABORATORY U . S . D EPART M ENT O F E NERG Y
Communication Communication Overview Overview Python for Data Acquisition System = PyDas Sample Control Motors Environment DcomClient Control … Computer Control Application Application Sample Satellite Motors Data Environment Satellite … Computers Preprocessor Satellite Application Application Sample Hardware Detector Motors … Environment Electronics Hardware O A K R IDG E N ATIONA L L ABORATORY U . S . D EPART M ENT O F E NERG Y
What do the scientists want? O A K R IDG E N ATIONA L L ABORATORY U . S . D EPART M ENT O F E NERG Y
What do the scientists want? O A K R IDG E N ATIONA L L ABORATORY U . S . D EPART M ENT O F E NERG Y
PyDas PyDas Architecture Architecture PyDas Main Application IPyDas shell PyDas GUI Device Abstraction Experiment Abstraction: pydas.devices pydas.scan, pydas.lib GUI Widgets REST Client: Core Packages: pydas.core pydas.web Memory Maps Win32 API ipython, numpy, GUI Base: dasmapcq, memmap (PyWin32) scipy, matplotlib wxPython O A K R IDG E N ATIONA L L ABORATORY U . S . D EPART M ENT O F E NERG Y
PyDas PyDas GUI Example: Sca GUI Example: Scanning nning O A K R IDG E N ATIONA L L ABORATORY U . S . D EPART M ENT O F E NERG Y
PyDas GUI Example: Status Page O A K R IDG E N ATIONA L L ABORATORY U . S . D EPART M ENT O F E NERG Y SciPy Conference 7/14/2011
PyDas PyDas Shell (IPyDas) Shell (IPyDas) O A K R IDG E N ATIONA L L ABORATORY U . S . D EPART M ENT O F E NERG Y
Examples: Examples: Scanning Scanning in in IPyDas IPyDas s = scan( ‘Motor1' , arange(10.0,90.0,0.5), runtime=30.0, plot= 'counts' ) s.fit('gauss+poly2') for SampleTemp.value in [273.0,293.0,303.0,323.0]: scan( 'Energy' , [25.,35.,50], pcharge=3e12, title= 'Nobel Prize Data at T=%s K‘ % SampleTemp.value) O A K R IDG E N ATIONA L L ABORATORY U . S . D EPART M ENT O F E NERG Y
Efficient Beam Time Usage while while not done: not done: exp_parameters_set( λ ;T,P,B) exp_parameters_set ;T,P,B) accumulate_statistics accumulate_statistics(t,N t,N) Beam time is expensive! 1) How to choose the parameters in the most optimal way? 2) How long to measure in each setting? O A K R IDG E N ATIONA L L ABORATORY U . S . D EPART M ENT O F E NERG Y SciPy Conference 7/14/2011
A Hypothetical Experiment O A K R IDG E N ATIONA L L ABORATORY U . S . D EPART M ENT O F E NERG Y SciPy Conference 7/14/2011
VULCAN – Engineering Diffraction O A K R IDG E N ATIONA L L ABORATORY U . S . D EPART M ENT O F E NERG Y SciPy Conference 7/14/2011
Sample Schema Strain Mapping unexpected area of interest Experiment Script crack tip O A K R IDG E N ATIONA L L ABORATORY U . S . D EPART M ENT O F E NERG Y
Instrument Control Real-time (PyDas) Event Data Experiment Uncertainty Real-time Data Optimization Evaluation Reduction (where to measure) (when to stop) O A K R IDG E N ATIONA L L ABORATORY U . S . D EPART M ENT O F E NERG Y
PyDAS REST Interface NEW Experiment (PUT) http://host/NEWEXP?EXPID=weld&XMIN=0.0&XMAX=10.0&MAXPTS=20 Current Point (GET) http://host/CURR_PT Quality of Data - are we there yet? (GET) http://host/QOD O A K R IDG E N ATIONA L L ABORATORY U . S . D EPART M ENT O F E NERG Y
Example Implementation PyDas HTTP (REST Client) REST Server StatusViewer NEUTRON DATA Instrument Optimizer Fitting Where to measure? When to stop? O A K R IDG E N ATIONA L L ABORATORY U . S . D EPART M ENT O F E NERG Y
RESTful Web Interface das = get_das() cli = DasWebClient('http://localhost:8080') qod = DasWebClient (‘http://localhost:8080/QOD’) cli.put(r'/NEWEXP?EXPID=weld&XMIN =0.0&XMAX=10.0&MAXPTS=20‘) while True: new_x w_x = = cli. cli.get get(r (r'/CUR '/CURR_PT' R_PT') if new_x is None: break das.start() das.wai s.waiton ton(qod od) das.stop() O A K R IDG E N ATIONA L L ABORATORY U . S . D EPART M ENT O F E NERG Y
the latest histogram Intensity x the latest fitting results Intensity x historical fitting results Position fitting error Peak O A K R IDG E N ATIONA L L ABORATORY i th Fitting Result U . S . D EPART M ENT O F E NERG Y
Summary & Summary & Outlook Outlook PyDas “glues” various DAS components together We’ve added and prototyped REST interface We will look into new IPython/ZMQ more closely Thanks to all engineering staff from SNS Data Acquisition Group and especially to Lloyd Clonts, Gayle Greene, Steve Hicks, Andre Parizzi, Richard Riedel, Mariano Ruiz-Rodriguez and Madhan Sundaram O A K R IDG E N ATIONA L L ABORATORY U . S . D EPART M ENT O F E NERG Y
The End. O A K R IDG E N ATIONA L L ABORATORY U . S . D EPART M ENT O F E NERG Y SciPy Conference 7/14/2011
Recommend
More recommend