Astrophysical and other libraries

4.1 Astrophysical modelling codes

4.2 General-purpose and numerical libraries

4.2.1 Reading and writing data

4.3 Link farms

4.2 General-purpose and numerical libraries

4.2.1 Reading and writing data

4.3 Link farms

This section aims to be no more than a set of pointers to more complete information and resources. I’m no expert in this field, myself, so if I’ve missed some important resource, or miscontextualised something, please do let me know.

Stellar atmosphere codes:

- CCP7 was a Collaborative Computational Project, ‘concerned with the calculation of theoretical models suitable for the interpretation of stellar and interstellar spectra’. As well as promoting the use of advanced computers in astronomy, it developed a library of stellar-atmosphere and spectroscopy codes. The project finished in April 2001, but the resources it produced are still useful.
- Simon Jeffery makes available a number of tools for stellar atmosphere calculations.
- At Robert Kurucz’s home page you can obtain copies of his ATLAS and other codes, along with grids of model atmospheres.
- PHOENIX: state-of-the-art M-star model atmospheres.

Atomic and molecular data:

- The Opacity Project is a collaborative project to produce the atomic data required for stellar envelope calculations. The project makes the results generally available both through a database called ‘TOPbase’, and by anonymous FTP.
- Other opacity data is available from the OPAL code. As well as making precalculated opacity tables available, you can make requests for new tables to be generated.
- Atomic data at Kentucky and Harvard
- JPL Molecular Spectroscopy
- The Vienna Atomic Line Database (VALD) is an excellent site with up-to-date atomic data needed for spectrum synthesis.

Astronomical chemistry (loosely) — dust, clouds and the interstellar medium:

- Cloudy is a arge-scale plasma simulation code that is widely used across the astronomical community as an aid in the interpretation of spectroscopic data.
- DUSTY is a dust-shell modelling code, also originating at Kentucky.

A number of CFD codes are available to buy or download. This is a collection of pointers and notes about a large number of CFD codes, from a variety of sources.

Thanks to [SJ], [BS] and [AS] for much of the content of this section.

There are numerous software libraries available. Many of these are free, many are public domain. The difference between the two is that ‘public-domain software’ is in some sense ‘ownerless’: it’s yours to play with, or modify, or exploit, as you wish, with only good manners requiring you to acknowledge the source (this is not an authoritative statement of copyright law, by the way...). ‘Free’ software, on the other hand, is still copyrighted, but you may have a free licence to use it for certain purposes. One of the best known of these licences is the GNU General Public Licence, which gives you very good access to the code, limited only by the requirement that programs produced using GPL’d code are themselves made as freely availale. Other licences might make the code available to academic users only, or only for non-commercial use. The GNU project have a useful collection of free and not-so-free licences, which is useful even though they are sometimes a little fervent about the issues. The type of licence makes a difference if you plan to redistribute your code. See also the observations about libraries, and thoughtless use of them, in 2.3.

Probably the most commonly used numerical library is the NAG library. This is a long-established, and very highly thought-of, library, which contains codes to deal with a broad range of numerical problems. The routines tend to come in several versions, typically a highly general, and highly configurable, one, accompanied by easy-to-use drivers. The NAG library is expensive, but Starlink’s size allows it to negotiate with NAG to provide the library at all Starlink sites. The routines are generally in Fortran, but C versions of some of them are becoming available.

The PDA library is a collection of public-domain and free routines, assembled by Starlink, and intended to replace the NAG library in Starlink application code. The collection was assembled using GAMS, with routines drawn from FFTPACK, SLATEC, NMS, OPT, plus other isolated sources. If you need to use one of the available algorithms, then the advantage of using the library version is that the (possibly non-trivial) work of building it for your architecture has already been done, leaving you able to simply link against the library. The collection is fully documented in SUN/194.

The remaining libraries are typically free.

In your search for codes, you would do well to start at GAMS: Guide to Available Mathematical Software. This describes itself as ‘A cross-index and virtual repository of mathematical and statistical software components of use in computational science and engineering’. You can either search for the code you need by keyword, or work through their classification of problems (a classification which is occasionally used more widely) to find references. They point to both free and commercial software.

