HLS V2.0 data format

Use this Forum to find information on, or ask a question about, NASA Earth Science data.
Post Reply
jasper.vandoninck
Posts: 1
Joined: Mon Jun 12, 2023 4:49 am America/New_York
Answers: 0

HLS V2.0 data format

by jasper.vandoninck » Mon Jun 12, 2023 4:59 am America/New_York

Hi,

I am using R with the "terra" and "rstac" to query and process images from LPCLOUD HLS collection. I noticed that the pixel values in the images I accessed can have different data types, some being integers (scaled between 0 and 10000) and some being floats (scaled between 0 and 1). Below is a reproducible example for two HLS.S30 tiles, but I have the same issue with HLS.L30. I don't know if this is because of the data themselves or because somehow the "terra" package does not apply a scalar for one but does for the other.
Any help on how to resolve this issue is appreciated. Apologies if this has been answered elsewhere.


## Reproducable example:
library(rstac)
library(terra)

endpoint <- "https://cmr.earthdata.nasa.gov/stac/LPCLOUD"

setGDALconfig("GDAL_HTTP_UNSAFESSL", value = "YES")
setGDALconfig("GDAL_HTTP_COOKIEFILE", value = ".rcookies")
setGDALconfig("GDAL_HTTP_COOKIEJAR", value = ".rcookies")
setGDALconfig("GDAL_DISABLE_READDIR_ON_OPEN", value = "EMPTY_DIR")
setGDALconfig("CPL_VSIL_CURL_ALLOWED_EXTENSIONS", value = "TIF")

items <- stac(endpoint) %>%
stac_search(ids=c("HLS.S30.T32ULC.2022237T103641.v2.0", "HLS.S30.T31UGT.2022237T103641.v2.0")) %>%
post_request()

item1 <- rast(items$features[[1]]$assets$B08$href)
item2 <- rast(items$features[[2]]$assets$B08$href)

item1
item2
item1[1]
item2[1]
is.int(item1)
is.int(item2)

Filters:

LP DAAC - dgolon
User Services
User Services
Posts: 324
Joined: Mon Sep 30, 2019 10:00 am America/New_York
Answers: 0
Has thanked: 24 times
Been thanked: 4 times
Contact:

Re: HLS V2.0 data format

by LP DAAC - dgolon » Tue Jun 13, 2023 11:36 am America/New_York

Hello @jasper.vandoninck Our developers are taking a look into this. We'll post more once we have an answer. Thanks!
Subscribe to the LP DAAC listserv by sending a blank email to lpdaac-join@lists.nasa.gov.

Sign up for the Landsat listserv to receive the most up to date information about Landsat data: https://public.govdelivery.com/accounts/USDOIGS/subscriber/new#tab1.

LP DAAC - dgolon
User Services
User Services
Posts: 324
Joined: Mon Sep 30, 2019 10:00 am America/New_York
Answers: 0
Has thanked: 24 times
Been thanked: 4 times
Contact:

Re: HLS V2.0 data format

by LP DAAC - dgolon » Fri Jun 30, 2023 9:41 am America/New_York

Hi @jasper.vandoninck Some of the HLS granules store the granule attributes differently. This is why data is being scaled for some granules and not for others. We will update the R tutorial in an upcoming sprint, but for now you can disable the auto scaling while reading the data and apply that manually for all your granules as a workaround.

We are aware of this issue and we are working with HLS team to list it under data products known issues. Thanks!
Subscribe to the LP DAAC listserv by sending a blank email to lpdaac-join@lists.nasa.gov.

Sign up for the Landsat listserv to receive the most up to date information about Landsat data: https://public.govdelivery.com/accounts/USDOIGS/subscriber/new#tab1.

Post Reply