Giter Site home page Giter Site logo

nikosalexandris / i.fusion.hpf Goto Github PK

View Code? Open in Web Editor NEW
13.0 3.0 4.0 13.41 MB

Replication of the High-Pass Filter Addition Image Fusion for GRASS-GIS (Python script)

Makefile 0.46% Python 83.32% TeX 5.45% HTML 10.78%
fusion pan-sharpening high-pass-filter

i.fusion.hpf's Issues

Version number tags

I think that it would be nice if you could add git tags for each version of the code; preferably using semantic versioning. This way the users of the application, could easily create replicatable environments.

ImportError: No module named high_pass_filter

Traceback (most recent call last):
  File "/osgeo/grass70/dist.x86_64-unknown-linux-gnu/scripts/i.fusion.hpf", line 162, in <module>
    from high_pass_filter import High_Pass_Filter
ImportError: No module named high_pass_filter

After compilation/installation, like:
make MODULE_TOPDIR=/osgeo/grass70/dist.x86_64-unknown-linux-gnu/
the main program fails to run.

Worldview-2 data: i.fusion.hpf crash with "ValueError: 9 is not in list"

Applying the i.fusion.hpf version in https://github.com/OSGeo/grass-addons/tree/master/grass7/imagery/i.fusion.hpf leads to a crash when using it on Worldview-2 data:

# input data
GRASS 7.9.dev (mexico_UTM11): >

PAN=wv2_17OCT08182034_P2AS_058891334010_01_P001
COLORPREFIX=wv2_17OCT08182034_M2AS_058891334010_01_P001

g.list raster pattern="$COLORPREFIX.?" 
wv2_17OCT08182034_M2AS_058891334010_01_P001.1
wv2_17OCT08182034_M2AS_058891334010_01_P001.2
wv2_17OCT08182034_M2AS_058891334010_01_P001.3
wv2_17OCT08182034_M2AS_058891334010_01_P001.4
wv2_17OCT08182034_M2AS_058891334010_01_P001.5
wv2_17OCT08182034_M2AS_058891334010_01_P001.6
wv2_17OCT08182034_M2AS_058891334010_01_P001.7
wv2_17OCT08182034_M2AS_058891334010_01_P001.8

g.list raster pattern="$PAN"
wv2_17OCT08182034_P2AS_058891334010_01_P001

Attempt to pan-sharpen:

i.fusion.hpf pan=$PAN msx=$(g.list raster pattern="$COLORPREFIX.?" sep=comma)
|! Region's resolution matched to Pan's (0.5)

Processing image: wv2_17OCT08182034_M2AS_058891334010_01_P001.1

|1 Determining ratio of low to high resolution
> Retrieving image resolutions
>> Resolution ratio low (2.000) to high (0.500): 4.0

|2 High Pass Filtering the Panchromatic Image
Traceback (most recent call last):
  File "/root/.grass7/addons/scripts/i.fusion.hpf", line 575, in <module>
    sys.exit(main())
  File "/root/.grass7/addons/scripts/i.fusion.hpf", line 378, in main
    hpf = get_high_pass_filter(ratio, center)
  File "/root/.grass7/addons/etc/i.fusion.hpf/high_pass_filter.py", line 140, in get_high_pass_filter
    kernel = get_kernel(size, level)
  File "/root/.grass7/addons/etc/i.fusion.hpf/high_pass_filter.py", line 116, in get_kernel
    center = get_center_cell(level, size)
  File "/root/.grass7/addons/etc/i.fusion.hpf/high_pass_filter.py", line 28, in get_center_cell
    kernel_size_idx = [k for ((lo, hi), k) in MATRIX_PROPERTIES].index(kernel_size)
ValueError: 9 is not in list
WARNING: No data base element files found

problem in G7

ISIS-GRASS 7.1.svn (p162r040):/dev/grass_yann > i.fusion.hpf
Traceback (most recent call last):
File "/usr/local/grass-7.1.svn/scripts/i.fusion.hpf", line 163, in
from high_pass_filter import High_Pass_Filter
ImportError: No module named high_pass_filter
ISIS-GRASS 7.1.svn (p162r040):
/dev/grass_yann >

Error after weighted HPFi added to unsampled image

I get the following error output when trying to pan sharpen a Landsat 8 image. I have tried various combinations of flags and settings, but not working yet. This is on Grass 7 beta 4.

<i.fusion.hpf -l -c --o pan=LC81670652014059LGN00_B8 msx=LC81670652014059LGN00_B2,LC81670652014059LGN00_B3,LC81670652014059LGN00_B 4 center=high modulation=max >

|5 Adding weighted HPFi to upsampled image

|* Matching output to input color table
WARNING: Unable to rename null file 'D:\user\Documents\grassdata/newLocation/Morogoro/.tmp/unknown/5664.1' to 'D:\userl\Documents\grassdata/newLocation/Morogoro/cell_misc/tmp.6716.0_msx_hpf/null': File exists
WARNING: Unable to rename cell file 'D:\user\Documents\grassdata/newLocation/Morogoro/.tmp/unknown/5664.0' to 'D:\user\Documents\grassdata/newLocation/Morogoro/fcell/tmp.6716.0_msx_hpf': File exists
ERROR: g.rename: Sorry, <rast=> is ambiguous
Traceback (most recent call last):
File ".\i.fusion.hpf.py", line 588, in
sys.exit(main())
File ".\i.fusion.hpf.py", line 576, in main
run("g.rename", rast=(tmp_msx_hpf, msx_nam))
File ".\i.fusion.hpf.py", line 210, in run
grass.run_command(cmd, quiet=True, **kwargs)
File "C:\Program Files (x86)\GRASS GIS
7.0.0beta4\etc\python\grass\script\core.py", line 373, in
run_command
return handle_errors(returncode, returncode, args,
kwargs)
File "C:\Program Files (x86)\GRASS GIS
7.0.0beta4\etc\python\grass\script\core.py", line 308, in
handle_errors
returncode=returncode)
grass.exceptions.CalledModuleError: Module run None
['g.rename', '--q',
'rast=tmp.6716.0_msx_hpf,LC81670652014059LGN00_B2.hpf']
ended with error
Process ended with non-zero return code 1. See errors in the
(error) output.

Warning on renaming null and cell file: already exists

The pansharpening works, but produces the following warnings along the way:
<WARNING: Unable to rename null file 'D:\Documents\grassdata/newLocation/.tmp/unknown/2544.1' to 'D:\Documents\grassdata/newLocation/cell_misc/tmp.5908.4_msx_hpf/null': File exists WARNING: Unable to rename cell file 'D:\grassdata/newLocation/Morogoro/.tmp/unknown/2544.0' to 'D:\grassdata/newLocation/fcell/tmp.5908.4_msx_hpf': File exists>

i.fusion.hpf module installation error

Dear Alexadris,

I am using GRASS GIS 7.8.5 and trying to install the add-on module.
Whenever I attempted to install the module, GRASS GIS issued the attached error message.
I used the module a few years ago, at that time there was no problem in installing it.
Would you please look at the error message and let me know any solution?
I will use the module to teach my lab for undergraduate students.
Thank you for your consideration in advance.

P.S. The GRASS GIS was installed via OSGeo4W.

Sincerely,

ifusionhpf installation error

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.