SC/12.1

Starlink Project
Starlink Cookbook 12.1

Jon Lockley

28 November 1997


Writing your own Data Reduction Software



Abstract

This Cookbook shows you how to write your own software for astronomical data reduction. There are two parts. The first part introduces you to simple data reduction using Starlink’s IMG subroutine library. This hides a lot of the underlying complications. The second part introduces you to the more powerful (but more complex) NDF subroutine library for handling data.

Contents

1 Introduction
 1.1 What is this book about?
 1.2 Why write my own software?
 1.3 How this book works
 1.4 What will I be able to do after reading this?
2 Getting started
 2.1 Introduction
 2.2 Interface files
 2.3 Compiling your applications – The alink command
 2.4 Section summary
3 The basics of the IMG library
 3.1 Example 1 – A “do nothing" code
 3.2 Example 2 – Opening and closing files
 3.3 About the IMG library
 3.4 Really getting to your data (or data mapping)
 3.5 Putting it all together – Complete applications
 3.6 Example 3 – Processing data values
 3.7 Output from applications
 3.8 Example 4 – Updating a file
 3.9 Example 5 – Creating a new file
4 Accessing header information
 4.1 Example 6 – Reading a header item
5 Accessing different file formats
 5.1 The Convert package
 5.2 Getting your code to read different file formats
6 Summary of part one
7 Using the NDF library calls
 7.1 Example 7 – Using NDF library calls to update an NDF
 7.2 Creating a new NDF
 7.3 Example 8a – Creating a new NDF (the bare essentials)
 7.4 Example 8b – Putting a title into the NDF
 7.5 Example 8c – Creating a data and variance array in an NDF
8 Variances, bad pixels, and quality – The art of error propagation
 8.1 Processing a variance array
 8.2 Example 9 – A code which does not propagate the variance array
 8.3 Example 10 – A code which DOES propagate the variance array
 8.4 The Quality component
 8.5 Rules for propagation of variance arrays
9 NDF extensions
 9.1 Example 11 – Reading an extension
 9.2 Example 12 – Creating a new extension
10 Making your own software package
 10.1 Monoliths
 10.2 Example 13 – A monolith
11 Compiling code without ADAM
12 Miscellaneous
 12.1 A brief word about axes
 12.2 Starlink libraries
 12.3 Hints for writing good applications
 12.4 Documenting your code
 12.5 Portability
 12.6 Submitting code to Starlink
A Useful resources
 A.1 Useful libraries and commands
 A.2 Further reading
B Glossary