Top Banner
(Almost) Everything you wanted to know about S2PLO T... 1 (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...”
24

(Almost) Everything you wanted to know about S2PLOT... 1 (Almost) Everything you wanted to know about using S2PLOT to visualise astronomy datasets...Workshop.

Dec 19, 2015

Download

Documents

Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: (Almost) Everything you wanted to know about S2PLOT... 1 (Almost) Everything you wanted to know about using S2PLOT to visualise astronomy datasets...Workshop.

(Almost) Everything you wanted to know about S2PLOT... 1

(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)

Page 2: (Almost) Everything you wanted to know about S2PLOT... 1 (Almost) Everything you wanted to know about using S2PLOT to visualise astronomy datasets...Workshop.

Visualizaton at ATNF 2009 (Almost) Everything you wanted to know about S2PLOT... 2

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.

Page 3: (Almost) Everything you wanted to know about S2PLOT... 1 (Almost) Everything you wanted to know about using S2PLOT to visualise astronomy datasets...Workshop.

Visualizaton at ATNF 2009 (Almost) Everything you wanted to know about S2PLOT... 3

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

Page 4: (Almost) Everything you wanted to know about S2PLOT... 1 (Almost) Everything you wanted to know about using S2PLOT to visualise astronomy datasets...Workshop.

Visualizaton at ATNF 2009 (Almost) Everything you wanted to know about S2PLOT... 4

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

Page 5: (Almost) Everything you wanted to know about S2PLOT... 1 (Almost) Everything you wanted to know about using S2PLOT to visualise astronomy datasets...Workshop.

Visualizaton at ATNF 2009 (Almost) Everything you wanted to know about S2PLOT... 5

What is your data like?

Discuss...

Page 6: (Almost) Everything you wanted to know about S2PLOT... 1 (Almost) Everything you wanted to know about using S2PLOT to visualise astronomy datasets...Workshop.

Visualizaton at ATNF 2009 (Almost) Everything you wanted to know about S2PLOT... 6

Get s2plot running on your laptop

Instructions at:http://astronomy.swin.edu.au/s2plotor (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

Page 7: (Almost) Everything you wanted to know about S2PLOT... 1 (Almost) Everything you wanted to know about using S2PLOT to visualise astronomy datasets...Workshop.

Visualizaton at ATNF 2009 (Almost) Everything you wanted to know about S2PLOT... 7

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>

Page 8: (Almost) Everything you wanted to know about S2PLOT... 1 (Almost) Everything you wanted to know about using S2PLOT to visualise astronomy datasets...Workshop.

Visualizaton at ATNF 2009 (Almost) Everything you wanted to know about S2PLOT... 8

Initialise

Create geometry lists

Register Callback Functions

GLUTMAINLOOP

Handle Window Events

Handle User Events

Call Callbacks

Draw Geometry using OpenGL lists

S2PLOT Program Flow

Page 9: (Almost) Everything you wanted to know about S2PLOT... 1 (Almost) Everything you wanted to know about using S2PLOT to visualise astronomy datasets...Workshop.

Visualizaton at ATNF 2009 (Almost) Everything you wanted to know about S2PLOT... 9

#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;}

Header files

All programs must have a main function

Declare variables

Assignment

LoopingLogical Tests

Output to terminal

{ } pairs - control structures

(Most) Commands end with semi-colon ;

For those of you who are not C-programmers...

Page 10: (Almost) Everything you wanted to know about S2PLOT... 1 (Almost) Everything you wanted to know about using S2PLOT to visualise astronomy datasets...Workshop.

Visualizaton at ATNF 2009 (Almost) Everything you wanted to know about S2PLOT... 10

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? :)

Page 11: (Almost) Everything you wanted to know about S2PLOT... 1 (Almost) Everything you wanted to know about using S2PLOT to visualise astronomy datasets...Workshop.

Visualizaton at ATNF 2009 (Almost) Everything you wanted to know about S2PLOT... 11

Example

1. Try changing the values of xmin,xmax etc.2. Try changing the values of x, y, z3. Try changing the value of ptype4. See if you can add some more points at random

locations in the box

Page 12: (Almost) Everything you wanted to know about S2PLOT... 1 (Almost) Everything you wanted to know about using S2PLOT to visualise astronomy datasets...Workshop.

Visualizaton at ATNF 2009 (Almost) Everything you wanted to know about S2PLOT... 12

Example: geometry

