SlideShare ist ein Scribd-Unternehmen logo
1 von 18
Downloaden Sie, um offline zu lesen
Lab overview
Experiment X
Verdict
Python in a physics lab
Gergely Imreh
PyCon Taiwan
May 25, 2013
Gergely Imreh Python in a physics lab
Lab overview
Experiment X
Verdict
Lab overview
Gergely Imreh Python in a physics lab
Lab overview
Experiment X
Verdict
Preparation
Talking to instruments
Interface
Analysis
Experiment X
Laundry list of an experiment
Planning and theory
Instrument control
Interface
Analysis and archiving
Gergely Imreh Python in a physics lab
Lab overview
Experiment X
Verdict
Preparation
Talking to instruments
Interface
Analysis
Theory
Tools of theory:
Gergely Imreh Python in a physics lab
Lab overview
Experiment X
Verdict
Preparation
Talking to instruments
Interface
Analysis
RS-232 Serial
import serial
instrument = serial.Serial("/dev/ttyUSB0",
baudrate=19200,
timeout=1)
instrument.write(cmd)
Gergely Imreh Python in a physics lab
Lab overview
Experiment X
Verdict
Preparation
Talking to instruments
Interface
Analysis
Gergely Imreh Python in a physics lab
Lab overview
Experiment X
Verdict
Preparation
Talking to instruments
Interface
Analysis
GPIB: General Purpose Interface Bus
import visa
oscilloscope = visa.instrument("GPIB::12")
oscilloscope.write("*IDN?")
print oscilloscope.read()
Gergely Imreh Python in a physics lab
Lab overview
Experiment X
Verdict
Preparation
Talking to instruments
Interface
Analysis
Gergely Imreh Python in a physics lab
Lab overview
Experiment X
Verdict
Preparation
Talking to instruments
Interface
Analysis
FireWire IEEE-1394
import pydc1394
lib = 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
Lab overview
Experiment X
Verdict
Preparation
Talking to instruments
Interface
Analysis
ctypes
import ctypes
my_dll = ctypes.windll.dll_name
receive_data = my_dll.ReceiveData
receive_data.restype = ctypes.c_long
print receive_data()
Gergely Imreh Python in a physics lab
Lab overview
Experiment X
Verdict
Preparation
Talking to instruments
Interface
Analysis
USB Test and Measurement Class
import os
file = os.open(device, os.O_RDWR)
os.write(file, command)
Gergely Imreh Python in a physics lab
Lab overview
Experiment X
Verdict
Preparation
Talking to instruments
Interface
Analysis
PyMCU - Python controller microcontroller unit
import pymcu
board = pymcu.mcuModule()
board.pinHigh(1)
board.pausems(500)
board.pinLow(1)
board.pausems(500)
Gergely Imreh Python in a physics lab
Lab overview
Experiment X
Verdict
Preparation
Talking to instruments
Interface
Analysis
Interface
Tools of control
Gergely Imreh Python in a physics lab
Lab overview
Experiment X
Verdict
Preparation
Talking to instruments
Interface
Analysis
Analysis
Tools of analysis:
Gergely Imreh Python in a physics lab
Lab overview
Experiment X
Verdict
Preparation
Talking to instruments
Interface
Analysis
Matplotlib aka. pylab
import pylab
import numpy
data = numpy.loadtxt(’data.csv’)
pylab.plot(data[:, 0], data[:, 1])
pylab.show()
Gergely Imreh Python in a physics lab
Lab overview
Experiment X
Verdict
Competitors
Gergely Imreh Python in a physics lab
Lab overview
Experiment X
Verdict
Balance
Gergely Imreh Python in a physics lab
Lab overview
Experiment X
Verdict
imrehg@gmail.com
https://gergely.imreh.net
Gergely Imreh Python in a physics lab

Weitere ähnliche Inhalte

Ähnlich wie Python in a physics lab

Python-nose: A unittest-based testing framework for Python that makes writing...
Python-nose: A unittest-based testing framework for Python that makes writing...Python-nose: A unittest-based testing framework for Python that makes writing...
Python-nose: A unittest-based testing framework for Python that makes writing...
Timo Stollenwerk
 

Ähnlich wie Python in a physics lab (13)

STAMP Descartes Presentation
STAMP Descartes PresentationSTAMP Descartes Presentation
STAMP Descartes Presentation
 
data-microscopes
data-microscopesdata-microscopes
data-microscopes
 
