Karma User Manual

Richard Go o ch

httpwwwsafemboxcomrgo o ch

December

Copyright Richard Go o ch

Permission is granted to make and distribute verbatim copies of this manual

provided the copyright notice and this p ermission notice are preserved on all

copies

Permission is granted to copy and distribute mo died versions of this manual

under the conditions for verbatim copying provided that the entire resulting

derived work is distributed under the terms of a p ermission notice identical to

this one

Permission is granted to copy and distribute translations of this manual into

another language under the ab ove conditions for mo died versions except that

this p ermission notice must b e retained in the English language Permission is

granted to provide an additional copy of this p ermission notice in the language

of the translation

Richard Go o chmay b e reached by email at rgoochsafemboxcom

or on the WWW at httpwwwsafemboxcomrgooch

The software describ ed in this do cument is distributed in the hop e that

it will be useful but WITHOUT ANY WARRANTY without even the im

plied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE See the GNU General Public License for more details ii

Contents

Intro duction

Supp orted Data Formats

Converting Other Data Formats to Karma Format

Converting Between Data Formats

Loading partial les

Adding your own Data Formats

Units

Coordinate Systems

Common Features

Loading Data

SubsettingDecimation of ArrayData

Intensity Scaling

Sequences of Images

Hardcopies

Exp orting Data

Zo oming

Resizingautoscaling

Axis Lab els

Magnifying Glass

Panner

Sp ectrum Proles

Image Statistics

Viewing Header Information

Freezing Events

Common Image DisplayFeatures

Generating MomentMaps

Cursor Readout

Warning for Astronomers

GUI Commandline Switches

Avoiding Colourmap Flashing

Drawing Overlays

Loading Overlays

Editing Images iii

iv CONTENTS

Viewing and Comparing multiple Images and Cub es

Overview

View Control

Data Browser

Commandline Options

IntensityIntensity Scatter Plots

Renzograms an alternativetovelo cityelds

Viewing Images and Cub es with the Multib eam

Commandline Options

Sp ecial Movies

Multiple Contour Images

IntensityIntensity Scatter Plots

Volume Rendering a Cub e

How the rendering is done

Shaders

Starting up the Volume Rendering Tool

Options

Loading Data into xray

The main control window

Rendering Mo des

Rotating the cub e

Making a Movie

Filtering your data

Adaptive Filtering

Contintuum Subtraction

Other Controls

Hot Gas Substances control panel

Hot Gas Mono control panel

trol panel Hot Gas Continuous con

Hot Gas Three Colour control panel

kpvslice interactive p ositionvelo city slicing

How to use it

Viewing Proles

Extracting Slices From An Image

Commandline Options

Algorithmic Details

How the Slice is Computed

kslice d slicing data cub es

Precompute

Magnications

kshell lo oking for expanding shells

CONTENTS v

koords interactive coordinate tting

Centring Algorithm

kp olar regridding to p olar coordinates

Sup erimp osing Images

Image and Contours

Hue and Intensity

IntensityandIntensity

Commandline Tools

Common Interface

InteractiveMode

Actions

Scalar Parameters

Vector Parameters

Choice Parameters

Eternal Actions

Other Arguments

Exiting Interactive Mo de

BatchMode

Passing in Parameters and Actions

Passing in Strings

Passing in Negative Values

Passing in Other Arguments

Saving and Restoring Parameters

List of Tasks

chlen

imageskarma

karmappm

kdecimate

kminmax

kprinthead

kregrid

krotate

ksend

sendcontours

A Chromatic Ab erration

B Setting up

B Environments needed

B Op erating Systems

C Resources

vi CONTENTS

D Annotation Format

D Usage

D Fundamental Syntax

D Annotation Commands

D NonGraphical Commands

D Attribute Commands

D Ob ject Commands

D Position Angle Conventions

D Example Annotation File

E Making

E Basic Facilities at the ATNF

E Using Sydney University VisLab Facilities

F Acknowledgements

G Quirks and Unexp ected Behaviour

H Undo cumented Features

Index

Chapter

Intro duction

Karma is a general purp ose programmers to olkit and contains KarmaLib the

structured library and API and a large number of mo dules applications to

p erform many standard tasks This manual describ es the many visualisation

to ols which are distributed with the Karma library

This do cument is written for Karma version which is probably

my exp erimental version Most of this manual will still be relevant to the

previously released binaryonly or b eta version since binary releases come

every few weeks or so Full public releases come once or twice a year so this

do cument may talk ab out several new things not available in the last public

release of Karma

This do cumentisavailable as compressed PostScript at

ftpftpatnfcsiroaupubsoftwarekarmausermanualpsgz

You can download a fancy colour frontcover for this do cumentat

ftpftpatnfcsiroaupubsoftwarekarmausercoverpsgz

Separate online do cuments the Karma Reference and Programming Man

uals may be found via the worldwideweb at the Karma home page at

httpwwwatnfcsiroaukarma The visualisation to ols are available via

the Karma home page or you can go directly to the Karma ftp site at

ftpftpatnfcsiroaupubsoftwarekarma

The programmes available at the momentare

olume rendering of data cub es xray chapter v

playmovies of data cub es kvis chapter

insp ecting multiple images and cub es at the same time kvis chapter

d chapter slice a cub e kslice

sup erimp osing images kvis section and kvis section

interactive p ositionvelo citysliceskpvslice chapter

lo ok for expanding shells kshell chapter

CHAPTER INTRODUCTION

interactive coordinate placement ko ords chapter

rectangular to p olar gridding of images kp olar chapter

Supp orted Data Formats

All the visualisation to ols supp ort a variety of data formats including

AIPS this is the format used by the AIPS package Astronomical Image

Pro cessing System sometimes called Classic AIPS or AIPS not to

b e confused with AIPS which is sometimes called AIPS This

data format uses a catalogue le which is automatically scanned by the le

browser and eachavailable dataset is given an entry in the browser with

the string AIPS shown in the lefthand column By default al l map

les in the catalogue are shown You may set the AIPS ID environment

variable to your AIPS user ID to avoid seeing les b elonging to other users

To see AIPS les on an AIPS disc you will need to change directory to

the AIPS data area ie where all those o ddlo oking CBD

les are kept You can use the le browser to change directories Byte

swapp ed data are automatically detected and corrected

AIPS this is the format used by the AIPS package Astronom

ical Information Pro cessing System not to be confused with AIPS

This is a directorybased data format like Miriad It is a new package

still under development The Karma supp ort for AIPS requires the

imagets programme to b e in your PATH The source co de is lo cated

somewhere in the AIPS source tree A precompiled binary is available

at

ftpftpatnfcsiroaupubsoftwarekarmaotherpackagesaips

for your convenience

DRAO this is the format pro duced by the Dominion Radio Astronomy

Observatory Penticton BC Canada reduction software This data for

mat uses a catalogue le which is automatically scanned by the le browser

and each available dataset whether a single image le or a family of

les for a cub e is given one entry in the browser with the string DRAO

shown in the lefthand column Unlikethe DRAO software Karma re

quires no environmentvariable to cop e with byteswapp ed data they are

automatically detected and corrected This format supp orts loading of

partial dimensional datasets section

FITS this is a p opular format amongst astronomers allowing you to move

data b etween many dierentsoftware packages It is more ecienttouse

tskarma to convert to Karma format rst For the le browser to

recognise a FITS le the extension should b e either fit fts

or upp ercase versions Files with extension efits are treated sp ecially

in that only the header is read These are called empty FITS les

SUPPORTED DATAFORMATS

where the image data are set to all zeros This format supp orts loading

of partial datasets section

GIF another p opular image format This requires the to ols to

b e installed on your machine

GIPSY this is the format for the GIPSY data reduction package It is

more ecienttousegipsykarma to convert to Karma format rst

This format supp orts loading of partial datasets section

IRAF this is the format for the IRAF optical astronomy analysis pack

age The current implementation requires IRAF to b e installed b ecause

it uses the wts task in IRAF and will create a temp orary le which

is automatically deleted

Karma this is the native data format Reading and writing Karma les

is the most ecient These les may be memorymapp ed up on load

which can give enormous sp eed b enets and reduce swap virtual memory

requirements Note that Karma les have the extension kf and that

this extension is automatically pro duced byany Karma software

Miriad this is the image format used by the Miriad data reduction

package It is more ecient to use miriadkarma to convert to

Karma format rst If your Miriad le has no mask attached to it then

the le may be memorymapp ed just like a Karma le which means

loading may b e just as fast as loading Karma les For this reason it is

worthwhile to avoid creating masks for Miriad les if you can help it

The PNMPPMPGM this is a common image interchange format

format do es not supp ort anything fancy like coordinate systems but it is

useful for converting b etween the many dierent image formats out there

Simple FITS this is a derivativeoftheFITS format which is easier for

the human to manipulate Lines in the header are separated by newline

characters rather than having to be padded to characters The data

directly follows the END keyword and must be in plain ASCI I format a

single value p er line The blank value for oating p oint data is e The

lename extension should b e sfits

Starlink Image this an astronomical reduction package used by many

optical astronomers The le extension is sdf and requires the sdfkarma

programme to b e in your PATH A precompiled binary is av ailable at

ftpftpatnfcsiroaupubsoftwarekarmaotherpackagesstarlink

for your convenience

le another p opular image format having the distinct ad

vantage of not using a patented compression algorithm unfortunately the

GIF format uses a patented algorithm

Targa TrueVision tga les yet another image format This requires

the NetPBM to ols to b e installed on your machine

CHAPTER INTRODUCTION

TIFF another p opular image format This requires the NetPBM to ols to

b e installed on your machine

In addition the automatic decompression of gzipp ed and bziped Karma

and FITS les is also supp orted by the le browser Filep opup widget

section

If your data are not in one of the supp orted formats you will need to convert

it to a supp orted format like FITS

Converting Other Data Formats to Karma Format

Anumb er of commandline utilities are provided to convert b etween other data

formats and Karma These are describ ed b elow

FITS requires the tskarma programme which is used

fitskarma fits file karma file

tskarma will attempt to trap most deviations from standard FITS

and continue gracefully However a truly bizzare FITS le may cause

tskarma to reject the conversion In this rare case please notify

Richard Go o ch who will attempt to add a trap so that the data can be

converted

Also note that tskarma will by default truncate axes so that they

are divisible by or larger The reason for this is that this then allows

the programme to tile the data tiling is a way of organising data so that

most ways of accessing it are faster If you really dont want to lo ose

up to coordinate points along an axis you can run tskarma as

follows

fitskarma allowtruncation off fits file karma file

But rememb er for the sake of a little bit of data you may be throwing

away enormous sp eed b enets

Miriad requires the miriadkarma programme which is used

miriadkarma miriad file karma file

This programme also tries to tile data like tskarma do es

GIPSY requires the gipsykarma programme which is used

gipsykarma gipsy file karma file

This programme also tries to tile data like tskarma do es

Converting Between Data Formats

There are also commandline utilities which allowyou to convert b etween other

data formats which are provided as a convenience These are describ ed b elow

ADDING YOUR OWN DATAFORMATS

miriadgipsy will convert from Miriad format to GIPSY format

which is used thus

miriadgipsy miriad file GIPSY file

This programme is obsoleted by the more general ktranslate

ktranslate will convert from any format supp orted by Karma to

another format It is used thus

ktranslate input file output file

The input and output formats are guessed by the programme based on

the lename extensions You can force the format if you wish An example

of this is

ktranslate intype fits outtype miriad input file output file

The choice of supp orted output formats is limited to Karma PPM

FITS Sun Rasterle Miriad and GIPSY If p ossible the conversion

pro cess is streamed to avoid the need to allo cate large amounts of

virtual memory

Loading partial les

Some data formats supp ort loading of partial datasets With these formats if

part of the data are missing the part of the dataset that is available can be

loaded if desired This is useful if you want to see a of a dataset that

is currently b eing written by another pro cess

Adding your own Data Formats

The visualisation to ols also provide a mechanism for you to add supp ort for

other data formats not already supp orted by the Karma library You will need

a programme that converts from your data format to either Karma FITS

or PNM format and for some data formats in particular directorybased

formats you will need to provide a tester programme which determines if a

dataset is of a particular typ e

To set this up you need to have a le karmadatafilters which

contains rules on how to convert data formats A systemwide le maintained

byyour lo cal Karma installer is also searched and is called

KARMABASEsitesharedatafilters Finally the le

KARMABASEsharedatafilters is scanned to load any lters which come

with the Karma distribution Your own data lters override the system data

lters which in turn override the Karma distribution lters

Atypical le would contain

Extension Converter Tester Output Format Name

imh iraffits FITS IRAF Image

sdf sdfkarma Karma Starlink Image

DIRECTORY ddfits isdd FITS A directory dataset

CHAPTER INTRODUCTION

DIRECTORY aipsfits isaips FITS AIPS Image

giftopnm PNM GIF Image

tga tgatoppm PNM Targa TrueVision

This would use the irafts programme to convert les with imh ex

tensions to FITS The FITS data would then be read in with the standard

FITS reader in Karma Similarly les with sdf extensions would be con

verted to Karma format using the sdfkarma programme which would

a lter write out Karma data Note that it is much more ecient to have

which generates Karma than FITS

Note the giftopnm and tgatoppm lters are both registered as

pro ducing PNM les whereas tgatoppm app ears to pro duce PPM les

This is not a problem since PNM Portable aNy Map is the generic format

and PPM Portable Map is a sp ecic subset of PNM

The converter programmes are called with a single argument that being

the name of the input le The output Karma FITS or PNM data must b e

written to the standard output

You will note that the tester programme supplied for the imh and sdf

formats is which means no tester is needed for these formats

The sp ecial extension name DIRECTORY signies that this data format is a

directorybased one examples of such formats are Miriad and AIPS images

Directorybased formats require a tester programme in order to determine if the

directory contains a dataset in which case it should b e loaded or just a plain

directory which should b e entered The tester programme must exit with status

if it recognises the dataset otherwise it should exit with some other value If

it returns the value no warning will be given It is given the name of the

dataset directory as a single argument

The le browser describ ed in section will show all les which are sup

p orted by data lters making the loading of extra data formats transparentto

the user

If you want to write your own data lters see the section on datalters

httpwwwatnfcsiroaukarmaprogrammermanualdatafiltershtmlpubdatafilters

in the Karma Programming Manual

The converter and tester programmes may b e sp ecied with absolute path

y give a plain lename and the PATH is searched As well as names or you ma

the normal absolute pathnames ie those with a leading character you

may also sp ecify an expression such as

KARMABASEsiteMACHINE OSbinsdfkarma

or alteratively

fKARMABASEusrlocalkarmagsitebinsdfkarma

which is useful if you wanttospecifyKARMABASEsitebinsdfkarma if the

KARMABASE environmentvariable is dened otherwise use

usrlocalkarmasitebinsdfkarma

instead This is a go o d way of providing a default lo cation

UNITS

Units

Karma follows the FITS conventions for units In other words SI units are

used Please see the FITS standard for more information

Coordinate Systems

The Karma data format supp orts simple regular coordinate systems as well as

irregularlyspaced coordinates In addition the curvilinear coordinate systems

ie Right AscensionDeclination and Galactic LongitudeGalactic Latitude

commonly found in astronomy are supp orted Many common pro jections for

these curvilinear coordinate systems are supp orted as is the p olynomialbased

pro jection used for DSS Digital Sky Survey images

The coordinate system supp ort is tightly integrated with much of the

Karma internal infrastructure In general mixing of data with dierent pro jec

tions is handled correctly For example displaying overlays and contours over a

greyscale image will work correctly even if the datasets have dierent rotations

scales and pro jections Supp ort for mixing dierent coordinate systems ie

RADEC overlaid with GLONGLAT is not yet supp orted nor are data of

mixed ep o chs

CHAPTER INTRODUCTION

Chapter

Common Features

Some features of dierent programmes are the same You may also notice

that parts of one programme may also be available as a separate programme

or also app ear in other programmes This is due to the mo dular approach

provided by Karma Most of the windowbased control panels you see are in

fact widgets and these are reused many times in the same programme or in

dierent programmes

Loading Data

All programmes have the same interface to load data Clicking left on Load or

File or whatever it is called will show a window with the les that you can load

This will b e all les with extension kf fts or fits Also sub directories and

the parent directory are shown Clicking on these changes the directory If a

directory is in fact a Miriad image dataset clicking on it will load that dataset

Note that GIPSY les consist of two les one with a descr extension and

another with a image extension Most of the software will simply display a

gipsy le instead since that makes the directory browser lo ok less cluttered

The Filep opup widget provides the le browsing interface This wid

get allows the user to browse a directory tree and select les All the les and

directories the application wants the user to see are displayed Any one of these

may b e selected by clicking the left mouse button over the lename The D

character is used to denote directories while the F character is used to de

note ordinary les Ab ove the list of les and directories is shown the current

directory for the browser If you edit the text and press return the current

directory is changed appropriately The notation is supp orted as well as

other simple Bourne Shelllike expansions of environment variables using the

variable fvariableg and fvariablewordg notations The following

controls are provided

close close the window

rescan rescan the directory in case a new le has app eared

pin enable to force the leselector window to stay pinned up even if

w once a le is selected les are selected The default is to close the windo

CHAPTER COMMON FEATURES

new create a new le browser The current directory will b e indep endent

of the original le browser

lter if enabled selected les are not automatically loaded rather the

LoadAndDecimate widget section is displayed

partial if enabled supp ort loading of partial les This is useful if you

want to see a preview of a dataset that is currently b eing written byan

other pro cess See the section on partialdata

httpwwwatnfcsiroaukarmausermanualpartialdatahtmlpubpartialdata

data in the Karma User Manual

writable if enabled the le may be mo died later ie by the image

editing facility

pull change the directory in this browser to match the most recent direc

tory change in any browser ie pull the most recent directory change

push change the directory in all other browsers to match the directory

for this browser ie push this directory to others

Convenience buttons for jumping to commonlyused directories maybecon

gured by the lo cal Karma administrator or by the user The following les are

searched

KARMABASEsharebrowserdirbuttons

KARMABASEsitesharebrowserdirbuttons

HOMEkarmabrowserdirbuttons

in that order The format of this le is a sequence of ASCI I lines with each

line containing the name of the button followed by the directory to jump to

For example

survey nfssurvey

mydata nfsdatausersfred

See Figure for a screen snapshot

SubsettingDecimation of Array Data

Sometimes your image or datacub e is to o big to handle eciently If you

have a le whichismuchbiggerthanyour physical memory RAM then most

of the visualisation to ols will run slower than a lame dog It generally do es

not make sense to visualise a dataset bigger than RAM To get around this

the visualisation to ols provide a mechanism whereby you can decimate a

dimensional image or dimensional cub e array Decimation involves taking

every N values along an axis and averaging them together to pro duce a single

output value then jumping to the next group of N input values If you use

a decimation factor of for each axis the output cub e is times smaller

LOADING DATA

Figure Screen snapshot of leselector panel

CHAPTER COMMON FEATURES

times smaller for an image You can also extract a sub cub e if you are only

interested in a small section of the data

Note that the decimator allo cates some temp orary dimensional buers

so when decimating a dimensional array the memory requirements may be

signicantly higher than rep orted for the output array

The LoadAndDecimate widget provides the decimation interface

This widget controls the pro cess of loading and decimating a datacub e The

user can skipaverage data values along each dimension as well as extract a

sub cub e The following controls are provided

Cancel close the windo w

Load load the le using the sp ecied parameters

Ab ort ab ort the loading pro cess

Auto Save if enabled the decimated sub cub e is automatically saved to

disc

X Start select the starting p osition of the sub cub e in the X dimension

Y Start select the starting p osition of the sub cub e in the Y dimension

Z Start select the starting p osition of the sub cub e in the Z dimension

X End select the end p osition of the sub cub e in the X dimension

Y End select the end p osition of the sub cub e in the Y dimension

Z End select the end p osition of the sub cub e in the Z dimension

X Skip select the skip factor along the X dimension The default value

of will makeevery input values along X averaged together

Y Skip select the skip factor along the Y dimension The default value

of will makeevery input values along Y averaged together

Z Skip select the skip factor along the Z dimension The default value

of will makeevery input values along Z averaged together

Output lename change this to select the name of the le whichissaved

to disc

Under the rst row of buttons the size of the le in data elements is

displayed and the memory size required by the decimated sub cub e is displayed

Underneath these the sub cub e b ottomleft corner BLC and topright corner

TRC coordinates are displayed and also the pixel increment INC

As you change the slider parameters the memory requirement changes as

do the BLC TRC and INC values and these are rep orted to you It is wise

to not use more than ab out half the physical RAM Random Access Memory

available in your machine

As the le is loaded and decimated a simple progress meter shows you how

much longer you havetowait Remember you can always ab ort See Figure for a screen snapshot

LOADING DATA

Figure Screen snapshot of decimation control panel

