How to standardize rasters?

Hello,
i have to compare two S2 products on the same area taken at different times.
So my idea was to first standardize the values in each band. Exactly if i can assume brightness = mean and contrast = stddev i was thinking to apply the classic standardization formula:

B_standard = (B_x - mean (B_x)) / stddev (B_x).

First of all i wonder if this is a correct procedure and if so i can’t find a way to obtain it in SNAP.
Band-math can’t be used on whole bands at once and even if i want to do it on each band one by one the functions mean and stddev don’t calculate it on the whole band’s value in a single run.

Is there a way in SNAP to obtain such results?
If not can you help me with any different idea about how to get similar standard values?

Thanks.

I am not sure that you need to normalise, the radiances are calibrated. Maybe it would be better to use L2 data for that comparison (BOA reflectances). In any case, most probably you will have to resample to a common spatial resolution first (1o, 20 or 60 m), and later use band maths to apply any calculation with bands.

  1. Optical/Geometric/S2 Resampling Processor
  2. Raster/Band Maths

hi @abruescas,
first of all thanks for helping.
I did those steps you suggest and yes i’m working on L2A products i made with sen2cor.
My idea was that since the images are taken in different times it’s very likely to have differences in weather, sun light etc and then also differences in brightness and contrast.
I suppose that when i need to compare those images would be better if they are both in the same scale and then i was thinking about standardization.

Anyway i’m new in remote sensing and i don’t know if this procedure is appropriate.

Basically, radiometrical calibration does exactly that. It takes into account the day of the year, the sun angle ect…
So if you are working with L2A products, you can assume that the images are comparable. Adjusting them based on mathematical relations would probably introduce new errors (at least I can imagine that this happens).

Oh i see, L2A products are already calibrated/standardized, i didn’t consider it.
Thanks for the answer.