Neutron Science Visualization Software



Similar documents
GR A universal framework for visualization applications

GR Framework / MODBUS on Raspberry Pi

Getting more out of Matplotlib with GR

GR.jl Plotting for Julia based on GR

The Most Popular UI/Apps Framework For IVI on Linux

CROSS PLATFORM DEVELOPMENT The HTML5 Way

David Boddie. PyCon UK 2007, Birmingham

Astronomical Instruments Software System Design

Overview of CS 282 & Android

Main Bullet #1 Main Bullet #2 Main Bullet #3

Computer Systems and Networks. ECPE 170 Jeff Shafer University of the Pacific. Linux Basics

Analysis Programs DPDAK and DAWN

Introduction CMake Language Specific cases. CMake Tutorial. How to setup your C/C++ projects? Luis Díaz Más.

Scientific Visualization

Programming Mobile Apps with Python

How to Choose Right Mobile Development Platform BROWSER, HYBRID, OR NATIVE

AVS/Express - an object-oriented visual development tool

Rapid Software Development with OpenAccess. Dean Marvin Exec Director, Product Development

PyQt for Desktop and Embedded Devices

Lecture 4 Cross-Platform Development. <lecturer, date>

Developing Applications for ios

IONU PRO Product Overview

Today's Topics. COMP 388/441: Human-Computer Interaction. simple 2D plotting. 1D techniques. Ancient plotting techniques. Data Visualization:

USE OF PYTHON AS A SATELLITE OPERATIONS AND TESTING AUTOMATION LANGUAGE

Extending the Survey123 for ArcGIS Mobile App

QML and JavaScript for Native App Development

Postprocessing with Python

ArcGIS ArcMap: Printing, Exporting, and ArcPress

Surface and Volumetric Data Rendering and Visualisation

The MaXX Desktop. Workstation Environment. Revised Road Map Version 0.7. for Graphics Professionals

Lecture 1 Introduction to Android

Software Development at the LMU - Munich. Ideas, Vision, Commitment?

Practical Data Visualization and Virtual Reality. Virtual Reality VR Software and Programming. Karljohan Lundin Palmerius

IDL. Get the answers you need from your data. IDL

Why this lecture exists ITK Lecture 12: Open Source & Cross Platform Software Development

Interoperabilnost LINUX-Windows. It is easily possible for Linux & Windows to coexist & even work together.

APPLICATION VIRTUALIZATION TECHNOLOGIES WHITEPAPER

ft6 Motivation next step: perform the tests usually tedious, error prone work aided by a tool easily repeatable enter ft6 ft6

KIVY - A Framework for Natural User Interfaces

Introduction to GUI programming in Python. Alice Invernizzi

Developing And Marketing Mobile Applications. Presented by: Leesha Roberts, Senior Instructor, Center for Education Programmes, UTT

Mobile Development with Qt

LittleCMS: A free color management engine in 100K.

Mobile Phones Operating Systems

Introduction to Android

OMX, Android, GStreamer How do I decide what to use? 15 July 2011

-Android 2.3 is the most used version of Android on the market today with almost 60% of all Android devices running 2.3 Gingerbread -Winner of

research: technical implemenation

Keywords Online Aptitude Test, Android, IOS, Cross Platform mobile application Development.

CORBA, DCOP and DBUS. A performance comparison.

System Structures. Services Interface Structure

Questions and Answers

01. Introduction of Android

SOFTWARE UNIT 1 PART B C O M P U T E R T E C H N O L O G Y ( S 1 O B J A N D O B J 3-2)

How to start with 3DHOP


An Android based Quantum GIS prototype. Ramon Carrillo, Daniel Ochoa

Data analysis and visualization topics

Programming Languages & Tools

Building native mobile apps for Digital Factory

Detailed Design Report

Mobile web apps: The best option for business? A whitepaper from mrc

AbiWord: A Cross Platform GNOME Office Component

Cross-Platform Mobile Apps Solution

How To Develop An App For Ios (Windows)

lubyk lua libraries for live arts Gaspard Bucher (Buma)! artist, musician, coder

An Introduction to Android. Huang Xuguang Database Lab. Inha University

CE 504 Computational Hydrology Computational Environments and Tools Fritz R. Fiedler

Automated testing for Mobility New age applications require New age Mobility solutions

Intro to scientific programming (with Python) Pietro Berkes, Brandeis University

A Tutorial Introduc/on to Big Data. Hands On Data Analy/cs over EMR. Robert Grossman University of Chicago Open Data Group

