CLAUS

Cloud Archive User Service (CLAUS)


PGM (Portable Grey Map) Format

DESCRIPTION

The Portable Greymap Format is a lowest common denominator greyscale file format. The file consists of an ASCII header followed by binary data values held as unsigned binary bytes.

The header may optionally contain comment lines interspersed anywhere between the "magic number" line and the line containing the maximum grey value. Comments lines are preceeded by the hash '#' character, which must appear as the first character. The maximum length of a comment line (including the hash) is 70 characters.

The format of the header is:

- a "magic number" for identifying the file type as binary greyscale, "P5".

- whitespace (blanks, TABs, CRs, LFs).

- width value, in ASCII decimal.

- whitespace.

- height value , in ASCII decimal.

- whitespace.

- maximum grey value, in ASCII decimal. Normally 255 (the maximum value for a byte).

- whitespace (normally a single CR character).

The data consists of width * height grey values, in binary unsigned bytes, arranged in row-wise order.

 

A PGM file with a minimal header may therefore consist of:

P5 100 200 255 {data}

 

SAMPLE CLAUS PGM DAILY FILE HEADER 

Data files in the CLAUS archive have headers containing CLAUS-specific information held within comment lines:

P5
# Type: BT (CLAUS Brightness Temperature Image Data)
# Resolution: 0.5 (Half degree)
# Synoptic Date: 1994061315
# Source Channel: 2 (TIR)
# Satellites: 13 63 54 32 43 44 00 00
# Creation Date: 2001/10/03 13:41:26
# Revision: 4.50 (ESSC)
720 359
255
   { … <width> X <height> unsigned byte data values in sequence,
starting at the top left corner of image and proceeding row-wise… }

For a full explanation of the information contained in the header refer to the CLAUS User Guide.

MANIPULATING PGM FILES

PGM files are relatively easy to handle using user-written 'C' programs.

Utilities: