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

Fix quiclook not found for S2 L1C and L2A when not archived #84

Closed
wants to merge 9 commits into from

Conversation

floriandeboissieu
Copy link
Contributor

There are two bugs in the way it looks for the quicklook in the S2 .SAFE scene:

  1. the pattern was missing a wildcard
  2. The TCI is 10m resolution for L1C, thus better use PVI which is the preview image (although 320m resolution)

I did not change regex pattern for L2A products, although the PVI image also exists. I would recommend using it also instead of TCI_60m as this last one can be quite heavy (several MB). But I let you make that change if you feel like it is the good solution.

Your checklist for this pull request

Please review the guidelines for contributing to this repository.

  • Check the commit's or even all commits' message styles matches our requested structure.
  • Check your code additions will fail neither code linting checks nor unit test.

Description

Please describe your pull request.

Further comments

If this is a relatively large or complex change, kick off the discussion by explaining why you chose the solution you did and what alternatives you considered, etc...

Thank you!

remi-braun and others added 7 commits March 24, 2023 18:47
…d confusion about the definitions (especially for SAR data) sertit#82
There are two bugs in the way it looks for the quicklook in the S2 .SAFE scene:
1. the pattern was missing a wildcard
2. The TCI is 10m resolution for L1C, thus better use PVI which is the preview image (although 320m resolution)

I did not change regex pattern for L2A products, although the PVI image also exists. I would recommend using it also instead of TCI_60m as this last one can be quite heavy (several MB). But I let you make that change if you feel like it is the good solution.
@remi-braun
Copy link
Member

Thanks a lot for this contribution !
The quicklook section of EOReader is not the part the most tested 😅
So you did good proposing this PR !

To tell the truth, I wasn't even aware of the existence of the PVI, but you are right, this should be the quicklook instead of the PVI.
You can make the change in your PR if you want, so you can be credited 😉

One question though. Some S2 products downloaded from AWS come with the preview.jpg file. You think those files should be the preview (although not georeferenced) or the PVI should be in any case ?

@remi-braun
Copy link
Member

Second question, is it OK to have this in the future 0.20.0 version ? I don't really know when I will be releasing it, so if you want it asap, I could try to fix it in a patch version (0.19.4)

@floriandeboissieu
Copy link
Contributor Author

No worries for the tests, it is always hard to cover everything (especially extras such as quicklook). Many thanks by the way for this very useful package.
For your first question, I think it may depend on its use... A browser preview does not need to be georeferenced and a jpg file would be easier to read (according to S2 specs p. 461, it seems that it was the idea of the Browse Image, although I never tried/used this download option). However, it can also be useful to have a quicklook on a geolocated true color image, e.g. to check potential clouds on a specific area. But this could be done quite fast with COG. So I would say the best solution would be to have both :), i.e. preferentially preview.jpg as a preview image and PVI if it does not exist, while maybe referencing the PVI as an asset in case it is needed as georeferenced.

For the second question, I proposed it in 0.20 not to break your dev workflow, but if you feel it could belong in a 0.19.4 version (that could be make it available on conda) it would be great.

By the way, from what I have read in the above S2 specs, it is not clear for me if PVI is inherited from L1C (i.e. TOA) or recomputed from L2A TCI (i.e. BOA). So TCI 60m may be the best choice for L2A until it is clarified (I'll check when I have time and make another PR if necessary).

@remi-braun
Copy link
Member

Hello,

Thanks for the feedback, this is really appreciated 😉
I have just create a 0.19.4 branch, so you can use it to update your PR :)

I agree to prioritize the .jpg file from AWS products.

However, in my opinion, we could always use PVI for L2A products. I'm not convinced the difference between BOA and TOA will be enough to be taken into account for such a dezoomed image.
And if I understood it correctly, this is the way Sentinal-2 products are delivered, so I would follow their way and use the PVI as the quicklook.

@floriandeboissieu floriandeboissieu changed the base branch from 0.20.0 to 0.19.4 April 11, 2023 09:02
@floriandeboissieu
Copy link
Contributor Author

I have just create a 0.19.4 branch, so you can use it to update your PR :)

I changed the base branch from 0.20 to 0.19.4, solving the conflict by removing the differences. I hope I have done things well, please check.

However, in my opinion, we could always use PVI for L2A products. I'm not convinced the difference between BOA and TOA will be enough to be taken into account for such a dezoomed image.
And if I understood it correctly, this is the way Sentinal-2 products are delivered, so I would follow their way and use the PVI as the quicklook.

I agree, I change the code to look for PVI for L2A product as well.

@remi-braun
Copy link
Member

I changed the base branch from 0.20 to 0.19.4, solving the conflict by removing the differences. I hope I have done things well, please check.

Thanks for the effort!
Unfortunately, I still see 58 files changed, so I'm wondering if you discarded the changes from the 0.20.0 (no mention of pixel_size should appear in this PR 😅 )
Could you just take a look ? (I am really not familiar with PR haha)

@floriandeboissieu
Copy link
Contributor Author

That is what I was fearing changing the base branch, I am not very used to that kind of operation 😅 .

I close this PR and make another one directly on branch 0.19.4 .

floriandeboissieu added a commit to floriandeboissieu/eoreader that referenced this pull request Apr 11, 2023
@remi-braun
Copy link
Member

Yeah it's safer haha
Thanks for your perseverance!

remi-braun added a commit that referenced this pull request Apr 11, 2023
…TCI file if no .jpg preview file is found (#84 #85, thanks a lot @floriandeboissieu)
bastiencyr pushed a commit to bastiencyr/eoreader that referenced this pull request May 30, 2023
bastiencyr pushed a commit to bastiencyr/eoreader that referenced this pull request May 30, 2023
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

Successfully merging this pull request may close these issues.

2 participants