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

STAMP Descartes Presentation
STAMP Descartes PresentationSTAMP Descartes Presentation
STAMP Descartes PresentationSTAMP Project
 
data-microscopes
data-microscopesdata-microscopes
data-microscopesStephen Tu
 
Automated hardware testing using python
Automated hardware testing using pythonAutomated hardware testing using python
Automated hardware testing using pythonYuvaraja Ravi
 
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 Prioritizationbrenoafmiranda
 
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 TrackSebastiano Panichella
 
Test Driven Development With Python
Test Driven Development With PythonTest Driven Development With Python
Test Driven Development With PythonSiddhi
 
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 NowcastingAndreas Scheidegger
 
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
 
Functional Reactive Programming on Android
Functional Reactive Programming on AndroidFunctional Reactive Programming on Android
Functional Reactive Programming on AndroidSam Lee
 
Boetticher Presentation Promise 2008v2
Boetticher Presentation Promise 2008v2Boetticher Presentation Promise 2008v2
Boetticher Presentation Promise 2008v2gregoryg
 
Automated Program Repair Keynote talk
Automated Program Repair Keynote talkAutomated Program Repair Keynote talk
Automated Program Repair Keynote talkAbhik Roychoudhury
 
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 CodeIan Robertson
 

Ä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

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?Gergely Imreh
 
Introduction to Open Source Hardware
Introduction to Open Source HardwareIntroduction to Open Source Hardware
Introduction to Open Source HardwareGergely Imreh
 
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 translationGergely Imreh
 
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 HackerspaceGergely Imreh
 
PCIeDuino328 Schematic v1
PCIeDuino328 Schematic v1PCIeDuino328 Schematic v1
PCIeDuino328 Schematic v1Gergely Imreh
 
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 GuideGergely Imreh
 
ICT-104 bill acceptor protocol
ICT-104 bill acceptor protocolICT-104 bill acceptor protocol
ICT-104 bill acceptor protocolGergely Imreh
 
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 TaiwanGergely Imreh
 
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 QuickGergely Imreh
 
Future Shorts Taipei intro
Future Shorts Taipei introFuture Shorts Taipei intro
Future Shorts Taipei introGergely 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

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 2024The Digital Insurer
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FMESafe Software
 
Spring Boot vs Quarkus the ultimate battle - DevoxxUK
Spring Boot vs Quarkus the ultimate battle - DevoxxUKSpring Boot vs Quarkus the ultimate battle - DevoxxUK
Spring Boot vs Quarkus the ultimate battle - DevoxxUKJago de Vreede
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native ApplicationsWSO2
 
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamDEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamUiPathCommunity
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Victor Rentea
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobeapidays
 
Exploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusExploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusZilliz
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProduct Anonymous
 
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfRising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfOrbitshub
 
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...apidays
 
[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdfSandro Moreira
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Victor Rentea
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MIND CTI
 
Cyberprint. Dark Pink Apt Group [EN].pdf
Cyberprint. Dark Pink Apt Group [EN].pdfCyberprint. Dark Pink Apt Group [EN].pdf
Cyberprint. Dark Pink Apt Group [EN].pdfOverkill Security
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
Ransomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdfRansomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdfOverkill Security
 
Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024The Digital Insurer
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWERMadyBayot
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Jeffrey Haguewood
 

Kürzlich hochgeladen (20)

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
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Spring Boot vs Quarkus the ultimate battle - DevoxxUK
Spring Boot vs Quarkus the ultimate battle - DevoxxUKSpring Boot vs Quarkus the ultimate battle - DevoxxUK
Spring Boot vs Quarkus the ultimate battle - DevoxxUK
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
 
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamDEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
Exploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusExploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with Milvus
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfRising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
 
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
 
[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
Cyberprint. Dark Pink Apt Group [EN].pdf
Cyberprint. Dark Pink Apt Group [EN].pdfCyberprint. Dark Pink Apt Group [EN].pdf
Cyberprint. Dark Pink Apt Group [EN].pdf
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Ransomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdfRansomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdf
 
Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
 

Python in a physics lab