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

Want to participate in subsequent development #7

Open
dorbodwolf opened this issue Dec 2, 2018 · 7 comments
Open

Want to participate in subsequent development #7

dorbodwolf opened this issue Dec 2, 2018 · 7 comments

Comments

@dorbodwolf
Copy link

Want to participate in subsequent development, anyone want to be together?

@samsammurphy
Copy link
Owner

Hi @dorbodwolf,
Thanks for interest all those years ago. I am thinking of getting this repo to work again then would love to hand it over. Are you still interested?

@dorbodwolf
Copy link
Author

Hi @dorbodwolf,
Thanks for interest all those years ago. I am thinking of getting this repo to work again then would love to hand it over. Are you still interested?
Hi @samsammurphy
The Py6S is used in my master's thesis in the year of 2018, its near 2 years passed, I am still interested with it, you can give more information about the subsequent development if that is convenient.

@samsammurphy
Copy link
Owner

Hello,
Apologies for slowness on my end. I don't have any ideas on how to develop this repo further.. I really am sorry about not having seen your message much sooner.. if you have ideas and/or desire to work on it let me know.. (again sorry for the delay)

@CristianICS
Copy link

CristianICS commented Nov 4, 2020

Hi @samsammurphy and @dorbodwolf,
I could suggest an idea. I have used your code in my master's thesis too (very gratefully) in order to correct automatically all Sentinel 2 images in a GEE collection. I'm not a code expert so I don't know If the approach that I followed was correct. It's the next:

Firstly I grouped the parts of the code metadata, atmospheric constituents, target altitude (km), 6S object and Atmospheric Correction in a function. Secondly I passed it over all Sentinel 2 collection, filtering at the end of the code, by for iteration. With this scope I corrected 35 images automatically considering the metadata of each image individually (despite of a little slowly).

Maybe this could inspire us or maybe not.

PD: I checked over your repo ee-atmcorr-timeseries but it didn't fit to my work.

@samsammurphy
Copy link
Owner

samsammurphy commented Jan 27, 2021

Hi @CristianICS

Congratulations on adapting the code for your use case. It sounds like you calculated all of the relevant atmospheric parameters in advanced then sent them over to GEE. Cool idea!

A concern is that it will start to take a long time if there are a lot of images (as you mentioned). However maybe someone processing 100 images doesn't mind waiting 200 seconds*. if it is a one off project (e.g. a scientific study)?

* It took me around 2 seconds to execute a single run of 6S (the radiative transfer code used in this solution.

@CristianICS
Copy link

CristianICS commented Jan 28, 2021

That's right. First I defined the functions that allows the surface correction (spectralResponseFunction, toa_to_rad and surface_reflectance). Then I created a new function called conversion where:

  1. Calculates image's date and defines some variables as global in order to call them out of conversion function
  2. Groups jupyter's chunks metadata, atmospheric constituents and target altitude, plus 6S object
  3. Applied atmospheric correction in all wavebands and export to GEE asset

At the end, I filtered the Sentinel-2 collection and applied the function conversion over all images.

As the VIS-NIR image's bands was corrected separately, it took me around 5-7 seconds per image* (plus a high time lapse between the correction of the image and his addition to the asset). In discussions with teachers and students, I have realized that this code is a good choice for studies/applications that must have done quickly atmospheric corrections of GEE Sentinel-2 images prior to 28th March (only in TOA reflectance) in small/medium areas. In my thesis I figured out that differences between original BOA VIS-NIR bands in GEE (corrected with ESA tools) and 6S corrected bands was only 0.02 per one reflectance. In addition, some teachers showed interest in applied this code and 6S transformations in GIS lessons.

I attach a copy of the code (switch the extension by .py). As I mentioned, my code skills are low and maybe there are some errors.

* The images were clipped by 100.000 ha area.

@CristianICS
Copy link

CristianICS commented Apr 15, 2021

Hi @samsammurphy,

I have rewritting the last attach process with @diegoalarc and we have integrated the proccess in the atmospheric.py. Now one can apply the loop within a new function (S2_L1C.conversion()).

Here is the new atmospheric.py (again, switch the extension by .py) and we hope you can use this to embedded in yours atmospheric.py if you consider it appropriate.

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

3 participants