CHAPTER COMMON FEATURES

Intensity Scaling

With many images that you display you will want to change the colourtable

used The colourtable control app ears after selecting the PseudoColour

bit option in the Intensity menu in most to ols

The Cmapwinp opup widget provides the colourtable control interface

This widget controls a colourtable for a PseudoColour displaycanvas Data

values are used to index into a table of colours This is typically used for false

colour image display The following controls are provided

Close close the window

Reverse this reverses the colour table the colours of the minimum and

maximum are swapp ed

Invert this inv erts every colour eg white b ecomes black green b ecomes

purple blue b ecomes yellow and so on

Save this brings up a p opup windowwhichallows you to save a colourtable

Load this brings up a le browser p opup which allows you to load a

previously saved colourtable

You can manipulate the colours in the colourtable bymoving the round dot

in the big square b ox left mouse button Usually moving the dot horizontally

changes the apparent p osition of the colours while moving it vertically changes

the range of colours

There are many colour functions available to set the colourmap the de

fault one b eing Greyscale Some colour functions pro duce smo othlyvarying

colourtables while others have sharp b oundaries

A nal way of manipulating the colourtable is provided bytheRed Scale

Green Scale and Blue Scale sliders With these you can turn down the

amountofeac h primary colour for all the colours in the colourtable

See Figure for a screen snapshot

In many cases you will want to change the intensity scale in an image

This may be b ecause the image has a very large dynamic range or has a few

outlier values and the control provided by the colourtable is inadequate

Most programmes haveanIntensity menu with a selection named IScale for

Dataset which will p op up a Dataclip widget

This widget allows the user to sp ecify a numb er of data regions ranges

It it most often used to give control over a single region so that an intensity

The widget displays a histogram of the data values in range may b e sp ecied

the array with the vertical axis b eing logarithmic The following controls are

provided

Close close the window

Blank enable to blank data outside sp ecied region not all applications

will show this toggle

INTENSITY SCALING

Figure Screen snapshot of colourtable control panel

CHAPTER COMMON FEATURES

Zo om zo om the histogram display to the range of the current region

Unzo om unzo om the histogram display to the full range of the data

Apply apply any changes made to the regions most applications will

then rescale and display their main image

Auto Apply enable this to automatically apply every change as they are

made

Subset enable this to use only a subset of the input data This will sp eed

up the histogram computation and mayavoid unwanted outlier values

Full Range set the region to the full range of the data

set the region to clip to the inner of the data values ie clip

the lower and upp er of the data values Thisisvery handy when

your data contains outliers small numb ers of data values which lie far

away from the real data

set the region to clip to the inner of the data values

set the region to clip to the inner of the data values

set the region to clip to the inner of the data values

set the region to clip to the inner of the data v alues

set the region to clip to the inner of the data values

Save save a new le which has b een clipp ed to the sp ecied range

Output Typ e Menu change the output typ e of the array to save not

all applications will showthismenu

Filename string the name of the le which will b e saved This may be

changed prior to saving

If you click with the left mouse button in the histogram displayyou dene

the lower b oundary of a region If no region exists one is created If you then

click with the right mouse button the upp er b oundary is dened Once the

lower and upp er b oundaries are dened you will see twovertical lines depicting

the b oundaries with two diagonal lines joining them You will also see a circle

the height of which indicates the width of the region relative to the width of

the entire histogram If you click with the middle mouse button the horizontal

cursor p osition will control the midp oint of the region ie change the lower and

upp er b oundaries at the same time and the vertical cursor p osition changes

the width of the region You can drag any of the three mouse buttons to see

things continuously change

If you havenotyet dened a region you may rst click with the right button

to dene the upp er b oundary The lower b oundary is automatically set to the

data minimum This is a convenience facility when you want to set the lower

SEQUENCES OF IMAGES

b oundary to the data minimum and set the upp er b oundary manually You

can get the same eect by pressing Full Range rst and then clicking with the

right button

See Figure for a screen snapshot

You can also change the intensitycontrol p olicy by selecting the Intensity

Policy option in the Intensity menu This will p op up an IntensityPolicy

widget

This widget controls the intensity policy to be used for displaying image

data on a drawing canvas The following controls are provided

Close this will close the window

Apply apply control changes and refresh the window

automatically applied Auto Refresh if enabled each control change is

and the window refreshed

Auto Intensity Scale if enabled the intensityrange of the subimage

b eing viewed is mapp ed onto the colourmap otherwise the intensity range

of the entire imagemovie is mapp ed onto the colourmap

Reset IntensityUponFileLoadif enabled the intensity scale is reset

when a new dataset is loaded it is reset to the full data range If disabled

the intensity scale is not changed on le load

Intensity Scale Menu this menuallows you to change b etween dierent

intensity scales By default the intensity scale is linear but you can select

a logarithmic intensity scale or a squarero ot intensity scale If you are

using a logarithmic intensityscaleyou can set the Log Cycles value to

control the visible dynamic range in p owers of

See Figure for a screen snapshot

Sequences of Images

kvis programme you may wish to play it If you load a datacub e into the

as a movie sequence of images A window to control this sequence is under

ViewAnimate

The AnimateControl widget provides the animation control interface

This widget controls movie lo ops It allows the user to control the sp eed and

direction of moviesaswell as the ability to skip frames The following controls

are provided

Close close the window

Previous Frame show the previous frame

Next Frame show the next frame

Start Movie start the movie

CHAPTER COMMON FEATURES

Figure Screen snapshot of intensityzoomcontrol panel

SEQUENCES OF IMAGES

Figure Screen snapshot of intensity p olicy control panel

Stop Movie stop the movie

Sync wait for each frame to be drawn b efore sending the next draw

request Normally this is enabled You can make movies run a little bit

faster not much by disabling this but you run the risk of developing a

backlog of display requests in the displaymachinary A large backlog will

make the interactive resp onse extremely p o or

Spin Mo de you can select forward or backward spin or alternatively

spin forwardsbackwardsforwards

Anti Flicker remove the icker observed when overlays ie contours

andor annotations andor axis lab els are shown This is normally dis

abled b ecause it slows down movie playing and interactive display up

dates Also icker is only noticeable under some conditions complex

overlays andor slow display hardware

Frame Interval the time interval b etween b etween frame draws Alow

interval will give fast movies

Skip Factor allows you to skip frames A skip factor of would skip

every second frame

Goto Frame jump to the frame n umb er shown in the Current Frame

control

Current Frame the current frame number

Starting Frame the starting frame numb er in the movie lo op

CHAPTER COMMON FEATURES

Figure Screen snapshot of movie control panel

End Frame the end frame number in the movie lo op

You can also step through the cub e by clicking left for the previous frame

or click right for the next frame in the black rectangle which app ears below

the Goto Frame button In addition you can click middle and drag in this

black rectangle allowing you to dynamically slide through the movie

See Figure for a screen snapshot

Hardcopies

To make a PostPcript hardcopy of the display click on the menu button Ex

p ort in the visualisation to ols and select PostScript This will display the

Postscript widget This widget provides controls for generating PostScript

torientations and trays and allows you to queue hardcopy It supp orts dieren

directly to a printer The following controls are available

close this will close the window

save ps saveaPostScript le

EXPORTING DATA

save eps save an Encapsulated PostScript le

print queue directly to a printer

TrayMenu you can cho ose b etween default pap er or trays

Size Menu you can cho ose b etween a variety of media sizes A A A

letter and so on The Aletter size will t on b oth A and letter size

media If you select user defined then you can dene the b ounding

box using the oset and size controls describ ed below The default is

taken from the PAPER SIZEenvironmentvariable

Keep Asp ect if enabled screen will always be drawn square in

the PostScript output

Orientation Menu you can cho ose b etween p ortrait and landscap e ori

entation or you can let the choice b e automatic so that a b est t is made

eg a display window that is much wider than it is high would be dis

played in landscap e mo de on A size media

hoset controls the horizontal oset of the output

voset controls the vertical oset of the output

hsize controls the horizontal size of the output

vsize controls the vertical size of the output

Auto Increment when enabled existing PostScript les are not over

written rather the outle lename has an incrementing sequence number

added to it

Lo ck Filename when enabled the application will never automatically

change the suggested output lename

Output le controls the basename of the output le

Printer queue controls whichprinter queue to printto The default is

taken from the PRINTERenvironmentvariable

See Figure for a screen snapshot

Exp orting Data

Tosave data you are lo oking at clickleft and hold the Exp ort button This

will show the Exp ortMenu widget

This widget allows you to exp ort the currently displayed data to some other

format The following options are available

PostScript generate hardcopy output of the contents of the drawing

canvas This will p op up the Postscript widget section

CHAPTER COMMON FEATURES

Figure Screen snapshot of PostScript output control panel

ZOOMING

SunRasterle exp ort the currently viewed image to Sun Rasterle for

mat

PPM Data Image exp ort the currently viewed image data to PPM for

mat Nonimage data ie axis lab els and annotations are not exp orted

The output is at the resolution of the image data

PPM Data Movie exp ort the currently viewed cub e data to PPM for

mat similar to PPM Data Image One PPM le is written for eachimage

along the unseen axis

PPM Data Window exp ort the contents of the window to PPM format

Nonimage data ie axis lab els and annotations are also exp orted The

output is at the resolution of the window and yields higher quality than

using a separate screencapture to ol

Karma whole dataset exp ort the currently viewed dataset to Karma

format

FITS whole dataset exp ort the currently viewed dataset to FITS

format

Miriad whole dataset exp ort the currently viewed dataset to Miriad

Image format

GIPSY whole dataset exp ort the currently viewed dataset to GIPSY

format

Karma subset exp ort the currently viewed subimage to Karma for

mat If the subimage b eing viewed is a cub e the sub cub e will b e saved

FITS subset exp ort the currently viewed subimage to FITS format

If the subimage b eing view ed is a cub e the sub cub e will b e saved

Miriad Image subset exp ort the currently viewed subimage to

Miriad Image format If the subimage b eing viewed is a cub e the sub cub e

will b e saved

GIPSY subset exp ort the currently viewed subimage to GIPSY for

mat If the subimage b eing viewed is a cub e the sub cub e will b e saved

Zo oming

Most to ols provide a generic dimensional zo oming interface This interface is

provided by the ImageDisplay widget section

CHAPTER COMMON FEATURES

Resizingautoscaling

To resize a display window grab the b ottom right corner of it and drag to

the size that you want The image is up dated automatically Most programs

have a menu Zo om which has a selection Zo om Policy which will show the

Zo omPolicy widget whichgives you control over how zo oming is done

This widget controls the policy to be used for displaying image data on a

drawing canvas The following controls are provided

Close this will close the window

Apply apply control changes and refresh the window

Auto Refresh if enabled each control change is automatically applied

and the window refreshed

Fix Asp ect if enabled the image will b e expandedshrunk with the same

factor in b oth dimensions to ll the window If disabled the factors are

not necessarily the same ie the pixels will not b e square but the image

will ll the window b etter

Allow Truncation if enabled and the image is to o big for the window

and integer zo oming is enforced a few rows or columns of data may be

discarded to allow the image to b e shrunk

Integer X Zo om if enabled force zo oming in the horizontal dimension

do be done in integer multiples Turning this o allows you to ll the

window but can intro duce artefacts

Integer Y Zo om if enabled force zo oming in the vertical dimension

do be done in integer multiples Turning this o allows you to ll the

window but can intro duce artefacts

Zo om In on Middle Mouse Click if enabled clicking the middle mouse

button will zo om in x using the mouse click p osition as the new centre

Zo om Out on Right Mouse Click if enabled clicking the right mouse

button will zo om out x

See Figure for a screen snapshot

Axis Lab els

All the standard visualisation to ols now supp ort axis lab elling Most programs

haveanAxis Lab els button which will show the DressingControl widget

which gives you control over how lab elling is done

This widget controls the way axis lab els are drawn onto a canvas The

follo wing controls are available

Close this will close the window

AXIS LABELS

Figure Screen snapshot of zo om p olicy control panel

Enable if enabled the axis lab els are displayed

Apply apply control changes and refresh the window

Auto Refresh if enabled each control change is automatically applied

and the window refreshed

Show Lab els if enabled the axis names are displayed

Show Scale if enabled the scale values corresp onding to ma jor tick

marks are displayed

Show Top Tick Marks if enabled the tick marks at the top of the

window are displayed

Show Bottom Tick Marks if enabled the tick marks at the b ottom of

the window are displayed

Show Left Tick Marks if enabled the tick marks at the left of the

window are displayed

Show Right Tick Marks if enabled the tick marks at the rightofthe

window are displayed

Internal Ticks if enabled the default the tick marks are placed inside

the b ounding b ox otherwise they are placed outside

Grid Lines if enabled the coordinate grid is shown

Screen Colours pressing this will set the background colour of the win

dowtoblack and the colour of the axis lab els to green If a colourmap is

asso ciated with the window its Reverse option is turned o

CHAPTER COMMON FEATURES

Pap er Colours pressing this will set the background colour of the win

dow to white and the colour of the axis lab els to black If a colourmap is

asso ciated with the window its Reverse option is turned on

Change Colourmap if enabled the Reverse option for the window

colourmap Cmapwinp opup widget section is set when you

press either Screen Colours or Pap er Colours

Show Colourbar if enabled a colourbar is displayed This shows the

mapping b etween data value and colour Note that currently only linear

intensity scales are supp orted

Font scale this slider allows you to enlarge or shrink the font scale for

the lab els

A further set of controls is provided under the red line most of the time

you will not need to use these

Background Colour the background colour of the window You need

to press the Apply button for your changes to take eect

Lab el Colour the colour the lab els are drawn in You need to press the

Apply button for your changes to take eect

Grid Colour the colour the grid is drawn in

Note that the axis lab elling currently do es not handle coordinate systems

whichhave rotations close to degrees or degrees

See Figure for a screen snapshot

Magnifying Glass

Many programmes have a Zo om menuwitha Magnier option which when

selected will show a magnifyingglass window As you move the mouse cursor

window a zo omedin subsection around the cursor is over the main image

displayed in the magnifying glass This view is zo omed in four times the scale

of the input image If the image in the main window is zo omed in ten times

the view in the magnifying glass will actually b e smaller

This widget is a sub class of the SlaveImageDisplayPopup widget

Panner

Many programmes have a Zo om menu with a Panner option which when

selected will show a panner control window By pressing the left mouse button

in this window the image in the main window is panned

This widget is a sub class of the SlaveImageDisplayPopup widget

PANNER

Figure Screen snapshot of axis lab elling control panel

CHAPTER COMMON FEATURES

Sp ectrum Proles

Many programmes allowyou to p oint at an image and obtain the corresp onding

prole along the third axis usually a sp ectrum prole Some programmes

provide a Prole button whichyou need to press rst b efore you will see the

prole while some others will automatically display the prole window when

you have loaded a cub e of oatingp oint data You dont need to press any

buttons to up date the prole display simply p oint the mouse at the desired sp ot

The ability to display sp ectrum proles is provided by the TracePopup

widget This widget will display a line plot of a single trace of onedimensional

data It is fast allowing dynamic displa y of data and provides zo oming and

smo othing controls as well as having the ability to display axis lab els The

controls available are

Close this will close the window

Auto Zo om if enabled the vertical scale is automatically zo omed to the

range of the data in the prole

Unzo om this will unzo om the window

Smo oth menu to select what kind of smo othing to apply to the data

prior to display Both hanning and uniform smo othing kernels are avail

able with a range of sizes

Print this will p op up the Postscript widget section

Overlay this allows you to p opup various control panels to control overlay

display including axis lab elling section

Save Data this will p op up a dialog widget which allows you to sa vethe

data to a le The data is saved in a simple ASCI I format with a few

comment lines followed by two columns of numbers Therstcolumnis

for the horizontal axis and the second column is for the vertical axis

Style menu to select the drawing style for the data p oints The following

choices are available

join a straight line is drawn from each p oint to the next

hist a centred column is drawn for each p oint aka histogram

style

cross a small crosshair is drawn for each p oint

Zo oming in TracePopup Widget

To zo om a prole click left and drag the mouse still keeping the left button

down across the window You will see a rubb erbanded b ox stretching be

tween the rst p oint and the current mouse cursor p osition When you release

the button the section of the prole within the b ox will b e zo omed To unzo om

IMAGE STATISTICS

cho ose the Unzo om option in the Zo om menu or press the u key while the

cursor is in the prole window This will show the entire image

See Figure for a screen snapshot

Image Statistics

Many programmes have a facilityto compute and displaythe statistics of the

current subimage b eing viewed This interface is provided bytheImageDisplay

widget section

Viewing Header Information

Many programmes allowyou to insp ect the header of the dataset you are cur

rently viewing as an image This interface is provided bytheImageDisplay

widget section

Freezing Events

All drawing op erations in Karma to ols are p erformed on a canvas whichis

usually a big plain black or white rectangle

The canvas allows you to freeze mouse move op erations ie things which

happ en in resp onse to your moving the mouse over the window but not while

pressing any mouse buttons or keyb oard keys This is useful when you have

pointed at a certain place and want to maintain a p osition or prole display

while you move the mouse to some other window p erhaps to print the win

dow All you need to do is press the spacebar and any further mouse moves

are ignored If you press the spacebar again the mouse moves once again do

you dont forget that mouse moves are disabled you will something So that

hear a quiet b eep every time you move the mouse into the window

Similar to ab ove except that when pressing any mouse buttons or keyb oard

keys the freeze p osition is used rather than the real p osition of the mouse

Common Image Display Features

Many of the visualisation to ols have one or two very similar main windows

This is b ecause they are all derived from the ImageDisplay widget which

provides most of the common functionality Most of the to ols which use this

widget provide the following controls

Set sometimes lab elled as Files or Cub es this will p opup up the

Filep opup widget section

Intensity menu this will p opup widgets to control the colourmap

Cmapwinp opup intensity p olicy IntensityPolicy and in

tensity scaling section

CHAPTER COMMON FEATURES

Figure Screen snapshot of prole display window

COMMON IMAGE DISPLAYFEATURES

Zo om menu this allows you to p opup a magnier or a panner zo om the

image in or out x or x unzo om or p opup the Zo omPolicy widget

section

Overlays menu this allows you to p opup various control panels to control

overlaydisplay The following choices are available

Axis Lab els this will p opup controls for the axis lab elling section

Load Annotations this will bring up a le browser to load a le

of ASCI I overlay commands The le format is describ ed in an ap

p endix to the User Manual

Editor this will p opup the OverlayEditorControl widget sec

tion which allows you to interactively drawoverlays

Remove Last connection this will remove the last o verlayobject

sent via a network connection

Remove All connection this will remove all overlay ob jects sent

via a network connection

Contours this will p op up a le browser whichallows you to load an

image and displayitascontours You can load an unlimited number

of images this way

Exp ort menu you can exp ort data in a variety of formats See section

View this will p opup a control panel used for displaying two datasets sec

tion This is only available in to ols like kvis and Multib eamView

Edit this will p opup the ImageEditorControl widget section

whichallows you to interactively edit image data

Quit this will quit the application

Set sometimes lab elled as Images this will p opup up the Filep opup

widget section

You will also see a few lines of display under the control buttons which

gives information ab out the data under the current cursor p osition

See Figure for a screen snapshot

The Magnier

Wherever you move the mouse over the main image you will see a magnied

p ortion of that part of the image the magnication is x the data resolution

You can resize the magnier window

CHAPTER COMMON FEATURES

Figure Screen snapshot of generic main window

COMMON IMAGE DISPLAYFEATURES

The Panner

Simply click with the left mouse button in the panner window and the main

window will pan to the desired lo cation The panner window will display a

green rectangle showing you where you have panned to relative to the entire

image You can resize the panner window When you select the panner from

the Intensity menu the panner is p opp ed up and the main windowis set to

panning mo de

Zo oming in the ImageDisplay Widget

To zo om an image click left and drag the mouse still keeping the left button

down across the window You will see a rubb erbanded b ox stretching be

tween the rst p oint and the current mouse cursor p osition When you release

the button the section of the image within the b oxwillbezoomed To unzo om

cho ose the Unzo om option in the Zo om menu or press the u key while the

cursor is in the image window This will showtheentire image

You can also press the i key zo om in and the image is zo omed x with

the new centre of the image b eing the p osition of the mouse when the i key

was pressed You can zo om in as many times as you like Tounzoomxpress

the o key zo om out When unzo oming it do esnt matter where the mouse

is

If you press and release the left mouse button without moving the mouse

in between the image will be panned so that what is under the mouse cur

sor is moved to the centre of the image An extra facility in kvis and

Multib eamView is the ability to zo om in and out using the middle and

right mouse buttons resp ectively in a similar fashion to using the i and o

keys

Note that these zo om controls are not available when you place the main

window in panning mo de

Another key you can press is r which simply refreshes the window without

changing the zo om area

