nikosalexandris / i.fusion.hpf Goto Github PK
View Code? Open in Web Editor NEWReplication of the High-Pass Filter Addition Image Fusion for GRASS-GIS (Python script)
Replication of the High-Pass Filter Addition Image Fusion for GRASS-GIS (Python script)
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.
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.
To check:
Can you provide the numerical spectral response function of WV-2
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
Minor nitpick, there is an undefined variable/function here. I.e the underscore (_
) is not defined.
ISIS-GRASS 7.1.svn (p162r040):/dev/grass_yann > i.fusion.hpf/dev/grass_yann >
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):
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.
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>
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,
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.