MENDIX FOR MOBILE APP DEVELOPMENT WHITE PAPER

Viewpoint. Choosing the right automation tool and framework is critical to project success. - Harsh Bajaj, Technical Test Lead ECSIVS, Infosys

Using EDA Databases: Milkyway & OpenAccess

Introduction to Web Development with R

Building a Python Plugin

Some Experiences With Python For Android (Py4A) Nik Klever University of Applied Sciences Augsburg

CHOOSING THE RIGHT HTML5 FRAMEWORK To Build Your Mobile Web Application

A Hybrid Visualization System for Molecular Models

How to test OpenGL drivers with Free Software

Chapter 1. Introduction to ios Development. Objectives: Touch on the history of ios and the devices that support this operating system.

Discovering Computers

Data analysis and visualization topics

RIC 2007 SNAP: Symbolic Nuclear Analysis Package. Chester Gingrich USNRC/RES 3/13/07

Cross Platform Mobile. -Vinod Doshi

Multiprocess System for Virtual Instruments in Python

Lecture 3 Mobile App Development (Android, ios, BlackBerry, Windows Mobile) <lecturer, date>

Introduction to Scientific Computing

A lap around Team Foundation Server 2015 en Visual Studio 2015

Rich Internet Applications

Tizen Technical Overview 枪 晦 随 鬴 缃 拜 枋 幞 垖 幁 穧 幤

Azure Day Application Development

Engineering the Ambulant Multimedia Player

Introduction to Python

Transcription:

Mitglied der Helmholtz-Gemeinschaft Neutron Science Visualization Software 1. September 2011 69. Koordinierungstreffen J. Heinen

Contents ü Visualization Software Requirements in Neutron Science ü Available Software ü Review ü Possible Approaches ü Pros and Cons ü GR Basics ü Real-life-examples ü Conclusions ü Future plans 2

Visualization Software Requirements in Neutron Science User Aspects Ease of use Fully-customizable Produce fast and reliable results Publication-quality printing and capturing capabilities Native look and feel Usability over slow network connections Well-documented Software Engineering Aspects Easy to install High quality graphics output in various formats Standard APIs for the creation of 2D- or 3D-graphs Embeddable in other applications, especially GUIs and Web Apps Scripting capabilities Long-time support Open Source based Cross platform interoperability 3

Available Software Graphics Application Programming Interfaces ü Cairo Graphics ü DISLIN ü GR / GKS ü Matplotlib ü OpenGL ü PGPlot ü Qwt3D ü SDL ü VTK Integrated Visualization Systems ü Gnuplot ü GLI ü grpython ü IDL ü IGOR Pro ü MantidPlot ü Octave ü Origin ü PlotScript ü QtiKWS ü QtiPlot ü XmGrace Graphical User Interface Tools ü FLTK ü Gtk / Gtk+ ü Motif ü Qt4 / Qt3 ü Tk ü Ultimate++ ü wxwidgets ü XForms 4

Review 5

Review (continued) Software developers are maintaining three principles: ü Reusability (classes, objects, methods) ü Extensibility (inheritance) ü Simplicity (abstraction, encapsulation, polymorphism) The above mentioned principles might have improved maintainability, but did they really help users? ü Linux distribution spins, flavors, ü Desktop environments: GNOME, KDE, Unity, ü Office software: OpenOffice, LibreOffice, KOffice, 6

Possible Approaches Graphics Application Programming Interfaces ü Cairo Graphics ü DISLIN ü GR / GKS ü Matplotlib ü OpenGL ü PGPlot ü Qwt3D ü SDL ü VTK Integrated Visualization Systems ü Gnuplot ü GLI ü grpython ü IDL ü IGOR Pro ü MantidPlot ü Octave ü Origin ü PlotScript ü QtiKWS ü QtiPlot ü XmGrace Graphical User Interface Tools ü FLTK ü Gtk / Gtk+ ü Motif ü Qt4 / Qt3 ü Tk ü Ultimate++ ü wxwidgets ü XForms 7

Pros and Cons PlotScript QtiKWS GR Pro + Instrument specific menus + Adapted to scientists needs + Uses existing QtiPlot framework + Adapted to KWS instruments + Standardized graphics (GKS) + Embeddable into Qt4 based GUIs + High quality graphics output in various formats + Cross language (Fortran, C/C++, Python, ) + Cross-platform + Conforms to the Jülich Munich Standard + Web ready Contra - GTK/GTK+ (or wxwidgets) based GUI - Gnuplot graphics (separated) - no API - Qt3 based GUI - Qt/Qwt3D graphics - no API - Documentation out-dated 8