Image Statistics in the ImageDisplay Widget

Many programmes have a facilityto compute and displaythe statistics of the

current subimage b eing viewed Simply press the s key in the display win

dow and you will see a summary of the image statistics in the terminal window

This summary includes the number of nonblank values the standard devi

ation the mean minimum maximum and sum value Alternatively you can

click left and drag the mouse to a new p osition still holding the mouse down

and press the s key The statistics are computed over the boxed area Af

ter you press s you may release the mouse button This feature saves you

from having to zo om in and unzo om every time you wish to compute statistics

on a subimage Note that the old box remains on the image until something

clears it this is useful when you wanttoknowwhich regions you hav e already

computed statistics over

CHAPTER COMMON FEATURES

The v key allows you to see the individual image pixel values rather than

their statistics This works in a similar fashion to the s key The V key is

a variation whichshows raw image pixel values Note that if you press v or

V without the mouse all the pixels in the subimage b eing viewed would be

printed Since this can take a long time with a large numb er of pixels a warning

message is issued if you attempt this with many pixels If you denately want

to display a large numb er of pixels press the control key at the same time

Viewing Header Information in the ImageDisplay Widget

Many programmes allowyou to insp ect the header of the dataset you are cur

rently viewing as an image Simply press the h key and the header will be

displayed in the terminal window If you press the H key you will get the

header without the history

Capturing Coordinate p ositions in the ImageDisplay Widget

Many programmes allowyou to capture the currentworld coordinate p osition

of the mouse by pressing the l key in the image window The output is set

to the standard output which you may redirect to a le prior to starting the

programme

Generating Moment Maps

Some of the programmes allow you to generate quick moment maps This is

usually available in to ols where you need b oth a cub e and an image of a similar

section of sky Tosaveyou the trouble of going into an astromonical reduction

package to generate the moment maps a menu is provided so that you can

generate and view a moment map This is usually the Loaded Image Menu

and has entries like th moment and st moment Selecting either one of

these will p op up the MomentGenerator widget This widget allows the

user to generate the th total intensity and st velo city eld moment maps

from a cub e The following controls are available

Close this will close the window

Apply Parameters this will apply the parameters and compute the

moment maps

st Moment Algorithm Menu this allows you to cho ose between a

simple weighted mean algorithm or a more robust median algorithm

wer Clip Level values in the cub e lower than this value are not used Lo

in the computation of the moments

Sum Clip Level values in the computed th moment map lower than

this value are not used in the computation of the st momentmap

Start Channel the rst channel that will b e used in the computation

CURSOR READOUT

Figure Screen snapshot of moment map generator control panel

End Channel the last channel that will b e used in the computation

See Figure for a screen snapshot

Cursor Readout

Most data display windows have cursor readout facilities simply move the

mouse over the displaycanvas and you will see a few lines of numbers change

ab ove the canvas In most cases p ositions are shown b oth in data pixel co

ordinates as well as realworld coordinates

Warning for Astronomers

Most astronomical reduction packages count from so the b ottomleft corner

of an image is at This reects the FORTRAN language from which these

packages originated The Karma software is written in the C language and

reects the C convention of counting from This means that the b ottomleft

corner of an image is at in Karma

CHAPTER COMMON FEATURES

GUI Commandline Switches

Many of the Graphical User Interface to ols have a number of commandline

switches whichmay b e used to mo dify their b ehaviour These are listed b elow

private cmap This option will force the to ol to use a private colourmap

for its PseudoColour window Otherwise the to ol trys to allo cate colours

from the default colourmap

colours This option sp ecies the number of colour cells that the num

to ol will try to allo cate for its PsuedoColour window up on startup If less

colours are available it allo cates as many as p ossible minimum

cmap master hostp ort This option will make the to ol use the colourmap

of another to ol The host p ortion of the second argument is the Internet

hostname or address where another Karma to ol is running If this is

or lo calhost the to ol to connect to is running on the same ma

chine The port p ortion sp ecies which Karma programme to connect to

You may use the port numb er which is displayed in the other to ols title

bar or you may use the name of the to ol such as kvis and it will

connect to the rst kvis to ol you started on that machine

fullscreen This option will make the image display window takeupthe

entire screen This is useful if you wish to make a of the data You

will need to congure your window manager to cycle the windowstacking

the Back key with the Op en order when a sp ecial key is pressed eg

Lo ok window manager Alternatively pressing the right mouse button

in the image window will place it underneath other windows See also the

app endix on making videos app endix E

In addition the standard Xt commandline switches are supp orted Read

the manual page for xterm for more details In particular the following options

are worth noting

display control where the to ol is displayed

geometry control the size and p ostion of the to ol

xrm pass a resource string

Avoiding Colourmap Flashing

Standard workstations with bit PseudoColour displays only have a single

colourmap active at one time If you start two display to ols each wanting

to use a large numb er of colours then when you move the mouse b etween the

windows you get that horrible colourmap ashing eect as the window manager

up dates the hardware colourmap Also since the colours used by one to ol are

likely to b e quite dierent from those used in another to ol the image in one to ol

will lo ok completely wrong when the mouse is in another to ol It is particularly

annoying if colourmap ashing o ccurs when moving b etween an image window

GUI COMMANDLINE SWITCHES

and the desktop ie normal terminal windows b ecause often you may want

to read something in a terminal window while also lo oking at an image There

are a number of ways to get around this

One of the most common problems is a WWW browser like Netscap e or

a displaytoollike xv or ghostview which is started b efore you start a display

to ol You can try to limit the number of colours Netscap e uses but I havent

found that to be all that reliable You can also use the install command

line switch which will force Netscap e to use its own colourmap rather than

course mean that as you stealing colours from the standard one This will of

move the mouse into the Netscap e window the colours ash but in practice

this shouldnt matter so much because p eople tend to use Netscap e less often

than a visualisation to ol

Another more recent and more insidious problem is the CDE the Com

mon Desktop Environment which steals not only to o much screen space but

also a large numb er of colours Unfortunately users dont get muchchoice ab out

CDE as the system administrator often blindly enables it when installing the

op erating system If you start a display to ol under CDE the to ol will usu

ally have to create its own private colourmap in order to get enough colours

This would give you that colourmap ashing whenever you move between the

image window and the desktop You can try to get around this by using the

num colours option to Karma to ols see ab ove Many to ols try to allo cate

colours but you can use instead and it is usually still workable In the

long run though it is probably b etter to get rid of CDE or p ossibly congure

it so it only takes a few colours go o d luck

Another problem can b e when you use more than one Karma visualisation

to ol at the same time The second to ol is likely to create its own colourmap

b ecause the standard desktop colourmap has few colours left You can either

reduce the numb er of colours required byeach to ol or you can share colourmaps

using the cmap master hostp ort commandline switchseeabove

Finally you may be wanting to use a Karma visualisation to ol as well as

some other display to ol To avoid colourmap ashing you will need to reduce

the numb er of colours each to ol uses You will need to read the manual for the

other to ol to see what option controls the colourmap size

Summary

Examples of things you can do

unix netscape install

If running within the CDE or other display to ols eg SAOimage

unix kvis num colours

and reducing the numb er of colours in the other to ols

unix saoimage

When running multiple Karma to ols at once even on dierent machines

you can do this

junior kvis

CHAPTER COMMON FEATURES

Figure Screen snapshot of overlay editor control panel

Port allocated

jumbo xray cmap master junior

Drawing Overlays

Many to ols provide a facilitytodrawoverlays This is provided bytheOverlayEditorControl

widget

This widget allows you to interactively drawoverlays on top of an image It

uses the overlay package which maintains a list of geometric gures which

should b e drawn

The following controls are provided

Close this will close the window

Remove Last will remove the last overlay that you drew from the list

Remove All will remove all overlays from the list

Ob ject Menu allows you to cho ose b etween the dierenttyp es of ob ject

that you can draw

First Co ordinate Typ e Menu sets the coordinate typ e of the rst

dening p oint for a geometric ob ject

Remaining Co ordinate Typ es Menu sets the coordinate typ es of the

remaining p oints which dene a geometric ob ject

See Figure for a screen snapshot

This widget uses the middle mouse button for its drawing functions Some

to ols may already be using this button for other purp oses in which case the

to ol should provide a control which allows you to disable the normal use of the

middle mouse button For instance the kvis programme provides such a

control through the Zo omPolicy widget section

LOADING OVERLAYS

Drawing Rectangles

You clickdown the mouse button to dene one corner of the rectangle and move

the mouse keeping the button down until you have a rectangle to your liking

Once you are happy release the button and the rectangle will b e added to the

overlay list

Drawing Ellipses

Click the mouse button to dene the centre of the ellipse and move the mouse

keeping the button down to change the size and shap e of the ellipse If you

press and release the r key still with the button down this will toggle rotation

mo de so that nowasyou move the mouse the ellipse will rotate To leave rotate

mo de just press the r key again and you will be back to changing the size

and shap e of the ellipse Once you have an ellipse you are happy with release

the mouse button and it will b e added to the overlaylist

Drawing Polygons

Click and release the mouse button to dene the rst and subsequentvertices

of the p olygon To close terminate the p olygon click and release the button

twice without moving the mouse Once you have closed the p olygon it is added

to the overlay list

Loading Overlays

Many to ols provide a facility to load overlays annotations from an ASCI I le

Please see app endix D for details

Editing Images

Many to ols provide a facility to edit image data This is provided by the

ImageEditorControl widget

This widget allows you to interactively edit images It uses the iedit

package whic h maintains a list of geometric gures which can be drawn and

then applied to data

The following controls are provided

Close this will close the window

Undo Last will undo the last edit ob ject that you drew from the list

Undo All will undo all edit ob jects from the list

Apply apply the edit ob jects to the data after this you can no longer

undo previous edits

Brush Width the width of the paint brush in pixels

CHAPTER COMMON FEATURES

Paint Value the data value to paintwith

Minimum set the data value to paint with to the current minimum clip

value for the displaycanvas

Middle set the data value to paint with to halfwaybetween the current

minimum and maximum clip values for the displaycanvas

Maximum set the data value to paint with to the current maximum

clip value for the displaycanvas

This widget uses the middle mouse button for its drawing functions Some

to ols may already be using this button for other purp oses in which case the

to ol should provide a control which allows you to disable the normal use of the

programme provides such a middle mouse button For instance the kvis

control through the Zo omPolicy widget section

The drawing interface is the same as for the OverlayEditorControl widget section

Chapter

Viewing and Comparing

multiple Images and Cub es

The kvis programme allows you to view multiple datasets

This to ol allows you to compare dierent datasets in a very easy fashion

You can displayany dataset as an image overlaycontours of datasets showpro

les along any axis and muchmore The programme uses the ImageDisplay

widget section to provide the usual interface

Overview

Thetooliscentred around the concept of a blinkstate which denes howyou

want to display datasets ie which dataset is shown as the image which

datasets are shown as contours howtocontrol movies and proles and so on

A blinkstate can control the display settings of all datasets that have been

loaded into the application

Multiple blinkstates may b e created each with a dierent conguration of

what datasets are to b e shown By pressing a key the displayisswitched from

one blinkstate to another

Blinkstates are created and managed using the DataBrowser widget

View Control

Pressing the View button will p op up the ViewDatasets widget

This widget provides controls for a display window to manage the display

of multiple datasets Most of the controls for data display management are in

the DataBrowser widget

The controls provided are

Close this will close the window

Browsers this will pop up the data browser windows for this display

window

CHAPTER VIEWING AND COMPARING MULTIPLE IMAGES AND CUBES

Movie this will pop up the AnimateControl widget section

whichwillallowyou to playmovies and step through frames In addition

the following key bindings are dened for the main display window

PgDn go to previous frame

PgUp go to next frame

Home go to start frame

End go to end frame

On some keyb oards PgDn is marked as Next and PgUp is marked as Prev

Prole Mo de Menu this allows you to pop up the TracePopup

widget section and cho ose the prole mo de The following mo des

are available

None will p op down the TracePopup widget

Line will show a single prole in the selected direction

Box Sum lets you draw a box over the image window using the

middle mouse button in a similar wayas using the left mouse but

ton to zo om and then the sum of all the proles in that region is

displayed Box modeonlyworks for dimensional datasets and will

always display a prole along the unseen dimension

BoxAverage is like the boxsummo de except that the average of

all proles is displayed rather than the sum

Radial will azimuthally average the image plane data and pro duce

a plot of average value versus radius A gaussian is then tted to

the radial prole and overplotted in red and the FWHM full width

half max of the gaussian is displayed over the prole You must

click the middle mouse button to dene the centre of the ob ject of

interest then keeping the mouse button down drag out to dene

the maximum radius of the prole and release the button to display

The algorithm automatically adjusts the centre p osition using a cen

troiding op eration so you dont have tobetoocarefulaboutpicking

the centre of your ob ject More information on the centroidingal

gorithm

e httpwwwatnfcsiroaukarmausermanualcentroidingalgorithmhtmlpubc

can b e found in the Karma User Manual

The programme should also work with a photographic negative The

centroiding algorithm is automatically mo died to lo ok for a trough

rather than a p eak

Boxed Horiz will pro duce a horizontal prole which is averaged

vertically The b oxisdrawn the same way as for the boxsummo de

The horizontal centroid of the prole is computed and a gaussian is

tted and displayed

VIEW CONTROL

Boxed Vert will pro duce a vertical prole whichisaveraged hori

zontally The b oxisdrawn the same wayasforthebox sum mo de

The vertical centroid of the prole is computed and a gaussian is

tted and displayed

Slice Direction Menu this allows you to cho ose howyou want to slice

your cub e You can view XY XZ or ZY planes

Prole Axis Menu this allows you to cho ose along whichaxisyou want

the prole to b e displayed valid only for line prole mo de

Freeze Displayed IntensityRangeif unset the default the intensity

range sp ecied for a dataset is used when that dataset is displayed as an

image If set switching from one dataset to the next will not change the

displayed in tensity range however changing the intensity range for the

image dataset will change the displayed intensity range

Track Cursor if set the corresp onding image display window will lis

ten for cursor moves which occur in other image display windows and

will draw a red circle at the same world coordinate p osition

Show Frame in Line Prole if this is set the current frame displayed

in the main image window is shown as a vertical red line in the prole

window This marker is only drawn if the prole axis is the unseen axis

Auto Title if enabled the axis lab elling title is automatically generated

Whenever this is disabled the string sp ecied by Axis Lab elling Title

is used instead

Show Beam if enabled the dataset headers are searched for BPA

BMAJ and BMIN FITSstyle keywords If these keywords are present

a representation of the telescop e b eam is overlaid on the image

Show Beam Name if enabled the name of the dataset is placed near

the b eam representation

Beam Xp os controls the horizontal p osition of the the b eam

Beam Yp os controls the vertical p osition of the the b eam

In addition if you click the left mouse button in the display window without

moving it in between the press and release the image will pan across If you

click the middle mouse button the image will zo om in x the new centre of

the image will b e the place where you clicked Click the righ t mouse button to

zo om out x If the prole mo de is b ox then you cant use the middle mouse

button to zo om

Pressing the c key in the display window will compute and display a scatter

plot of intensityvalues in the image dataset versus intensityvaluesinthe al

ternate dataset This is useful for seeing if there is a correlation b etween the

values in two images You can use the left mouse button to dene a subimage

similarly to zo oming in from which the scatter plot is computed See Figure for a screen snapshot

CHAPTER VIEWING AND COMPARING MULTIPLE IMAGES AND CUBES

Figure Screen snapshot of view control panel

Data Browser

This widget provides controls for managing the displayofmultiple datasets

See Figure for a screen snapshot

The controls provided are

Browser Controls

Close this will close the window

Destroy the blinkstate that the browser is showing is destroyed It is

not p ossible to destroy the rst blinkstate for the display window

Copy create a new blinkstate and browser which has the same cong

uration as the currently viewed blinkstate In all mo de the browser for

the new blinkstate is p opp ed up

Show menu gives control over howthevarious blinkstates are displayed

The following mo des are available

all each blinkstate is viewed in its own browser

some each display window has a single browser which can b e switched

to displayany blinkstate for the display window

selects which kind of data is displayed in the browser The Data menu

choices are

Arrays gridded array data can b e viewed as images or contours

DATABROWSER

Figure Screen snapshot of data browser

CHAPTER VIEWING AND COMPARING MULTIPLE IMAGES AND CUBES

Annotations text and geometric gures which can be overlaid for

annotation purp oses

Advanced this will raise the advanced control panel section

Make Data this will raise the makedatacontrol panel section

Data List

Beneath these general controls the list of loaded data app ears Eachlineshows

the name and a summary of the conguration settings for that dataset The

list section is dierentfor each data typ e There are common op erations that

may b e p erformed irresp ectiveofdatatyp e which are describ ed here

There is always a highlighted line which shows whichentry you can make

changes to using either the mouse buttons or the keyb oard The highlighted

line is shown by a sligh tly dierent background colour You can change the

highlighted line by using the mouse or updown arrowkeys

There is also a selected line which shows whichentry has more detail shown

in the sections below The list section only shows a summary of the current

conguration for each dataset The selected line is shown by using reverse video

If the browser is in active mo de the default then the selected line is lo cked

to the highlighted line If in passive mo de the selected line do es not moveuntil

you explicitly select an entry

If you select an entry while in active mo de the browser switches to passive

mo de If in passive mo de and you select the already selected entry the browser

switches to active mo de

As the mouse is moved over the data names one of the names will be

highlighted The mouse and keyb oard may be pressed to control the settings

of the highlighted data The following bindings are available

Left Mouse select the highlighted dataset for display in the sections

b elow and disable active mo de If the data is already selected and active

mo de is disabled active mo de is enabled

Spacebar same eect as left mouse button

Up Arrow highlight and select the previous data

Down Arrow highlight and select the next data

equals sign selects this dataset for replacement section copying

all data attributes

tilde sign selects this dataset for replacement section without

attribute copying

There are other key bindings whic h are indep endent of which dataset the

mouse is highlighting

Left Arrow cycle backwards in the list of blinkstates for the same win

dow in Some or One mo des Has no eect in All mo de

DATABROWSER

Right Arrow as ab ove but cycle forwards

Shift Left Arrow similar to Left Arrow but also make the blinkstate

active

Shift Right Arrow similar to Right Arrow but also make the blink

state active

Control Left Arrow cycle backwards to the last browser for the previous

display windowOne mo de Has no eect in other mo des

Control Right Arrow cycle forwards to the rst browser for the next

display windowOne mo de Has no eect in other mo des

Shift Control Left Arrow similar to Control Left Arrow but also

make the blinkstate active

Shift Control RightArrow similar to Control Right Arrow but also

make the blinkstate active

b key blink the display window to the next browser for this display

window

B key make the currently viewed blinkstate active

key blink the display window to the next browser for this display

window

key blink the display window to the next browser for this display

window

The list section will show single character co des in a number of columns

to the left of the data entry names Dierent data typ es will show a dierent

number of columns and the character co des have dierent meanings as well

However following convention is followed

equals sign this dataset has been selected for replacement section

with data attribute copying

tilde sign this dataset has b een selected for replacement section

without attribute copying

upp ercase this is an exclusive option only one entry may have this

option set p er blinkstate

lowercase noninclusive option Any number of entries may have this

option set

Below the list of data more detailed information and conguration settings

are shown The app earance dep ends on the kind of data b eing shown

The conguration controls for the dierentdatatyp es are describ ed b elow

CHAPTER VIEWING AND COMPARING MULTIPLE IMAGES AND CUBES

Data Replacement

As discussed ab ove a dataset may be selected for replacement When a new

dataset is loaded the list of already loaded datasets is scanned for a dataset

which has been selected for replacement and was loaded from the same data

source A typical data source is a le browser but may also include network

connections When a dataset is replaced with a new one either all the old

settings such as intensity range contour levels etc are retained or none of

the settings are retained dep ending on which replacementmodewas selected

If more than one dataset is selected for replacement and these datasets were

loaded from the same data source the selected dataset closest to the top of the

list is replaced

Note that if a data source is removed eg a le browser is destroyed then

datasets loaded via that data source can no longer b e replaced These datasets

can still b e explicitly unloaded however

Array List

There are several columns used to display a summary of the conguration using

a simple legend These are describ ed b elow

Image Column shows which datasets contribute to the displayed im

age These are exclusive settings The legend is

I show this array as the image

A this array is the alternate image for intensityintensity scatter

plot computation hueintensity

Contour Column shows which datasets are displayed as contours These

are nonexclusive settings The legend is

c show this array as a normal contour map

y as a Renzogram only for cub es r show this arra

Movie Column shows which datasets can be shown as a movie The

legend is

M enable movie controls for this array

m slave this arraytothemovie controls

Prole Column shows which datasets can be shown as proles The

legend is

P display line proles of this array this array controls the axis la

b elling and is drawn on top

p display line proles of this array

