text2ipw

IPW User Command
Category - Importing Image Data


NAME

text2ipw - convert text file with data to IPW image

SYNOPSIS

text2ipw -l nlines -s nsamps [ -b nbands ] [ -n nbits[,...] ]
      [infile]

DESCRIPTION

text2ipw reads ASCII floating point values from infile (default: standard input) and writes an IPW image containing those points to the standard output.

The data values are read free-format: any amount of white space separates each value, any number of values may be on an input line. The data values are assumed to be in band-interleaved-by-pixel, row by column order.

OPTIONS

-l nlines
The output image will have nlines lines.

-s nsamps
The output image will have nsamps samples.

-l nlines
and -s must always be specified.

-b nbands
The output image will have nbands bands (default: 1). For each sample in the output image, nbands values will be read.

-n nbits[,...]
The output image will have nbits bits for each band (default: 8). If more than one value is given, there must be nbands values given.

OPERANDS

[infile]
infile

EXAMPLES

If the file "input.dat" contains:

	0       0.5     2.2     1.3     6.5     12.2
	21.5    3.5     -1.5    0.1     13.4    -1.9

then the following command:

     text2ipw  -l 6  -s 2  input.dat  >image

creates an image with 6 lines, 2 samples per line where the first lines contains samples 0 and 0.5, line 2 contains samples 2.2 and 1.3, etc.

FILES

None.

DIAGNOSTICS

input file contains more than %d values - remainder ignored

More data values were given than could fit in nlines by nsamps by nbands.

read past EOF, line line

Not enough data values were given to fill nlines by nsamps by nbands.

must specify #bits for each band or one value for all

If the -n option is used, it must have either one argument, which specified the bits for all bands, or the same number of arguments as bands in the output image as specified by the -b option.

write error - output file likely incomplete

It is likely that the program ran out of temporary space. By changing the value of your environment variable "WORKDIR" to a directory with more space, it may succeed.

RESTRICTIONS

If a one band image is output, and nlines * nsamps is less than 1 million, then no temporary file will be used. This has some advantages, but the program will use more memory.

HISTORY

Jul 1990
Written by Kelly Longley, ERL-C.

Aug 1993
New routine ffscanf reads in multiple values in one call of fscanf for speed improvement. It also can correctly deal with fpixel_t not being a float. Dana Jacobsen, ERL-C.

May 1996
Name changed from "import" to "text2ipw" to avoid conflict with ImageMagic (Unix) utility of the same name. Danny Marks, USGS/ERL-C.
Jun 1998
Name changed from "iimport" for consistency with other IPW commands. J.Domingo, OSU

SEE ALSO

IPW
primg, text2bin, bin2text
Unix
awk, perl


IPW documentation / Last revised 5 March 2015 / IPW web site