[GRASS-user] Landsat 8 Workflow for Grass 7.0.0RC2

Hi Grass Users,

I want to use the following Landsat 8 workflow to obtain some pansharpened images but have a problem when i convert the DN values to 8bit for pansharpening. Here is my preferred workflow in Grass 7.0.0RC2.

· r.in.gdal (success)

· i.landsat.toar (success)

· r.rescale bands 432 & 8 (convert reflectance ‘DN’ values to 0-255, 8bit)

· i.pansharpen bands 432 with 8

· r.rescale (convert 0-255 values back to reflectance 'DN)

· i.colors.enhance (pansharp bands)

· d.rgb

My question…is this a valid workflow? because i’m getting the same two errors below and the images when displayed look solid grey when viewed with d.rgb:-

displaying the pansharpened images error log:-

(Tue Feb 17 14:57:26 2015)

g.list rast

LC82040242014206LGN00_B1

LC82040242014206LGN00_B10

LC82040242014206LGN00_B11

LC82040242014206LGN00_B2

LC82040242014206LGN00_B3

LC82040242014206LGN00_B4

LC82040242014206LGN00_B5

LC82040242014206LGN00_B6

LC82040242014206LGN00_B7

LC82040242014206LGN00_B8

LC82040242014206LGN00_B9

LC82040242014206LGN00_BQA

LC82040242014206LGN00_refl1

LC82040242014206LGN00_refl10

LC82040242014206LGN00_refl11

LC82040242014206LGN00_refl2

LC82040242014206LGN00_refl3

LC82040242014206LGN00_refl4

LC82040242014206LGN00_refl5

LC82040242014206LGN00_refl6

LC82040242014206LGN00_refl7

LC82040242014206LGN00_refl8

LC82040242014206LGN00_refl9

LC82040242014318LGN00_B1

LC82040242014318LGN00_B10

LC82040242014318LGN00_B11

LC82040242014318LGN00_B2

LC82040242014318LGN00_B3

LC82040242014318LGN00_B4

LC82040242014318LGN00_B5

LC82040242014318LGN00_B6

LC82040242014318LGN00_B7

LC82040242014318LGN00_B8

LC82040242014318LGN00_B9

LC82040242014318LGN00_BQA

LC82040242014318LGN00_refl1

LC82040242014318LGN00_refl10

LC82040242014318LGN00_refl11

LC82040242014318LGN00_refl2

LC82040242014318LGN00_refl2_rescale

LC82040242014318LGN00_refl3

LC82040242014318LGN00_refl3_rescale

LC82040242014318LGN00_refl4

LC82040242014318LGN00_refl4_rescale

LC82040242014318LGN00_refl5

LC82040242014318LGN00_refl6

LC82040242014318LGN00_refl7

LC82040242014318LGN00_refl8

LC82040242014318LGN00_refl8_rescale

LC82040242014318LGN00_refl9

(Tue Feb 17 14:57:27 2015) Command finished (0 sec)

Command 'd.rast

map=LC82040242014318LGN00_pansharp@PERMANENT’ failed

Details: Raster map

LC82040242014318LGN00_pansharp@PERMANENT not found

i.colors.enhance error log:-

(Tue Feb 17 13:06:40 2015)

i.colors.enhance red=LC82040242014318LGN00_B4@PERMANENT green=LC82040242014318LGN00_B3@PERMANENT blue=LC82040242014318LGN00_refl2@PERMANENT strength=96

Processing…

Process Process-3:

Traceback (most recent call last):

File

“C:\OSGeo4W\apps\Python27\lib\multiprocessing\process.py”,

line 258, in _bootstrap

self.run()

File

“C:\OSGeo4W\apps\Python27\lib\multiprocessing\process.py”,

line 114, in run

self._target(*self._args, **self._kwargs)

File "C:\OSGeo4W\apps\grass\grass-7.0.0RC2\scripts\i.color

s.enhance.py", line 103, in get_percentile_mp

result = get_percentile(map, percentiles)

File "C:\OSGeo4W\apps\grass\grass-7.0.0RC2\scripts\i.color

s.enhance.py", line 89, in get_percentile

percentiles = values, quiet = True)

File "C:\OSGeo4W\apps\grass\grass-7.0.0RC2\etc\python\gras

s\script\core.py", line 427, in read_command

return handle_errors(returncode, stdout, args, kwargs)

File "C:\OSGeo4W\apps\grass\grass-7.0.0RC2\etc\python\gras

s\script\core.py", line 310, in handle_errors

returncode=returncode)

CalledModuleError: Module run None [‘r.quantile’, ‘–q’,

‘input=LC82040242014318LGN00_refl2@PERMANENT’,

‘percentiles=2,96’] ended with error