GR from a developer point of view Fortran" C / C++" Objective-C" Python" Psh"..." GR! Pascal" Fortran" C / C++" GLGr! Graphical Kernel System (GKS)! Qt" X11" Quartz" Win32" Java" PS" PDF" SVG" " OpenGL (ES)! gksqt" GKSTerm" gkswebapp" Additional drivers / plugins:! - CGM, GKSM, GIF, RF, UIL" - WMF, Xfig" - GS (BMP, JPEG, PNG, TIFF) " 9

GR from user point of view Physics Computer! Qt event loop" Qt GUI" Python! C / C++! GR! Socket communication" OpenGL enabled Host / ios Device! GLGr! C! C / Objective-C! GKS! OpenGL! ES! GKS Logical Device Drivers! Qt" X11" Quartz" Win32" Java" PS" PDF" SVG" " gksqt" GKSTerm" gkswebapp" Additional drivers / plugins:! - CGM, GKSM, GIF, RF, UIL" - WMF, Xfig" - GS (BMP, JPEG, PNG, TIFF) " 10

% gkswebapp % export GKS_WSTYPE=410... % glgr % export GKS_WSTYPE=410... Browser Window OpenGL Window 11

Real-life-examples: KWSlive... ü Written in C++ ü Requires Qt4, TACO and GR / GKS ü Native GUI completely rewritten using Qt SDK (Qt Creator, Qt Designer) ü Visualization based on GKS Qt logical device driver ü Platform independent graphics output (GrWidget) ü Smooth integration into Qt event mechanism ü Features: 3D surface plots, contour plots, 2D line plots, radial averages, ROI selection, least-square fitting, sensitivity masks, TOF channel selection 12

13

14

#!/usr/bin/env python import sys, string, os from PyQt4 import * from PyQt4 import QtCore, QtGui import sip import gr def readdata(file, data) : stream = open(file, "r") num_items = -1 for line in stream.readlines() : if line == "" : break if line[0] == "$" : num_items = 0 else : if num_items >= 0 : line = line[:-1] for s in string.split(line) : data[num_items] = int(s) num_items = num_items + 1 stream.close() class GrWidget(QtGui.QWidget) : def init (self, *args) : QtGui.QWidget. init (self) self.setupui(self) os.environ['gks_wstype'] = "381" os.environ['gks_double_buf'] = "True" a simple PyQt4/GR script timer = QtCore.QTimer(self) self.connect(timer, QtCore.SIGNAL("timeout()"), self.draw) timer.start(1000) def draw(self) : x = y = range(128) z = range(128 * 128) readdata('simple.dat', z) z_max = max(z) gr.setviewport(0.1, 0.95, 0.1, 0.95) gr.setwindow(0, 127, 0, 127) gr.setspace(0, z_max, 0, 90) gr.setlinewidth(0.75) gr.setcharheight(18 / 600.) gr.axes(5, 5, 1, 1, 4, 4, -0.0075) gr.surface(128, 128, x, y, z, 5) h = range(0, 1) gr.contour(128, 128, 0, x, y, h, z, -1) self.update() def paintevent(self, ev) : self.painter = QtGui.QPainter() self.painter.begin(self) os.environ['gks_conid'] = "%x!%x % (sip.unwrapinstance(self), sip.unwrapinstance(self.painter)) gr.updatews() self.painter.end() def quit(self) : gr.emergencyclosegks() self.close() app = QtGui.QApplication(sys.argv) w = GrWidget() w.show() sys.exit(app.exec_()) def setupui(self, Form) : Form.setWindowTitle("GrWidget") Form.resize(QtCore.QSize(600, 600).expandedTo( Form.minimumSizeHint())) 15

