I'm working with Sentinel-2 satellite and i'm working with 2,3,4,8 bands
. I have to make composite mergining bands. I download images from https://scihub.copernicus.eu/. I used gdal_merge
in console for creating composites. I have batch files, code below:
For /F %%i in ('where /R %cd% *B02*.jp2') do set file1=%%i
For /F %%n in ('where /R %cd% *B03*.jp2') do set file2=%%n
For /F %%m in ('where /R %cd% *B04*.jp2') do set file3=%%m
For /F %%o in ('where /R %cd% *B08*.jp2') do set file4=%%o
gdal_merge -o composite.tif %file1% %file2% %file3% %file4% -co COMPRESS=LZW -separate
pause
It's working, but i'd like to write own script using Python.
Could somebody give me advice how can i do it, please ? Is there another way to do it ?