Title: Almost Everything you wanted to know about using S2PLOT to visualise astronomy datasets
1(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)
2What is Visualisation?
Visualisation System
Knowledge discovery
Data
Science
- The process of creating (computer-generated)
images in order to gain new understanding or
insight into data.
3Astronomical 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,
comprehension Many astronomical datasets have N gt
3
4The 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
5Introducing S2PLOT
- AIM to enable visualization-led scientific
discovery - BY making an easy-to-use programming library
- THAT WORKS ON the astronomers desktop
workstation - AND WITHOUT RECOMPILATION ON advanced display
devices - RESULT
- S2PLOT Barnes et al., 2006, PASA, 23, 82
- www.astronomy.swin.edu.au/s2plot (Version 2.4)
6Key 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
7A Practical Example
8A Practical Example
9A Practical Example
10A Practical Example
11A Practical Example
- 2-d views of multi-d data
- Colour-colour
- Colour-magnitude
12A Practical Example
13S2PLOT Program Flow
Handle window events
Handle user events
Process callbacks
Draw geometry using OpenGL lists
14An easy s2plot program (in C)
15An easy s2plot program (in C)
16An easy s2plot program (in C)
17An easy s2plot program (in C)
18An easy s2plot program (in C)
19An easy s2plot program (in C)
20Comiple and Execute
- Configure your S2PLOT environment...
- cbuild.csh s2example
- ./s2example
21Programming Reference
http//astronomy.swin.edu.au/s2plot
22Sample code for every function
23PGPLOT versus Native functions
24Example Points and lines
25Example spheres and polygons
26Example text
27Static 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
28Billboards 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.
29Billboards Splats Example
30Nice 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.
31Nice Fonts Example
32Handles
- 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.
33Handles (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.
34Isosurfaces and Volume Rendering
Data courtesy J.English
35Colour maps
- Computers generate colours through R G B
combinations - 24-bit RGB 16,777,216 (256³ or 224) colours
- Colour can enhance important features
- Can exaggerate unimportant details
- Try different colour maps
36Other media
- 3-d PDF
- Barnes, 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 - Web
- Fluke, C.J., Barnes, D.G., Jones, N.T. 2009,
Interchanging Interactive 3-d Graphics for
Astronomy, Publications of the Astronomical
Society of Australia, accepted, arXiv0810.4201F - s2slides PowerPoint-style presentations
37Where to next?
- Try some S2PLOT sample code
- http//astronomy.swin.edu.au/s2plot
- Take part in the hands-on workshop
- Talk to me about your data