240 likes | 254 Views
(Almost) Everything you wanted to know about using S2PLOT to visualise astronomy datasets... Workshop. CRICOS provider 00111D. Christopher Fluke & David Barnes.
E N D
(Almost) Everything you wanted to know about using S2PLOT to visualise astronomy datasets...Workshop 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)
Overview • In this session, you will receive a hands-on introduction to S2PLOT programming. This will include the basics of an S2PLOT program, the standard graphics primitives, and how to create more complex applications using the power of the S2PLOT callback system. • Disclaimer: I am a C-programmer (and a vi user) and my bias is shown in the examples. • S2PLOT is also available for FORTRAN and Python.
Outline • Discuss some of your 3-d data • Get s2plot running on your laptop • Try out some of the basic functions • Change parameters • Look at callbacks • Handles • Isosurfaces • Volume rendering
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 Astronomical Data
What is your data like? • Discuss...
Get s2plot running on your laptop • Instructions at: • http://astronomy.swin.edu.au/s2plot • or (Mac OS X Leopard) • http://www.physics.umanitoba.ca/~english/vizATNF/s2plotSetup_cf.txt • Download sample code: • gunzip ATNF_3DWorkshop.tar.gz • tar -xvf ATNF_3DWorkshop.tar • cd ATNF_3DWorkshop
Basic functionality • Try out some of the basic functions. • Either: • 1. Get sample code from function reference at • http://astronomy.swin.edu.au/s2plot • or • 2. Copy from ${S2PATH}/functions • cbuild.csh <code>
Initialise Create geometry lists Register Callback Functions S2PLOT Program Flow Handle Window Events GLUTMAINLOOP Handle User Events Call Callbacks Draw Geometry using OpenGL lists
For those of you who are not C-programmers... Header files • #include <stdio.h> • #include <stdlib.h> • int main(int argc, char *argv[]) • { • int I, N; • N = 20; • for (I=0;I<N;I++) { • if (I != 4) { • printf(“hello world %d\n”, I); • } else { • printf(“time for a change?\n”); • } • } • return 1; • } All programs must have a main function Declare variables Assignment Looping Logical Tests Output to terminal { } pairs - control structures (Most) Commands end with semi-colon ;
Building S2PLOT code • cp src/s2hello.c . • [EDIT] s2hello.c • cbuild.csh s2hello • ./s2hello When prompted for a Graphics device type, hit <enter> Not very exciting is it? :)
Example • 1. Try changing the values of xmin,xmax etc. • 2. Try changing the values of x, y, z • 3. Try changing the value of ptype • 4. See if you can add some more points at random locations in the box
Example: geometry • cp src/s2geometry.c . • cbuild.csh s2geometry • ./s2geometry • [EDIT] s2geometry.c For more geometry, see http://astronomy.swin.edu.au/s2plot
Plotting transmission curves • cp src/filters1.c . • cbuild.csh filters1.c • ./filters1 • [EDIT] filters1.c Notice anything wrong?
cp src/filters2.c . • cbuild.csh filters2.c • ./filters2 • [EDIT] filters2.c TASK: Draw line segments rather than points TASK: Try and add some more labels
cp src/landolt1.c . • cbuild.csh landolt1.c • ./landolt1 • [EDIT] landolt1.c TASK: Experiment with changing the parameters that are plotted.
cp src/landolt2.c . • cbuild.csh landolt2.c • ./landolt2 • [EDIT] landolt2.c TASK: Make the points a bit thicker Wouldn’t it be nice to know more about those outliers?
Dynamic geometry via callbacks • cp src/landolt3.c . • cbuild.csh landolt3.c • ./landolt3 • [EDIT] landolt3.c Use Shift-S to toggle handles Use Shift-C to display cross-hairs De/Select with right mouse button TASK: Replace s2textxy strings with billboard text
Isosurfaces & Volume Rendering • cp src/volumes.c . • cbuild.csh volumes • ./volumes • [EDIT] volumes Press <space> to switch between: • Points only • Volume render • Isosurface TASK: Edit volumes.c and change slope, level and colour map (s2icm).
The Next Step • Now that you’ve had a chance to experiment with the basics of S2PLOT, let’s talk about your 3-d visualization needs...
Me: cfluke@swin.edu.au • Web-site: http://astronomy.swin.edu.au/s2plot • Google Group: http://groups.google.com/group/s2plot • Please send me your images for the gallery: • http://astronomy.swin.edu.au/s2plot/index.php?title=S2PLOT:Gallery • If you use S2PLOT to help your research, we would appreciate the following acknowledgement in your paper(s): • Three-dimensional visualisation was conducted with the S2PLOT progamming library • and a reference to • D.G.Barnes, C.J.Fluke, P.D.Bourke & O.T.Parry, 2006, Publications of the Astronomical Society of Australia, 23(2), 82-93.