The following keyb oard and mouse bindings are available to quickly control the conguration

DATABROWSER

Middle Mouse show as the image the previous image b ecomes the

alternate image If already displayed as the image disable image display

Right Mouse toggle b etween enabling and disabling contour display

i key same eect as the middle mouse button

controli make the next dataset in the list the currently displayed image

This will cycle back to the top of the list when the end is reached

controlshifti make the previous dataset in the list the currently dis

played image This will cycle back to the end of the list when the top is

reached

a key make this image the alternate image

c key same eect as the right mouse button

r key toggle between enabling and disabling Renzogram display

controlc enable contours and apply levels

controlr enable Renzogram and apply level

M key enable movie controls for this array

m key slave this array to the movie controls

P key display line proles of this array this array controls the axis

lab elling and is drawn on top

p key display line proles of this array

Detailed Array Information

This shows information ab out the array suchasthe directory from where the

arraywas loaded the format of the data ie FITS AIPS Miriad Gipsy and

many more the size and dimensionality and the range of data values The

following control buttons are available

Histogram pop up a histogram for this array The histogram display

can b e used to control the intensity range for this array

Clone create a virtual copy of the array which will have indep endentcon

guration settings Note that the data are not copied instead a reference

is made

Unload unload the array

Note that these op erations aect all browsersblinkstates and all display

windows

CHAPTER VIEWING AND COMPARING MULTIPLE IMAGES AND CUBES

Array Conguration

How to display an array is controlled via this section Some controls are per

blinkstate while others are global and apply to all blinkstates and all display

windows The following controls are p er blinkstate

Image menu The choices are

o the array is not selected for image display

main the array is selected for normal image display

alt the array is the alternate image for computing intensityintensity

scatter plots

Contour menu The choices are

o the array is not displayed as contours

map the array is shown as normal contours

renzo the array is shown as a Renzogram

Movie menu The choices are

o the array will not b e shown as a movie

master the arra y is shown as a movie and controls the frames

slave the arrayisshown as a movie and is slaved to the master

The following controls are global to the application and aect all blink

states and display windows

Low the low end of the intensity range

High the high end of the intensity range

Map Contour Levels the contour levels for normal contours The syn

tax for the contour levels is as follows

just typ e the levels you want eg

levels with a constant increment means that

the rst level is that this level is incremented with

reached So this example gives the same levels as in until is

the rst case

levels incremented by a factor This gives levels

levels as p ercentage of the p eak rst character should b e num

b ers are taken as p ercentage the rest of the syntax is as ab ove eg

gives and of the maximum of the data

the sp ecial values min and max indicate the minimum and maximum

value

DATABROWSER

These options can be mixed ie

is interpreted correctly You should press the enter key for your

changes to takeeect

ve Cont Width the width of negativecontour levels

ve Cont Width the width of p ositivecontour levels

Colour the colour of negativecontour levels

Colour the colour of p ositivecontour levels

Renzo Contour Levels the contour levels for Renzograms The syntax

is the same as for the contour levels

Renzogram Channels the channels along the unseen axis to display

in the Renzogram The syntax is similar as for the contour levels except

press the enter key for that a leading I or W must b e given Again

your changes to take eect These leading characters have the following

meaning

I sp ecify channel Indices Thus Iminmax selects channels b etween

channel the rst and the last channel in single channel increments

ie all channels For example if you wanted to display channels

to inclusive typ e I

W sp ecify World coordinates ie velo city in ms or frequency in

Hz For example if you wantedtoshowchannels b etween and

MHz in KHz steps typ e Weee

Prole menu The choices are

o the arra y will not b e shown as a prole

master the arrayisshown as a prole is drawn on top and controls

the axis lab els

slave the arrayisshown as a prole and is slaved to the master

Dark the colour to use for prole display This must be a dark colour

appropriate for displayonlightbackgrounds ie white pap er

Light the colour to use for prole display This must be a light colour

appropriate for displayondarkbackgrounds ie a computer monitor

Advanced Control Panel

This control panel allows you to control some extra asp ects of the b ehaviour of

all data browsers The following controls are available

Close this will close the window

low and high clip levels Clip Mo de menu controls how changes in the

aect display windows The following mo des are available

CHAPTER VIEWING AND COMPARING MULTIPLE IMAGES AND CUBES

Image and Proles the image intensity range and prole vertical

range are synchronised and clip level changes aect both

Images only only the image intensity range is aected bycliplevel

changes

Proles only only the prole vertical range is aected by clip level

changes

Both later the image intensity range and prole vertical range are

aected by subsequentcliplevel changes but they are not immedi

ately synchronised

Range changes aect all arrays if this is turned on an attempt to

change the clip levels of any array dataset will change the clip levels for

all array datasets

Make slaved movie on load if this is turned on an array dataset with

three or more dimensions will b e automatically marked as a movie slave

when loaded

Activate annotations on load if this is turned on an annotation

dataset is automatically made activeie displayed when loaded

Slave Prole Hrange to image window if this is turned on the

horizontal range of the prole window is set to the same as the horizontal

range of the image window if the the axes corresp ond

Show new data as Image if this is turned on an array dataset is

marked as the active image when loaded

Make Data Control Panel

This control panel allows you to create new array data from existing arraydata

This is useful if you want to combine data together The following controls are

available

Close this will close the window

Algorithm menucontrols how data arrays are combined The following

mo des are available

RGB combine one two or three datasets into an RGB red green

and blue array Each colour comp onent is bits yielding a bit

array The input values between the low and high clip are linearly

scaled into the output If the clip values on an input array are

subsequently changed the RGB image is rescaled The following

bindings are available

R use this dataset as the red colour comp onen t

G use this dataset as the green colour comp onent

B use this dataset as the blue colour comp onent

DATABROWSER

Left Mouse use this dataset as the red colour comp onent

Middle Mouse use this dataset as the green colour comp onent

Right Mouse use this dataset as the blue colour comp onent

use this dataset as the grid template

Arithmetic combine multiple datasets using simple arithmetic ad

dition subtraction multiplication or division The output dataset

is computed by pro cessing the list of datasets from top to bottom

applying the sp ecied arithmetic op erations for selected datasets

Before pro cessing any datasets the output dataset is initialised to

either zeros if the rst op erator is addition or subtraction or ones

if the rst op erator is multiplication or division The following

bindings are available

add this dataset to the output dataset

subtract this dataset from the output dataset

multiply the output dataset by this dataset

divide the output dataset by this dataset

Hue Intensity combine two datasets into a HueIntensity array

The two datasets may be directly mapp ed to intensity and hue or

they can represent a complex image The real and imaginary com

ponents will b e in separate datasets and they are converted to am

plitude and phase values which are then mapp ed to intensity and

hue The following bindings are available

B use this dataset as the brightness intensity comp onent

H use this dataset as the hue colour comp onent

R use this dataset as the real comp onent

I use this dataset as the imaginary comp onent

Left Mouse use this dataset as the brightness comp onent

Middle Mouse use this dataset as the hue comp onent

Right Mouse use this dataset as the grid template

use this dataset as the grid template

the dataset list shows the available datasets This is used to mark which

datasets are used as inputs to the combining pro cess This list has a

similar interface as the dataset list in the data browser Note that in

most cases a dataset can only be marked once If you need to mark a

dataset for multiple purp oses such as to use it for both red and green

inputs you will need to clone the dataset rst

ws you to sp ecify the name for the new dataset A default Name this allo

name is provided

Make this will create the new dataset based on the selections you have

made This could take some time dep ending on how large the input datasets are

CHAPTER VIEWING AND COMPARING MULTIPLE IMAGES AND CUBES

Annotation List

There is just one column used to display a summary of the conguration The

a character is used to indicate whether a annotation le is active visible or

not The a key may be used to switch between the two states The middle

mouse button has the same eect of switching b etween the two states

Detailed Annotation Information

This shows where directory from which the annotation le was loaded the

Unload button may be used to unload the annotation le This aects all

blinkstates and display windows

Annotation Conguration

The Active toggle may b e used to switchbetween active visible and inactiv e

settings for this annotation le

Commandline Options

You may pass the names of les to b e loaded via the commandline You may

sp ecify as many les as you desire up to the limit imp osed by the op erating

system

IntensityIntensity Scatter Plots

Earlier in this chapter is a brief description of howyou can use the c key

to compute and displayanintensityintensity scatter plot of two images You

may also use this facility to display a scatter plot of twochannels from the same

cub e Simply clone the cub e ie using the Clone data browser button and

select the two channels one from each cub e You will need to ensure that the

original and cloned cub e do not have a masterslavemovie relationship

If there is a masterslave movie relationship then the scatter plot is com

puted using the two frames whichhave corresp onding coordinates for the frame

axes This is usually the desired setting when generating scatter plots from

frames of two dierent cub es

Note that when computing a scatter plot from two images with a dierent

coordinate grid the pixels from the unseen image corresp ond to pixels with

the same world coordinates in the visible image Thus there is no need to

regrid either of the images

Renzograms an alternative to velo city elds

A renzogram is a technique for displaying velo city information in a cub e in

a dierent b etter way than velo city elds The technique was pioneered by

Renzo Sancisi at the Kapteyn Institute in Groningen A renzogram overlays

a singlelevel contour map for every channel in a cub e over an image such

RENZOGRAMS AN ALTERNATIVE TO VELOCITY FIELDS

as an optical image or moment map The contour map for each channel is

displayed in a dierent colour typically redblue although this can b e changed

interactively This has an advantage over velo city elds b ecause it shows

multiple p eaks in the velo city prole whicha velo city eld cannot do

To use this feature simply load a cub e and select it for renzogram display

in the data browser You can control the contour level used for the renzogram

and the range of channels displayed

You may wish to load a separate image p erhaps an optical image and

displaythatas the image This can be useful for comparing optical and radio

data

can also view a prole section sp ectrum of your cub e Just You

select select line prole display and a prole window will app ear You will note

that the prole is drawn in the same colours as the contours

CHAPTER VIEWING AND COMPARING MULTIPLE IMAGES AND CUBES

Chapter

Viewing Images and Cub es

with the Multib eam

Note that this to ol will b e replaced with the more p owerful kvis chap

ter programme

The Multib eamView programme allows you to view two datasets

This allows you to compare dierent datasets in a very easy fashion This

programme uses the ImageDisplay widget section to provide the

usual interface Pressing the View button will p op up the ViewDatasets

widget This widget provides an advanced control for two datasets either two

dimensional or threedimensional It allows the user to display one dataset or

the other overlay contours of one over the other show proles along anyaxis

trols provided are and much more The con

Close this will close the window

Movie this will pop up the AnimateControl widget section

which will allowyou to playmovies and step through frames In addition

the following key bindings are dened for the main display window

PgDn go to previous frame

PgUp go to next frame

Home go to start frame

End go to end frame

On some keyb oards PgDn is marked as Next and PgUp is marked as Prev

Blink if enabled dataset is displayed if the display mo de is set to

blink if disabled dataset is displayed By rep eatedly clicking this

the user can blink between the two datasets You can also press the

b key in the image window and get the same eect Note that when

blinking between two images with nonlinear coordinate systems the

linear data pixel coordinates of the canvas b oundary are preserved

not the nonlinear world coordinates This is esp ecially noticable when

blinking b etween two images with a dierent pixel scale

CHAPTER VIEWING IMAGES AND CUBES WITH THE MULTIBEAM

Prole Mo de Menu this allows you to pop up the TracePopup

widget section and cho ose the prole mo de The following mo des

are available

None will p op down the TracePopup widget

Line will show a single prole in the selected direction

Box Sum lets you draw a box over the image window using the

middle mouse button in a similar wayas using the left mouse but

ton to zo om and then the sum of all the proles in that region is

displayed Box modeonlyworks for dimensional datasets and will

always display a prole along the unseen dimension

BoxAverage is like the boxsummo de except that the average of

all proles is displayed rather than the sum

Radial will azimuthally average the image plane data and pro duce

a plot of average value versus radius A gaussian is then tted to

the radial prole and overplotted in red and the FWHM full width

half max of the gaussian is displayed over the prole You must

click the middle mouse button to dene the centre of the ob ject of

interest then keeping the mouse button down drag out to dene

the maximum radius of the prole and release the button to display

The algorithm automatically adjusts the centre p osition using a cen

troiding op eration so you dont ha ve tobetoocarefulaboutpicking

the centre of your ob ject More information on the centroidingal

gorithm

httpwwwatnfcsiroaukarmausermanualcentroidingalgorithmhtmlpubce

can b e found in the Karma User Manual

The programme should also work with a photographic negative The

centroiding algorithm is automatically mo died to lo ok for a trough

rather than a p eak

Boxed Horiz will pro duce a horizontal prole which is averaged

vertically The b oxisdrawn the same way as for the boxsummo de

The horizontal centroid of the prole is computed and a gaussian is

tted and displayed

Boxed Vert will pro duce a vertical prole whichisaveraged hori

zontally The b ox is drawn the same way as for the boxsummo de

The vertical centroid of the prole is computed and a gaussian is

tted and displayed

Slice Direction Menu this allows you to cho ose howyou want to slice

your cub e You can view XY XZ or ZY planes

Prole Axis Menu this allows you to cho ose along whichaxisyou want

the prole to b e displayed valid only for line prole mo de

Display Mo de Menu this allows you to cho ose how you want to view

your two datasets The following choices are available

Set image view dataset as an image

Set image view dataset as an image

Set image Set contour view dataset as an image and

overlaydatasetascontours

Set contour Set image view dataset as an image and

overlaydatasetascontours

Blink between Set and Set enable blinking b etween the two

datasets

Link Intensity Scales if this is set then if the intensity scale for either

dataset is mo died using the Dataclip section widget then the

intensity scaling for both datasets is changed This can be useful when

blinking b etween two images

Link Frames if this is set then whenever the the current frame number

for the image dataset is changed the frame numb er for the other dataset is

also up dated to have the same value If the two frame dimensions havethe

same coordinate typ e then the coordinate values are matched rather

than coordinate indices This feature is often used when displaying a

movie of b oth datasets one as images and one as contours

Show Frame in Line Prole if this is set the current frame displayed

in the main image window is shown as a vertical red line in the prole

window This marker is only drawn if the prole axis is the unseen axis

Contour Lev els this controls the contour levels Be careful not to hit

return after lling in the levels The syntax for the contour levels is as

follows

just typ e the levels you wanteg

levels with a constant increment means that

the rst level is that this level is incremented with

until is reached So this example gives the same levels as in

the rst case

els levels incremented by a factor This gives lev

levels as p ercentage of the p eak rst character should b e num

b ers are taken as p ercentage the rest of the syntax is as ab ove eg

gives and of the maximum of the data

These options can be mixed ie

is interpreted correctly

Contour Colour sp ecies the colour the contours should b e drawn in

Apply Levels this will apply the contour levels and colour

Reset Levels will reset the contour levels to the default

CHAPTER VIEWING IMAGES AND CUBES WITH THE MULTIBEAM

Auto Apply if this is on then if you load a new dataset over one that

is currently b eing displayed as contours the old contour levels are auto

matically applied The reason this is o by default is b ecause the contour

levels for one dataset may b e incorrect for another An inappropriate set

of contours can take a long time to displaysomistakes are costly

Axis Lab elling Title this allows you to change the title placed ab ovethe

image when axis lab elling is enabled Normally the title is automatically

generated

ve Contour Width this controls the width of negativecontours

ve Contour Width this controls the width of p ositivecontours

Auto Title if enabled the axis lab elling title is automatically generated

Whenever this is disabled the string sp ecied by Axis Lab elling Title

is used instead

Show Beam if enabled the dataset headers are searched for BPA

BMAJ and BMIN FITSstyle keywords If these keywords are present

a representation of the telescop e b eam is overlaid on the image

Show Beam Name if enabled the name of the dataset for each beam

is placed near the b eam representation

Set Beam Xp os controls the horizontal p osition of the the b eam for

dataset

Set Beam Yp os controls the vertical position of the the beam for

dataset

Set Beam Xp os controls the horizontal p osition of the the b eam for

dataset

Set Beam Yp os controls the vertical position of the the beam for

dataset

k the left mouse button in the display window without In addition if you clic

moving it in between the press and release the image will pan across If you

click the middle mouse button the image will zo om in x the new centre of

the image will b e the place where you clicked Clicktheright mouse button to

zo om out x If the prole mo de is b ox then you cant use the middle mouse

button to zo om

Pressing the c key in the display window will compute and display a scatter

plot of intensityvalues in one image versus intensityvalues in the other image

This is useful for seeing if there is a correlation b etween the values in the two

images You can use the left mouse button to dene a subimage similarly to

zo oming in from which the scatter plot is computed See Figure for a screen snapshot

Figure Screen snapshot of two datasets displaycontrol panel

CHAPTER VIEWING IMAGES AND CUBES WITH THE MULTIBEAM

Commandline Options

The following commandline options are supp orted by Multib eamView

set filename this will load the dataset filename as set

Sp ecial Movies

If you want to play a movie that was made using the Hot Gas Substances

section or the Hot Gas Continuous section shaders of the xray

chapter volume rendering to ol you should compress this movie from bit

to bit Movies made with the other algorithms do not require compression

and can b e played directly The compression of bit movies is done with the

command

convto com w max max num of colours inmovie

The switch com w tells the program that it should compress such that it

has the same colourmap for all the images In principle you could leave out this

switch but that is not recommended Your movie will lo ok awful

The switch max max num of colours gives the maximum number of

colours the nal movie can have The recommended value to use is max

Do not give a higher numb er than

Please note the space b etween the name of the movie and the minussign

You do not have control over the name of the output le The string

conv to is prep ended to the name of the input le

convto c w m ugcmovie

pro duces a le conv to ugc moviekf with the compressed

movie

Multiple Contour Images

The Multib eamView programme has sp ecialpurp ose co de to displaytwo

datasets one as images and the other as contours If you wish to display

multiple images or cub es you should use the kvis chapter programme

IntensityIntensity Scatter Plots

Earlier in this chapter is a brief description of how you can use the c key

to compute and displayanintensityintensity scatter plot of two images You

may also use this facility to display a scatter plot of twochannels from the same

the same cub e in twice ie using the Set and Set le cub e Simply load

browser buttons and select the two channels one from each cub e You will

need to ensure that the Link Frames toggle is disabled

If the Link Frames toggle is enabled then the scatter plot is computed

using the two frames which have corresp onding coordinates for the frame di

mensions This is usually the desired setting when generating scatter plots from

frames of two dierent cub es

INTENSITYINTENSITY SCATTER PLOTS

Note that when computing a scatter plot from two images with a dierent

coordinate grid the pixels from the unseen image corresp ond to pixels with

the same world coordinates in the visible image Thus there is no need to regrid either of the images

CHAPTER VIEWING IMAGES AND CUBES WITH THE MULTIBEAM

Chapter

Volume Rendering a Cub e

The xray programme is used to volume render cub es

How the rendering is done

You can think of the way a data cub e is rendered as lines of sight going from

every pixel of the display through the data cub e and the voxels visualisation

sp eak for volume element of the data cub e on a line of sightcontribute in some

way to the colour and intensity of the display pixel To decide howevery voxel

contributes a numb er of algorithms called shadersareavailable

Shaders

Below are two lists with the shaders available The rst list contains simple

shaders The V oxel sum and the Maximum voxel shaders are useful for

exploring the data cub e b ecause they are relatively fast and give a reasonable

display of the data

Voxel sum The value of the display pixel is the sum of all voxel values

along the line of sight This is a fast and quite useful way of representing

the data With this shader one gets a go o d global view of the emission

It is less useful for lo oking at small details

Minimum voxel The pixel value is the minimum voxel along the line of

sight

Maximum voxel The pixel value is the maximum voxel along the line

of sight This is a fast way of getting a reasonable image It also allows

the inside of your data the dep ending on your data to have a view of

ob ject lo oks more transparent than with the Voxel sum shader

Front voxel The pixel gets the value of the rst voxel along the line of

sight ab ove a sp ecied threshold not usually useful the image is very

blo cky and has many holes You get a control window where you can

change the threshold value by clicking the left mouse button

CHAPTER VOLUME RENDERING A CUBE

The second kind of shaders uses an equation of radiative transfer to compute

the images These are called hot gas shaders

The contribution of a voxel to the pixel on the display is calculated using a

simple equation of radiative transfer where a voxel is partly absorb ed byvoxels

that are in front of it

c c o s o

i i i i i

th

where c is the intensity along a line of sight after adding the i voxel in

i

front s the intensity of the voxel added c the intensity along the line of sight

i i

th

that is b ehind the i voxel and o the opacityof the voxel i This calculation

i

is done backtofront so voxels in the back of the cub e are partly obscured by

voxels in the frontpartofthecube

If the opacity for a voxel is zero that voxel b ecomes completely transparent

but also invisible This closely resembles the b ehaviour of a selfradiating cloud