The first collection to be aware of is Netlib. The archive is based at http://www.netlib.org, but there are UK mirrors Although there are some facilities which are primarily available at Netlib, it also mirrors several other archives.

NHSE, the (US) National High-Performance Software Exchange, is ‘a distributed collection of software, documents, data, and information of interest to the high performance and parallel computing community’. NHSE is part of Netlib, and incorporates software repositories HPC-netlib for high-performance software, PTlib for parallel tools, and CSIR for chemistry software.

The CERN program library includes CERNLIB, which consists of a number of component libraries. This is a long-standing and well-known library of general-purpose Fortran (typically) numerical routines with, obviously, some bias towards particle physics. The service is free to all HEP users, and to physics departments in CERN member states, with separate non-commercial and commercial rates available. There is a FAQ.

JPL has a Computational Mathematics Library. These appear to be free, but no longer formally supported by JPL.

The ACM Transactions on Mathematical Software (TOMS) is a journal produced by the ACM. The software discussed in there is available at GAMS, and mirrored at HENSA.

The Scientific Computing Division of the (US) National Center for Atmospheric Research, has an overview of mathematical and statistical packages. Not all the packages reviewed there are freely available, but the discussions are useful.

PORT is a collection of general maths subroutines. Its description of itself is on the front page: ‘The PORT Mathematical Subroutine Library (third edition) is a collection of Fortran 77 routines that address many traditional areas of mathematical software, including approximation, ordinary and partial differential equations, linear algebra and eigensystems, optimization, quadrature, root finding, special functions, and Fourier transforms, but excluding statistical calculations. PORT stands for Portable, Outstanding, Reliable, and Tested.’ Some routines are public-domain when, for example, they are developments of public routines, others have a non-commercial-use licence condition.

Slatec is ‘a comprehensive software library containing over 1400 general purpose mathematical and statistical routines written in Fortran 77.’

Specifically concerned with minimisation, minpack (or at netlib), is a library for solving linear and nonlinear minimisation problems. It has documentation within the source code.

The codes you write do not exist in isolation, and at some point you will have to read data from, or write it to, files. You might, therefore, need to read or write one of a number of standard data formats. Clive Davenhall wrote an article on this in the September 1998 issue of the Starlink Bulletin. This covered reading and writing using the IMG library (SUN/160), using NDF files and the HDS files they are a special case of (SUN/33 and SUN/92 respectively), and reading and writing FITS files (SUN/136).

You can convert between different data formats using the CONVERT package, documented in SUN/55. CONVERT is extremely easy to use, and converting a FITS file, say, to an NDF is as easy as

If you have to read or write FITS files, then visit the FITS home page for the FITS users guide and the `cfitsio`

library. Although FITS files have a very simple format, there are enough ways of getting things wrong that you
will, as usual, save yourself time in the long run by taking the trouble to use the `cfitsio`

library. It’s easier than
you might think: the Quick Start Guide contains most of what you’ll ever need to know. Note that, although the
library is called *c*fitsio, it’s designed to be used with Fortran as well, and the programmer’s reference guide
comes in two flavours.

Once the data is there, you will need to visualise it. See 3.3 for some pointers to suitable software.

http://cdsweb.u-strasbg.fr/astroweb.html: AstroWeb is one of the most useful link collection, because it has been developed by the astronomy community.

http://math.nist.gov/toms/Resources.html: The TOMS list of web resources for mathematical software is a collection of pointers maths software on the web.

Yahoo has managed to assemble a respectable collection of pointers to Scientific software at http://uk.yahoo.com/Computers_and_Internet/Software/Scientific/, as well as more specific pointers to maths (http://uk.yahoo.com/Science/Mathematics/Software/), physics (http://uk.yahoo.com/Science/Physics/Software/) and astronomy (http://uk.yahoo.com/Computers_and_Internet/Software/Scientific/Astronomy/) resources.

Copyright © 1999, 2001–2003, Central Laboratories for the Research Councils