GRDZIP(l) GRDZIP(l)
NAME
grdzip - Pack/unpack short integer data grids
SYNOPSIS
grdzip [ infile] [ -C|D ] [ -Eendian ] [ -Foutfile ] [ -H
] [ -Iin_size ] [ -V ] [ -Xnx ] [ -Ynx ]
DESCRIPTION
grdzip reads a binary short int grid (or GMT short int
grid; see -H) (or stdin) and encodes it using the d2zdxdy
differences of the data. These increments are stored in a
packed 8/16/24/32-bit format that varies with the size of
the increments. grdzip takes advantage of the fact that
many data sets are smooth, so the differences from point
to point are small and can be stored in much less than 16
bits. The endianness of the calling computer is recorded
at the start of the file so that grdzip can make any
required byte swapping during unpacking. The packed data
is written to file (or stdout) via the bzip2 i/o library,
resulting in superior data compression. For technical
details, see grdzip.c.
OPTIONS FOR COMPRESSION
infile binary, short integer file in scanline format [we
read stdin if no file is given].
-C Selects compression [Default].
-F Specifies output file [Default is stdout].
-H Input file has a GMT header structure [Default
assumes no header].
-V Report progress and final statistics to stderr
[Default is silent].
-X Number of data columns, i.e., points along each
scanline (not needed if header is present).
-Y Number of data rows, i.e., scanlines (not needed
if header is present).
EXAMPLES OF COMPRESSION
To compress the global topography file etopo5.i2, try
grdzip etopo5.i2 -V -X4321 -X2160 -Fetopo5.gbz
To pack Sandwell and Smith's 2 min gravity img file really
small, try
grdzip grav7.2.img -V -X10800 -X6336 > grav7.2.img.gbz
The combined packing and compression reduces this 131 Mb
file to approximately 25% of its size.
OPTIONS FOR DECOMPRESSION
infile Packed file made by grdzip -C [we read stdin if no
file is given].
-D Selects decompression [Default is compression].
-E Select desired endian-ness of the output file.
Choose B for big-endian, L for little-endian, O for
the the original endian-ness on the originating
machine, or H for the host-system's endian-ness
[Default].
-F Specifies output file [Default is stdout].
-I If stdin is read we need the packed file's actual
input size in order to report on expansion/compres
sion ratio.
-V Report progress and final statistics to stderr
[Default is silent].
EXAMPLES OF DECOMPRESSION
To unpack the packed Sandwell and Smith's 2 min gravity
img used in the example above, and make sure it is written
in big-endian format, try
grdzip grav7.2.img.gbz -D -EB -V > grav7.2.img
1 Apr 2002 GRDZIP(l)
Man(1) output converted with
man2html