Fortran C real x(30), y(30), z(30,30), tbx(4), tby(4) real r1, r2, z1, z2 do 1, i = 1, 30 x(i) = -2.0 + (i - 1) * 0.5 y(i) = -7.0 + (i - 1) * 0.5 1 continue do 2, i = 1, 30 do 3, j = 1, 30 r1 = sqrt((x(i)-5)**2+y(j)**2) r2 = sqrt((x(i)+5)**2+y(j)**2) z1 = exp(cos(r1)) z2 = exp(cos(r2)) z(i,j) = (z1 + z2-0.9) * 25 3 continue 2 continue call gr_beginprint('face.pdf') call gr_setcharheight(24.0/500) call gr_settextalign(2, 1) call gr_textext(0.5, 0.9, 'Surface Example') call gr_inqtextext(0.5, 0.9, 'Surface Example', tbx, tby) call gr_fillarea(4, tbx, tby) call gr_setcharheight(14.0/500) call gr_setviewport(0.1, 0.9, 0.1, 0.9) call gr_setwindow(-3.0, 13.0, -8.0, 8.0) call gr_settextfontprec(3, 0) call gr_setspace(-20.0, 200.0, 45, 70) call gr_axes3d(1.0, 0.0, 10.0, -3.0, -8.0, -20.0, 2, 2, 4, -0.01) call gr_axes3d(0.0, 1.0, 0.0, 13.0, -8.0, -20.0, 2, 2, 4, -0.01) call gr_titles3d('x-axis', 'Y-Axis', 'Z-Axis') call gr_surface(30, 30, x, y, z, 3) call gr_surface(30, 30, x, y, z, 1) call gr_updatews() call gr_endprint() read(*, *) call gr_emergencyclosegks() end #include <math.h> #include "gr.h" int main(void) { float x[30], y[30], z[30][30], tbx[4], tby[4]; } float r1, r2, z1, z2; int i, j; for (i = 0; i < 30; i++) { x[i] = -2.0 + (i - 1) * 0.5; y[i] = -7.0 + (i - 1) * 0.5; } for (i = 0; i < 30; i++) { for (j = 0; j < 30; j++) { r1 = sqrt((pow(x[i]-5,2))+pow(y[j],2)); r2 = sqrt((pow(x[i]+5,2))+pow(y[j],2)); z1 = exp(cos(r1)); z2 = exp(cos(r2)); z[i][j] = (z1 + z2-0.9) * 25; } } gr_beginprint("face.pdf"); gr_setcharheight(24.0/500); gr_settextalign(2, 1); gr_textext(0.5, 0.9, "Surface Example"); gr_inqtextext(0.5, 0.9, "Surface Example", tbx, tby); gr_fillarea(4, tbx, tby); gr_setcharheight(14.0/500); gr_setviewport(0.1, 0.9, 0.1, 0.9); gr_setwindow(-3.0, 13.0, -8.0, 8.0); gr_settextfontprec(3, 0); gr_setspace(-20.0, 200.0, 45, 70); gr_axes3d(1.0, 0.0, 10.0, -3.0, -8.0, -20.0, 2, 2, 4, -0.01); gr_axes3d(0.0, 1.0, 0.0, 13.0, -8.0, -20.0, 2, 2, 4, -0.01); gr_titles3d("x-axis", "Y-Axis", "Z-Axis"); gr_surface(30, 30, x, y, (float *)z, 3); gr_surface(30, 30, x, y, (float *)z, 1); gr_updatews(); gr_endprint(); sleep(5); gr_emergencyclosegks(); 16

Python + NumPy + GR 3.5 200 3.0 2.5 2.0 100 1.5 1.0 0.5 0 0 100 200 0 17

Conclusions GR is not an all-in-one solution, but it might help to make a lot of things easier: Ø keeps things as simple as possible and reduces complexity Ø increases maintainability and extensibility Ø makes use of abstraction layers Ø loosely couples system-specific components Ø allows code to be reused in other applications Ø minimizes use of external code Less is more 18

Future plans Ø Move GR code into a code management system (Subversion, Git, Trac) Ø Setup a Wiki (documentation) Ø Add more 3D functions (OpenGL) Ø Add a GKS logical device driver for wxwidgets Ø Migrate SIGHT (Simple Interactive Graphics Handling Tool) to Qt4 19

Thanks to Dück, Marcel (GKS WebApp) Bachelor Thesis: Entwicklung eines GKS-Gerätetreibers als Java-basierte Client/Server Webanwendung Felder, Christian (GLGr OpenGL ES Programming) Master Thesis: Implementierung einer Visualisierungsanwendung für Apples ios Goblet, Marvin (GKSTerm) Bachelor Thesis: Entwicklung eines GKS Gerätetreibers auf der Basis des Mac OS X Core Graphics Frameworks Neßelrath, Robert (GLGr OpenGL Programming) Diploma Thesis: Plattformunabhängige Visualisierung von Neutronenspektren auf der Basis von OpenGL Schätzler, Liane (KWSlive Qt4 Migration) 20