Generally speaking, a band is just a 2D array of light intensities within a 3D array of the intensities of multiple light spectra. You can organize ("interleave") the storage of the 2D arrays inside the 3D array three different ways. The most common way for IDL users is probably "pixel-interleaved", which has the 2D subarrays accessed via the first element of the 3D array, e.g. the first band is stored in 'my_multispectra_image[0,*,*]', the second band is stored in 'my_multispectra_image[1,*,*]', etc.
Here, then, is an example of how to add a 4th 400 x 500 band ('newBand') to a 3-band image that currently has the dimensions 3 x 400 x 500:
img4bands = bytarr(4,400,500)
img4bands[0:2,*,*] = img3bands
img4bands[3,*,*] = newBand
James Jones
|