[GRASS-user] Pan sharpen Worldview-2 imagery

Hello,

I was wondering whether anyone has a workflow to pan sharpen Worldview-2 imagery (0.5 m pan, and 2.0 m MS) with 5 bands (panchromatic, red, blue, green, NIR). I am using grass 7.0.3 on ubuntu 16.01, but cannot find the i.fusion.hbf command. I would also like information on any pre-processing I might need to perform, such as converting digital number to reflectance.

Any assistance is much appreciated...

Thanks

William Hudspeth:

Hello,

Hello William,

I was wondering whether anyone has a workflow to pan sharpen Worldview-2
imagery (0.5 m pan, and 2.0 m MS) with 5 bands (panchromatic, red, blue,
green, NIR).

I am using grass 7.0.3 on ubuntu 16.01, but cannot find the
i.fusion.hbf command. I would also like information on any
pre-processing I might need to perform, such as converting digital
number to reflectance.

A simple workflow, would be to *first*, ortho-rectify your images
based on their own RPCs. You might want to read this à propos:
http://fwarmerdam.blogspot.ch/2013/09/exploring-rpcs.html

Next, you can create a Location based on the image's own reference
system, like:

grass70 -c WorldView2_Image.TIF /projects/grassdb/location_name

of course, you would (re-)name the above as it fits for you.

Now, inside GRASS,

1. import bands (pan and multispectral) in grass' data base using `r.in.gdal` -- bands will
likely get a basename (the one given for `output=`, and a number as a
suffix if the number of bands is more than 3, I think).

2. optionally, rename for the imported multispectral bands their names to easier
know which is which (like instead of ".1" , "blue" or whatsoever fits).

3. you may want to use
https://github.com/NikosAlexandris/i.worldview.toar to convert digital
numbers to radiance or reflectance. An example command:

i.worldview.toar
band=11APR03001446-M2AS_R1C1.Blue,11APR03001446-M2AS_R1C1.Green,11APR03001446-M2AS_R1C1.Red,11APR03001446-M2AS_R1C1.NIR
outputsuffix=Rad utc=2011-04-03T00:14:46.590888Z sea=44.1

4. Then you can use i.fusion.hpf to sharpen all multispectral bands in
one go like:

i.fusion.hpf pan=Panchromatic msx=msRed,msBlue,msGreen,msNIR

given, of course, the appropriate band names.

Any assistance is much appreciated...
Thanks

You might want to have a look at
https://grasswiki.osgeo.org/wiki/WorldView and assist in cleaning it up
and improving it.

Nikos

Nikos,

Thank you for your help. I was able to easily install the i.fusion.hpf, but have had considerable trouble understanding how to install i.worldview.toar as a python script. Any help appreciated...

Thanks, William

On 08/13/2016 11:23 PM, Nikos Alexandris wrote:

William Hudspeth:

Hello,

Hello William,

I was wondering whether anyone has a workflow to pan sharpen Worldview-2
imagery (0.5 m pan, and 2.0 m MS) with 5 bands (panchromatic, red, blue,
green, NIR).

I am using grass 7.0.3 on ubuntu 16.01, but cannot find the
i.fusion.hbf command. I would also like information on any
pre-processing I might need to perform, such as converting digital
number to reflectance.

A simple workflow, would be to *first*, ortho-rectify your images
based on their own RPCs. You might want to read this à propos:
http://fwarmerdam.blogspot.ch/2013/09/exploring-rpcs.html

Next, you can create a Location based on the image's own reference
system, like:

grass70 -c WorldView2_Image.TIF /projects/grassdb/location_name

of course, you would (re-)name the above as it fits for you.

Now, inside GRASS,

1. import bands (pan and multispectral) in grass' data base using `r.in.gdal` -- bands will
likely get a basename (the one given for `output=`, and a number as a
suffix if the number of bands is more than 3, I think).

2. optionally, rename for the imported multispectral bands their names to easier
know which is which (like instead of ".1" , "blue" or whatsoever fits).

3. you may want to use
https://github.com/NikosAlexandris/i.worldview.toar to convert digital
numbers to radiance or reflectance. An example command:

i.worldview.toar
band=11APR03001446-M2AS_R1C1.Blue,11APR03001446-M2AS_R1C1.Green,11APR03001446-M2AS_R1C1.Red,11APR03001446-M2AS_R1C1.NIR

outputsuffix=Rad utc=2011-04-03T00:14:46.590888Z sea=44.1

