PostScript printing of SOM codebooks

A new program has been added to SOM_PAK 3.0 that converts a SOM codebook into an PS/EPS file. Umat prints maps with hexagonal or rectangular topology and can print multiple labels on one unit. The EPS output should conform to the EPSF-3.0 specification from Adobe. It it doesn't, let me know what's wrong with it so I can fix it.

Options

There is only one required option, -cin, the codebook filename:
-cin filename
The name of the codebook file.
The optional parameters are:
-o filename
Save output to a different file. Default: Output to standard output. The printing mode is determined from the filename. If the name ends with .ps Postscript output is used. The ending .eps specifies EPS output. This is overridden by the -ps and -eps options.
-border
Draws borders around hexagons. Default: no borders.
-onlylabs
Prints only the labels.
-portrait and -landscape
Orientation of map, portrait or landscape. Default: Depends on the dimensions of the map. Maps with width greater than height will be printed in landscape, others in portrait. Only affects PS printing.
-eps
Selects EPS-printing. Will produce a EPS file suitable for including in your documentations, for example, with LaTeX. This option is the default
-ps
Selects PS-printing. Will produce a ready to print A4 size page.
-W and -B
Set white and black tresholds. Scales the grayscales so that values from 0 to black treshold are printed black, then grayscale goes linearly to white treshold values higher than that are printed as white. Defaults: for black: 0.0, for white 1.0.
-font fontname
Font used to print labels. This should be a name of a PostScript font. Default: Helvetica
-fontsize size
Label font size. This is relative to the radius of the hexagons/squares. Default: 1.0. The height of the letters is about half of the height of the hexacons.
-title string
Selects the title to print on the top left corner of an PS page. Default: codebook name.
-paper papertype
Select paper type. Supported values are A4 and A3. Default: A4.
-notitle
Do not print title on PS page.
-average
Average umatrix.
-median
Median filter the umatrix.
-headerfile filename
Use alternate PostScript header file. Default: use the one compiled in the binary (the same as header.ps in the distribution).
-swapx
Swap x-coordinate in the image (swap right and left). [1]
-swapy
Swap y-coordinate in the image (swap up and down). [1]

Notes

Footnote 1:
Not available in the SOM_PAK-3.1 distribution. Works in our lab only. Will be in the next public release.