C Bad data masks (ARD)

 C.1 Detailed description of ARD files

A number of the ESP application allows image regions to be defined as being of poor quality by two basic methods; by use of an NDF whose data component values are set bad (either explicitly or by use of the quality component and the badbits flag — see SUN/33) or by interpreting bad-region commands contained within an ordinary text file (an ASCII Region Definition file — ARD file — see SUN/183)

An NDF, with the appropriate pixels set to the bad value, can be produced interactively using the KAPPA applications ARDGEN and ARDMASK (SUN/95).

The capabilities of the ARD option (which uses little disk and could form part of a ‘database’ of data masking information) are described below.

As things stand, with images generated using a known CCD, the bad or hot pixels, rows or columns might be defined by ARDGEN so that they are always set to bad and excluded from all subsequent processing. The information required is often supplied by the observatory operating the CCD and can placed in a text file using any text editor.

C.1 Detailed description of ARD files

The shapes of regions which can be defined are specified by the following KEYWORDS:

Regions are specified using the keywords suffixed by the following information.

- a list of the pixel indices (X and Y) of the required pixels.
- the coordinates (pixel coordinates or pixel indices) of the two end points of the line, all pixels through which the line passes will be used.
- a list of row numbers (pixel indices).
- a list of column numbers (pixel indices).
- the coordinates of the centre of the box (pixel indices or pixel coordinates) followed by the lengths of the two sides in pixels (may be a fraction).
- a list of coordinates (pixel indices or pixel coordinates) of the polygon vertices.
- the coordinates of the centre (pixel indices or pixel coordinates) followed by the radius in pixels (may be a fraction).
- the coordinates of the centre (pixel indices or pixel coordinates) followed by the lengths of the semi-major and semi-minor axes in pixels (may be a fraction) and the position angle of the semi-major axis (measured +X through Y in degrees).

Only one KEYWORD is allowed per line and the parameters must be enclosed in parentheses. The parameters must be separated by commas. Any amount of white space (blanks) is allowed between keywords and numerics. Tabs are not allowed.

Comments are indicated by the characters ‘#’ and may be in-line or whole line at any place within the file. The presence of a comment terminates the current line immediately.

Any line within the file may be continued on to another by terminating with the continuation character ‘-’.

Thus an ARD file might contain the following information:

  # ARD description file for bad regions with the current CCD.
  COLUMN (41, 177, 212)   # Three bad columns
  PIXEL (201, 143)
  PIXEL (153, 167)   # Two Bad pixels
  BOX (188, 313, 5, 5)   # One Hot spot
  ELLIPSE (99, 120, 21.2, 5.4, 45.0)
  # Polygons defining badly vignetted corners
  POLYGON (2.2, 96.4, 12.1, 81.5, 26.9, 63.7, 47.7, 41.9, -
          61.5, 24.1, 84.3, 0.0, 0.0, 0.0)
  POLYGON (6.2, 294.3, 27.9, 321.0, 52.6, 348.7, 74.4, 371.5, -
          80.0, 384.0, 0.0, 384.0)
  # end

The co-ordinates used by ARD by default refer to the co-ordinate system defined by the image bounds for the current NDF. Further details are available from SUN/183.