Process ended with non-zero return code -1073741571. See

errors in the (error) output.

Process Process-2:

Traceback (most recent call last):

File

“C:\OSGeo4W\apps\Python27\lib\multiprocessing\process.py”,

line 258, in _bootstrap

self.run()

File

“C:\OSGeo4W\apps\Python27\lib\multiprocessing\process.py”,

line 114, in run

self._target(*self._args, **self._kwargs)

File "C:\OSGeo4W\apps\grass\grass-7.0.0RC2\scripts\i.color

s.enhance.py", line 103, in get_percentile_mp

result = get_percentile(map, percentiles)

File "C:\OSGeo4W\apps\grass\grass-7.0.0RC2\scripts\i.color

s.enhance.py", line 89, in get_percentile

percentiles = values, quiet = True)

File "C:\OSGeo4W\apps\grass\grass-7.0.0RC2\etc\python\gras

s\script\core.py", line 427, in read_command

return handle_errors(returncode, stdout, args, kwargs)

File "C:\OSGeo4W\apps\grass\grass-7.0.0RC2\etc\python\gras

s\script\core.py", line 310, in handle_errors

returncode=returncode)

CalledModuleError: Module run None [‘r.quantile’, ‘–q’,

‘input=LC82040242014318LGN00_B3@PERMANENT’,

‘percentiles=2,96’] ended with error

Process ended with non-zero return code -1073741571. See

errors in the (error) output.

Process Process-1:

Traceback (most recent call last):

File

“C:\OSGeo4W\apps\Python27\lib\multiprocessing\process.py”,

line 258, in _bootstrap

self.run()

File

“C:\OSGeo4W\apps\Python27\lib\multiprocessing\process.py”,

line 114, in run

self._target(*self._args, **self._kwargs)

File "C:\OSGeo4W\apps\grass\grass-7.0.0RC2\scripts\i.color

s.enhance.py", line 103, in get_percentile_mp

result = get_percentile(map, percentiles)

File "C:\OSGeo4W\apps\grass\grass-7.0.0RC2\scripts\i.color

s.enhance.py", line 89, in get_percentile

percentiles = values, quiet = True)

File "C:\OSGeo4W\apps\grass\grass-7.0.0RC2\etc\python\gras

s\script\core.py", line 427, in read_command

return handle_errors(returncode, stdout, args, kwargs)

File "C:\OSGeo4W\apps\grass\grass-7.0.0RC2\etc\python\gras

s\script\core.py", line 310, in handle_errors

returncode=returncode)

CalledModuleError: Module run None [‘r.quantile’, ‘–q’,

‘input=LC82040242014318LGN00_B4@PERMANENT’,

‘percentiles=2,96’] ended with error

Process ended with non-zero return code -1073741571. See

errors in the (error) output.

···

Paul J. Shapley MSc CGeog (GIS) FRGS

On 18.02.2015 14:44, Paul Shapley wrote:

I want to use the following Landsat 8 workflow to obtain some pansharpened
images but have a problem when i convert the DN values to 8bit for
pansharpening.

..

Here's something that will work with anything, no matter the bit-ness:
<https://github.com/NikosAlexandris/i.fusion.hpf&gt;\.

I've been trying to get this integrated into i.pansharpen. But didn't do anything serious so far (various reasons).

Best, Nikos

Paul Shapley wrote:

I want to use the following Landsat 8 workflow to obtain some pansharpened
images but have a problem when i convert the DN values to 8bit for
pansharpening. Here is my preferred workflow in Grass 7.0.0RC2.

· r.in.gdal (success)
· i.landsat.toar (success)
· r.rescale bands 432 & 8 (convert reflectance 'DN'
values to 0-255, 8bit)

· i.pansharpen bands 432 with 8
· r.rescale (convert 0-255 values back to reflectance
'DN)
· i.colors.enhance (pansharp bands)
· d.rgb

My question...is this a valid workflow? because i'm getting the same two
errors below and the images when displayed look solid grey when viewed with
d.rgb:

Paul,

just some thoughts:

- why mix the term "Digital Number (DN)" with Reflectance? DN's are (supposed to be) the result of the quantisation (and calibration) of the energy that hits the sensor. And Reflectance (unitless) is the result of radiometrically processing the DN values.

- Not sure if the values of the end-product, as in the work-flow you outline above, can be called Reflectance.

- Landsat8 is 16-bit. Once you downscale down to 8-bit, how would you come back to the 16-bit details? I think the radiometric detail is lost.

Instead, import > DN to ToAR > Pan-Sharpen with i.fusion.hpf (to not loose the fine digits which are important if you seek for more than just sharp visuals for viewing purposes).

Best, Nikos