These pixel functions are downloaded as a patch provided by Antonio Valentino:
http://trac.osgeo.org/gdal/ticket/3367

To use these in Nansat we have simply to:
- compile contents in this folder with "make"
- include the present folder in the environmental variable "GDAL_DRIVER_PATH"

Note that this must be performed on each users machine, as compiled code is machine-specific!

The file pixelfunctions.c contains all the functions listed in the ticket above
We may add more pixel functions in this file as we need, and then use them as described on
http://www.gdal.org/gdal_vrttut.html

As the pixel functions are a bit awkward to implement, we probably dont want to use them
for our scientific algorithms where we use trial-and-error approach. But it can be very useful for 
common operations such as:
- returning speed (sqrt(u*u+v*v)) when we have two bands with U and V
- returning angle from North for the same input
- returning a difference of two bands
- ...

I have tested it, and can confirm that it works like charm!

Knut-Frode


*Usage of GenericPixelFunctionPixelLine
This is generic pixel function for one pixel band, one line band and full size band(s).
From the 1st to (N-2)th bands (papoSource) must be full size bands (XSize x YSize). The second and the last bands must be a line band and a pixel band respectively.
Here N is total number of bands.

!!N.B.!!
Order of bands may be not same as written order in mappers.

e.g. 
------------------------------------------------------------
'src': [ {'SourceFilename': self.adsVRTs[0].fileName,
'SourceBand': 1},
         {'SourceFilename': self.calibrationVRT.fileName,
           'SourceBand': 1},
         {'SourceFilename': fileName, 'SourceBand': 1}]
--------------------------------------------------------------
The 1st band is line, 2nd is pixel and the last one is full size band in this example. But in the pixelfunctions, the 1st is full size, 2nd is line and the 3rd is pixel band. I do not know how the order is changed. It is good to check with vrt file since the order of vrt file is same as pixelfunction.

*Usage of GenericPixelFunctionLine
This is generic pixel function for one line band and full size band(s).
From the 1st to (N-1)th bands (papoSource) must be full size bands (XSize x YSize) and the second is a line band.
Here N is total number of bands.
Asuka












