Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DN Scaling? #2

Closed
gastoneb opened this issue Dec 4, 2020 · 2 comments
Closed

DN Scaling? #2

gastoneb opened this issue Dec 4, 2020 · 2 comments

Comments

@gastoneb
Copy link

gastoneb commented Dec 4, 2020

Hi, I'm trying to reproduce your aster_3x3_proper_gamma code in Python with rasterio and numpy. I'm wondering, is there a scaling of bands 2/3/4 (values 0-10000) applied before running your code? I don't know how it works in Sentinel Hub, e.g. if the band values have been scaled to 0-256 or something like that.

@mkadunc
Copy link
Member

mkadunc commented Dec 5, 2020

Hi, Sentinel-Hub scripts get TOA reflectance as input into variables B04, B03, B02 — if you're working with DNs, you should divide them by 10000 to get approx. range 0-1 (in exceptional cases it could go up to 6.5534).

The script is linear in input reflectances up to the point of final conversion to RGB, though, so you can adjust the gain factor to get an brighter or darker image (default is 2.5).

@gastoneb
Copy link
Author

gastoneb commented Dec 6, 2020

Thank you so much for the clarification. The gain adjustment works great now. On the unscaled DNs I was getting essentially greyscale outputs.

@gastoneb gastoneb closed this as completed Dec 6, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants