SlideShare uma empresa Scribd logo
1 de 18
Baixar para ler offline
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

Mais conteúdo relacionado

Semelhante a 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
 

Semelhante a 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
 

Mais de 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
 

Mais de 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
 

Último

CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Servicegiselly40
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel Araújo
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
Evaluating the top large language models.pdf
Evaluating the top large language models.pdfEvaluating the top large language models.pdf
Evaluating the top large language models.pdfChristopherTHyatt
 
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...Martijn de Jong
 
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
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024The Digital Insurer
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking MenDelhi Call girls
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Scriptwesley chun
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsJoaquim Jorge
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherRemote DBA Services
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProduct Anonymous
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slidevu2urc
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
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
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)wesley chun
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonAnna Loughnan Colquhoun
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘RTylerCroy
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfEnterprise Knowledge
 

Último (20)

CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
Evaluating the top large language models.pdf
Evaluating the top large language models.pdfEvaluating the top large language models.pdf
Evaluating the top large language models.pdf
 
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...
 
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
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
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
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 

Python in a physics lab