kappazeta / cm-vsm

Tool to sub-tile Sentinel-2 products and preprocess segmentation masks from a variety of formats
Apache License 2.0
1 stars 0 forks source link

Data scaling #18

Closed JaschaMuller closed 3 years ago

JaschaMuller commented 3 years ago

Awesome library, I am just wondering how the spectral scaling is done (e.g. scale factor) from the 16-bit SAFE jpegs to the 32-bit netCDF rasters. The most common scaling I am aware of if * 0.0001 (for % reflectance), but this does not seem to be the case with this library. Any indication would be appreciated.

indrek-sunter commented 3 years ago

Thank you,

At the moment it scales by the maximum possible 16-bit value (1 / 65535). You're right, though, scaling by 1 / 10000 would make more sense for Sentinel-2 rasters.

For our use case (preparing datasets for training a cloud mask model) the scaling does not make much of a difference because as part of cloudmask-fit, additional normalization is performed later anyway.

Do you have a specific use case in mind for cm-vsm?

JaschaMuller commented 3 years ago

Perfect, thanks. At the moment I am trying out your cm_predict, and was just trying to understand the cm-vsm more. Thanks a lot.