Thanks for that explanation, Even. Is this to say, if i have a panchromatic 
band that spans coastal-blue-green-red-rededge1-rededge2-rededge2-nir, and I 
only have blue-green-red-NIR, that pansharpening is invalid? The math works 
out, but it may not be a spectrally consistent result.

I'm able to calculate the weights for the full band set given a data provider's 
RSR data. But sometimes we do not get the full multispectral product due to 
ordering specifics. The pseudo-code suggests that I'd be producing a 
pseudo-panchromatic value using the bands I provide, regardless of if I have 
the full multispectral band set or not. This works out math-wise, but in terms 
of image interpretation, it would be preferable to use the full multispectral 
band set. In the event that I do not, such as having a 4-band subset that is 
still within the spectral bandwidth of the panchromatic band, it seems the 
pansharpening operation should still hold. Or am I misreading something? Please 
advise.

Thanks for your help!
Joe
________________________________
From: Even Rouault <even.roua...@spatialys.com>
Sent: Thursday, January 9, 2025 14:49
To: Joe McGlinchy <j...@aidash.com>; Barry DeZonia <bdezo...@gmail.com>
Cc: gdal-dev@lists.osgeo.org <gdal-dev@lists.osgeo.org>
Subject: Re: [gdal-dev] pansharpen subset of multispectral bands


EXTERNAL SENDER. DO NOT click links, or open attachments, if the sender is 
unknown, or the message seems suspicious in any way. DO NOT provide your user 
ID or Password.





> in the event that we are provided only 4 bands, but from an 8-band system, 
> will this still hold? It is what we have to work with, unfortunately or not.

Yes, obviously, the example generalizes to other number of bands.

So, providing either band_nums=[1,2,3,4] along with weights and extracting 
bands 1 and 4 after-the-fact, or band_nums=[1,4] and providing the 
corresponding weights for those bands, in my mind should produce something 
similar? I haven't tried it just yet.

No.

Let's consider the minimum example:

A = 10, weightA = 0.7

B = 20, weightB = 0.3

P = 30

PseudoPanchro = 10 * 0.7 + 20 * 0.3 = 13

then A_pansharpened = A / PseudoPanchro * Panchro = 10. / 13 * 30 = 23.08

and  B_pansharpened= B / PseudoPanchro * Panchro = 20. / 13 * 30 = 46.15

If you ignore B, than A_pansharpened = 10. / (10 * 0.7) * 30 = 42.85

And, even if you rebalance the reduced set of weights so its sum is still 1, 
which makes much more sense, that still won't work, because that would in that 
example just give the value of P.

https://github.com/mapbox/rio-pansharpen/blob/master/docs/pansharpening_methods.rst#brovey
 : "It assumes that the spectral range spanned by the panchromatic image is the 
same as that covered by the multispectral channels."   If you ignore 
multispectral channels in the computation of the pseudo panchro value, then the 
assumption no longer holds true. Or you need some magic to generate a reference 
panchromatic image that only takes into account the subset of bands you are 
interested in.

--
http://www.spatialys.com
My software is free, but my time generally not.
Butcher of all kinds of standards, open or closed formats. At the end, this is 
just about bytes.
_______________________________________________
gdal-dev mailing list
gdal-dev@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/gdal-dev

Reply via email to