of hot gas where gas particles both emit and absorb radiation Regions with

high gas particle density will have a higher surface brightness but will also have

a higher crosssectional area of absorption

The resulting rendered image app ears like a cloud of glowing gas which

shows b oth internal and external structure

You can use this to make features disapp ear eg noise The disadvantage

is that in order to make the data that you want to see transparent you also

make it barely visible Consequently the opacity of data you want to see has

to be not to o low and as a result one will tend to see only the surface of the

emission regions

There are a few versions of this implemented diering in whether they do

the rendering mono chromatically or in colour

Hot Gas substances This works as follows the value range

of the v oxels is divided into a numb er of subranges typically eight

Each subrange has a colour and an opacity asso ciated to it and is called

a substance Like every colour in computer displays a colour consists

of red green and blue

The contribution of a voxel to the colour of the pixel on the display is

calculated using the radiative transfer but for each colour red green or

blue separately This means that if a blue voxel is b ehind a red one

the blue is still visible This makes the data app ear more transparent

It also means that this shader pro duces images that are bit deep one

byte for every colour and to change colours on the displayyou will have

to manipulate the substances It also means that to play movies made

with this shader you may want to convert the images to bit using the

convto programme section

the A practical disadvantage of this shader is that it is dicult to set

colours and the opacities of the substances exactly as you want there

are many many parameters to set It takes quite some time to pro duce

reasonable images with this shader You can save time by only dening

STARTING UP THE VOLUME RENDERING TOOL

a small numb er of substances say the default eight but then the repre

sentation of the data is somewhat schematic If you dene the maximum

numb er of substances you can set up a substance table with a smo other

colour transition but of course it takes more time for you to set up the

table

A strong advantage of this shader is it can be useful to display both

absorption and emission in a datacub e

Hot Gas Mono This shader also uses opacities but the control is much

simpler This shader takes

o v

where o is again the opacity v the value of the voxel By setting you

of the data are visibleopaque A small value can control which parts

of makes lowlevel emission already quite opaque while a large value

will show only the brighter voxels Also the computation is done on the

oating p oint data not on colours hence the mono This increases the

dynamic range of the image very much Images pro duced by this shaders

are oating p oint

An option oered with this shader that the intensity can b e transformed

b efore rendering according to a similar function as ab ove

s v

where s is the value used for the voxel in the radiative transfer and v is

the value of the voxel

Hot Gas Continuous this shader is a mix b etween the Hot Gas Sub

stances and the Hot Gas Mono shaders There are now substances

but the opacity is dened in the same way as in Hot Gas Mono The

user interface of this shader is much b etter than that of hot gas sub

stances Also this shader pro duces bit images and to playmovies made

with this shader you will have to convert the images to bit using the

convto programme section

Starting up the Volume Rendering Tool

To start the rendering software on anyworkstation typ e

xray

Options

xray supp orts several command line options which are all do cumented in

the manual page The options of general interest are

CHAPTER VOLUME RENDERING A CUBE

private cmap This option will force xray to use a private colourmap

for its PseudoColour window Otherwise xray trys to allo cate colours

from the default colourmap

num colours This option sp ecies the numb er of colour cells that xray

will try to allo cate for its PsuedoColour window up on startup If less

colours are available it allo cates as many as p ossible minimum

fullscreen This option will make the image display window takeupthe

entire screen This is useful if you wish to make a video of the data

You will need to congure your window manager to cycle the window

stacking order when a sp ecial key is pressed eg the Back key with

the Op en Lo ok window manager See also the app endix on making videos

app endix E

no slice win This option will disable the D slicing window similar to

what you get in kslice d chapter

After starting up many windows will app ear

the control window with whichof course you control the rendering pro

gram

a slice window This shows the data cub e along the three principle planes

XY ZY and XZBy moving the mouse press left the windows will b e

up dated To make things run smo othly click on Precompute This is

also available as a standalone program kslice d chapter and is quite

useful for insp ecting your data This window will app ear after you have

loaded a cub e and p ossibly converted to bytes

Another windowthatyou will see after the rst time you render the cub e

is the image display This window is similar to the display windowinmanyof

the other to ols see section

Loading Data into xray

xray supp orts manydata formats likeany other Karma programme For

reasons of memory use and sp eed the preferred data format used by xray

is that the data is stored as bytes with values ranging from to the

value is used for blank or missing data The valuesinyour data cub e will

have to b e scaled into this range

If you load a nonbyte data cub e xray will displaya window sho wing

the histogram of the data values in the cub e If you want to use the full range

of values in the cub e go o d for a rst lo ok at the data click left on the Full

Range button If you want to select a subrange of the data click left in

the histogram window to dene the lower b ound and click right to dene the

upp er b ound You then click left on Apply to tell xray to compress the

cub e to abyte cub e You will then b e able to click left on the Save button

THE MAIN CONTROL WINDOW

to save the compressed data cub e The default lename is scaled but you

can change this prior to saving Once you have saved a compressed cub e the

next time you load it in xray it will load much faster

The prop er values for the scaling range of course dep end on the data in

the cub e and on what you want to see in the data but here are some hints

Normally the histogram has a large p eak around zero The Noise Unless you

in your data cub e eg because you want to want to have a lo ok at the noise

lo ok at subtle calibration errors or errors in the continuum subtraction errors

that show up quite well with the rendering software it may be a good idea

to take the minimum such that most of this peak is excluded Dep ending on

whichvoxel algorithm you use in the rendering see later if you include data

at the noise level your rendered data cub e will have a lot of noise in front of

your ob ject of interest and it may just be in the way There are however also

other ways see b elow to hide the noise

Consider that with the rendering software you may see faint structures in

your data that you were not aware of So you may not want the minimum to

b e to o high either otherwise you maymissinteresting features in your data Of

course when there is absorption in the data the noise will have to b e included

Also consider that the b ecause the data is scaled into the dy

namic range is limited so in some cases it may be a go o d idea to cho ose the

maximum not to o high You will be able to see more detail in the fainter

emission

The main control window

See Figure for a screen snapshot

The following controls are available

Files this p ops up a standard Filep opup widget section with

whichyou can load your cub e

Show Orientation this pops up a window which shows a wireframe of

the cub e As you change the cub e rotations this is up dated immediately

This should giveyou a feel for whichway the cub e will rotate b efore you

press Compute

Make Movie this p ops up a movie control panel This is descib ed in

section

Rescale if you loaded a nonbyte cub e then you can bring up the his

display using this button and then you can set the data scaling togram

again

Filter this p ops up a ltering control panel describ ed in section

Quit this will quit the application

Hide Wireframe if disabled a wireframe showing the visible edges of

the cub e is displayed over the rendered data to showhow the data cub e is

CHAPTER VOLUME RENDERING A CUBE

Figure Screen snapshot of main control panel

rotated It also helps the brain to p erceive the data as three dimensional

If you dont like the wireframe you should enable this toggle

Stereo if your are sitting in frontof pho enix and you started the window

system in stereo mo de clicking on Stereo will enable stereo display The

way this works is that slightly dierent images are displayed in your left

and right eyes mimicking the way you see depth normally You will

hop efully see the rendered cub e as a threedimensional ob ject with depth

To make use of this you need to wear a pair of Crystal Eyes glasses

these t over most prescription glasses If you want to use this feature

please ask the system administrator who will lend you the glasses These

things are rather exp ensivesowe dont just leave them lying around

vendors graphics library it is b est to use Because of a problem with the

the stereo option when rendering to bit images ie when using the

Hot Gas Substances or Hot Gas Continuous shaders

D Cursor Menu

This menuallows you to switch from the default cursor to an exp erimental

dimensional active cursor The default or dumb cursor will allow

you to read image values and p ositions in the display window in the

conventional way The active cursor allows you to p oint at a feature

say a blob on your volume rendered cub e and obtain the dimensional

p osition of that feature The horizontal and vertical p osition information

is accurate however the depth p osition is computed using a heuristic and

THE MAIN CONTROL WINDOW

is less accurate In another windowyou will see a plot of the cub e values

versus the position along the line of sight drawn in white A yellow

vertical line shows the depth of the feature you are pointing at really

the depth the algorithm thinks the feature is at Both the dimensional

p osition information and the plot window are dynamically up dated as you

move the cursor in the image display window

Shader Menu this allows you to select which shader to use See section

Pro jection Menu this allows you to select a prjection Two pro jections

are available Orthogonal and Persp ective If you select the p ersp ec

tive pro jection you can control the distance of the cub e ie the amount

of p ersp ective with the Distance slider in the control window The main

reason that the Persp ective pro jection is there is that this is quite useful

for stereo display Even if you are not using stereo mo de you may want

to try it anyway It helps for the D p erception of the images

Mo de Menu this allows you to cho ose the rendering mo de The pro cess

of pro jecting rays into the data volume and collecting the data along each

ray can be quite involved and there are sp eedquality tradeos The

Mo de Menu allows you to cho ose b etween these tradeos

D Cursor Menu this allows you to cho ose the kind of dimensional

cursor available This co de is currently in development so things may

change rapidly An overla y cursor is available the cursor is drawn over

the rendered volume so the cursor will not dissapp ear b ehind a feature

in the data A prop er translucent cursor is also available You can move

the p osition of the D cursor by pressing the left mouse button in anyof

the three slice windows the ones with the red crosshairs and dragging

the mouse

Compute this will cause the cub e to be rendered using all the current

parameters

Reset Orientation this will reset the view and then renderer the cub e

Load Segments this will bring up a le browser whichallows you to load

les with extension seg These les contain pairs of threedimensional

coordinates each pair dening a line in the world coordinate system

These D lines are drawn through the volume and are of the volume

obscured by opaque structure in the volume data The les are simple

ASCI I format where each line denes one pair of D points Note that

the endp oints are pro jected from D to screen coordinates and then the

p oints are joined by a straight line on the screen For b est results your

lines in D space should b e short

Roll Slider this controls the roll angle Think of an airplane rotating ab out its long axis

CHAPTER VOLUME RENDERING A CUBE

Pitch Slider this controls the pitch angle The nose of the airplane dips

up and down

Yaw Slider this controls the yawangle The nose of the airplane swings

left and right

Start X Slider this controls the starting X p osition of the sub cub e to

render

Start Y Slider this controls the starting Y p osition of the sub cub e to

render

Start Z Slider this controls the starting Z p osition of the sub cub e to

render

End X Slider this controls the end X p osition of the sub cub e to render

End Y Slider this controls the end Y p osition of the sub cub e to render

End Z Slider this controls the end Z p osition of the sub cub e to render

Distance this changes the distance your viewp oint is from the cub e This

ersp ective pro jection only has eect when using the P

Image Expansion Often the image generated by the volume redering

software is rather small this is b ecause the original cub e was small

The software automatically expands the image so that it lls as muchas

p ossible the display window using simple pixel replication This results

in blo cky images whichmay b e undesirable Setting the expansion factor

to a value greater than uses an antialiasing image expansion algorithm

which maintains the original smo othness of the image See note on anti

alising for more information Setting this to to o large a value will result

in very large movies which is undesirable Try a vlaue of to start with

Eye Separation When viewing the cub e in stereo mo de it is useful to

enhance or diminish the stereo separation The lower the value the closer

the left and righteye viewp oints and hence the lesser the stereo eect

Rendering Mo des

The following rendering mo des are dened

through the volume will normal this is the default mo de Because rays

not fall exactly on grid p oints some approximation of the value has to b e

made In this mo de the ray is snapp ed to a grid p oint This can result in

aliasing problems but is the fastest mo de In most cases the aliasing is

not a problem In addition this mo de computes a rotated version of the

cub e in a cache in the background while you are not doing anything the

background pro cessing do es not slowdown normal rendering op erations

The cub e is rotated using the same grid snapping technique so has the

same aliasing problems However provided you do not keep changing the

THE MAIN CONTROL WINDOW

view or the cub e subsequent render op erations such as changing the

shader are four to ten times faster Whenever you rotate the cub e or

change it the cache is automatically built up again xray always uses

as much of the cache as it can

smo oth cache will build up the cache using a b etter algorithm when a ray

falls between grid p oints The value computed uses a distance weighted

contribution from each of the nearest surrounding values in eect an

interp olation This algorithm do es not suer from aliasing The cache

longer to build up than in normal mo de but takes ab out four times

once its done rendering is as fast as using the cache that normal mo de

pro duces In fact it do esnt matter how complex the cache building

pro cess is once its built rendering times are the same for the same

shader of course If the cache is not completed part of the rendering

uses the normal mo de when you request an up date This can lead to

the interesting sideeect that the lower part of the rendered volume is

smo other whilst the upp er part is rougher and p ossibly shows aliasing

artefacts

always smo oth will always render using the interp olation algorithm

It do es this by waiting for the cache to be built using the interp olation

algorithm and then rendering If you dont change your view or cub e

subsequent rendering op erations are still at maximum sp eed If you nd

that you are having aliasing problems you should use this option when

making a movie otherwise the movie generation pro cess will not wait for

the cache to b e built up

smo oth delayed will rst render using the normal mo de and will then

build up the cache using the interp olation algorithm in the background

once the cache Provided you dont change the view or cub e parameters

is computed the cub e will be rendered again and you will see a rened

image Note that if you render the cub e with normal mo de and then

idly change the view or cub e parameters and sit back a little while later

the cub e will suddenly rotate even though you havent clicked on Apply

Orientation

Rotating the cub e

With the sliders Roll Pitch and Yaw you can rotate the data cub e by hand

The co ordinate axes are dened suchthat the Xaxis is horizontal the Yaxis

vertical and the Zaxis p ointing into the display The Roll rotation is around the

Xaxis Pitch around the Yaxis and Yaw around the Zaxis Since rotations

do not commute it is imp ortant to kno w that the order of the rotations is Roll

rst then Pitch and then Yaw

To see the cub e in the orientation you sp ecify click left on Compute

Reset Orientation resets the orientation to faceon

CHAPTER VOLUME RENDERING A CUBE

Making a Movie

The main problem with volume rendering data cub es is that one do es not really

get a three dimensional p erception of the rendered cub e One can displaya scene

from daily life in a very crude way and still p erceiveitasaDscene But this

apparently is not true for data cub es The brain do es not recognize the ob ject

in the image and therefore it do es not make a three dimensional p erception

One way to get a three dimensional p erception of the data is to makeamovie

in which the data cub e is rotated while it is rendered

For making such a movie click left on Make Movie and the movie

control window will p op up This window allows you to make a series of images

where the data cub e is rotated in steps Use the sliders to set the increment

in Roll Pitch and Yaw and the number of images you want Start Movie

then starts computing this sequence To save a movie typ e in a lename and

click Save Movie Once the movie has been generated an animation control

window will app ear allowing you to view the movie

One consideration is the size of the movie If this is to o large ie larger

than ab out Mbyte on pho enix playing the movie will b e slow An estimate

of the size of a movie is

x y z N N

frames

zo om

where x y and z are the size of the axes of the data cub e in pixels and N

zo om

the zo om factor My exp erience is that rotating the cub e in steps of degrees

so the mo vie is frames is in general sucient to get a smo oth movie

It may not be a go o d idea to make a movie of images with a large Image

Expand Factor dep ending on the sizes of the axes of the cub e You will

nd that when you play such a movie it will be slow b ecause it has to swap

images in and out You can always zo om afterwards when you play the movie

by resizing the window although the result may not b e as go o d

Filtering your data

Often there will be problems with the data to o noisy confusing or bright

continuum sources whichmake it dicult to see your data To help there are

a few ltering alogorithms implemented which should help Clickon Filter in

the main control window and a ltering control panel will p op up

The following ltering algorithms are available

simple one of the adaptive ltering algorithms

slow median mask one of the adaptive ltering algorithms

fast median mask one of the adaptive ltering algorithms

D one of the adaptive ltering algorithms

subtract continuum the continuumsubtraction algorithm

FILTERING YOUR DATA

Adaptive Filtering

One problem with volume rendering is that in order to see faint structures in the

data cub e one has to set the opacities intensity transformation and clips such

that also the noise b ecomes bright As a consequence the emission is visible

only through a thick fog of noise and this noise hides a lot of information

One solution is to apply adaptive ltering to the data cub e the data is

smo othed where the emission is faint and extended or absent while the data

is left intact if it is stronger or more p ointlike There are several techniques to

do this At the moment two algorithms are implemented but we are working

on other lters

The lters are based on work of JL Starck F Murtagh and A Bijaoui

with a few extentions of our own They consists of making a wavelet transform

of eachchannel in the cub e This allows to consider the data lo cally at dierent

resolutions and mo dify it such that the signaltonoise is improved

Note that the wavelet transforms can b e D and D channel bychannel

The adaptive ltering algorithms available are

Simple this is a very simple lter It is a bit crude but it has the

advantage that it is fast the other lters are quite a bit slower It gets rid

of most of the noise This lter makes a wavelet transform and in each

wavelet plane it clips the wavelet co ecients that are below the noise

level dened by the parameter lter clip section to zero This

lter is only slight y more complicated than simple clipping the data b elow

a certain level The fact that it lo oks at the data with dierent resolutions

makes it more ecient

Median mask fast slow the rst step of this lter is identical

to the simple lter This lter also makes a wavelet transform of the

data and makes a logical mask for each wavelet plane dening where

there is signicant signal for every resolution and inverse transforms only

the signicant wavelet co ecients Now an iteration cycle b egins It

transforms the dierence b etween the original data and the ltered data

retains only the co ecients of the transform of the diernece for those

p ositions and resolutions where there is signicant signal in the data using

the logical mask It inverse transforms this masked dierence and adds

this ltered dierence to the ltered data For the second iteration cycle

it again denes a mask takes the dierence between the original data

and this second ltered data masks the wavelet co ecients and adds

the masked dierence to the ltered data etc etc The iteration cycle

ensures that the wavelet co ecients of the ltered data are identical to

those of the original data for those resolutions and p ositions where there

is signicant signal

An imp ortant element of this lter is that it do es a median ltering on

the logical mask This makes isolated noise p eaks disapp ear and makes

the data lo ok more consistent

The dierence b etween the fast and slow version of this lter is that in

the fast version iterations are done compared to iterations in the

CHAPTER VOLUME RENDERING A CUBE

slow version The fast lter still leaves some noise blobs in the data but

fewer than the simple lter The slow lter gets rid of almost all of them

There are two parameters to set for this ltering

levels this sp ecies the number of wavelet planes to be computed The

b est values to are either or Using more than planes pro duces

artifacts for the simple lter Usually it is also not necessary to consider

more than planes

Sp ecifying Levels to the original unltered data cub e is rendered but

with noise clipping applied

lter clip this sp ecies the clip level to b e applied to the wavelet planes

in units of the noise level Recommended values are for the simple

lter For the median mask lter use or

Contin tuum Subtraction

Often when you observe a sp ectralline source you mayhave a confusing contin

uum source in the eld Your data reduction package should have a programme

to subtract the continuum eg uvlin in Miriad The problem with some of

these programmes is that in order to compute a t to the sp ectrum of the con

tinuum source you rst have to tell the programme whichchannels contain the

sp ectralline emission so that it can ignore those channels when computing the

t The problem is how to nd out whichchannels contain the line emission

An eective technique is to invert your UV data into a cub e before sub

tracting the continuum and then using xray to render it Of course if the

continuum source is brighter than your sp ectralline source it usually is the

sp ectralline source will b e washed out This is where you can use the subtract

continuum lter This will subtract the average ux in a sp ectral prole for

every p oint on the sky image This is a go o d continuumsubtraction algorithm

to rst order it should lter out more than of the continuum source

Once you have your rst order continuumsubtracted cub e you can use

xray to nd the sp ectralline emission In particular you should nd the

D slicing window very handy since it will give you the D coordinates of

a p oint Be warned that Karma programmes count from whereas most

astronomical reduction packages count from If you take a channel index

from Karma and put it into Miriadremembertoaddthevalue

Now that you have identied the sp ectralline emission you can run a pro

gramme like uvlin to do a b etter job of subtracting the continuum

Other Controls

To apply the ltering clickonDo Filter The cub e is rendered automatically

To get back the original data without any ltering clickonUndo Filter

You may also Save the ltered cub e for later use

HOT GAS SUBSTANCES CONTROL PANEL

Hot Gas Substances control panel

See Figure for a screen snapshot

This controls the settings for the Hot Gas Substances section You

should see a window with a histogram of the data values in the cub e actually

the logarithm of the distribution and in the b ottom part you will see space

for the colours of the substances Each colour has a horizontal line on it This

is an indicator for the opacity of the substance

To change the colour of a substances you have to click left on the space

on the b ottom of the window that is reserved for the substance This selects

the substance To change the colour move the mouse in the upp er part of

the window and drag middle not left the mouse around until you havethe

colour you want The saturation of the colour can be changed by moving the

mouse around while you drag with the right button Tochange the opacityput

