Geoscience Reference
In-Depth Information
189 190 190 188 186 183
Raster data can be visualized as 3D plots. h e x and y i gures are the indices
of the 2D array or any other reference frame, and z is the numerical value
of the elements of the array (see also Chapter 7). h e numerical values
contained in the 2D array can be displayed as a pseudocolor plot, which is a
rectangular array of cells with colors determined by a colormap. A colormap
is an m -by-3 array of real numbers between 0.0 and 1.0. Each row dei nes a
red, green, or blue (RGB) color. An example is the above array, which could
be interpreted as grayscale intensities ranging from 0 (black) to 255 (white).
More complex examples include satellite images that are stored in 3D arrays.
As previously discussed, a computer stores data as bits that have one of
two states, represented by either a one or a zero (Chapter 2). If the elements
of the 2D array represent the color intensity values of the pixels (short for
picture elements ) of an image, 1-bit arrays contain only ones and zeros.
0 0 1 1 1 1
1 1 0 0 1 1
1 1 1 1 0 0
1 1 1 1 0 1
0 0 0 0 0 0
0 0 0 0 0 0
h is 2D array of ones and zeros can be simply interpreted as a black-and-
white image, where the value of one represents white and zero corresponds
to black. Alternatively, the 1-bit array could be used to store an image
consisting of any two dif erent colors, such as red and blue.
In order to store more complex types of data, the bits are joined together
to form larger groups, such as bytes consisting of eight bits. Since the earliest
computers could only process eight bits at a time, early computer code was
written in sets of eight bits, which came to be called bytes. Each element of
the 2D array or pixel therefore contains a vector of eight ones or zeros.
1 0 1 0 0 0 0 1
h ese 8 bits (or 1 byte) allow 2 8 =256 possible combinations of the eight
ones or zeros, and are therefore able to represent 256 dif erent intensities,
such as grayscales. h e 8 bits can be read in the following way, reading from
right to let : a single bit represents two numbers, two bits represent four
numbers, three bits represent eight numbers, and so forth up to a byte (or
eight bits), which represents 256 numbers. Each added bit doubles the count
of numbers. Here is a comparison of binary and decimal representations of
the number 161:
Search WWH ::




Custom Search