View
42
Download
0
Category
Tags:
Preview:
DESCRIPTION
(Almost) Everything you wanted to know about using S2PLOT to visualise astronomy datasets. CRICOS provider 00111D. Christopher Fluke & David Barnes. - PowerPoint PPT Presentation
Citation preview
(Almost) Everything you wanted to know about using S2PLOT to visualise astronomy datasets CRICOS provider 00111D
Christopher Fluke
& David Barnes
“Those not properly initiated into the mysteries of visualisation research often seek to understand the images rather than appreciate their
beauty...” Al Globus & Eric Raible (1994)
Visualizaton at ATNF 2009 (Almost) Everything you wanted to know about S2PLOT... 2
What is Visualisation?
Science
Data
Visualisation System
Knowledge discovery
The process of creating (computer-generated) images in order to gain new understanding or insight into data.
Visualizaton at ATNF 2009 (Almost) Everything you wanted to know about S2PLOT... 3
Astronomical Data
Brunner et al. (2001):• Imaging data: 2D, narrow , fixed epoch• Catalogs: secondary parameters determined from processing
(coordinates, fluxes, sizes, etc). • Spectroscopic data and products (e.g. redshifts, chemical composition).• Studies in the time domain - moving objects, variable and transient
sources (synoptic surveys) • Numerical simulations from theory
Planning, data collection, reduction, comprehensionMany astronomical datasets have N > 3
Visualizaton at ATNF 2009 (Almost) Everything you wanted to know about S2PLOT... 4
The rest of this presentation...• What is S2PLOT?• Getting started• Geometry
• Points, lines, coordinates, labels, text• Spheres, cubes, polygons• Colour and colour maps
• Static versus dynamic geometry: S2PLOT callbacks• Billboards/splats• Handles• Nice fonts• Volume rendering, isosurfaces
• Other media• 3d-PDF, Web, s2slides
Visualizaton at ATNF 2009 (Almost) Everything you wanted to know about S2PLOT... 5
Introducing S2PLOT
• AIMto enable visualization-led scientific discovery
• BYmaking an easy-to-use programming library
• THAT WORKS ONthe astronomer’s desktop workstation
• AND WITHOUT RECOMPILATION ONadvanced display devices
• RESULTS2PLOT: Barnes et al., 2006, PASA, 23, 82 www.astronomy.swin.edu.au/s2plot (Version 2.4)
Visualizaton at ATNF 2009 (Almost) Everything you wanted to know about S2PLOT... 6
Key Features and Benefits
• Supports standard and enhanced displays
• Real-time interaction
• Mouse + keyboard navigation
• Static and dynamic data
• Runs on Apple/OSX, GNU/Linux and Windows (GNU/cygwin)
• C/C++, Fortran and Python
• PGPLOT-inspired programming interface
Visualizaton at ATNF 2009 (Almost) Everything you wanted to know about S2PLOT... 7
A Practical Example
Visualizaton at ATNF 2009 (Almost) Everything you wanted to know about S2PLOT... 8
A Practical Example
Visualizaton at ATNF 2009 (Almost) Everything you wanted to know about S2PLOT... 9
A Practical Example
Visualizaton at ATNF 2009 (Almost) Everything you wanted to know about S2PLOT... 10
A Practical Example
Visualizaton at ATNF 2009 (Almost) Everything you wanted to know about S2PLOT... 11
A Practical Example
2-d views of multi-d data• Colour-colour
• Colour-magnitude
Visualizaton at ATNF 2009 (Almost) Everything you wanted to know about S2PLOT... 12
A Practical Example
Visualizaton at ATNF 2009 (Almost) Everything you wanted to know about S2PLOT... 13
Initialise
Create geometry lists
Register callback functions
Handle window events
Handle user events
Process callbacks
Draw geometry using OpenGL lists
S2PLOT Program Flow
Visualizaton at ATNF 2009 (Almost) Everything you wanted to know about S2PLOT... 14
An easy s2plot program (in C)
Visualizaton at ATNF 2009 (Almost) Everything you wanted to know about S2PLOT... 15
An easy s2plot program (in C)
Visualizaton at ATNF 2009 (Almost) Everything you wanted to know about S2PLOT... 16
An easy s2plot program (in C)
Visualizaton at ATNF 2009 (Almost) Everything you wanted to know about S2PLOT... 17
An easy s2plot program (in C)
Visualizaton at ATNF 2009 (Almost) Everything you wanted to know about S2PLOT... 18
An easy s2plot program (in C)
Visualizaton at ATNF 2009 (Almost) Everything you wanted to know about S2PLOT... 19
An easy s2plot program (in C)
Visualizaton at ATNF 2009 (Almost) Everything you wanted to know about S2PLOT... 20
Comiple and Execute
• Configure your S2PLOT environment...
cbuild.csh s2example ./s2example
Visualizaton at ATNF 2009 (Almost) Everything you wanted to know about S2PLOT... 21
Programming Reference
http://astronomy.swin.edu.au/s2plot
Visualizaton at ATNF 2009 (Almost) Everything you wanted to know about S2PLOT... 22
Sample code for every function
Visualizaton at ATNF 2009 (Almost) Everything you wanted to know about S2PLOT... 23
PGPLOT versus Native functions
Visualizaton at ATNF 2009 (Almost) Everything you wanted to know about S2PLOT... 24
Example: Points and lines
Visualizaton at ATNF 2009 (Almost) Everything you wanted to know about S2PLOT... 25
Example: spheres and polygons
Visualizaton at ATNF 2009 (Almost) Everything you wanted to know about S2PLOT... 26
Example: text
Visualizaton at ATNF 2009 (Almost) Everything you wanted to know about S2PLOT... 27
Static versus Dynamic geometry
• Static geometry• Draw it once
• Dynamic• Redraw on every display refresh• Animation!• Advanced interaction: mouse click events, key presses, iPod• Geometry that depends on camera angle
• Callbacks
Visualizaton at ATNF 2009 (Almost) Everything you wanted to know about S2PLOT... 28
Billboards & Splats
• Billboards: (2-d) things which always face the camera• good for labels & markers
• Splats: billboards which are soft point-like textures (images)• visually appealing alternative to single-pixel points
star fields, stellar clusters• variable size and colour with good blending properties
simulated particle distributions thresholded, gridded volume data
• Billboards have to be redrawn whenever the camera moves, so they must only be created in a callback function.
Visualizaton at ATNF 2009 (Almost) Everything you wanted to know about S2PLOT... 29
Billboards & Splats: Example
Visualizaton at ATNF 2009 (Almost) Everything you wanted to know about S2PLOT... 30
Nice Fonts
• As in PGPLOT, the basic font in S2PLOT is a "Hershey" font• vector-based• functional & fast, but inelegant
• S2PLOT provides 2 better ways to create text labels• unsigned int ss2ltt(char *latexcmd, float *aspect);
uses LaTeX to generate a bitmap which is converted into an S2PLOT texture for you. (Requires a few environment variables to be set correctly - see ENVIRONMENT.TXT in S2PLOT)
nice for equations• unsigned int ss2ftt(char *fontfilename, char *text,
int fontsizepx, int border); uses the FreeType2 font engine to generate a bitmap which is
converted into an S2PLOT texture for you.
Visualizaton at ATNF 2009 (Almost) Everything you wanted to know about S2PLOT... 31
Nice Fonts: Example
Visualizaton at ATNF 2009 (Almost) Everything you wanted to know about S2PLOT... 32
Handles
• Handles provide user interaction• they can be displayed or hidden with Shift-S• your code can be alerted when a handle is clicked on• your code can be alerted when a handle is dragged
• Handles have:• a position in 3-d space, and a size (fraction of the screen)• a texture and colour for their "unselected" state• a texture and colour for their "selected" state
• You can make invisible handles and draw other geometry at their location if you want.
Visualizaton at ATNF 2009 (Almost) Everything you wanted to know about S2PLOT... 33
Handles (continued)
• Possible uses for handles:• select points in a displayed dataset• select galaxies or stars or planets in a visualisation• define a 3-d region (volume selection)• provide buttons and sliders and even menus
this is typically done in "screen coordinates" mode• allow users to define control points along a spline camera path• etc.
Visualizaton at ATNF 2009 (Almost) Everything you wanted to know about S2PLOT... 34
Isosurfaces and Volume Rendering
Data courtesy J.English
Visualizaton at ATNF 2009 (Almost) Everything you wanted to know about S2PLOT... 35
• Colour can enhance important features• Can exaggerate unimportant details• Try different colour maps
Colour maps
Computers generate colours through R G B combinations24-bit RGB = 16,777,216 (256³ or 224) colours
Visualizaton at ATNF 2009 (Almost) Everything you wanted to know about S2PLOT... 36
Other media
• 3-d PDFBarnes, D.G., Fluke, C.J. 2008, Incorporating interactive 3-dimensional graphics in astronomy research papers, New Astronomy, 13, 599
Fluke, C.J., Barnes, D.G. 2008, The Interactive Astronomy Textbook, Astronomy Education Review, 7, 113
• WebFluke, C.J., Barnes, D.G., Jones, N.T. 2009, Interchanging Interactive 3-d Graphics for Astronomy, Publications of the Astronomical Society of Australia, accepted, arXiv:0810.4201F
• s2slides: “PowerPoint”-style presentations
Visualizaton at ATNF 2009 (Almost) Everything you wanted to know about S2PLOT... 37
Where to next?
• Try some S2PLOT sample codehttp://astronomy.swin.edu.au/s2plot
• Take part in the hands-on workshop
• Talk to me about your data
Recommended