Big Python

76
Big Python Andreas Schreiber <[email protected]> Python Unconference Hamburg, 29.11.2014 > Python Unconference Hamburg 2014 > Andreas Schreiber Big Python > 29.11.2014 DLR.de Folie 1

description

Keynote Python Unconference Hamburg 2014

Transcript of Big Python

Page 1: Big Python

Big Python

Andreas Schreiber <[email protected]>

Python Unconference Hamburg, 29.11.2014

> Python Unconference Hamburg 2014 > Andreas Schreiber • Big Python > 29.11.2014 DLR.de • Folie 1

Page 2: Big Python

Vorstellung

DLR.de • Folie 2 > Python Unconference Hamburg 2014 > Andreas Schreiber • Big Python > 29.11.2014

Wissenschaftler, Abteilungsleiter

Co-Gründer, Geschäftsführer

Communities

Page 3: Big Python

DLR.de • Folie 3 > Python Unconference Hamburg 2014 > Andreas Schreiber • Big Python > 29.11.2014

Bild: Mariluna, CC BY-SA 3.0

Page 4: Big Python

Big Number of Devices

•  Internet of Things •  Smartphones

Big Computers

•  High Performance Computing

Big Applications

•  „Killer“-Applikationen in Wissenschaft und Technologie

> Python Unconference Hamburg 2014 > Andreas Schreiber • Big Python > 29.11.2014 DLR.de • Folie 4

Big Python Themen

Page 5: Big Python

Big Number of Devices

•  Internet of Things

•  Smartphones

> Python Unconference Hamburg 2014 > Andreas Schreiber • Big Python > 29.11.2014 DLR.de • Folie 5

Page 6: Big Python

Milliarden an Geräten, Sensoren und Chips

•  Verbundene physikalische Objekte (oder deren virtuelle Repräsentation)

•  Verbunden über das Internet •  Eindeutig identifiziert •  Sie interagieren miteinander

> Python Unconference Hamburg 2014 > Andreas Schreiber • Big Python > 29.11.2014 DLR.de • Folie 6

Internet der Dinge Internet of Things

Page 7: Big Python

Die „Dinge“ sind

•  Embedded Systeme •  Sensoren •  Aktuatoren

In unseren Lebenswelten

•  Smart Home •  Connected Car • Wearables • …

> Python Unconference Hamburg 2014 > Andreas Schreiber • Big Python > 29.11.2014 DLR.de • Folie 7

Geräte im Internet der Dinge

Page 8: Big Python

Die Anzahl der mit Internet verbundenen Geräte steigt täglich

50.000.000.000 „Dinge“ bis 2020

> Python Unconference Hamburg 2014 > Andreas Schreiber • Big Python > 29.11.2014 DLR.de • Folie 8

Wie groß ist „Big“? Wachstum

Page 9: Big Python

Kommunikation

DLR.de • Folie 9 > Python Unconference Hamburg 2014 > Andreas Schreiber • Big Python > 29.11.2014

Internet der Dinge

Kommunikations- infrastruktur

Page 10: Big Python

MQ Telemetry Transport

• Machine-to-machine (M2M) connectivity protocol

•  Publish/Subscribe-Messaging

•  Rechnet mit unzuverlässigen Netzwerken mit geringer Bandbreite und hoher Latenzzeit

•  Rechnet mit Clients mit geringer Rechenleistung

•  Erlaubt hohen Quality-of-Service, falls das Netzwerk es erlaubt

•  Einfach zu implementieren

> Python Unconference Hamburg 2014 > Andreas Schreiber • Big Python > 29.11.2014 DLR.de • Folie 10

Ein Kommunikationsprotokoll MQTT

Page 11: Big Python

MQTT Broker

DLR.de • Folie 11 > Python Unconference Hamburg 2014 > Andreas Schreiber • Big Python > 29.11.2014

MQTT Broker

MQTT Broker

Client

Client

Client

Client

publish

subscribe

topic/subtopic

(optional) Bridge

Client

Page 12: Big Python

Messages in MQTT werden auf „Topics“ veröffentlicht

•  Keine Konfiguration notwendig, einfach auf dem Topic veröffentlichen

•  Topics sind hierarchisch mit „/“ als Trenner

> Python Unconference Hamburg 2014 > Andreas Schreiber • Big Python > 29.11.2014 DLR.de • Folie 12

MQTT Topics