the mouse on the substance and drag with the middle mouse button vertically

Tochange the value ranges for the substances drag left the mouse in the

upp er part of the window In the upp er part there are a few symb ols that help

to orientyourself The is the setting for the value ranges the O the setting

for the substance you have selected and the horizontal line on the left of the

window is the saturation of that substance With this window one is only able

to change the value ranges in a way similar to a normal colour table control

To use the settings you have made click left on Apply and a new image

will b e calculated

Save brings up a windowtosave substances The button

To load a substance table clickonLoad and select your le

Hot Gas Mono control panel

See Figure for a screen snapshot

The control window for this allows you to set the opacity law of the Hot

Gas Mono section shader as well as the exp onent for the intensity

transformation One can also set the range of voxel values that are set to

blank

The following controls are available

Close this will close the window

Compute this will render the cub e

Intensity Alpha this controls the value of in equation

Opacit y Alpha this controls the value of in equation

Blank Start Slider this controls the start of a region of data values

which will b e blanked

Blank End Slider this controls the end of a region of data values which

will b e blanked If this value is greater than that of Blank Start Slider

CHAPTER VOLUME RENDERING A CUBE

Figure Screen snapshot of hot gas substances control panel

HOT GAS MONO CONTROL PANEL

Figure Screen snapshot of hot gas mono control panel

CHAPTER VOLUME RENDERING A CUBE

then some range of data will be blanked The blanking is implemented

by setting the opacities for that range to

In the display canvas under the controls you will see a loghistogram of your

data in white as well as a red curve showing the transfer function b etween data

value and intensitysee equation and a yellow curve showing the transfer

function b etween data value and intensity see equation The opacitycurve

also reects the blanked range of values

Hot Gas Continuous control panel

This shader is a cross between Hot Gas Substances and Hot Gas Mono

It has a similar control as the Hot Gas Mono shader in xray Also here

the exp onent of the opacitylaw can b e set as well as the v alues range for valid

data The dierence is that one can set the connection b etween voxel value and

colour using a colourtablelikeinterface

Hot Gas Three Colour control panel

This shader is an extension of the Hot Gas Continuous shader It allows

you to divide the data range into three regions with indep endant opacity and

colour transfer functions for each region This shader is a little esoteric and

is designed for rendering data with two or three distinct p opulations of data

values This kind of data do es not o ccur in radio astronomy You may generate

this data by combining two datacub es together This shader would allow you to render one dataset in one colour and another dataset in another colour

Chapter

kpvslice interactive

p ositionvelo city slicing

The kpvslice programme allows you to use a twodimensional image to

dene a slice through a threedimensional data cub e The image and cub e must

havetwo dimensions in common and the co ordinate range of those dimensions

must partially overlap but the axes need not have the same reference point

orientation or scale

Atypical use is to examine the p ositionvelo city diagram for a slice drawn

along the ma jor axis of a rotating galaxy The slice is drawn on the total column

densityorvelo city eld map and the corresp onding p ositionvelo city diagram

will app ear in the other window The slice can be moved around interactively

for quick comparison of dierent regions

The fancy colour frontcover of this do cumentcontains a screen snapshot of

this programme

How to use it

You need a cub e naturally and a sky map image The image is usually taken

tensity map of the cub e but it could just as easily be the to be the totalin

velo cityeld or an optical image As long as the cub e and the image have a

prop er coordinate system for RA and DEC youre in business To load the

cub e press the Cub es button in the left window and select a cub e le Press

the Images button to load the image le The image is displayed in the left

window If you then click middle in the image and drag the mouse still

keeping the button pressed you will see the p ositionvelicity slice in the right

window b eing up dated b efore your very eyes Back in the image window a

line is drawn over the image to show where the slice is The horizontal axis

in the right windowshows p osition and the vertical axis shows velo city If the

machine you are running this on is rather old and slow you can disable Auto

Up date and the p ositionvelo city image will only b e computed once you release

the middle mouse button The cursor p osition in RA and DEC is printed to

the command shell window whenever the middle button is pressed or released

This tells you the endp oints of the slice Also the centre of the slice and its

CHAPTER KPVSLICE INTERACTIVE POSITIONVELOCITY SLICING

p osition angle are also printed

If you clickwiththeright mouse button near the centre of the slice you can

then move the slice centre around whilst the length and p osition angle is kept

constant If instead you clicked the right button near either end of the slice

you can change the p osition angle while the length and centre are kept xed

When moving the cursor in the slice window the co ordinates of the cursor

are displayed in several ways The natural co ordinates of oset from the

slice centre and thirdaxis co ordinate are shown in the second line The image

co ordinates corresp onding to the oset are shown in the third line The p osition

of the cursor along the slice is also shown by a small circle in the image window

If you compute the moments of the cub e with kpvslice b oth are held

y switch between them easily The values in the rst in memory so you ma

moment image along the slice are plotted as a red trace in the slice window

Note that no smo othing is done b efore the clipping level is applied so they do

not do as good a job of representing weak signals as the standard MOMNT

task in AIPS This may b e xed in later versions of the program

If the values in the twodimensional image have the same units as the cub es

third co ordinate axis the values are extracted and displayed as a green trace

in the slice window In practice this usually happ ens when one draws a slice on

a velo city eld image the velo cities from the image are drawn as a green line

on the p ositionvelo city diagram The p osition angle is dened as the angle in

the corner of a spherical triangle

Viewing Proles

You can also view a prole sp ectrum of your cub e proles section Just

press the ZProle button and move the mouse over the image window

If you wish to see a prole along the slice across the image press the I

Prole button and another prole window will app ear Just dont confuse the

two dierent prole windows

Extracting Slices From An Image

kpvslice can also extract a one dimensional slice from an image In this

case you do not have to load a cub e only the image is needed Click on the

IProle button and drawyour slice The prole window will show the values

in the image which lie along the slice lo cus

Commandline Options

The following commandline options are supp orted b y kpvslice

trace internal colour colour the colour sp ecied by colour is

used when displaying the trace taken from the internally computed st

momentmap

ALGORITHMIC DETAILS

trace external colour colour the colour sp ecied by colour is

used when displaying the trace taken from the externally computed loaded

st moment map

Algorithmic Details

How the Slice is Computed

The slices are interp olated using a weighted average of the nearest four pixels

The weighting is inversely prop ortional to the distance of the p oint in the slice

from the centre of the neighb our pixel

So the thickness is basically one spatial pixel but the width of the region

that the interp olation is made over varies dep ending on the angle of the slice

with resp ect to the pixel grid It is least pixels wide when the slice is along

the x or y axis of the pixel grid and greatest sqrt when the slice is at



to the pixel grid

The interp olation is made only with resp ect to the pixel grid so the ab ove

numb ers are only strictly true if the x and y directions hav e the same spatial

scales If the arcsecpixel is dierent in the x and y directions the width of

the slice in arcsec will change from dierently as the angle of the slice wrt the

pixel grid changes

x x is the current pixel are the neighbours

is the other pixels in the slice

CHAPTER KPVSLICE INTERACTIVE POSITIONVELOCITY SLICING

Chapter

kslice d slicing data cub es

The programme kslice d is the Karma version of an idea of Francois

Viallefond a program called view Also GIPSY has an implementation of

something very similar Because Karma is much more designed for this kind

of work kslice d is much faster than the other twoversions

The program shows images in a window b eing the data cub e sliced along

the principle planes The top left image is a XY image so for a radio cub e

this would be a channel the b ottom image is XZ so normally v and the

top right ZY v With the mouse one can interactively change the planes

that are shown If the mouse is in the XY image the other two images are

the XZ and the ZY image corresp onding the the xy p osition of the cursor

Alternatively if the mouse is in one of the two other images the XY image

shown is the image corresp onding to the Zco ordinate of the mouse

kslice d is fast enough contrary to view and GIPSY that if you

move the mouse while keeping the left button pressed the images are up dated

real time

Note that the volume rendering programme xraychapter will automati

cally displaya kslice d windowsothatyou can slice through the cub e as

well as volume render it

There are only a few buttons in kslice d

Precompute

If a cub e is loaded the images to display are not computed automatically If

next you move the mouse kslice d will have to compute the image that

is has to display in real time This makes things a bit slow sometimes Clicking

d compute all the images it can display Precompute will make kslice

This takes a few seconds but it makes the up date of the images very fast

Note that to run smo othly kslice d requires quite a bit of memory

certainly if you expand the images If this gives problems try running it sitting

in frontofpho enix Note that the memory requirementisonthemachine you

are sitting in front of not the machine that you are running the programme on

although for b est p erformance they should b e the same

CHAPTER KSLICE D SLICING DATA CUBES

Magnications

There are three sliders that control the size of the three images If you expand

to o much kslice d will not display anything ie you will see a blank

window Just reduce your expansion factor appropriately until the display

reapp ears

If you want to make the images larger than the window would allow you

can resize the window drag on the b ottom right corner and after this increase the magnications

Chapter

kshell lo oking for expanding

shells

This to ol allows you to browse your datacub e searching for expanding shells

Since most shells are mostly radially symmetric it is reasonable to azimuthally

average concentric annuli around a designated centre What this means is that

the programme allows you to dene a centre p osition on the sky and a maximum

radius It will then step through a range of radii from zero to the maximum

and at each radius will average the values in one velo city map around the

circumference of a circle hence azimuthal average This pro cess is rep eated

for each velo city map and the result is an image with one axis corresp onding

to radius and the other velo city

If you are lo oking at an expanding shell for each velo city map the av er

age radius of the emission from the centre is approximately constant As you

progress from one velo city extreme to the other the radius will change from

zero pass through a maximum at the central velo city and go back down to

zero So in the computed radiusvelo city map you should see half an ellipse

the signature If you have slightly missed the centre of the expansion you

will see a double ellipse so this is a go o d wayofnding the centre If you are

mess so this is also a not lo oking at an expanding shell at all you just see a

go o d way for sp eculatively searching for shells The lower the expansion velo c

ity the more squashed the ellipse b ecomes vertically of course In fact if you

had a static shell you would just see a straight line The power of this to ol

is that it is b oth a fast way of browsing for expanding shells b ecause of their

charactistic signature and that it is insensitive to fragmentation of shells

Todrive this programme you need a cub e le load with the Cub es button

and an image le load with the Images button Actually the image le is

optional you can compute an image on the y from the cub e by selecting

say the th moment option from the Image Mo de menu and adjusting the

parameters as needed and pressing Apply The reason you need an image is

so that you can search for a p ossible centre of an expanding shell The image

is displayed in the left window The image and cub e les do not have to lie on

the same coordinate grid

Once you have loaded your les you simply click with the middle mouse

CHAPTER KSHELL LOOKING FOR EXPANDING SHELLS

button dont let go yet to dene the centre of the shell drag the mouse so

that you see the expanding circle and release the middle button when you think

the radius is suciently large such that the entire shell is enclosed Dont make

it larger than is really necessary since it will take longer for the programme

to compute the radiusvelo city image After a short time fraction of a second

to a few seconds for typical cub es you will see the computed radiusvelo city

image Do you see a nice ellipse in the right window If you move the mouse

into the right window you should see the current p osition in sensible units

Exp ort menu as well as the averaged intensity at that p oint You can use the

ab ove the image to write the image with coordinates in a variety of formats

cho ose one of the whole dataset options

A small tip for p eople lo oking at data with very high dynamic range suchas

OHIR masers set intensity scale for the right window to logarithmic see the

zo oming section section otherwise you will only see a few bright blobs

Chapter

ko ords interactive

coordinate tting

This to ol allows you to quickly place a coordinate system compute a plate

solution onto an image which do es not have one This is very useful if you

have say a CCD image which do es not have a coordinate system on it All

you need is an image of a similar piece of sky which do es have a coordinate

system such as an image from the Digital Sky Survey The to ol handles

ipping and rotation correctly This to ol is much faster to use than the various

commandline driven to ols currently available usually less than a minute

After you start the to ol you will get two windows The left window should

b e loaded with the reference image the image which has a coordinate system

by pressing Ref Images The right window should b e loaded with your target

image the image without the coordinate system by pressing Target Images

The programme should also work with a photographic negative The picking

algorithm is automatically mo died to lo ok for a trough rather than a p eak

Once you have loaded your images you are now ready to dene matching

pairs of points stars To do this you must rst click middle in the left

the window near a star and then click middle in the right window near

corresp onding star You then go back to the left window and dene another

star and click on its mate in the right window You must dene at least three

pairs of stars

As you select a star a green circle is drawn around the tted centre of the

star If at any time you miss the star you can just click again only before

going to the other window If you press Undo Pair a pair of stars will be

removed from the list As long as some visible part of the star is within the

circle cursor also known as the capture region when you click middle the

to ol will nd the centroid of the star

You might nd it helpful to clicktheMagnier button to see the magnier

w You will see a crosshair whichiscentred on the current mouse p osition windo

in the main window You will also see a green circle whichshows the capture

region if any part of the star lies within that circle when you click middle

the centroid of the star will b e picked You can adjust the size of the capture

region by clicking with the left mouse button in the magnier window You

CHAPTER KOORDS INTERACTIVE COORDINATE FITTING

will also see a dashed green circle which is slightly larger than the solid green

circle The area b etween the two circles is called the background annulus The

magnier will also show small red crosshairs at the exact centroid p ositions of

selected stars

Once you have selected all your star pairs you can click on Compute

Coordinate System and the to ol solves for a coordinate system In your

commandline window a rep ort of the solution is displayed If you move your

mouse around the rightwindow you will see the prop er world coordinates of

the pixels Once you are happy with the coordinate solution you can press the

Apply Coordinate System button and then save the image with the new

coordinate system using the Exp ort menu The co ordinate system is written

in the header using the standard CTYPEn CRVALn CDELTn CRPIXn

notation

The co ordinate system is computed under the assumption that the image

of the sky has b een pro jected by the telescop e optics in a particular way The

pro jection geometry is assumed to be the Rectangular pro jection denoted by

the standard pro jection name ARC which is used by Schmidt telescop es

This may not be always be the appropriate pro jection to use but the errors

should only b ecome noticeable for elds larger than degree

Centring Algorithm

The following steps are taken by the picking algorithm

nd the brightest pixel within the circle cursor capture region

pro ceed from that pointby walking up the hill searching for a neigh

b ouring pixel which is of a greater value It continues searching until it

nds a pixel with no neighb ours with a greater value ie a lo cal maxi

mum This is usually the p eak pixel

nd the halfintensity size of the star To do this it needs an estimate

of the background value The background is computed by nding the

median value inside the background annulus

computes the centroid p osition by using a twodimensional weighted mean

algorithm The centroid is computed out to the halfintensity size

Note that the centring algorithm will not work with heavily clipp ed images

ork with rather there is only a plateau This is b ecause there is no real p eak to w

In these cases the centring algorithm is eectively bypassed and the p osition

you selected will b e used for the star p osition This allows you to p osition by

eye Please note that heavily clipp ed images have lost information and hence the accuracy of star p ositions will b e limited

Chapter

kp olar regridding to polar

coordinates

This to ol allows you to regrid an image using a rectangular to polar trans

formation It allows you to see the azimuthal variation of intensity around a

given centre This can b e useful for lo oking at the optical structure of galax

ies or doing close insp ection of a dirty beam quite useful when doing radio

astronomy

To use this programme all you need is an image le whichyou load with

the Files button Once your image is loaded you need to dene an ellipse

Press the right mouse button to dene the centre then drag the mouse

while keeping the button pressed to dene the size and shap e of the ellipse

If y ou press and release the r key still keeping the mouse button down

this will toggle on rotation mo de so that nowwhenyou drag the mouse

the ellipse will rotate Press r again to turn o rotation mo de so you

can continue changing the size and shap e of the ellipse

Once you are happywithyour ellipse release the mouse button and the

p olar image will b e computed and displayed in the Polar Window The

vertical axis is azimuth angle and the horizontal axis is radius

Please note this is an exp erimental programme that at present do es this

transformation in a simpleminded way It works by binning the input image in

radius and azimuth directions using a set of concentric elliptical annuli Each

annulus has a width of one pixel Some p oints that you may wish to consider

when using this task are listed b elow

terp olation to pro duce The programme do es simple nearestneighbour in

the output intensities the absolute ux scale will probably not be p er

fectly preserved

No world ie angle in degrees radius in arcseconds coordinate system

is attached to the image No allowance is made for images which have

dierent scales on their x and y axes

CHAPTER KPOLAR REGRIDDING TO POLAR COORDINATES

The centre p osition of the ellipses is not tted in any way it is exactly

where you place it

Feedback on improvements to this task including co de is welcome

Chapter

Sup erimp osing Images

The kvis chapter programme allows you to display dierent images on

top of each other while each image has a dierent colour co ding This can b e

used to display amplitude and phase together in one image or compare dierent

channels from a data cub e by sup erimp osing them

These visualisation techniques require a bit display

Image and Contours

Note that there is another way to sup erimp ose images whichinvolves drawing

one image as a greyscale or falsecolour image and the other is drawn over the

top as contours This can be done with kvis chapter and do es not

require a bit display

You may also use the sendcontours section programme to

draw contours over any image This programme is a commandline to ol how

ever and is not normally used since the the GUI to ols are much easier to use

Hue and Intensity

With the program kvis you can sup erimp ose two images where one image

is taken to control the intensity and the other the colour This can be used

to display amplitude and phase together in one image or line integral and a

velo city eld

To display the images run

kvis

First load File and File You should nowseethecombined images The

sliders Start Hue and Stop Hue manipulate the colour of the image the

sliders Minimum Intensity and Saturation the intensity

will control the intensityandFile the hue You can swap By default File

this by cho osing Phase Amplitude from the RAW DATA FORM menu

If you select Real Imaginary then a rectangular to p olar transformation of

the data is p erformed where File is real image and File is the imaginary

image You can swap the sense of this by cho osing Imaginary Real After

CHAPTER SUPERIMPOSING IMAGES

the rectangular to p olar transformation the amplitude value will control the

intensity and the phase value will control the hue

Intensity and Intensity

Another p ossibilityistooverlay images so that all images are co ded as intensity

but in a dierent colour This you can use to overlay two or three dierent

channels of a data cub e and insp ect subtle dierences The kvis chapter

programme can b e used to do this

Chapter

Commandline Tools

Karma has a number of commandline to ols to manipulate data les There

are to ols for converting from foreign data formats to Karma format to ols to

convert from Karma to foreign formats as well as to ols to manipulate data les

in various ways ie regridding

Common Interface

All of the commandline to ols use the panel package in the Karma library

to implement a common feel This package denes a set of panel items which

are simply parameters you can set or actions you can take The to ols may be

started in interactivemodeby giving no arguments to the to ol or they maybe

started in batch mo de giving a set of arguments to the to ol Once the to ol has

completed pro cessing it exits

Interactive Mo de

To start a to ol in interactive mo de just typ e in its name at the shell prompt

You should then see a prompt with the name of the to ol followed by a

In this discussion it is assumed that you will press the return key after typing

something in

Probably the rst thing you will want to do is press to see a list of

parameters and actions On the left hand side you will see all the parameter

and action names For parameters you will then see zero or more values after

the parameter name For actions you will not see anyvalues Finallyyou will

see a character usually followed by a short description of the parameter or

action

a parameter or action typ e in its name followed by any argu To sp ecify

ments required You can typ e shorter nonambiguous name if you wish You

can only sp ecify a single parameter or action on one line

CHAPTER COMMANDLINE TOOLS

Actions

Actions are things that happ en when you typ e their name Some actions require

no further arguments suchas the exit action while others may require any

numb er of arguments The brief description for the action should indicate what

arguments are needed

Scalar Parameters

These are parameters which take as argument a single scalar value or string

After typing in the name of the parameter followed by a space you must typ e

in the value or string

Strings do not need to be enclosed in quotes unless they contain a space

You may use either single or double quotes to enclose a string Naturally you

must use the same typ e of quote character to close the string as you used to

op en it To encase a quote character inside a string just typ e it if you used the

other typ e of quote character to enclose the string or typ e the quote character

twice if the string is enclosed by the same typ e of quote

Scalar values maybeinteger or oating p oint and may b e real or complex

dep ending on the typ e of the parameter If it is a complex value the real and

imaginary comp onents must b e separated by a space

Vector Parameters

Avector parameter is an array of scalar parameters The parameter is displayed

with a trailing nm after its name The value n is the minimum number of

elements in the array and the value m is the maximum numb er of elements in

the array

After typing in the name of the parameter you must typ e in the array of

ust be separated by a space You scalar elements Elements in the array m

must typ e in at least the minimum numberofelements otherwise your input is

rejected If you typ e in more than the maximum numb er of elements allowed

the excess elements are discarded

If you wish to app end elements to an existing array simply typ e followed

by the parameter name and then followed by the scalar elements

If you want to empty out the contents of an arrayjusttyp e the name of the

parameter without any elements after it This do es not work if the minimum