Automated hardware testing using python
Automated hardware testing using pythonAutomated hardware testing using python
Automated hardware testing using python
 
FAST Approaches to Scalable Similarity-based Test Case Prioritization
FAST Approaches to Scalable Similarity-based Test Case PrioritizationFAST Approaches to Scalable Similarity-based Test Case Prioritization
FAST Approaches to Scalable Similarity-based Test Case Prioritization
 
SBFT Tool Competition 2024 -- Python Test Case Generation Track
SBFT Tool Competition 2024 -- Python Test Case Generation TrackSBFT Tool Competition 2024 -- Python Test Case Generation Track
SBFT Tool Competition 2024 -- Python Test Case Generation Track
 
Labview final
Labview finalLabview final
Labview final
 
Test Driven Development With Python
Test Driven Development With PythonTest Driven Development With Python
Test Driven Development With Python
 
Recurrent Neuronal Network tailored for Weather Radar Nowcasting
Recurrent Neuronal Network tailored for Weather Radar NowcastingRecurrent Neuronal Network tailored for Weather Radar Nowcasting
Recurrent Neuronal Network tailored for Weather Radar Nowcasting
 
Python-nose: A unittest-based testing framework for Python that makes writing...
Python-nose: A unittest-based testing framework for Python that makes writing...Python-nose: A unittest-based testing framework for Python that makes writing...
Python-nose: A unittest-based testing framework for Python that makes writing...
 
Functional Reactive Programming on Android
Functional Reactive Programming on AndroidFunctional Reactive Programming on Android
Functional Reactive Programming on Android
 
Boetticher Presentation Promise 2008v2
Boetticher Presentation Promise 2008v2Boetticher Presentation Promise 2008v2
Boetticher Presentation Promise 2008v2
 
Automated Program Repair Keynote talk
Automated Program Repair Keynote talkAutomated Program Repair Keynote talk
Automated Program Repair Keynote talk
 
Lambda Chops - Recipes for Simpler, More Expressive Code
Lambda Chops - Recipes for Simpler, More Expressive CodeLambda Chops - Recipes for Simpler, More Expressive Code
Lambda Chops - Recipes for Simpler, More Expressive Code
 

Mehr von Gergely Imreh

Future Shorts Taipei intro
Future Shorts Taipei introFuture Shorts Taipei intro
Future Shorts Taipei intro
Gergely Imreh
 

Mehr von Gergely Imreh (10)

Do you really want to be this cheap?
Do you really want to be this cheap?Do you really want to be this cheap?
Do you really want to be this cheap?
 
Introduction to Open Source Hardware
Introduction to Open Source HardwareIntroduction to Open Source Hardware
Introduction to Open Source Hardware
 
Taiwan's Habeas Corpus Act, English translation
Taiwan's Habeas Corpus Act, English translationTaiwan's Habeas Corpus Act, English translation
Taiwan's Habeas Corpus Act, English translation
 
Innovation through an open social platform: The case of the Taipei Hackerspace
Innovation through an open social platform: The case of the Taipei HackerspaceInnovation through an open social platform: The case of the Taipei Hackerspace
Innovation through an open social platform: The case of the Taipei Hackerspace
 
PCIeDuino328 Schematic v1
PCIeDuino328 Schematic v1PCIeDuino328 Schematic v1
PCIeDuino328 Schematic v1
 
VIA VAB-600 Springboard Linux BSP Development Guide
VIA VAB-600 Springboard Linux BSP Development GuideVIA VAB-600 Springboard Linux BSP Development Guide
VIA VAB-600 Springboard Linux BSP Development Guide
 
ICT-104 bill acceptor protocol
ICT-104 bill acceptor protocolICT-104 bill acceptor protocol
ICT-104 bill acceptor protocol
 
Hackerspaces from around the world to Taiwan
Hackerspaces from around the world to TaiwanHackerspaces from around the world to Taiwan
Hackerspaces from around the world to Taiwan
 
Gergely Imreh: Enlighten Us But Make It Quick
Gergely Imreh: Enlighten Us But Make It QuickGergely Imreh: Enlighten Us But Make It Quick
Gergely Imreh: Enlighten Us But Make It Quick
 
Future Shorts Taipei intro
Future Shorts Taipei introFuture Shorts Taipei intro
Future Shorts Taipei intro
 

Kürzlich hochgeladen

Kürzlich hochgeladen (20)

Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor Presentation
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectors
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challenges
 
Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptx
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu SubbuApidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
 

Python in a physics lab