Lab overviewExperiment XVerdictPython in a physics labGergely ImrehPyCon TaiwanMay 25, 2013Gergely Imreh Python in a physi...
Lab overviewExperiment XVerdictLab overviewGergely Imreh Python in a physics lab
Lab overviewExperiment XVerdictPreparationTalking to instrumentsInterfaceAnalysisExperiment XLaundry list of an experiment...
Lab overviewExperiment XVerdictPreparationTalking to instrumentsInterfaceAnalysisTheoryTools of theory:Gergely Imreh Pytho...
Lab overviewExperiment XVerdictPreparationTalking to instrumentsInterfaceAnalysisRS-232 Serialimport serialinstrument = se...
Lab overviewExperiment XVerdictPreparationTalking to instrumentsInterfaceAnalysisGergely Imreh Python in a physics lab
Lab overviewExperiment XVerdictPreparationTalking to instrumentsInterfaceAnalysisGPIB: General Purpose Interface Busimport...
Lab overviewExperiment XVerdictPreparationTalking to instrumentsInterfaceAnalysisGergely Imreh Python in a physics lab
Lab overviewExperiment XVerdictPreparationTalking to instrumentsInterfaceAnalysisFireWire IEEE-1394import pydc1394lib = py...
Lab overviewExperiment XVerdictPreparationTalking to instrumentsInterfaceAnalysisctypesimport ctypesmy_dll = ctypes.windll...
Lab overviewExperiment XVerdictPreparationTalking to instrumentsInterfaceAnalysisUSB Test and Measurement Classimport osfi...
Lab overviewExperiment XVerdictPreparationTalking to instrumentsInterfaceAnalysisPyMCU - Python controller microcontroller...
Lab overviewExperiment XVerdictPreparationTalking to instrumentsInterfaceAnalysisInterfaceTools of controlGergely Imreh Py...
Lab overviewExperiment XVerdictPreparationTalking to instrumentsInterfaceAnalysisAnalysisTools of analysis:Gergely Imreh P...
Lab overviewExperiment XVerdictPreparationTalking to instrumentsInterfaceAnalysisMatplotlib aka. pylabimport pylabimport n...
Lab overviewExperiment XVerdictCompetitorsGergely Imreh Python in a physics lab
Lab overviewExperiment XVerdictBalanceGergely Imreh Python in a physics lab
Lab overviewExperiment XVerdictimrehg@gmail.comhttps://gergely.imreh.netGergely Imreh Python in a physics lab
Upcoming SlideShare
Loading in …5
×

Python in a physics lab

1,285 views

Published on

Talk at PyCon Taiwan 2013.

The basic premise: Python is uniquely suited to run a physics lab end-to-end.

Published in: Technology, Education
0 Comments
1 Like
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total views
1,285
On SlideShare
0
From Embeds
0
Number of Embeds
2
Actions
Shares
0
Downloads
17
Comments
0
Likes
1
Embeds 0
No embeds

No notes for slide

Python in a physics lab

  1. 1. Lab overviewExperiment XVerdictPython in a physics labGergely ImrehPyCon TaiwanMay 25, 2013Gergely Imreh Python in a physics lab
  2. 2. Lab overviewExperiment XVerdictLab overviewGergely Imreh Python in a physics lab
  3. 3. Lab overviewExperiment XVerdictPreparationTalking to instrumentsInterfaceAnalysisExperiment XLaundry list of an experimentPlanning and theoryInstrument controlInterfaceAnalysis and archivingGergely Imreh Python in a physics lab
  4. 4. Lab overviewExperiment XVerdictPreparationTalking to instrumentsInterfaceAnalysisTheoryTools of theory:Gergely Imreh Python in a physics lab
  5. 5. Lab overviewExperiment XVerdictPreparationTalking to instrumentsInterfaceAnalysisRS-232 Serialimport serialinstrument = serial.Serial("/dev/ttyUSB0",baudrate=19200,timeout=1)instrument.write(cmd)Gergely Imreh Python in a physics lab
  6. 6. Lab overviewExperiment XVerdictPreparationTalking to instrumentsInterfaceAnalysisGergely Imreh Python in a physics lab
  7. 7. Lab overviewExperiment XVerdictPreparationTalking to instrumentsInterfaceAnalysisGPIB: General Purpose Interface Busimport visaoscilloscope = visa.instrument("GPIB::12")oscilloscope.write("*IDN?")print oscilloscope.read()Gergely Imreh Python in a physics lab
  8. 8. Lab overviewExperiment XVerdictPreparationTalking to instrumentsInterfaceAnalysisGergely Imreh Python in a physics lab
  9. 9. Lab overviewExperiment XVerdictPreparationTalking to instrumentsInterfaceAnalysisFireWire IEEE-1394import pydc1394lib = pydc1394.DC1394Library()cams = l.enumerate_cameras()cam0 = fw.Camera(l, cams[0][’guid’], isospeed=800)image = numpy.array(cam0.current_image, dtype=’f’)Gergely Imreh Python in a physics lab
  10. 10. Lab overviewExperiment XVerdictPreparationTalking to instrumentsInterfaceAnalysisctypesimport ctypesmy_dll = ctypes.windll.dll_namereceive_data = my_dll.ReceiveDatareceive_data.restype = ctypes.c_longprint receive_data()Gergely Imreh Python in a physics lab
  11. 11. Lab overviewExperiment XVerdictPreparationTalking to instrumentsInterfaceAnalysisUSB Test and Measurement Classimport osfile = os.open(device, os.O_RDWR)os.write(file, command)Gergely Imreh Python in a physics lab
  12. 12. Lab overviewExperiment XVerdictPreparationTalking to instrumentsInterfaceAnalysisPyMCU - Python controller microcontroller unitimport pymcuboard = pymcu.mcuModule()board.pinHigh(1)board.pausems(500)board.pinLow(1)board.pausems(500)Gergely Imreh Python in a physics lab
  13. 13. Lab overviewExperiment XVerdictPreparationTalking to instrumentsInterfaceAnalysisInterfaceTools of controlGergely Imreh Python in a physics lab
  14. 14. Lab overviewExperiment XVerdictPreparationTalking to instrumentsInterfaceAnalysisAnalysisTools of analysis:Gergely Imreh Python in a physics lab
  15. 15. Lab overviewExperiment XVerdictPreparationTalking to instrumentsInterfaceAnalysisMatplotlib aka. pylabimport pylabimport numpydata = numpy.loadtxt(’data.csv’)pylab.plot(data[:, 0], data[:, 1])pylab.show()Gergely Imreh Python in a physics lab
  16. 16. Lab overviewExperiment XVerdictCompetitorsGergely Imreh Python in a physics lab
  17. 17. Lab overviewExperiment XVerdictBalanceGergely Imreh Python in a physics lab
  18. 18. Lab overviewExperiment XVerdictimrehg@gmail.comhttps://gergely.imreh.netGergely Imreh Python in a physics lab

×