numb er of elements is greater than

Choice Parameters

A choice parameter allows you to cho ose from a selection of p ossibilities If

y ou wish to see what all the p ossibilities are typ e and you will see a list of

choices for each choice parameter

After typing in the name of the parameter typ e in your choice You can

typ e the minimum nonambiguous choice string if you wish

BATCH MODE

Eternal Actions

There are a few actions which are common to all to ols which allow you to

exit the panel exit the to ol with or without saving parameters and others

which manipulate the communications infrastructure

Other Arguments

Most to ols dene some other arguments which are not parameters or actions

They are usually lenames to pro cess although they can be other things to o

like dimension to lter along An unlimited numb er of other arguments may

be typ ed in one line

Some to ols will show the other arguments by printing General usage

followed by the arguments

Exiting Interactive Mo de

The abort action will ab ort the to ol without saving any parameters The exit

and quit actions will exit the to ol after saving parameters Pressing controlD

has the same eect as typing exit

Batch Mo de

Another term for batch mo de is shell mo de which just means that the

to ol is started from the shell with arguments and exits when it has completed

From the shell you can pass in any number of parameters and actions The

limitation in interactive mo de of only typing a single parameter or action is

removed

Passing in Parameters and Actions

You simply need to place the character in front of the name of the parameter

or action with no intervening space This marks the start of a new parameter

or action All subsequent shell arguments are treated arguments for the action

or parameter until the the list is broken A new parameter or action name with

a preceeding will break the list as will a solitary character The solitary

character marks the start of remaining other arguments after which there

can b e no further action or parameters

Passing in Strings

If a string contains spaces you should enclose it in quotes on the shell command

line If you are familiar with how most shells work you will know that it removes

enclosing quotes b efore passing them onto the programme Karma deals with

this by checking if a shell argument has a space in it and if it do es it puts a

pair of double quotes around the argument again This should b e transparent

to you unless you start doing esoteric things with emb edded quotes

CHAPTER COMMANDLINE TOOLS

Passing in Negative Values

Passing in a negative number is not a problem b ecause this case is trapp ed

note all parameter or action names must b egin with an alphab etic character

If you wish to pass in a string with a preceeding then you should typ e in

at the shell command line The double minus will b e reduced to a single minus

b efore b eing used

Passing in Other Arguments

If you do not pass in any parameters or actions then you can just typ e in the

other arguments as you would in interactive mo de However if you preceed

the other arguments with parameters or actions you need to typ e a solitary

between the last argument to the last parameter or action and the rst other

argument This solitary should b e surrounded by at least one space on either

side

Saving and Restoring P arameters

Each of the commandline to ols will lo ok for a le called namedefaults

where name is the name of the programme This le the defaults le con

tains saved parameters which will be read by the to ol as it starts First the

current working directory is searched and then each parent directory in turn

until either a defaults le is found or the ro ot directory is reached If still a de

faults le is not found then the to ol will lo ok in the karmamoduledefaults

directory under the users home directory and then nally it lo oks in the

KARMABASEdefaults directory If no defaults le can be found then inter

nally hardco ded defaults are used

Up on normal exit each to ol will write its defaults le in the currentworking

directory

List of Tasks

chlen

This to ol will change the length of a dimension in a Karma le You can in

crease the length of a dimension by zeropadding or resampling and decrease the

length by truncating windowing or resampling The option parameter con

trols whether a dimension is resampled truncated or padded The resampling

option is the same as a onedimensional regridding

If you have chosen to resample a dimension then the resample option

parameter controls whether a nearest neighb our copy or linear interp olation is

p erformed

The general usage for the programme is

name chlen infile dimension

where infile is the input data le and dimension name is the name of the

dimension to change Note that the input le may beofany format

LIST OF TASKS

Examples

If you had a sp ectralline datacub e and you wanted to resample the velo city

axis to say data pixels the following options would b e needed

resampleoption linearinterpolation

option resample

numcoordinates

and then you would typ e something like

mycube VELOHEL

imageskarma

This to ol will convert multiple images of any format into a Karma cub e This

to ol is not implemented with the panel and hence do es not have settable

parameters or an interactivemode The usage for this programme is

imageskarma infiles outfile

The input images must b e of the same shap e size and typ e but do not need

to b e of the same le format

karmappm

This to ol will convert a Karma image or cub e le into one or more PPM

Portable Pixel Map les The PPM format is a bit TrueColour image

format A Karma image or cub e movie may b e either TrueColour or Pseu

doColour with an asso ciated colourmap in the le

If the input image or cub e is greyscale ie no colour information is avail

able then it is still p ossible to write out a PPM le if you supply a colourmap

le previously saved with a Cmapwinp opup widget section You

sp ecify the colourmap le using the cmapfile parameter

The general usage for this programme is

karmappm infile outfile

where infile is the input Karma le and outfile is the output PPM

le If the input le is a dimensional array a sequence of numb ered output

les will b e written

Formats Writing other Image

You can also use karmappm to write out images in other p opular formats

such as GIF TIFF Targa TrueVision and so on To do this requires that

you have the NetPBM to ols installed These to ols are freely available and very

p opular as they allow conversion between many dierent image formats To

use this facilityyou need to set the converter and extension parameters The

converter is the name of the programme which converts PPMPNM images

to the image format you desire The extension is the conventional lename

extension for that image format

For example if you wanted to convert a Karma image or cub e to a TIFF

image or sequence of images you would need the following settings

CHAPTER COMMANDLINE TOOLS

converter pnmtotiff

extension

On the other hand if you wanted to generate GIF images you would need

the following settings

converter ppmtogif

extension gif

Notice how the the TIFF converter seems to require PNM les whereas

the GIF converter seems to require PPM les This is not a problem since

PNM Portable aNy Map is the generic format and PPM Portable Pixel

Map is a sp ecic subset of PNM

Changing the Output Image Size

If you wish to write out images of a dierent size from your input imagecub e

width and out height parameters If your then you will need to use the out

input is smaller than this the image will b e blanklled and centred onto the

desired output image size If the input is larger than this it will b e centred and

truncated No pixel averaging or replication is p erformed

kdecimate

This to ol will decimate a cub e averaging a sp ecied number of values along an

axis to pro duce a single value This decimation is p erformed along all axes

This to ol provides a simplied version of the LoadAndDecimate widget

section The only reason to use it is if you are developing batch mo de

scripts to pro cess large numb er of datacub es

The general usage for this programme is

kdecimate infile outfile

kminmax

This to ol will show the minimum and maximum value in a datale It will also

display the numb er of blank values TOOBIGs and the numb er of illegal values

Note that illegal values should never o ccur and are the result of an incorrectly

values will cause problems for Karma programmes such written le Illegal

as a segmentation fault or other crash Hence this programme is an excellent

diagnostic to determine if the data you are giving to a programme is legal

This programme supp orts many data formats The general usage for this

programme is

kminmax infile dataname

where infile is the le to load and dataname is the name of the data

elements to pro cess this is usually the same as the unit name for example

JYBEAM or HZ

kprinthead

This to ol will show the header in a datale It supp orts many data formats The general usage for this programme is

LIST OF TASKS

kprinthead infile

where infile is the le to print the header for

kregrid

This to ol will regrid one or more input images or a cub e onto an output image

or cub e It is p ossible to use this to ol to several images or cub es together

onto a new grid The general usage for this programme is

kregrid infile

where infile is the input le to regrid or is a le containing a list of les

infilekf to regrid and mosaic The output lename will b e kregrid

krotate

This to ol will rotate by regridding an image or cub e such that the longitude

axis Right Ascension or Galactic Longitude is aligned with the horizontal axis

This is often used to rotate images to a more convenient or familiar orientation

eg images from the Hubble Space Telescop e The general usage for this

programme is

krotate infile outfile

where infile is the input le to rotate and outfile is the name of the

output rotated le you wish to create If you sp ecify an extension of fits

then a FITS le will be written otherwise a Karma le will b e written You

may use the projection option to control the output pro jection the default

is to use the same pro jection as the input

ksend

This to ol allows you to send commands to various GUI to ols The commands

include loading a le writing PostScript to a le setting display ranges and so

on This can be useful for batch pro cessing many dierent datasets using the

same control settings

If you wanted to load the les mom and mom into the kvis chapter

programme displaying mom as an image and mom as contours and then write

PostScript to the ps le you would rst need to start kvis and set up the

controls appropriately to displaycontours Then you can use the command

ksend add connection unix kvis multi array load ARRAYFILE mom

load ARRAYFILE mom print ps

Avariation of this would b e to generate a Portable Pixel Map PPM le

with name fredppm

ksend add connection unix kvis multi array load ARRAYFILE mom

load ARRAYFILE mom ppm fredppm

You can use the ab ove command many times each time sp ecifying dierent

les and hence obtain batch mo de op eration

If you wanted to set the intensity display range to and for dataset

you would do something like this

ksend add connection unix kvis multi array

rclip Dataset

CHAPTER COMMANDLINE TOOLS

Alternativelyifyou wanted to set the intensity display range to of the

data you would do something likethis

ksend add connection unix kvis multi array

hclip Dataset

sendcontours

This to ol allows you to load an image and compute contour overlays whichmay

then be sent to any GUI programme for display This facility is only useful

when you want to add contours to a to ol which do esnt already have builtin

supp ort

For each extra dataset you wish to display as contours you need to run a

copyofthesendcontours programme To start the programme typ e

sendcontours

Once in the to ol you will need to sp ecify the desired contours levels This

interface is quite primitive requiring you to enter the actual values for each

level For example if you have a st moment map with interesting contours at

GHz and GHz you would typ e the following

contour levels e e

You then need to sp ecify the input le containing the image data

in file infile

where infile is the input lename Next you need to make a connection

from the to ol to a GUI to ol Typically this will be the kvis programme

which is running on the same machine For example typ e

add connection unix D overlay

The number is the Karma port number of the GUI to ol and is dis

played in the title bar of the GUI to ol Other GUI to ols will have dierentport

numb ers Once you have done all this setup typ e go and you should see your

new contours The normal GUI functions for zo oming are supp orted You can

list command to remove the contours and clean up the display use the empty

App endix A

Chromatic Ab erration

Radio telescop e interferometers exhibit chromatic ab erration eects This is

b ecause the resolution of the instrument changes with wavelength For low

bandwidth sp ectralline observations these eects are minor and can usually

be ignored However for highbandwidth observations say MHz these

eects can p ose a problem

Reduction packages such as AIPS and AIPS will pro duce a b eam pattern

image for each frequency channel This allows these packages to compute a

sp ectralline cub e which has a pixel size cellsize indep endent of frequency The

chromatic ab erration manifests itself in the dirty cub es as a changing antenna

pattern In other words if you playa movieofthechannel maps you will see

the grating ring pattern c hange Once the cub e has b een prop erly cleaned you

should no longer see grating rings and hence the cromatic ab erration has b een

eectively corrected

Reduction packages such as Miriad will only pro duce a single b eam pattern

for a nominal reference frequency channel this approach has the advantage of

saving disc space Because of this Miriad pro duces cub es where the pixel size

changes with frequency You can see this when you playamovie of the channel

maps an ob ject distant from the phase centre will app ear to move although the

grating ring pattern will not change it only shifts with the source ob ject This

shifting of an ob ject with frequency is of itself not a serious problem however

it is imp ortant that the coordinate system takes the variable pixel size into

account so that it tracks the moving ob ject correctly

The scaling of the cell size with frequency is accounted for in the co ordinate

handling within Miriad The correction is quite small for narrow bandwidths

eg MHz but quite noticable for cub es with MHz bandwidths at cm

a pixel shift is not unheard of

The FITS convention assumes that pixel sizes are constant The visualisa

tion software also makes this assumption

Since June Karma has taken account of this chromatic ab erration

by adding the new CELLSCAL keyword as it reads in Miriad cub es This

keyword is used in the astronomical world coordinate package to correctly

track variable pixel sizes At the same time Miriad was mo died to add the

CELLSCAL keyword when it writes FITS les Prior to this old FITS cub es

APPENDIX A CHROMATIC ABERRATION

written by Miriad did not have this keyword and hence violated the FITS

convention If you havesuch old cub es you should either regenerate the FITS

from the original Miriad cub e or else manually edit the FITS header by adding

a line suchas

CELLSCAL F

If you use a current version of Miriad and Karma then the coordinate

system will correctly handle the chromatic ab erration eects Note that the

source ob ject will stil l app ear to move as you playa movie of channel maps I

have b een asked to change this but this would require the visualisation software

to regrid the cub e Apart from the computational cost involved it is also not the

tro duced The correct approach correct approach as subtle artefacts can b e in

is to pro duce a cub e in Miriad which do es not haveavariable pixel size This is

p ossible to do although a little awkward It involves computing eachchannel

image indep endently This will mean that Miriad computes a b eam pattern

image for each channel If you manually sp ecify the pixel size each computed

image will have the same pixel size After this you clean each image and collect

them into a single cub e You can make this pro cedure easier by writing a script

Once you have pro duced suchacubecheck the header to ensure that you dont

have a CELLSCAL keyword with value F Miriad should only do this

when a dimensional invert is p erformed

App endix B

Setting up

B Environments needed

The visualisation software is written using the Karma package a library for

networked data pro cessing and visualisation In order to be able to use this

librarya number of environmentvariables have to b e set There are twoways

of doing this

is to typ e

source usrlocalkarmalogin

You can also include this in your login le

if you are using the standard login le select Karma

APPENDIX B SETTING UP

B Op erating Systems

All the programs here are available for Unix environments Ihave ready access

to the following platforms

SunOS sparc

sparc Solaris

Linux i

mips IRIX

IRIX mips

alpha OSF

so I make binary distributions for these platforms Karma has also been

p orted to the following platforms

rs AIX

mips ULTRIX

hp HPUX

crayPVP UNICOS

c ConvexOS

mips IRIX

mips IRIX

but since I dont have ready access binary distributions may not b e forth

coming

If you want to run Karma under another op erating system I will try to

make the executables for it if I can get access to a machine

App endix C

Resources

All the GUI visualisation to ols dene a number of resources whichcontrol the

app earance and functionality of the to ols Many of these resources are common

to other nonvisualisation programmes for the X Windowsystem such as the

xterm programme Listed beloware those resources which are sp ecic to

Karma visualisation to ols These resources may b e set in your Xdefaults

le which is the standard le into which to put your p ersonal resources Some

systems use the nonstandard Xresources le instead although the format

is the same On SGI systems you may need to put your Karma resources in a

separate le and run

xrdb merge filename

in your window system startup script You may alsoinstead on SGI systems

need to set resources in your Sgiresources le

In some cases you will need to prep end the application classname ie Kvis

to the resource name First try sp ecifying the particular resource as shown and

if that do esnt work prep end the application classname

Zo omPolicyxAsp ect this controls whether the asp ect ratio will b e

xed TrueornotFalse

Zo omPolicyintegerXZo omTogglestate this controls whether hor

izontalzoomingwillbeforcedtointeger multiples TrueornotFalse

Zo omPolicyintegerYZo omTogglestate this controls whether ver

tical zo oming will b e forced to integer multiples True or not False

IntensityPolicyresetIntensityTogglestate this controls whether the

intensity range will be reset up on loading of a new le True or not

False

iscaleMenusetChoice this controls the default intensity transforma

tion The folowing are supp orted

linear the screen intensity is prop ortional to the input data values

logvalmin the screen intensity is prop ortional to the logarithm

of the input data v alues

APPENDIX C RESOURCES

logmaxval the screen intensity is prop ortional to the logarithm

of the negative input data values

sqrtvalmin the screen intensity is prop ortional to the square

ro ot of the input data values

MagnierPopupfastPanner this controls whether the magnier win

dow will use a fast largememory mo de True or not False panner

The default is to use the slower smallmemory panner In most cases

the default mo de is quite fast enough unless you enlarge the magnier

window so it nearly lls your screen The reason the default is to use the

y kk then smallmemory mo de is that if you have a large image sa

the fast mo de would require MBytes of RAM just to store one copyof

the image Unless you have lots of RAM in your computer you will be

forced to wait a long time while your machine swaps to disc hence the

default

ImageDisplayfastPanner as ab ove but applies to the main image

window The default is to use the fast largememory panner This is

only of signicance when you use panning mo de ie select Panner

from the Zo om menu

MagnierPopupshowCrosshair this controls whether magnier win

dows should show a crosshair True or not False

displayAxisLab elsTogglestate if this is True then most windows

which supp ort axis lab els will have enabled them by default You also need

to set the OverlayMenucreateAtInit resource to True see b elow

OverlayMenucreateAtInit if this is True then creation of certain

control panels is p erformed at programme startup rather than b eing de

layed until if and when required Normallydelayed creation is preferred

since it sp eeds application startup but this prevents some resource sp eci

cations from taking eect until sometime later Some programmes provide

the shorthand create at init option

transient if True all p opup windows will b e iconied if the main window

is iconied

AnimateControlpinTogglestate this controls whether the anima

tion control will be stay p opp ed up when an image is displayed True

or will b e p opp ed down False

AnimateControltransient as ab ove but sp ecically only for the AnimateControl

widget section

Cmapwinp opuptransient as ab ove for the Cmapwinp opup wid

get section

Datacliptransient as ab ovefortheDataclip widget section

DataclipsubsetTogglestate this controls whether a subset of the

input data will be used to compute a histogram for the Dataclip

widget section

Dialogp opuptransient as ab ove for the Dialogp opup widget

DressingControltransient as ab ove for the DressingControl

widget section

Filep opuptransient as ab ove for the Filep opup widget section

Filep opupdotsTogglestate control whether True or not False

hidden les and directories are shown by default in the Filep opup

widget section

FilewinnumLines the desired size of the directory browser in lines

The default is that the browser size is automatically congured

Filewinlisttranslations may b e used to change the le browser mouse

b ehaviour The default is to highlighttheentry under the current mouse

p ointer p osition If you sp ecify BtnDownSetnnBtnUpNotify

then highlighting only o ccurs when an entry has b een selected The only

advantage of this b ehaviour is that it leaves the last selected entry high

lighted ie moving the mouse wont highlight a dierententry

IntensityPolicytransient as ab ove for the IntensityPolicy wid

get section

LoadAndDecimatetransient as ab ove for the LoadAndDecimate

widget section

MagnierPopuptransient as ab ovefortheMagnierPopup wid

get section

MomentGeneratortransient as ab ovefortheMomentGenerator

widget section

OverlayEditorControltransient as ab ove for the OverlayEditorControl

widget section

PannerPopuptransient as ab ove for the PannerPopup widget

section

Postscripttransient as ab ove for the Postscript widget section

SlaveImageDisplayPopuptransient as ab ove for the SlaveImageDisplayPopup

widget

TracePopuptransient as ab ove for the TracePopup widget sec tion

APPENDIX C RESOURCES

ViewDatasetstransient as ab ove for the ViewDatasets wid

get section

Zo omPolicytransient as ab ove for the Zo omPolicy widget sec

tion

Kvisgeometry the size and placement of the main display windowfor

kvis The default is top left

KvisrstDataBrowserShellgeometry the size and placementofthe

rst data browser window for kvis The default is to the

right of the main display window and at the b ottom of the screen

KvisimageDisplayShellgeometry the size and placement of the

second display windowfor kvis The default is top right

PostscriptnameDialogfont the name of the font to use in the text

entry dialog for the output lename in the Postscript widget section

App endix D

Annotation File Format

D Usage

Karma has a facility to annotate D images with lines b oxes and other sim

ple gures as well as strings of text Commands to draw these various things

are stored in text les which are read in by selecting the Load Annotations

option from the Overlays button menu see x The names of annotation

les must have the extension ann or ANN for Karma to recognize them

Annotations read from a le can be removed from the image with the Re

move buttons in the Annotation File Loader Often the b est way to pro duce a

go o d set of annotations for a particular image is to see what an annotation le

pro duces on the screen then mo dify the le contents remove the annotations

and reload the le until everything app ears satisfactory

Note the annotations descib ed here only work with D images or D

images For information on marking rendered D images with slices of D

line segments in xraysee x

D Fundamental Syntax

Annotation le syntax is very simple Commands are listed in the order they

are to b e p erformed separated by carriage returns Each command is followed

by one or more arguments which may be separated with commas spaces or

tabs Comments may be placed in the annotation le by using a comment

character All text o ccuring after a commentcharacter on the same line is

ignored Blank lines are also ignored The syntax is caseinsensitive UPPER

over more lower or MiXeD cases are all valid Commands can be extended

than one line of text by placing a continuation character n at the end of each

line to be continued Any text app earing after the continuation character on

the same line is ignored Continuation characters do not continue comments

only command strings therefore any n following a is ignored If the

line following a continued line is blank or a comment line the continuation is

terminated

Note The parser ignores any spaces tabs or commas preceding useful

text on a command line Consequently a space should b e placed prior to the

