[GRASS-dev] i.pansharpen and Landsat 8

Using L8 with i.pansharpen gives nodata output, is it assuming 8-bit datasets?

On Wednesday 23 of October 2013 13:39:59 Yann Chemin wrote:

Using L8 with i.pansharpen gives nodata output, is it assuming 8-bit
datasets?

Bonjour Yann.

So far all of my tests (using Landsat5, Landsat7, IKONOS, QuickBird2 and
WorldView2 imagery) indicate that you _need_ to feed the module with 8-bit
data.

For your interest, there is also a related ticket:
<https://trac.osgeo.org/grass/ticket/2048&gt;\.

My small research on it as an answer in a related question over at GIS@SE:
<http://gis.stackexchange.com/questions/39174/how-to-color-balance-false-composites-of-pan-sharpened-landsat-images-in-grass/67319#67319&gt;\.

So you better rescale, optinally color-balance before sharpening, sharpen and,
probably color-rebalance after sharpening.

Best, Nikos

On Wed, Oct 23, 2013 at 10:09 AM, Yann Chemin <ychemin@gmail.com> wrote:

Using L8 with i.pansharpen gives nodata output, is it assuming 8-bit
datasets?

I didn't have such problems, see

http://courses.neteler.org/processing-landsat-8-data-in-grass-gis-7-rgb-composites-and-pan-sharpening/

Markus

On Wednesday 23 of October 2013 12:48:16 Markus Neteler wrote:

On Wed, Oct 23, 2013 at 10:09 AM, Yann Chemin <ychemin@gmail.com> wrote:
> Using L8 with i.pansharpen gives nodata output, is it assuming 8-bit
> datasets?

I didn't have such problems, see

http://courses.neteler.org/processing-landsat-8-data-in-grass-gis-7-rgb-comp
osites-and-pan-sharpening/

Hi Markus.

I cannot confirm this :-(. I only wish am completely wrong on this. I tested
with LC81260592013137LGN01.

All bands are visible when drawn in "d.mon wx0" and they (i.e. B2, B3, B5 and
Pan) range in min=0, max=65535 (16-bit, unsigned). I MASKed the area of my
interest. I then ran

i.pansharpen ms3=B5 ms2=B3 ms1=B2 pan=B8 output=sharpen sharpen=ihs --v

All of the derived sharpen_* maps are of min=NULL, max=NULL. If I rescale them
to 8-bit, i.e.

r.rescale B2 out=B2_255 to=0,255
r.rescale B3 out=B2_255 to=0,255
r.rescale B3 out=B3_255 to=0,255
r.rescale B5 out=B5_255 to=0,255
!!:gs/B5/B8

it works fine. Both the data have a "valid" range, i.e. they are not NULLs,
and they are drawn perfectly fine on "d.mon wx0". For the records:

r.info sharpen_green -r
min=0
max=158

r.info sharpen_red -r
min=0
max=175

r.info sharpen_blue -r
min=0
max=144

Nikos

On 23/10/13 12:48, Markus Neteler wrote:

On Wed, Oct 23, 2013 at 10:09 AM, Yann Chemin<ychemin@gmail.com> wrote:

Using L8 with i.pansharpen gives nodata output, is it assuming 8-bit
datasets?

I didn't have such problems, see

http://courses.neteler.org/processing-landsat-8-data-in-grass-gis-7-rgb-composites-and-pan-sharpening/

In the first part of that tutorial, you run i.landsat.toar on the data. Could that make a difference ?

Moritz

I did not run i.landsat.toar, so data is still 16-bit, not float. Might be the difference indeed.

···

On 23 October 2013 18:43, Moritz Lennert <mlennert@club.worldonline.be> wrote:

On 23/10/13 12:48, Markus Neteler wrote:

On Wed, Oct 23, 2013 at 10:09 AM, Yann Chemin<ychemin@gmail.com> wrote:

Using L8 with i.pansharpen gives nodata output, is it assuming 8-bit
datasets?

I didn’t have such problems, see

http://courses.neteler.org/processing-landsat-8-data-in-grass-gis-7-rgb-composites-and-pan-sharpening/

In the first part of that tutorial, you run i.landsat.toar on the data. Could that make a difference ?

Moritz


grass-dev mailing list
grass-dev@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-dev

On Wed, Oct 23, 2013 at 10:09 AM, Yann Chemin<ychemin@gmail.com> wrote:

>> Using L8 with i.pansharpen gives nodata output, is it assuming 8-bit
>> datasets?

On 23/10/13 12:48, Markus Neteler wrote:

> I didn't have such problems, see
> http://courses.neteler.org/processing-landsat-8-data-in-grass-gis-7-rgb-co
> mposites-and-pan-sharpening/

On Wednesday 23 of October 2013 15:13:48 Moritz Lennert wrote:

In the first part of that tutorial, you run i.landsat.toar on the data.
Could that make a difference ?

I (re-)tested here by using the same bands that were already converted to Top
of Canopy Reflectance (based on DOS1). The outputs are not NULLs. However, I
don't like the look of it, even after rebalancing.

--%<---
G70 [ mangroves_monitoring / bengalis_island_utm_48n @LC81260592013137LGN01 ]
: ~ [12/134]

r.info -r B.ToCR.DOS1.2

min=0.0279806868991949
max=0.0887139433548827
[Raster MASK present]

G70 [ mangroves_monitoring / bengalis_island_utm_48n @LC81260592013137LGN01 ]
: ~ [13/135]

!!:s/2/3

r.info -r B.ToCR.DOS1.3
min=0.162416309747371
max=0.826031487626996
[Raster MASK present]
G70 [ mangroves_monitoring / bengalis_island_utm_48n @LC81260592013137LGN01 ]
: ~ [14/136]

!!:s/3/5

r.info -r B.ToCR.DOS1.5
min=0.12789699116205
max=1.01093695749278
[Raster MASK present]
G70 [ mangroves_monitoring / bengalis_island_utm_48n @LC81260592013137LGN01 ]
: ~ [15/137]

!!:s/5/8

r.info -r B.ToCR.DOS1.8
min=0.156489372272025
max=0.839101471394332
[Raster MASK present]
--->%--

and

--%<---
for Sharp in `g.mlist rast pat=sharpen_ToCR*` ; do r.info "${Sharp}" -r ;
done

min=0
max=0
min=0
max=2
min=0
max=2
[Raster MASK present]
--->%--

I think this is a Floating Point vs. Integers values issue here (if I recall
from the discussion in ticket #2048).

Nikos