cp src/s2geometry.c . cbuild.csh s2geometry ./s2geometry [EDIT] s2geometry.c

For more geometry, seehttp://astronomy.swin.edu.au/s2plot

Page 13: (Almost) Everything you wanted to know about S2PLOT... 1 (Almost) Everything you wanted to know about using S2PLOT to visualise astronomy datasets...Workshop.

Visualizaton at ATNF 2009 (Almost) Everything you wanted to know about S2PLOT... 13

Page 14: (Almost) Everything you wanted to know about S2PLOT... 1 (Almost) Everything you wanted to know about using S2PLOT to visualise astronomy datasets...Workshop.

Visualizaton at ATNF 2009 (Almost) Everything you wanted to know about S2PLOT... 14

Page 15: (Almost) Everything you wanted to know about S2PLOT... 1 (Almost) Everything you wanted to know about using S2PLOT to visualise astronomy datasets...Workshop.

Visualizaton at ATNF 2009 (Almost) Everything you wanted to know about S2PLOT... 15

Page 16: (Almost) Everything you wanted to know about S2PLOT... 1 (Almost) Everything you wanted to know about using S2PLOT to visualise astronomy datasets...Workshop.

Visualizaton at ATNF 2009 (Almost) Everything you wanted to know about S2PLOT... 16

Page 17: (Almost) Everything you wanted to know about S2PLOT... 1 (Almost) Everything you wanted to know about using S2PLOT to visualise astronomy datasets...Workshop.

Visualizaton at ATNF 2009 (Almost) Everything you wanted to know about S2PLOT... 17

Plotting transmission curves

cp src/filters1.c .cbuild.csh filters1.c./filters1[EDIT] filters1.c

Notice anything wrong?

Page 18: (Almost) Everything you wanted to know about S2PLOT... 1 (Almost) Everything you wanted to know about using S2PLOT to visualise astronomy datasets...Workshop.

Visualizaton at ATNF 2009 (Almost) Everything you wanted to know about S2PLOT... 18

cp src/filters2.c .cbuild.csh filters2.c./filters2[EDIT] filters2.c

TASK: Draw line segments rather than pointsTASK: Try and add some more labels

Page 19: (Almost) Everything you wanted to know about S2PLOT... 1 (Almost) Everything you wanted to know about using S2PLOT to visualise astronomy datasets...Workshop.

Visualizaton at ATNF 2009 (Almost) Everything you wanted to know about S2PLOT... 19

cp src/landolt1.c .cbuild.csh landolt1.c./landolt1[EDIT] landolt1.c

TASK: Experiment with changing the parameters that are plotted.

Page 20: (Almost) Everything you wanted to know about S2PLOT... 1 (Almost) Everything you wanted to know about using S2PLOT to visualise astronomy datasets...Workshop.

Visualizaton at ATNF 2009 (Almost) Everything you wanted to know about S2PLOT... 20

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?

Page 21: (Almost) Everything you wanted to know about S2PLOT... 1 (Almost) Everything you wanted to know about using S2PLOT to visualise astronomy datasets...Workshop.

Visualizaton at ATNF 2009 (Almost) Everything you wanted to know about S2PLOT... 21

Dynamic geometry via callbacks

cp src/landolt3.c . cbuild.csh landolt3.c ./landolt3 [EDIT] landolt3.c

Use Shift-S to toggle handlesUse Shift-C to display cross-hairsDe/Select with right mouse button

TASK: Replace s2textxy strings with billboard text

Page 22: (Almost) Everything you wanted to know about S2PLOT... 1 (Almost) Everything you wanted to know about using S2PLOT to visualise astronomy datasets...Workshop.

Visualizaton at ATNF 2009 (Almost) Everything you wanted to know about S2PLOT... 22

Isosurfaces & Volume Renderingcp 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).

Page 23: (Almost) Everything you wanted to know about S2PLOT... 1 (Almost) Everything you wanted to know about using S2PLOT to visualise astronomy datasets...Workshop.

Visualizaton at ATNF 2009 (Almost) Everything you wanted to know about S2PLOT... 23

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...

Page 24: (Almost) Everything you wanted to know about S2PLOT... 1 (Almost) Everything you wanted to know about using S2PLOT to visualise astronomy datasets...Workshop.

Visualizaton at ATNF 2009 (Almost) Everything you wanted to know about S2PLOT... 24

Me: [email protected] 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.