### B Finding the Air Mass and Zenith Distance

This appendix gives some advice on how you can find out the air mass and zenith distance of your individual observations. It is impossible to give simple instructions which will work in all cases because the procedures adopted by different observatories are different. Ideally, at the conclusion of your observing run you would be given a summary list of all your observations which would include the air mass for each. However, it is much more likely that the air mass or zenith distance will be included in the auxiliary information stored in the data file for each observation. Again, different observatories use different data formats and different keywords17.

#### B.1 Information required

Ideally you need to know the average air mass, $X$, of each observation. Alternatively, the zenith distance, $z$, is just as good. The CURSA applications for calibrating instrumental magnitudes (see the recipe in Section 16) can automatically calculate the air mass from the zenith distance. Conversely, if you need to calculate the air mass from the zenith distance yourself then Section 8 gives the requisite formulæ.

If the auxiliary information for your observations contain neither the air mass nor the zenith distance then you will have to calculate the zenith distance from whatever information is available about the celestial coordinates and times of your observations. The zenith distance, $z$, can be calculated from:

 $secz=\frac{1}{\left(sin\psi sin\delta +cos\psi cos\delta cosh\right)}$ (23)

where:

$\psi$
is the latitude of observation,
$\delta$
is the Declination of the object observed,
$h$
is the Hour Angle of the object observed.

The Hour Angle is simply:

 $h=s-\alpha$ (24)

where $\alpha$ is the Right Ascension of the object observed and $s$ is the local sidereal time. Again, the local sidereal time may not be recorded in your observations and it might be necessary to calculate it from whatever information is available about the time of your observations. Most standard textbooks on spherical astronomy give further details of calculating the zenith distance and converting between time systems (see, for example, Spherical Astronomy by Green[31]). Another useful source of information is the explanation and notes for the SLALIB positional-astronomy subroutine library (see SUN/67[75]).

The keywords used to represent these various items of information differ between different observatories. Table 5 gives some examples. It is based on CCD frames observed with the Jacobus Kapteyn Telescope (JKT) on La Palma. In this case both the air mass and the zenith distance are included and hence there is no need to calculate them. The keywords used at the Anglo-Australian Observatory are available via the World Wide Web (at URL http://www.aao.gov.au/local/www/tjf/fits.html). The appropriate instrument and observatory manuals should document the keywords used in a given dataset. In case of difficulty staff at the observatory where the dataset was acquired should be able to advise.

 Keyword Description AIRMASS air mass ZENDIST zenith distance (degrees) TIMSTART start time of exposure TIMEND end time of exposure RA Right Ascension of the object DEC Declination of the object EQUINOX equinox of coordinate system DATE-OBS date of the observation

Table 5: Example of some keywords present in a CCD frame acquired with the Jacobus Kapteyn Telescope (JKT) on La Palma

#### B.2 Examining files

Files containing observations come in a number of different formats. The procedures for inspecting them to determine the values of the keywords that they contain differ for different formats. The following notes cover some of the more common formats, though they are not comprehensive. Note that you can convert a data file between any of the formats mentioned below (and others) using the CONVERT package (see SUN/55[12]).

If you are using Starlink applications such as PHOTOM (see Section 14) or GAIA (see Section 15) to measure instrumental magnitudes in CCD frames then you will probably have converted them to the $n$-dimensional Data Format (NDF; see SUN/33[77]) which itself is a special case of Starlink’s Hierarchical Data System (HDS; see SUN/92[78]). HDS files, including NDF ones, usually have file type ‘.sdf’. In this case, the file name specified to applications, such as those in KAPPA, must omit the ‘.sdf’ file type.

If the observations were originally formatted as FITS files (see below) prior to being converted to the NDF format then all the FITS keywords are preserved in an extension to the NDF file and usually this extension will contain any information about the air mass etc. Application fitslist in KAPPA (see SUN/95[11]) will list the FITS extension of an NDF. Briefly, if you have not previously started KAPPA type kappa. Then type fitslist filename (remembering to omit the file type).

If you know the name of the required keyword then you can use the Unix command grep to extract just the required line from the output produced by fitslist. For example, if the required keyword was ‘AIRMASS’ you would type:

%  fitslist filename
$|$ grep -i AIRMASS

If you cannot find the required datum in the FITS keywords then it is worth reading the FITS comments to see if they give any useful information.

You can examine the entire contents of an HDS file using hdstrace (see SUN/102[10]). This option will be useful if the file is not an NDF which was created from a FITS file. Simply type hdstrace filename (again remembering to omit the file type). hdstrace is a flexible utility and you should refer to SUN/102 for a full description.

FITS files
The FITS18 (Flexible Image Transport System) format is in widespread use in astronomy. The original observations which you brought away from the observatory after your observing run are perhaps most likely to be in this format.

Application fitshead in KAPPA (see SUN/95[11]) will list all the header information, including the keywords, in a FITS file. Briefly, if you have not previously started KAPPA type kappa. Then type fitshead filename. Alternatively, and perhaps even more simply, the header information can be displayed using Unix command more. The resulting display is perfectly readable, though perhaps not very æsthetic. This technique works best with a window which is eighty characters wide.

A description of the FITS format is beyond the scope of this note. However, briefly, a FITS file comprises a primary dataset and optionally one or more extensions. fitshead allows you to access the header information for the primary dataset and all the extensions. Conversely, often only the primary header information can be conveniently accessed with more.

Figaro DST files
Figaro DST files are another special case of the Starlink HDS format and can be examined with hdstrace. See above for details. The air mass, zenith distance and similar information are most likely to be found in the .FITS or .OBS structures.
IRAF files
A given IRAF (Image Reduction Analysis Facility) dataset is comprised of two files. One file has type ‘.pix’, the other ‘.imh’. The .pix file contains the ‘bulk data’ for the dataset; the array comprising the two-dimensional image in the case of CCD photometry. The .imh file contains all the header information. It is a simple text file and the keywords have a similar format to FITS keywords. It can be listed using standard Unix commands such as more or cat.

17In this context, a keyword is simply the name of each datum or item of information. For example, the keyword for the air mass might be ‘AIRMASS’.

18The original FITS format was proposed by Wells et al.[79] in 1981. However, it has been developed and enhanced over the years. The FITS standard is now maintained and documented by the FITS Support Office of the Astrophysics Data Facility at the NASA Goddard Space Flight Center (see URL: http://fits.gsfc.nasa.gov/fits_home.html). Though FITS is basically an astronomical format it is sometimes mentioned in books about standard image formats. See, for example, Graphics File Formats by Kay and Levine[47].