my/home/temperature/kitchen my/home/temperature/livingroom my/server/temperature

Page 13: Big Python

MQTT Implementierungen

DLR.de • Folie 13 > Python Unconference Hamburg 2014 > Andreas Schreiber • Big Python > 29.11.2014

Server/Broker

•  IBM Websphere MQ •  RSMB •  Eclipse Paho • MQTT.js •  Apache ActiveMQ •  RabittMQ •  HiveMQ

Bibliotheken für

•  C/C++ •  Java •  Python •  Perl •  PHP •  Ruby • …

http://mqtt.org/wiki/software

Page 14: Big Python

Python Client-Modul

•  Eine einzelne Datei, reine Python-Implementierung •  Veröffentlichen und Empfangen von Messages •  Callbacks

•  Connect •  Disconnect •  Publish • Message •  Subscribe

> Python Unconference Hamburg 2014 > Andreas Schreiber • Big Python > 29.11.2014 DLR.de • Folie 14

MQTT mit Python Eclipse Paho

https://eclipse.org/paho

Page 15: Big Python

> Python Unconference Hamburg 2014 > Andreas Schreiber • Big Python > 29.11.2014 DLR.de • Folie 15

MQTT mit Python Subscribe

import paho.mqtt.client as mqtt def on_message(mosq, obj, msg): print(msg.topic + ' ' + str(msg.payload)) mqtt_client = mqtt.Client() mqtt_client.on_message = on_message mqtt_client.connect('test.mosquitto.org') mqtt_client.subscribe(‘#', 0) # all topics return_code = 0 while return_code == 0: return_code = mqtt_client.loop()

Page 16: Big Python

> Python Unconference Hamburg 2014 > Andreas Schreiber • Big Python > 29.11.2014 DLR.de • Folie 16

MQTT mit Python Publish

import paho.mqtt.client as mqtt mqtt_client = mqtt.Client() mqtt_client.connect('test.mosquitto.org') mqtt_client.publish('python/demo', 'hello world', 1)

Page 17: Big Python

MQTT Anwendungsbeispiel Heimautomatisierung mit Raspberry Pi

DLR.de • Folie 17 > Python Unconference Hamburg 2014 > Andreas Schreiber • Big Python > 29.11.2014

Messdaten mit Sensoren via 1-Wire

•  1-Wire: Einkabel-Bussystem, niedrige Geschwindigkeit

•  Sensoren für Temperatur, Spannung, Licht, Feuchtigkeit, …

Eclipse Paho auf Raspberry Pi installieren

•  apt-get install mosquitto

Messwerte von 1-Wire-Sensoren

• Mehrere Lösungen für Python

Page 18: Big Python

Temperatur veröffentlichen OWFS: One Wire File System

DLR.de • Folie 18 > Python Unconference Hamburg 2014 > Andreas Schreiber • Big Python > 29.11.2014

import time import os import paho.mqtt.client as mqtt file_name = os.path.join('/', 'mnt', '1wire', '10.67C6697351FF', 'temperature') mqtt_client = mqtt.Client('home-temperature') mqtt_client.connect('test.mosquitto.org') while 1: file_object = open(file_name, 'r') temperature = '%sC' % file_object.read() mqtt_client.publish('home/demo/temperature', temperature, 1) mqtt_client.loop() time.sleep(5) file_object.close()

Page 19: Big Python

Relayr WunderBar

•  IoT Starter Kit •  Verschiedene Sensoren • WiFi und Bluetooth LE •  SDKs und APIs

•  Android •  iOS/OSX •  Python • Web/Javascript

> Python Unconference Hamburg 2014 > Andreas Schreiber • Big Python > 29.11.2014 DLR.de • Folie 19

Hardware für das Internet der Dinge WunderBar

https://relayr.io Bild: relayr.io

Page 20: Big Python

WunderBar Hardware

DLR.de • Folie 20 > Python Unconference Hamburg 2014 > Andreas Schreiber • Big Python > 29.11.2014

Bild: relayr.io

Page 21: Big Python

WunderBar Cloud Service und Web-Oberfläche

DLR.de • Folie 21 > Python Unconference Hamburg 2014 > Andreas Schreiber • Big Python > 29.11.2014

Page 22: Big Python

> Python Unconference Hamburg 2014 > Andreas Schreiber • Big Python > 29.11.2014 DLR.de • Folie 22

WunderBar Python SDK

from relayr import Client client = Client(token='XXX') device = client.get_device(id='XXX') device.switch_led_on(True)

Page 23: Big Python

> Python Unconference Hamburg 2014 > Andreas Schreiber • Big Python > 29.11.2014 DLR.de • Folie 23

WunderBar Python SDK

import time from relayr import Client def callback(message, channel): print(repr(message), type(message)) client = Client(token='<XXX>') device = client.get_device(id='<XXX>').get_info() user = client.get_user() conn = user.connect_device(device, callback) conn.start() time.sleep(10) conn.stop()

Page 24: Big Python

DLR.de • Folie 24 > Python Unconference Hamburg 2014 > Andreas Schreiber • Big Python > 29.11.2014

Verbreitete Devices Smartphones

Page 25: Big Python

Wie groß ist „Big“? Weltweit verkaufte Smartphones

DLR.de • Folie 25 > Python Unconference Hamburg 2014 > Andreas Schreiber • Big Python > 29.11.2014

Quelle: http://en.wikipedia.org/wiki/Smartphone

Page 26: Big Python

Wie groß ist „Big“? Verfügbare Apps im Google Play Store

DLR.de • Folie 26 > Python Unconference Hamburg 2014 > Andreas Schreiber • Big Python > 29.11.2014

16 30 38 70

100

200 250

300

400 450

500

600

675 700

850 900

1.000

1.300

0

200

400

600

800

1000

1200

1400

Dez '09 Mär '10 Apr '10 Jul '10 Okt '10 Apr '11 Jul '11 Aug '11 Dez '11 Feb '12 Mai '12 Jun '12 Sep '12 Okt '12 Apr '13 Jul '13 Aug '13 Jul '14

Anz

ahl d

er v

erfü

gbar

en A

pps

(in 1

.000

)

Weltweit; Dezember 2009 bis Juli 2014, Quelle: statista GmbH, http://de.statista.com/statistik/daten/studie/74368/umfrage/anzahl-der-verfuegbaren-apps-im-google-play-store/

Page 27: Big Python

Sehr viele Apps…

DLR.de • Folie 27 > Python Unconference Hamburg 2014 > Andreas Schreiber • Big Python > 29.11.2014

… aber die allerwenigsten sind in Python entwickelt!

Page 28: Big Python

Frühe Technologien

•  PyS60 for Symbian •  Python CE for Windows Mobile

Aktuelle Technologien

•  Scripting Layer for Android (SL4A) •  Python for Android (Py4A) •  PySide / Qt for Android • WinRT / IronPython for Windows 8 •  Kivy…

> Python Unconference Hamburg 2014 > Andreas Schreiber • Big Python > 29.11.2014 DLR.de • Folie 28

Python auf Smartphones

Page 29: Big Python

Plattformen

•  Android •  iOS • Meego • Windows •  Linux • OS X •  Raspberry Pi

Entwicklung in Python auf allen Plattformen – keine Emulation!

> Python Unconference Hamburg 2014 > Andreas Schreiber • Big Python > 29.11.2014 DLR.de • Folie 29

Kivy Plattformübergreifendes Python-Framework

kivy.org

Page 30: Big Python

Kivy „Hello World“

DLR.de • Folie 30 > Python Unconference Hamburg 2014 > Andreas Schreiber • Big Python > 29.11.2014

from kivy.app import App from kivy.uix.button import Button class TestApp(App): def build(self): return Button(text='Hello Cologne') TestApp().run()

Page 31: Big Python

Kivy Sprache „KV“ für Layout und Grafik

DLR.de • Folie 31 > Python Unconference Hamburg 2014 > Andreas Schreiber • Big Python > 29.11.2014

from kivy.app import App class HelloApp(App): pass HelloApp().run()

#:kivy 1.0 Button: text: ‘Hello Hamburg’

Datei hello.kv definiert Root-Widget

Page 32: Big Python

Kivy Apps Verfügbar zum Beispiel im Google Play Store

DLR.de • Folie 32 > Python Unconference Hamburg 2014 > Andreas Schreiber • Big Python > 29.11.2014

Page 33: Big Python

Kivy Apps Geeignet für Prototypen

DLR.de • Folie 33 > Python Unconference Hamburg 2014 > Andreas Schreiber • Big Python > 29.11.2014

Page 34: Big Python

Pflanzenbeleuchtung

• Webcam nimmt Bild auf •  Rechner erkennt Pflanze •  Rechner berechnet anhand von

Einstellungen ein Ausgabebild •  Lichtquelle (z.B. Beamer) beleuchtet die

Pflanze mit dem Bild

> Python Unconference Hamburg 2014 > Andreas Schreiber • Big Python > 29.11.2014 DLR.de • Folie 34

Kivy zur Erstellung von GUIs und Apps Beispiel aus der Raumfahrtbiologie

Page 35: Big Python

DLR.de • Folie 35 > Python Unconference Hamburg 2014 > Andreas Schreiber • Big Python > 29.11.2014

Page 36: Big Python

DLR.de • Folie 36 > Python Unconference Hamburg 2014 > Andreas Schreiber • Big Python > 29.11.2014

Page 37: Big Python

DLR.de • Folie 37 > Python Unconference Hamburg 2014 > Andreas Schreiber • Big Python > 29.11.2014

Page 38: Big Python

QPython – Python on Android (http://qpython.com)

> Python Unconference Hamburg 2014 > Andreas Schreiber • Big Python > 29.11.2014 DLR.de • Folie 38

Python auf Smartphones Weitere Möglichkeiten…

Page 39: Big Python

Pythonista – Python on iOS http://omz-software.com/pythonista

> Python Unconference Hamburg 2014 > Andreas Schreiber • Big Python > 29.11.2014 DLR.de • Folie 39

Python auf Smartphones Weitere Möglichkeiten…

Page 40: Big Python

Big Computers

High Performance Computing

> Python Unconference Hamburg 2014 > Andreas Schreiber • Big Python > 29.11.2014 DLR.de • Folie 40

Page 41: Big Python

Wenn der Arbeitsplatzrechner nicht mehr ausreicht

•  Hohe Rechenleistung und hoher Speicherbedarf

> Python Unconference Hamburg 2014 > Andreas Schreiber • Big Python > 29.11.2014 DLR.de • Folie 41

High Performance Computing (HPC) Spezialgebiet des Wissenschaftlichen Rechnens

Bilder: http://www.isgtw.org

Das Bild kann nicht angezeigt werden. Dieser Computer verfügt möglicherweise über zu wenig Arbeitsspeicher, um das Bild zu öffnen, oder das Bild ist beschädigt. Starten Sie den Computer neu, und öffnen Sie dann erneut die Datei. Wenn weiterhin das rote x angezeigt wird, müssen Sie das Bild möglicherweise löschen und dann erneut einfügen.

Das Bild kann nicht angezeigt werden. Dieser Computer verfügt möglicherweise über zu wenig Arbeitsspeicher, um das Bild zu öffnen, oder das Bild ist beschädigt. Starten Sie den Computer neu, und öffnen Sie dann erneut die Datei. Wenn weiterhin das rote x angezeigt wird, müssen Sie das Bild möglicherweise löschen und dann erneut einfügen.

Das Bild kann nicht angezeigt werden. Dieser Computer verfügt möglicherweise über zu wenig Arbeitsspeicher, um das Bild zu öffnen, oder das Bild ist beschädigt. Starten Sie den Computer neu, und öffnen Sie dann erneut die Datei. Wenn weiterhin das rote x angezeigt wird, müssen Sie das Bild möglicherweise löschen und dann erneut einfügen.

Das Bild kann nicht angezeigt werden. Dieser Computer verfügt möglicherweise über zu wenig Arbeitsspeicher, um das Bild zu öffnen, oder das Bild ist beschädigt. Starten Sie den Computer neu, und öffnen Sie dann erneut die Datei. Wenn weiterhin das rote x angezeigt wird, müssen Sie das Bild möglicherweise löschen und dann erneut einfügen.

Page 42: Big Python

Aktuelle Supercomputer haben

> 1.000.000 Cores > 10 PetaFLOPS

Die drei derzeit größten Systeme (Nov 2014)

1.  Tianhe-2 (Guangzhou, China) 3.120.000 Cores, 33,8 PetaFLOPS

2.  Titan (ORNL, USA) 560.640 Cores, 17,5 PetaFLOPS

3.  Sequoia (LLNL, USA) 1.572.864 Cores, 17,1 PetaFLOPS

> Python Unconference Hamburg 2014 > Andreas Schreiber • Big Python > 29.11.2014 DLR.de • Folie 42

Wie groß ist „Big“? Aktuelle Supercomputer

Page 43: Big Python

Supercomputer Tianhe-2 (天河二号)

DLR.de • Folie 43 > Python Unconference Hamburg 2014 > Andreas Schreiber • Big Python > 29.11.2014

Page 44: Big Python

Supercomputer Titan

DLR.de • Folie 44 > Python Unconference Hamburg 2014 > Andreas Schreiber • Big Python > 29.11.2014

Quelle: https://www.olcf.ornl.gov/titan/

Page 45: Big Python

Supercomputer Sequoia

DLR.de • Folie 45 > Python Unconference Hamburg 2014 > Andreas Schreiber • Big Python > 29.11.2014

Quelle: https://asc.llnl.gov/computing_resources/sequoia/

Page 46: Big Python

MPI (Message Passing Interface)

•  API für Distributed-Memory-Architekturen in C, C++, Fortran, ...

OpenMP (Open Multi-Processing)

•  API für Shared-Memory-Architekturen in C, C++, Fortran

OpenACC (Open Accelerators)

•  API für heterogene CPU/GPU-Systeme in C, C++, Fortran

Global Arrays Toolkit

•  API für Shared-Memory-Programmierung auf Distributed-Memory-Architekturen in C, C++, Fortran und Python

> Python Unconference Hamburg 2014 > Andreas Schreiber • Big Python > 29.11.2014 DLR.de • Folie 46

High Performance Computing Programmiertechnologien

Page 47: Big Python

Architektur

•  Viele Core pro Node • Geeignet für Prozessierung von Datenströmen

(viele parallele unabhängige Datenpunkte)

Programmiertechnologien

•  CUDA •  API von NVIDIA in C •  Python-Binding: PyCUDA

• OpenCL • Offenes Framework für heterogene Systeme •  Python-Binding: PyOpenCL

> Python Unconference Hamburg 2014 > Andreas Schreiber • Big Python > 29.11.2014 DLR.de • Folie 47

GPGPU General-purpose computing on graphics processing units

Bild: NVIDIA

Page 48: Big Python

Just-in-time-Compiler

•  Annotationen •  Nutzt LLVM

> Python Unconference Hamburg 2014 > Andreas Schreiber • Big Python > 29.11.2014 DLR.de • Folie 48

Numba Optimierungs-Compiler für Python

Page 49: Big Python

Free-Wake (DLR)

•  Simulation dreidimensionaler Strömungen um einen aktiv gesteuerten Rotor eines Helikopters

•  Code entwickelt 1994-1996 • MPI-parallelisiert in Fortran

•  Aufwendige Performance-Optimierung 2013-2014

• MPI und Open ACC

> Python Unconference Hamburg 2014 > Andreas Schreiber • Big Python > 29.11.2014 DLR.de • Folie 49

Beispiel Free-Wake Simulation von Hubschrauber-Rotoren

Page 50: Big Python

Visualisierung der Wirbel

DLR.de • Folie 50 > Python Unconference Hamburg 2014 > Andreas Schreiber • Big Python > 29.11.2014

Page 51: Big Python

Kern-Schleifen von Free-Wake (Standard Python)

DLR.de • Folie 51 > Python Unconference Hamburg 2014 > Andreas Schreiber • Big Python > 29.11.2014

for iblades in range(numberOfBlades): for iradial in range(1, dimensionInRadialDirection): for iazimutal in range(dimensionInAzimualDirectionTotal): for i1 in range(len(vx[0])): for i2 in range(len(vx[0][0])): for i3 in range(len(vx[0][0][0])): # wilin-Aufruf 1 for iblades in range(numberOfBlades): for iradial in range(dimensionInRadialDirection): for iazimutal in range(1, dimensionInAzimualDirectionTotal): for i1 in range(len(vx[0])): for i2 in range(len(vx[0][0])): for i3 in range(len(vx[0][0][0])): # wilin-Aufruf 2 for iDir in range(3): for i in range(numberOfBlades): for j in range(dimensionInRadialDirection): for k in range(dimensionInAzimualDirectionTotal): x[iDir][i][j][k] = x[iDir][i][j][k] +

dt * vx[iDir][i][j][k]

Page 52: Big Python

Vergleich der hoch-optimierten Fortran-Version mit parallelen Python-Versionen

• Multi-core CPUs •  Cython mit OpenMP •  Python-Bindings für Global Array Toolkit

• GPGPUs

•  NumbaPro

> Python Unconference Hamburg 2014 > Andreas Schreiber • Big Python > 29.11.2014 DLR.de • Folie 52

Free-Wake Performance-Vergleich Fortran – Python

Page 53: Big Python

Performance-Tests Single-Core Performance (Xeon E5645, 6 Cores)

DLR.de • Folie 53 > Python Unconference Hamburg 2014 > Andreas Schreiber • Big Python > 29.11.2014

Page 54: Big Python

Performance-Tests Multi-Core Performance (Xeon E5645, 6 Cores)

DLR.de • Folie 54 > Python Unconference Hamburg 2014 > Andreas Schreiber • Big Python > 29.11.2014

Page 55: Big Python

Performance-Tests GPGPU Perf. (NVIDIA Tesla C2075, 448 CUDA-Cores)

DLR.de • Folie 55 > Python Unconference Hamburg 2014 > Andreas Schreiber • Big Python > 29.11.2014

Page 56: Big Python

Neue Rechnerarchitekturen Quantencomputer

DLR.de • Folie 56 > Python Unconference Hamburg 2014 > Andreas Schreiber • Big Python > 29.11.2014

•  Adiabatische Quantencomputer

Bilder: NASA

Page 57: Big Python

Big Applications

„Killer“-Applikationen in Wissenschaft und Technologie

> Python Unconference Hamburg 2014 > Andreas Schreiber • Big Python > 29.11.2014 DLR.de • Folie 57

Page 58: Big Python

Viele kommerzielle Anwendungen sind noch Standard

• Microsoft Excel • MATLAB •  IDL •  Fortran-Compiler

Der Weg nach Python...

• Open Source •  Einheitliche Sprache für viele Anwendungsgebiete

> Python Unconference Hamburg 2014 > Andreas Schreiber • Big Python > 29.11.2014 DLR.de • Folie 58

Wichtige Anwendungssoftware Wissenschaft und Technik

Page 59: Big Python

Wesentliche Funktionen

•  Tabellen •  Sortier-, Gruppier-, Filterfunktionen •  Pivot-Tabellen •  Diagramme

Python-Alternative

•  IPython •  pandas

> Python Unconference Hamburg 2014 > Andreas Schreiber • Big Python > 29.11.2014 DLR.de • Folie 59

Microsoft Excel Tabellenkalkulation

Page 60: Big Python

Wesentliche Funktionen

•  Eigene proprietäre Programmiersprache •  Viele Anwendungs-Toolboxes

z.B. Statistik, Signal- und Bildverarbeitung

Python-Alternative

•  NumPy • Matplotlib

Nützliche Quelle: wiki.scipy.org/NumPy_for_Matlab_Users

> Python Unconference Hamburg 2014 > Andreas Schreiber • Big Python > 29.11.2014 DLR.de • Folie 60

The MathWorks MATLAB Numerische Matrixberechnungen

Page 61: Big Python

Wesentliche Funktionen

•  Array-basierte Programmiersprache • Gute Bildverarbeitungsfunktionen

Python-Alternative

•  IDL-nach-Python-Compiler PIKE

> Python Unconference Hamburg 2014 > Andreas Schreiber • Big Python > 29.11.2014 DLR.de • Folie 61

IDL – Interactive Data Language Analyse und Visualisierung von Daten

Page 62: Big Python

PIKE Beispiel-Codes

DLR.de • Folie 62 > Python Unconference Hamburg 2014 > Andreas Schreiber • Big Python > 29.11.2014

;; Simple image/ plotting and graphics tests pro MRI_demo ;Load demo data file file = filepath("mri500x300x5.dat", subdirectory=["data"]) print,file device, decomposed=0 loadct, 3 openr, lun, file, /get_lun ;Associate a variable with a data file img = assoc(lun, bytarr(500, 300)) !P.multi=[0,0,0,0] window, 0, xsize=500, ysize=300,

title='MRI Demo - Flicker Loop' ;Display the five images in a loop for j=0, 2 do begin for i=0, 4 do begin tvscl, img[i] wait, 0.1 endfor endfor . . .

Page 63: Big Python

PIKE Beispiel-Codes

DLR.de • Folie 63 > Python Unconference Hamburg 2014 > Andreas Schreiber • Big Python > 29.11.2014

import numpy as np import pike def mri_demo( ): #Load demo data file pike.setArrayOrder("0and1") # expected array ordering # %; Define detected undefined variables lun = 0 file = pike.filepath("mri500x300x5.dat”, subdirectory=pike.catarr(["data"])) pike.print_(file) pike.device(decomposed=0) pike.loadct(3) lun = pike.openr(lun, file, get_lun=True) #Associate a variable with a data file img = pike.assoc(lun, pike.bytarr(500, 300)) pike.sysv.P.multi = pike.catarr([0, 0, 0, 0]) pike.window(0, title='MRI Demo - Flicker Loop', xsize=500, ysize=300) #Display the five images in a loop for j in xrange(np.int16(0), (np.int16(2))+(1)): for i in xrange(np.int16(0), (np.int16(4))+(1)): pike.tvscl(img[i]) pike.wait(0.1) . . .

Page 64: Big Python

PIKE Beispiel-Codes

DLR.de • Folie 64 > Python Unconference Hamburg 2014 > Andreas Schreiber • Big Python > 29.11.2014

Bild: Torsion Analytics

Page 65: Big Python

Entwerfen von Raumfahrzeugen

DLR.de • Folie 65 > Python Unconference Hamburg 2014 > Andreas Schreiber • Big Python > 29.11.2014

Page 66: Big Python

SpaceLiner

•  Konzeptstudie für Passagiertransport

• Mittelding zwischen Flugzeug und Raumschiff

•  Langstreckenflüge mit Hyperschallgeschwindigkeit (> Mach 5)

•  Strecke Europa – Australien in 90 Min.

•  Hochaufstieg mit Booster auf ca. 85 km

• Gleitflug des Orbiters mit ca. Mach 20

> Python Unconference Hamburg 2014 > Andreas Schreiber • Big Python > 29.11.2014 DLR.de • Folie 66

Entwerfen von Raumfahrzeugen Beispiel: Der DLR SpaceLiner

Page 67: Big Python

Simulation mit verschiedenen Wärmeschutzsystemen

• Wasserkühlung durch Verdampfung •  Hochwärmeleitende Faserverbundstoffe

> Python Unconference Hamburg 2014 > Andreas Schreiber • Big Python > 29.11.2014 DLR.de • Folie 67

Simulation in der Entwurfsphase Wärmeentwicklung beim Wiedereintritt

Page 68: Big Python

Wärmeschutzsystem Magnetohydrodynamik mit supraleitenden Magneten

DLR.de • Folie 68 > Python Unconference Hamburg 2014 > Andreas Schreiber • Big Python > 29.11.2014

Page 69: Big Python

Lorentzkraft in der Natur Aurora Borealis

DLR.de • Folie 69 > Python Unconference Hamburg 2014 > Andreas Schreiber • Big Python > 29.11.2014

Bild: Alexander Gerst (https://twitter.com/Astro_Alex/status/507212904689848320)

Page 70: Big Python

Lorentzkraft in der Raumfahrt Schutzschilde

DLR.de • Folie 70 > Python Unconference Hamburg 2014 > Andreas Schreiber • Big Python > 29.11.2014

Page 71: Big Python

Wie entwirft man Raumschiffe?

DLR.de • Folie 71 > Python Unconference Hamburg 2014 > Andreas Schreiber • Big Python > 29.11.2014

Page 72: Big Python

> Python Unconference Hamburg 2014 > Andreas Schreiber • Big Python > 29.11.2014 DLR.de • Folie 72

Simulations-Workflow Vernetzung der Fachdisziplinen

Geometrie

Aerodynamik

Thermal- management

Subsystem- massen

Struktur

Page 73: Big Python

> Python Unconference Hamburg 2014 > Andreas Schreiber • Big Python > 29.11.2014 DLR.de • Folie 73

Simulations-Workflow Mit Optimierung

Geometrie Aerodynamik Thermal- management

Subsystem- massen Struktur

Optimierer

Page 74: Big Python

> Python Unconference Hamburg 2014 > Andreas Schreiber • Big Python > 29.11.2014 DLR.de • Folie 74

Simulations-Workflow Integration in eine Simulationsumgebung

Page 75: Big Python

Simulationsumgebung RCE

DLR.de • Folie 75 > Python Unconference Hamburg 2014 > Andreas Schreiber • Big Python > 29.11.2014

Page 76: Big Python

Vielen Dank! DLR.de • Folie 76 > Python Unconference Hamburg 2014 > Andreas Schreiber • Big Python > 29.11.2014

Fragen?

[email protected]

www.DLR.de/sc | @onyame