I want to apply max operator over two bands ‘CI_1’ and ‘CI_2’ ,contained in two different products ‘product_1’ and ‘product_2’, respetively. To this end, I first resampled both the images to same size and then merged the band ‘CI_2’ with ‘product_1’. Then I used BandMaths operator to take the pixel-wise maximum of the two images. The resampling procedure, however, creates misalignment of two bands, and, therefore, the resulting band obtained after max operator is undesirable: this problem is illustrated through figures below.

This is the band ‘CI_1’:im1.bmp (2.1 MB)
This is the band ‘CI_2’: im2.bmp (2.1 MB)
This is the final band after max operator: im3.bmp (2.1 MB)

Can anyone please suggest how to solve this problem?

One solution to this could be to pad the bands with additional pixels taking the values NaN such that each band has same size. But I do not know how to do it either.

If the two images have different map projections, resampling isn’t appropriate. You should make sure both images have been mapped using the same projection and geographical extent (maybe chosen to include the intersection of the 2 images). Then you can apply band maths directly without resampling.

Thanks George. Yes, the problem is that the geographical extent of the two images is different. I cannot, however, use intersection operation because I need to keep the non-overlapping region also. For example, in product_1 has a value ‘a’ at a pixel and product_2 has a value ‘NaN’ at the corresponding pixel, I want the final image to have a value of ‘a’ at that pixel.

I guess then the question is if it is possible to artificially increase the geographical extent of an image by padding with NaN values.