avalentino / gdal-pixfun-plugin

A GDAL plugin that provides a small set of "pixel functions".
MIT License
2 stars 1 forks source link

Please add support for complex data given as real and imag bands #2

Closed alexamici closed 9 years ago

alexamici commented 9 years ago

COSMO-SkyMed SLC SAR data are given as two bands with real and imag values, so you cannot use the complex band pixel functions: mod, phase and intensity. A colleague of mine has written two-bands versions of them and I can clean them up for inclusion if you are interested. In case: do you prefer to have different functions, like "mod2" etc, or to overload the current functions to accept two real/int bands treated as real and imaginary parts?

I prefer to add different functions, but I'll comply to your choice.

avalentino commented 9 years ago

Hi @alexamici, having real and imaginary parts in different bands is quite uncommon AFAIK. Modified versions of the operators would be quite COSMO specific. Probably it is a good idea to have them in a separate source file (maybe with an RI suffix).

Anyway please consider that you can obtain the same result of modified operators by stacking 2 VRT files:

I have already experimented this solution and it works. Also I didn't noticed any particular performance issue.

Finally, I have somewhere a modified version of the HDF5 driver that supports COSMO SLC products so that you can access them as complex typed GDAL bands. It is based on an old version of GDAL, so it needs some update. I have not too much time to work on it but if you are interested I can publish it.

alexamici commented 9 years ago

@avalentino as a matter of fact you can do something even more perverse than stacking two vrt's. You can build a virtual raster that include a 'complex' band and then point the SourceFilename of itself for the other bands. We tested it and it works (w00t!).

We are evaluating which strategy best applies to our use cases. I'm willing to close the issue for now.