4. Then you can use i.fusion.hpf to sharpen all multispectral bands in
one go like:

i.fusion.hpf pan=Panchromatic msx=msRed,msBlue,msGreen,msNIR

given, of course, the appropriate band names.

Any assistance is much appreciated...
Thanks

You might want to have a look at
https://grasswiki.osgeo.org/wiki/WorldView and assist in cleaning it up
and improving it.

Nikos

William Hudspeth:

Nikos,

Thank you for your help. I was able to easily install the i.fusion.hpf,
but have had considerable trouble understanding how to install
i.worldview.toar as a python script. Any help appreciated...

William, can you try the following, as per
https://grass.osgeo.org/grass73/manuals/g.extension.html:

--%<---
Online repositories: GitHub, GitLab and Bitbucket

For well known general hosting services, namely GitHub, GitLab and
Bitbucket, g.extension supports the download of a repository as a ZIP
file. Here the user only needs to provide a base URL to the repository
web page (with or without the https:// part). For GitLab and Bitbucket,
the latest source code in the default branch is downloaded, for GitHub,
the latest source code in the master branch is downloaded. Of course, a
user can still specify the full URL of a ZIP file and install a specific
branch or release in this way (ZIP file mechanism will be applied). --->%--

The script is yet not in the official add-ons repository

Nikos

[rest deleted]

Hello Nikos,

The link you provided documents how to use g.extension for installing python scripts in GRASS 7.3. In particular, it uses the 'url=....' argument to specify a link to a zip file. I am using the stable version of GRASS 7.0 that is installed with Ubuntu 16.01. In that version, the 'url=...' argument is not available. Is there an alternative way to install your extension in GRASS 7.0?

Thanks much, William

On 08/13/2016 11:23 PM, Nikos Alexandris wrote:

William Hudspeth:

Hello,

Hello William,

I was wondering whether anyone has a workflow to pan sharpen Worldview-2
imagery (0.5 m pan, and 2.0 m MS) with 5 bands (panchromatic, red, blue,
green, NIR).

I am using grass 7.0.3 on ubuntu 16.01, but cannot find the
i.fusion.hbf command. I would also like information on any
pre-processing I might need to perform, such as converting digital
number to reflectance.

A simple workflow, would be to *first*, ortho-rectify your images
based on their own RPCs. You might want to read this à propos:
http://fwarmerdam.blogspot.ch/2013/09/exploring-rpcs.html

Next, you can create a Location based on the image's own reference
system, like:

grass70 -c WorldView2_Image.TIF /projects/grassdb/location_name

of course, you would (re-)name the above as it fits for you.

Now, inside GRASS,

1. import bands (pan and multispectral) in grass' data base using `r.in.gdal` -- bands will
likely get a basename (the one given for `output=`, and a number as a
suffix if the number of bands is more than 3, I think).

2. optionally, rename for the imported multispectral bands their names to easier
know which is which (like instead of ".1" , "blue" or whatsoever fits).

3. you may want to use
https://github.com/NikosAlexandris/i.worldview.toar to convert digital
numbers to radiance or reflectance. An example command:

i.worldview.toar
band=11APR03001446-M2AS_R1C1.Blue,11APR03001446-M2AS_R1C1.Green,11APR03001446-M2AS_R1C1.Red,11APR03001446-M2AS_R1C1.NIR

outputsuffix=Rad utc=2011-04-03T00:14:46.590888Z sea=44.1

4. Then you can use i.fusion.hpf to sharpen all multispectral bands in
one go like:

i.fusion.hpf pan=Panchromatic msx=msRed,msBlue,msGreen,msNIR

given, of course, the appropriate band names.

Any assistance is much appreciated...
Thanks

You might want to have a look at
https://grasswiki.osgeo.org/wiki/WorldView and assist in cleaning it up
and improving it.

Nikos

William Hudspeth:

Hello Nikos,

The link you provided documents how to use g.extension for installing
python scripts in GRASS 7.3. In particular, it uses the 'url=....'
argument to specify a link to a zip file. I am using the stable version
of GRASS 7.0 that is installed with Ubuntu 16.01. In that version, the
'url=...' argument is not available. Is there an alternative way to
install your extension in GRASS 7.0?

Thanks much, William

Hi William. Please, try to keep some bottom-posting in the list.

Can you get GRASS' source code (any version 7.x) and follow steps in
https://svn.osgeo.org/grass/grass-addons/README?

Nikos

On 16/08/16 19:56, William Hudspeth wrote:

Hello Nikos,

The link you provided documents how to use g.extension for installing
python scripts in GRASS 7.3. In particular, it uses the 'url=....'
argument to specify a link to a zip file. I am using the stable version
of GRASS 7.0 that is installed with Ubuntu 16.01. In that version, the
'url=...' argument is not available. Is there an alternative way to
install your extension in GRASS 7.0?

Download the extension to your machine, unzip it, go into the directory and then run
  make MODULE_TOPDIR=/path/to/your/grass/installation

You have to have the grass-dev package installed for it to work.

Moritz

Thanks much, William

On 08/13/2016 11:23 PM, Nikos Alexandris wrote:

William Hudspeth:

Hello,

Hello William,

I was wondering whether anyone has a workflow to pan sharpen Worldview-2
imagery (0.5 m pan, and 2.0 m MS) with 5 bands (panchromatic, red, blue,
green, NIR).

I am using grass 7.0.3 on ubuntu 16.01, but cannot find the
i.fusion.hbf command. I would also like information on any
pre-processing I might need to perform, such as converting digital
number to reflectance.

A simple workflow, would be to *first*, ortho-rectify your images
based on their own RPCs. You might want to read this à propos:
http://fwarmerdam.blogspot.ch/2013/09/exploring-rpcs.html

Next, you can create a Location based on the image's own reference
system, like:

grass70 -c WorldView2_Image.TIF /projects/grassdb/location_name

of course, you would (re-)name the above as it fits for you.

Now, inside GRASS,

1. import bands (pan and multispectral) in grass' data base using
`r.in.gdal` -- bands will
likely get a basename (the one given for `output=`, and a number as a
suffix if the number of bands is more than 3, I think).

2. optionally, rename for the imported multispectral bands their names
to easier
know which is which (like instead of ".1" , "blue" or whatsoever fits).

3. you may want to use
https://github.com/NikosAlexandris/i.worldview.toar to convert digital
numbers to radiance or reflectance. An example command:

i.worldview.toar
band=11APR03001446-M2AS_R1C1.Blue,11APR03001446-M2AS_R1C1.Green,11APR03001446-M2AS_R1C1.Red,11APR03001446-M2AS_R1C1.NIR

outputsuffix=Rad utc=2011-04-03T00:14:46.590888Z sea=44.1

4. Then you can use i.fusion.hpf to sharpen all multispectral bands in
one go like:

i.fusion.hpf pan=Panchromatic msx=msRed,msBlue,msGreen,msNIR

given, of course, the appropriate band names.

Any assistance is much appreciated...
Thanks

You might want to have a look at
https://grasswiki.osgeo.org/wiki/WorldView and assist in cleaning it up
and improving it.

Nikos

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

On 08/16/2016 05:00 PM, Nikos Alexandris wrote:

William Hudspeth:

Hello Nikos,

The link you provided documents how to use g.extension for installing
python scripts in GRASS 7.3. In particular, it uses the 'url=....'
argument to specify a link to a zip file. I am using the stable version
of GRASS 7.0 that is installed with Ubuntu 16.01. In that version, the
'url=...' argument is not available. Is there an alternative way to
install your extension in GRASS 7.0?

Thanks much, William

Hi William. Please, try to keep some bottom-posting in the list.

Can you get GRASS' source code (any version 7.x) and follow steps in
https://svn.osgeo.org/grass/grass-addons/README?

Nikos

On 16/08/16 19:56, William Hudspeth wrote:

/Hello Nikos, />//>/The link you provided documents how to use g.extension for installing />/python scripts in GRASS 7.3. In particular, it uses the 'url=....' />/argument to specify a link to a zip file. I am using the stable version />/of GRASS 7.0 that is installed with Ubuntu 16.01. In that version, the />/'url=...' argument is not available. Is there an alternative way to />/install your extension in GRASS 7.0? /

Download the extension to your machine, unzip it, go into the directory
and then run
   make MODULE_TOPDIR=/path/to/your/grass/installation

You have to have the grass-dev package installed for it to work.

Moritz

I have tried installing from the unzipped directory using the following for grass installation
path, and with the following errors:
     
make MODULE_TOPDIR=/usr/lib/grass70

GISRC=/usr/lib/grass70/demolocation/.grassrc70 GISBASE=/usr/lib/grass70 PATH="/usr/lib/grass70/bin:/usr/lib/grass70/bin:/usr/lib/grass70/scripts:$PATH" PYTHONPATH="/usr/lib/grass70/etc/python:/usr/lib/grass70/gui/wxpython:$PYTHONPATH" LD_LIBRARY_PATH="/usr/lib/grass70/bin:/usr/lib/grass70/bin:/usr/lib/grass70/scripts:/usr/lib/grass70/lib:/usr/lib/grass70/lib:" LC_ALL=C g.parser -t i.worldview.toar.py | sed s/\"/\\\\\"/g | sed 's/.*/_("&")/' > /usr/lib/grass70/locale/scriptstrings/i.worldview.toar_to_translate.c
/bin/sh: 1: cannot create /usr/lib/grass70/locale/scriptstrings/i.worldview.toar_to_translate.c: Directory nonexistent
ERROR: Variable 'LOCATION_NAME' not set
/usr/lib/grass70/include/Make/ScriptRules.make:28: recipe for target '/usr/lib/grass70/locale/scriptstrings/i.worldview.toar_to_translate.c' failed
make: [/usr/lib/grass70/locale/scriptstrings/i.worldview.toar_to_translate.c] Error 2 (ignored)

On 8/16/16, William Hudspeth <bhudspeth@edac.unm.edu> wrote:

Hello Nikos,

The link you provided documents how to use g.extension for installing
python scripts in GRASS 7.3. In particular, it uses the 'url=....'
argument to specify a link to a zip file. I am using the stable version
of GRASS 7.0 that is installed with Ubuntu 16.01.

Just for the record: The new stable 7.2.0 will be published soon. It
already ships the improved g.extension.

Markus

William:

The link you provided documents how to use g.extension for installing
python scripts in GRASS 7.3. In particular, it uses the 'url=....'
argument to specify a link to a zip file. I am using the stable version
of GRASS 7.0 that is installed with Ubuntu 16.01. In that version, the
'url=...' argument is not available. Is there an alternative way to
install your extension in GRASS 7.0?

Nikos:

Can you get GRASS' source code (any version 7.x) and follow steps in
https://svn.osgeo.org/grass/grass-addons/README?

William:

The link you provided documents how to use g.extension for installing
python scripts in GRASS 7.3. In particular, it uses the 'url=....'
argument to specify a link to a zip file. I am using the stable
version of GRASS 7.0 that is installed with Ubuntu 16.01. In that
version, the 'url=...' argument is not available. Is there an
alternative way to install your extension in GRASS 7.0?

Moritz:

Download the extension to your machine, unzip it, go into the directory
and then run

  make MODULE_TOPDIR=/path/to/your/grass/installation

You have to have the grass-dev package installed for it to work.

William:

I have tried installing from the unzipped directory using the following
for grass installation path, and with the following errors:

make MODULE_TOPDIR=/usr/lib/grass70

GISRC=/usr/lib/grass70/demolocation/.grassrc70 GISBASE=/usr/lib/grass70
PATH="/usr/lib/grass70/bin:/usr/lib/grass70/bin:/usr/lib/grass70/scripts:$PATH"
PYTHONPATH="/usr/lib/grass70/etc/python:/usr/lib/grass70/gui/wxpython:$PYTHONPATH"
LD_LIBRARY_PATH="/usr/lib/grass70/bin:/usr/lib/grass70/bin:/usr/lib/grass70/scripts:/usr/lib/grass70/lib:/usr/lib/grass70/lib:"
LC_ALL=C g.parser -t i.worldview.toar.py | sed s/\"/\\\\\"/g | sed
's/.*/_("&")/' >
/usr/lib/grass70/locale/scriptstrings/i.worldview.toar_to_translate.c
/bin/sh: 1: cannot create
/usr/lib/grass70/locale/scriptstrings/i.worldview.toar_to_translate.c:
Directory nonexistent
ERROR: Variable 'LOCATION_NAME' not set
/usr/lib/grass70/include/Make/ScriptRules.make:28: recipe for target
'/usr/lib/grass70/locale/scriptstrings/i.worldview.toar_to_translate.c'
failed
make:
[/usr/lib/grass70/locale/scriptstrings/i.worldview.toar_to_translate.c]
Error 2 (ignored)

Alright. Are you inside a GRASS session? Try it out. I always compile my
add-ons once inside a GRASS session.

Best, Nikos