I’ve got an atmospherically corrected Sentinel-2 image and wondering if its possible to obtain the reflectance values of the entire pixels of the entire image as a table or a csv so that I can export it to Excel and perform some statistics.
Yes, this is possible. You need to resample the S2 product to a common resolution and the you can export it to a CSV file.
But I don’t recommend doing it for the whole image. The file will be huge.
Just do it for a small area.
You can also draw rectangle and the chose from the context menu in the image view Export mask pixels.
Thank you very much for the reply! Yes I made a subset of my image and only need the pixel values of this subset. I resampled it as you advised. However, I’m trying to find exactly where is the “context menu in the image view Export mask pixels.” Do you mean in the Product Explorer? for some reason the “Export Transect Pixels” is not activated here. (see attached image)
It is common to do statistics on images with a large number of pixels using random samples. In most cases there is no benefit to using complete images over much smaller samples. SNAP/GPT StatisticsOp does the sampling for you. Is there a reason you can’t use StatisticsOp? Excel may not be the best tool for working with images. Third party packages (R, Python, Matlab) can import images directly and do statistics using sampling without the need to make an intermediate ASCII file.