Re: [gdal-dev] Help with band pixel functions

2019-07-15 Thread Adriana Parra
Hello Steven, Thank you for your reply. I should have mentioned that my ultimate goal is to mosaic more than two images, so I don't know if the workflow that you suggest would work in that case. I did use your suggestion of masking values, and changed the VRT python function to this: import

Re: [gdal-dev] Help with band pixel functions

2019-06-24 Thread Stephen Woodbridge
Hi Adriana, Here are a few ideas: import numpy as np ima = gdal.Open(filea, 0) banda = ima.GetRasterBand(1) dataa = banda.ReadAsArray() print type(dataa), dataa.shape, isinstance(dataa, np.ma.MaskedArray) imb = gdal.Open(fileb, 0) bandb = imb.GetRasterBand(1) datab = bandb.ReadAsArray()

[gdal-dev] Help with band pixel functions

2019-06-24 Thread Adriana Parra
Hello, I have been trying to mosaic two images that partially overlap using band pixel functions in Python. My images contain unsigned integers (uint8) and the no data value is 255. I considered using the nanmean function so that I would get average values in overlapping areas of the two images