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

Snow Collection #5

Closed
SveBuch opened this issue Jan 26, 2022 · 7 comments
Closed

Snow Collection #5

SveBuch opened this issue Jan 26, 2022 · 7 comments
Assignees

Comments

@SveBuch
Copy link

SveBuch commented Jan 26, 2022

Hi Xavier,

I was trying to access the Theia Snow Collection via the following query
query2 <- list(collection = "Snow", start.date = "2017-01-01", end.date = "2022-01-01")

But running q <- TheiaQuery$new(query2) returns Error: No tiles matching search criteria. Via the website I can download the corresponding .meta4 and read this into R without problems.

Is this a bad from my side or is it not possible to access the snow collection?

Best,
Sven

@norival
Copy link
Owner

norival commented Jan 26, 2022

Hi Sven, thanks for the feedback!

It was possible to access the Snow collection, but I haven't used it in a while, maybe there have been some changes on theia API. I am sorry, I may not be able to look at it now, but I will check next week :)

Best,
Xavier

@norival norival self-assigned this Jan 26, 2022
@SveBuch
Copy link
Author

SveBuch commented Jan 26, 2022

Thank you very much!

@norival
Copy link
Owner

norival commented Jan 31, 2022

There was indeed a little problem with the query string generated for Snow collection. I fixed the problem and I'm releasing the new version to CRAN (should be online in a few days).

Meanwhile, you can use the version from github:

devtools::install_github('norival/theiaR)

@SveBuch
Copy link
Author

SveBuch commented Jan 31, 2022

Thanks a lot for your help and your time! It works now for the Snow L2B products.

However, I struggle to download the Snow L3B products (yearly composites). If I try to specify level = "LEVEL3A, I get the same 134 tiles as with level = "LEVEL3A (instead of 1 as in https://theia.cnes.fr/atdistrib/rocket/#/search?page=1&q=Zernez&collection=Snow&processingLevel=L3B-SNOW&startDate=2020-09-01&completionDate=2021-08-31)

query1 <- list(collection = "Snow",
               level = "LEVEL3A",
               town = "Zernez",
               start.date = "2020-09-01",
               end.date = "2021-08-31")
query2 <- list(collection = "Snow",
               level = "LEVEL2A",
               town = "Zernez",
               start.date = "2020-09-01",
               end.date = "2021-08-31")

collection1 <- TheiaCollection$new(query = query1, dir.path = ".", check = TRUE)
collection2 <- TheiaCollection$new(query = query2, dir.path = ".", check = TRUE)

all(collection1$status$tile == collection2$status$tile)

[1] TRUE

Is this because of a difference between Level3A and Level3B products? Maybe I don't quite get the difference.

@norival
Copy link
Owner

norival commented Feb 1, 2022

For Snow products, the processing levels are actually called 'L2B-SNOW' and 'L3B-SNOW'. It was not supported by the package but I just pushed a fix to github.

Please try installing the package from Github again;

devtools::install_github('norival/theiaR)

And then you should be able to do use it like that:

query1 <- list(collection = "Snow",
               level = "L3B-SNOW",
               town = "Zernez",
               start.date = "2020-09-01",
               end.date = "2021-08-31")
query2 <- list(collection = "Snow",
               level = "L2B-SNOW",
               town = "Zernez",
               start.date = "2020-09-01",
               end.date = "2021-08-31")

(collection1 <- TheiaCollection$new(query = query1, dir.path = ".", check = TRUE))
# An collection of tiles from Theia
# 
# Number of tiles: 1
# Directory path : './'
# 
# Obtained from query

(collection2 <- TheiaCollection$new(query = query2, dir.path = ".", check = TRUE))
# An collection of tiles from Theia
# 
# Number of tiles: 133
# Directory path : './'
# 
# Obtained from query

It seems consistent with results from the website :)

@SveBuch
Copy link
Author

SveBuch commented Feb 1, 2022

It works now, 1000x thanks!

There are still 2 issues I came across. However, there are easy workarounds and maybe you are already aware of those, so please don't feel forced to correct them just for me. You already helped more than enough :) But just for completeness:

  • tiles = "XYZ" does not work for snow collection
  • a collection can only contain max. 500 tiles, so for longer time periods some tiles are missed.

Thanks again and all the best,
Sven

@norival
Copy link
Owner

norival commented Feb 1, 2022

Thanks for the feedback :)

tiles = "XYZ" does not work for snow collection

It was originally not permitted by theia API, but I see that it is now possible. I will update the package to make it possible :)

a collection can only contain max. 500 tiles, so for longer time periods some tiles are missed

Yes, it is the max number of tiles that can be retreived from a single request to the API. I think it would not be too difficult to repeat the request when this limit is reached. I'll try to implement it when I can.

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