Commit 18ef5591 authored by Alexandre Fiche's avatar Alexandre Fiche
Browse files

Merge branch '23-replace-gdal_calc-py-with-bandmath' into 'develop'

Resolve "Replace gdal_calc.py with BandMath"

Closes #23

See merge request !25
parents 5218fec9 e45c218d
Pipeline #10867 passed with stages
in 24 minutes and 56 seconds
......@@ -201,8 +201,6 @@ build-ubuntu-feat:
script:
- $(ls ./pkg-build/WASP-*.run | head -n 1) --target WASP
- export PYTHONPATH=$(pwd)/WASP/bin:$(pwd)/WASP/lib/python
- mv $(pwd)/WASP/bin/gdal-config /opt/otb/bin/
- pip install gdal==$(gdal-config --version)
- rclone copy s3_otb:wasp-data/test_S2B_T31TCH_1_20171008 Data/test_S2B_T31TCH_1_20171008
- rclone copy s3_otb:wasp-data/test_VNS_FR-LUS_4_20180207 Data/test_VNS_FR-LUS_4_20180207
- rclone copy s3_otb:wasp-data/test_S2B_T31TCH_1_20171008_l2_light_to_l3_light Data/test_S2B_T31TCH_1_20171008_l2_light_to_l3_light
......
......@@ -72,9 +72,7 @@ add_subdirectory(Code/UpdateSynthesis)
add_subdirectory(Code/ProductFormatter)
add_subdirectory(PythonScripts)
install(FILES ./Scripts/WASP ./Data/gdal-config PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_WRITE GROUP_EXECUTE WORLD_EXECUTE DESTINATION ${CMAKE_INSTALL_PREFIX}/bin)
message(WARNING "gdal-config move to OTB directory: ${OTB_DIR}/../../../bin/")
install(FILES ./Data/gdal-config PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_WRITE GROUP_EXECUTE WORLD_EXECUTE DESTINATION ${OTB_DIR}/../../../bin/)
install(FILES ./Scripts/WASP PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_WRITE GROUP_EXECUTE WORLD_EXECUTE DESTINATION ${CMAKE_INSTALL_PREFIX}/bin)
# first we can indicate the documentation build as an option and set it to ON by default
option(BUILD_DOC "Build documentation" ON)
......
......@@ -947,8 +947,8 @@ class TemporalSynthesis():
args = f"gdalwarp -tr 60 60 -q -r {interpolation_type} {in_name} {out_name}"
subprocess.run(args.split())
if interpolation_type=="cubic":
args = f'gdal_calc.py -A {out_name.parent / "tmp.tif"} --outfile={out_name} --calc="A*(A>0)" --quiet ' \
f'--NoDataValue=-10000 --overwrite'
args = f'otbcli_BandMath -il {out_name.parent / "tmp.tif"} -out {out_name} -exp ' \
f'"im1b1*(im1b1>0)+im1b1*(im1b1==-10000)"'
subprocess.run(args, shell=True)
if (out_name.parent / "tmp.tif").is_file():
(out_name.parent / "tmp.tif").unlink()
......
......@@ -47,10 +47,6 @@ Then extract and execute the downloaded executable:
./WASP-1.x.run --target /path/to/install
```
Note: if you use OTB you may need to move gdal-config from /bin to the /bin of your OTB >= 7.3 directory and then do:
```
pip install GDAL==(GDAL version in your OTB)
```
### Compiling from source
#### Prerequisites
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment