Table of Contents

Module: imageheader filetype/imageheader.py

Generic Image Header

Image headers for different types of images contain wildly different information. The "collect" package tries to adapt to different image header styles by providing a generic image header class, and subclasses for each supported header style.

The image header modules are in the <TT CLASS="package">filetype</TT> package, but since you probably do not need to construct an image header yourself, you will not need to import any of these packages into your programs. An image header is normally only constructed when an image is measured or when an image is read from disk. It is possible to create an empty KappaCCD header using a function in the kcdheader module.

An image header object behaves like a record of values. It can be queried by attribute reference.

The representation of a header is the raw string of data that makes up the header part of the data. Not all types of header may have a representation: it is only required for image types that can be written to disk.

By far not all attributes are available in all types of image headers. Even in older KappaCCD images some attributes might be absent. It is a good idea to test for the presence of an attribute using python's hasattr() function before using it or alternatively, to catch the AttributeError() exception.

Image header objects are the objects passed to the HeaderInfo() methods of imagesink objects.

Reliable attributes of any header

These are the attributes that each header should have:

binned

Is set to 1 if the image is binned, 0 otherwise. Deprecated. Should use binningfactor instead.

binningfactor

Is set to the binning factor. Currently 1 for unbinned, and 2 for binned images. Other factors might be possible in the future.

detid

The detector ID. A four-digit string for KappaCCD images; for other type detectors it is a string that starts with the detector type. If the detector id can not be found in the header, this attribute is set to None

effpixsize

The effective size of a pixel in micrometers. For CCD detectors this is an approximate value disregarding any spacial distortion. This value can be missing in synthetic images (like precession images created by the precession program).

xsize

The number of pixels horizontally in the image.

ysize

The number of pixels vertically in the image.

Many more attributes can be available for the different header types, for a description of those, see the individual header modules.

Classes   
Header

Parent class for all image headers


Table of Contents

This document was automatically generated on Tue Nov 25 12:18:58 2008 by HappyDoc version WORKING