APPENDIX D ANNOTATION FILE FORMAT

continuation character if the text b eginning on the following line is not to be

considered part of the last argument on the current continued line The reason

for this is to allow a long argumenteg a really long font name to b e broken

up if necessary without b eing treated as two separate arguments

D Annotation Commands

There are three typ es of commands those which draw ob jects those which

change attributes of ob jects and nongraphical commands A complete list of

currently implemented commands is given below with syntaxes and brief de

scriptions In the syntax lists the command is given in CAPS with o ccasional

brackets synonyms in parentheses Required arguments followinangle

and optional arguments or argument groups in square brackets The brack

ets are for illustration only and should not b e typ ed

D NonGraphical Commands

At present there is only one of these but it is quite useful

INCLUDE name of file

Includes the contents of another annotation le in the current one The

parser acts on the instructions it nds in the included le b efore moving to

the next command in the present one Thus one can include the same les

worth of annotations in several dierent les without having to maintain

multiple copies Furthermore by sp ecifying attributes such as color in

the parent le instead of the included le the attributes can b e changed

from one inclusion to the next

The lename can include the notation as well as other simple Borne

Shelllike expansions of environmentvariables using the

variable fvariableg and fvariablewordg notations

Note Filenames are casesensitive on many op erating systems eg

Unix Also when using multilevel inclusion including les which in

clude other les etc be careful with relative pathnames The parsers

working directory remains that of the original le thus if fileann

has INCLUDE subdirfileann and that le has INCLUDE fileann

Karma will lo ok for fileann in the directory containing fileannnot

in subdir Unless all the les are in the same directory its probably

safer to use absolute pathnames or environmentvariables

D Attribute Commands

Attributes are general prop erties of ob jects An attribute command sets one of

these prop erties for all ob jects drawn after until the attribute is changed by

another attribute command Each has an initial value it is assigned when the application rst starts

D ANNOTATION COMMANDS

COLOR or COLOUR name of color

Sets the color of subsequent ob jects The color name is a standard sys

tem color a list of which can be found for XWindows systems in the

le usrlibXrgbtxt Basic color names include red green yel

low white etc The default color is green

FONT name of font

Sets the font of subsequent text ob jects The font name is a standard

system font a list of which can b e found for XWindows systems with the

command xlsfonts The name of the default font is hershey Note

font names are casesensitive

COORD default coordinate type W R or P

Sets the default co ordinate typ e of subsequen t ob jects This will apply to

any ob jects which do not have a co ordinate typ e given in their command

string Any co ordinate typ e in an ob ject command string takes precedence

over the default co ordinate typ e but only applies to that particular ob ject

Some ob jects allowmultiple co ordinate typ e arguments in this case each

co ordinate typ e given applies only to vertices following it in the argument

list until sup erceded by another co ordinate typ e sp ecication See b elow

for descriptions of the dierent co ordinate typ es The initial setting of

COORD is W

PA position angle convention STANDARD or SKY

Sets the p osition angle convention for subsequent ob jects Unlikecoordi

nate typ e p osition angle convention cannot b e sp ecied inside an ob ject

command but must be set with this attribute command See below for

descriptions of the two p osition angle conventions The initial setting of

PA is STANDARD

D Ob ject Commands

Ob ject commands draw sp ecic ob jects over a displayed image These include

text strings as well as gures made up of dots and lines

The lo cations of drawn ob jects can be sp ecied in three typ es of co ordi

nates world W relative R and pixel P World co ordinates are those in

dicated by axis lab eling eg right ascension and declination or velo city in

a p ositionvelo city map but b e careful ab out co ordinate units since anno

tations use the units sp ecied by the image header eg the FITS standard

default units for right ascension are degrees not hours and for velo city are

ms not kms Relative co ordinates range from to inside region b ounded

by the image axes increasing from the lower left corner of the image Pixel

co ordinates count screen pixels explicitly in the entire display region includ

ing outside any lab eled axes b eginning in the upper left corner note these

are not image pixels but rather the physical pixels of the computer monitor

screen Image pixel co ordinates are not a usable co ordinate typ e here unless

no world co ordinates are dened for the image in which case Karma will use

the image pixel co ordinates in place of world co ordinates For most purp oses

APPENDIX D ANNOTATION FILE FORMAT

involving the marking of image features world co ordinates are the b est choice

though relative co ordinates are o ccasionally go o d for marking a particular part

of the display region regardless of image pro jection Pixel co ordinates by their

inexible nature are as a rule not very useful The three co ordinate typ es are

sp ecied in an argument list with the letters W RandP

In several of the ob ject commands b elowDOTS LINE CLINES DLINES

VECTOR dierent geometric parameters of the ob ject can be sp ecied in dif

ferent co ordinate typ es and so a co ordinate typ e argumentmay precede more

than one co ordinate pair in the argument list However all co ordinate typ e

arguments are optional they are only necessary to override the current value

t list or the default co ordinate either one sp ecied earlier in the argumen

typ e selected with the COORD attribute command

DOT or POINT coord type x coord y coord

Draw a single p oint

DOTS or POINTS coord type x y coord type x

y

Draw a collection of p oints

LINE coord type x y coord type x y

Drawalinebetween twopoints

CLINES coord type x y coord type x y

coord type x y

Draw a series of connected lines connect the dots

DLINES coord type x y coord type x y

type x y coord type x y coord

Draw a collection of disconnected lines

VECTOR coord type x base y base coord type x comp

y comp

Drawavector with sp ecied comp onents at agiven lo cation At present

this is just a line with no arrowhead drawn However unlike the LINE

command which sp ecies co ordinates of both endp oints the arguments

for VECTOR are the p osition of the base and the comp onents of the vector

which get added to the base to determine the other endp oint

BOX coord type x y x y

Draw a rectangular b ox given co ordinates of two opp osed corners

CBOX coord type x cent y cent x width y height

angle

Draw a rotatable rectangular box given center co ordinates width and

height and an optional p osition angle in degrees

type x cent y cent x width y height CROSS coord

angle

Draw a rotatable cross given center co ordinates width and height and an optional p osition angle in degrees

D ANNOTATION COMMANDS

CIRCLE coord type x cent y cent radius

Draw a circle given center co ordinates and radius

type x cent y cent a b angle ELLIPSE coord

Draw a rotatable ellipse given center co ords semima jor and semiminor

axes and an optional p osition angle in degrees The semima jor axis must

be given b efore the semiminor axis if adherence to the standard denition

of ellipse p osition angle is desired In order to maintain consistency with

the CBOX and CROSS commands the rst axis is the one oriented by the

p osition angle regardless of whether it is the largest

TEXT coord type x left y left string

Draw a text string leftjustied at the given co ordinates more precisely

these sp ecify the lower left corner of text The string to be used is

whatever follows the third argument eg several words separated by

spaces and ends with the line of text unless continued onto another line

Comment and continuation n characters cannot be included in a

text string but are acted up on in the usual fashion if found thus text

commands can also b e extended to multiple lines

WARNING At present rotatable gures b oxes crosses and ellipses have

a tendency to app ear distorted from their real app earance in curved world

co ordinates eg maps of the sky Prop er pro jection of geometric ob jects into

world co ordinates is a nontrivial exercise and has b een deferred

D Position Angle Conventions

Standard Postition Angles are generally dened in the Cartesian sense



where PA sp ecies fX Y g PA sp ecies fX Y g

and so forth In a co ordinate system where X increases from left to right and

Y increases from b ottom to top PA will increase in a counterclo ckwise direc

tion However this will be reversed if the X increases from right to left or Y

from top to b ottom though not both So be careful To summarize PA is

measured CCW from right in R co ords and CW from rightinP co ords How

it is measured in W co ords dep ends on the co ordinate system in many cases

it will b e the same as R co ords but this is not always true For example most

astronomical maps of the sky have the X co ordinate increasing toward the left

in which case PA will b e measured CW from left

Sky Position Angles are for the astronomers Usage of this convention in

annotations assumes two things a map of the sky is b eing displayed with

the X co ordinate increasing from right to left and the Y co ordinate increasing

from b ottom to top ie north up south down east left west right

and p osition angle is measured from north through east up through left

The convention is followed regardless of whether the co ordinate typ e is W RorP

So unlike STANDARD p osition angles SKY PAs retain their app earance regardless

of co ordinate typ e This same system can be used with Ecliptic and Galactic

co ordinates as well as Equatorial though the PA referent p oints up in all

cases toward the grids north p ole However unless the image pro jection is at

APPENDIX D ANNOTATION FILE FORMAT

PA will only p oint exactly north at the image pro jection center but if the

image covers a small piece of the sky and is not close to a co ordinate p ole the

error will b e small Generalizing this to b e correct in all parts of the image is

a future pro ject

D Example Annotation File

includeann have been pro Two sample annotation les mann and m

vided to illustrate the functions and concepts outlined ab ove To use these ex

ample les prop erly in Karma it is necessary to load the FITS image m hats

to set the world co ordinates For best image app earance select a square ro ot

intensity scale from the Intensity Policy p opup and a intensity range

from the IScale p opup

These example les and some image data may b e found at

ftpftpatnfcsiroausoftwarekarmadataannotations

SAMPLE KARMA ANNOTATION FILE MANN

to be used with MFITS images

Comments are preceded by a character

the commands names below are given in CAPS for readability All of

but they could just as easily be lower case

World coordinates here are decimal degrees of Right Ascension and

Declination in accordance with the FITS standard

COORD W These are the attribute settings at startup time

PA STANDARD If no annotation files loaded prior to this one

COLOR GREEN have changed any attributes then these commands

FONT hershey are reduntant

Label the image near the top Use relative coordinates to fix

the position regardless of image zoom

COLOR WHITE

TEXT R THE ORION NEBULA

Change font to something a little smaller for other labels

FONT hershey

Mark the four Trapezium stars with blue circles and connect them

D EXAMPLE ANNOTATION FILE

Use world coordinates for these markers and name label

Since COORD is currently set to W specifying W coords in the

argument lists of the objects below is not necessary

Note W coords are in degrees for consistency with coordinate

information in the FITS image header even though RA is labeled

in hours by Karma Note also the TEXT string is continued onto

another line The leading space is ignored but a trailing space

after Trap would not be The commas in the CLINES command

string are not necessary but make it easier for a human to read

COLOR BLUE

DOT Theta A Orionis HD

DOT Theta B Orionis HD

DOT Theta C Orionis HD

DOT Theta D Orionis HD

CIRCLE Theta A Orionis HD

CIRCLE Theta B Orionis HD

CIRCLE Theta C Orionis HD

CIRCLE Theta D Orionis HD

CLINES

TEXT Trap

ezium

Indicate the star Theta C Orionis source of much of the UV flux

ionizing the gas in the nebula Use a mixture of world and

relative coordinates to fix the label on the screen when zooming

COLOR YELLOW

LINE W R

TEXT R Theta C

Mark the region imaged by the HST mosaic released in

httpopositestsciedupubinfoprhtml

COLOR RED

BOX

TEXT HST

One transverse light year at a distance of ly subtends

degrees At a declination of degrees this is Right

Ascension degrees

COLOR GREEN

CBOX

CROSS

APPENDIX D ANNOTATION FILE FORMAT

TEXT ly

Here is a series of disconnected lines for no very good

reason The last continuation character is ignored because

the following line is empty

COLOR LIGHT GRAY

DLINES R

Change default coordinates to relative In the DLINES command

above the default was world coordinates so the R was necessary

to specify something else

COORD R

Here are a of couple vectors

COLOR CYAN

VECTOR

VECTOR

COORD W Change back to world coordinates as the default

Here are three plain adjacent ellipses No position angle

parameter is given so PA However this applies to the first

semiaxis given not necessarily the larger of the two With the

semiminor axis listed first these ellipses have an effective

position angle of degrees in the standard system see

below

COLOR ORANGE

ELLIPSE

ELLIPSE

ELLIPSE

Put a dot in the center of all three orange ellipses using a

single command

DOTS

D EXAMPLE ANNOTATION FILE

Include another annotation file which has examples of some

rotatable objects

INCLUDE mincludeann

END OF SAMPLE KARMA ANNOTATION FILE MANN

SAMPLE KARMA ANNOTATION FILE MINCLUDEANN

to be used with MFITS images

Draw rotated crosses cboxes and ellipses with standard PAs

PA STANDARD

The Ws arent actually necessary since COORD is still set to W

COLOR AQUAMARINE

CBOX W

CROSS W

ELLIPSE W

COLOR MAGENTA

CBOX R

CROSS R

CBOX R

ELLIPSE R

COLOR VIOLET

CBOX P

CROSS P

ELLIPSE P

crosses cboxes and ellipses with sky PAs Draw rotated

PA SKY

COLOR TAN

CBOX W

APPENDIX D ANNOTATION FILE FORMAT

CROSS W

ELLIPSE W

COLOR KHAKI

CBOX R

CROSS R

ELLIPSE R

COLOR GOLD

CBOX P

CROSS P

ELLIPSE P

END OF SAMPLE KARMA ANNOTATION FILE MINCLUDEANN

App endix E

Making Videos

Sometimes you will want to prepare a video for presentation The pro cedure to

do this dep ends on the equipmentyou haveavailable and the desired qualityof

the pro duction This app endex discusses some options

E Basic Facilities at the ATNF

The ATNF has video recording equipment connected to the workstation pho enix

This equipment is not capable of pro ducing highquality ie broadcast stan

dard videos but it has the advantage of b eing lo cated at the ATNF and so is

convient to use

Once you have pro duced your movie you need to purchase a VHS video

cassette and use the video recorders supplied When playing the movies it is

advisable to use the fullscreen commandline option for the kvis chapter

and xray chapter to ols This will make the image display windowtake

up the entire screen You should see a button lab elled Raise somewhere which

allows you to place the displayed image ab ove all other windows By clicking

the right mouse button you can lower this window again and get back your

control panels

E Using Sydney University VisLab Facilities

The University of Sydney has created a commercial visualisation lab oratory

They are able to make highquality broadcast standard VFS and Betacam

videos All you need to do is provide them with a sequence of numb ered images

in a supp orted format

VisLab also have facilities to convert from many p opular image formats to

a format their machinery requires but this will cost real money Instead you

should pro duce les in Targa TrueVision format which they will b e able to

use directly The karmappm section commandline utilitymaybeused

to pro duce this format

The image size required by VisLab is pixels horizontal and pixels

vertical Note that you need to leave a b order of inside this otherwise some

television screens will chop the outer parts of your movie

APPENDIX E MAKING VIDEOS

You would need to use the following parameters for karmappm

converter ppmtotga

extension tga

outheight

outwidth

You would then typ e something like

karmappm mymovie image

and you would get a sequence of numb ered images starting from such as

imagetga

imagetga

imagetga

imagetga

imagetga

imagetga

imagetga

imagetga

imagetga

imagetga

imagetga

imagetga

imagetga

imagetga

Try to keep the lenames to lengths ie characters for the rst part

and characters for the extension This avoids any potential problems with

some broken op erating systems

These les are already compressed so further compression is probably not

worthwhile Write these images onto a tap e or CDROM and takeittoVisLab

It is recommended that you attend the video recording session in p erson in

case there are problems You ma y nd that the colour balance intensity or

contrast is dierent on your workstation screen than on the television screen

Ab orting the pro cess early if there are problems will save you money

Rememember its your video Nob o dy knows exactly how you want it to

app ear except you

App endix F

Acknowledgements

Nearly all of the Karma software and do cumentation has been written by

Richard Gooch formerly of the CSIRO Australia Telescop e National Facility

and later at the DepartmentofPhysics and Astronomy UniversityofCalgary

Richard Go o chmay b e reached by email at

rgoochsafemboxcom or on the WWW at

httpwwwsafemboxcomrgooch

Some of the early widgets such as the le browser and colourtable con

troller were written byPatrick Jordan then with the CSIRO Division of Ra

diophysics In addition Patrickcontributed through lengthy architectural dis

cussions Patrick Jordan maybereached by email at

patrickarielcomau or on the WWW at

httpwwwarielcomaupatrick

The antialiasing image expansion co de and the waveletbased ltering co de

was written byTom Oosterlo o then with the CSIRO Australia Telescop e Na

tional Facility

The rst versions of the programme khuei section were written

by Simone Magri of the CSIRO Australia Telescop e National Facility Simone

Magri maybereached by email at

SimoneMagriatnfcsiroau or on the WWW at

httpwwwatnfcsiroausmagri

The kpvslice chapter and ko ords chapter programmes were

a collab orative eort between myself and Vincent McIntyre then with the

University of Sydney VincentMcIntyre maybereached by email at

VinceMcIntyreatnfcsiroau or on the WWW at

httpwwwatnfcsiroauvmcintyr

The Starlink to Karma conversion programme sdfkarma was written

by Karl Glazebro ok of the Anglo Australian Observatory Karl Glazebro ok may

b e reached by email at

kgbphajhuedu or on the WWW at

httpwwwaaogovaulocalwwwkgb

The annotation le reading co de was designed and implemented by Steven

Gibson then with the University of Calgary and currently with Arecib o Ob

servatory The app endix describing the data format was also written bySteve

APPENDIX F ACKNOWLEDGEMENTS

He maybereached by email at

gibsonnaicedu or on the WWW at

httpwwwnaicedugibson

App endix G

Quirks and Unexp ected

Behaviour

There are some op erations that may not behave in the way you may exp ect

although they are op erating according to design These are quirks rather

than bugs Below is a list of quirks

When loading a le and Reset Intensity Up on File Load is disabled the

intensity range of the previous image will b e used However the intensity

range that is used is the raw range not the scaled range Thus with

images whichhave dierent scaling parameters the scaled intensity range

will change

When moving b etween two images such as when blinking or when load

ing a new image the display system attempts to retain the old image

parameters ie zo om b ox What is retained are the corners of the zo om

box measured in image pixel coordinates not world coordinates

Coordinate p ositions start from not

APPENDIX G QUIRKS AND UNEXPECTED BEHAVIOUR

App endix H

Undo cumented Features

Index

data formats D overlays

AIPS

acknowledgements

AIPS

adaptive ltering

DRAO

annotations

FITS

loading

GIF

autoscaling

GIPSY

axis lab els

IRAF

Karma

batch pro cessing

Miriad

in GUIs

PGM

blanked values

PNM

blinking images

PPM

Simple FITS

capturing coordinates

Starlink

changing dimension lengths

Sun Rasterle

chlen

Targa TrueVision

chromatic ab erration

TIFF

coordinate system tting

data replacement

coordinate systems

decimating cub es

colourmap ashing

decimating images

colourtables

drawing

commandline to ols

drawing overlays

ktranslate

miriadgipsy

exp orting

common GUI features

common GUI switches

lter clip

contours

tting coordinate systems

levels

tting gaussians

multiple

icker removal

crashes

freezing events

cursor readout

hardcopies

data converters

header viewing

tskarma

histograms

gipsykarma

image intensit y

ktranslate

hueintensity display

miriadgipsy

illegal values miriadkarma

image formats data lters

INDEX

image statistics commandline

images

loading data

editing

loading partial data

imageskarma

intensity scaling

magnifying glass

making videos

karma

maximum

Karma WWW site

of data

karmappm

minimum

kdecimate

of data

key bindings

miriad masks

b

miriadgipsy

c

moment maps generating

controlspacebar

mosaicing

controlv

End

op erating systems

H

overlay le format

h

overlays

Home

D

i

adding annotations

l

axis lab els

o

contours

PgDn

editing

PgUp

le format

r

loading

s

spacebar

painting

u

panner

V

panning

v

p oint spread function

kminmax

measuring

ko ords

p ostscript output

kp olar

printing headers

kprinthead

printing images

kpvslice

proles

switches

areaaveraged

kregrid

areasummed

krotate

tting gaussians

ksend

radial

kshell

spatial

kslice d

sp ectral

magnications

programme crashes

precompute

ktranslate

quirks

kview

regridding switches

rendering algorithms kvis

INDEX

Exp ortMenu renzogram

Filep opup channels

ImageDisplay renzograms

ImageEditorControl resizing displays

IntensityPolicy resources

LoadAndDecimate

rotating

MagnierPopup

saving

MomentGenerator

as PostScript

OverlayEditorControl

images

PannerPopup

proles

Postscript

scatter plots

TracePopup

screen snapshots

ViewDatasets

segmentation faults

ViewDatasets

sendcontours

Zo omPolicy

sending commands to GUIs

WWW site

sequences of images

xray

setting up

shaders

zo oming

frontvoxel

hot gas continuous

hot gas mono

hot gas substances

intensity transformation

maximum voxel

minimum voxel

substances

voxel sum

statistics

images

sup erimp osing images

undo cumented features

units

viewing headers

viewing multiple datasets

volume rendering

widgets

AnimateControl

Canvas

Cmapwinp opup

DataBrowser

Advanced

Make Data

Dataclip

DressingControl