e-sensing / sits

Satellite image time series in R
https://e-sensing.github.io/sitsbook/
GNU General Public License v2.0
459 stars 76 forks source link

Support for Harmonized Sentinel Landsat data #941

Closed daniel-althoff closed 1 year ago

daniel-althoff commented 1 year ago

I am sorry if this is something you are already working on. I looked up in issues and could not find anything related.

The Harmonized Sentinel Landsat data can be very useful, especially in regions where cloud cover is high. I thought it could be a great addition to the list of collections made available by sits.

Here is an example made by USGS to access the CMR-STAC and download HSL.S and HSL.L https://lpdaac.usgs.gov/resources/e-learning/getting-started-with-cloud-native-harmonized-landsat-sentinel-2-hls-data-in-r/

Do you guys think this could be added to the list of collections in a later version?

Thanks

gilbertocamara commented 1 year ago

Dear @daniel-althoff many thanks for your suggestion. We will include access to the HSL collection in the next version of sits. We plan to include this access first in the "dev" version and will inform you as soon as possible.

rolfsimoes commented 1 year ago

Available in sits dev version. To test it, please run this command:

devtools::install_github("e-sensing/sits@dev")
rolfsimoes commented 1 year ago

Hi @daniel-althoff

I've prepared an example to you on how to use the HLS collection. We will include this example soon in the sits documentation. To run the example, you must create a ~/.netrc plain text file in Unix (or %HOME%\_netrc in Windows) containing the following fields:

machine urs.earthdata.nasa.gov
login <YOUR-LOGIN>
password <YOUR-PASSWORD>

You must create an account here. Once you have create ~/.netrc file, you can run the example using sits 1.4 available in github (development version). You can install it by typing devtools::install_github("e-sensing/sits@dev").

Example:

bbox <- c(lon_min = -63.153456, 
          lat_min = -7.681265, 
          lon_max = -62.862239, 
          lat_max = -7.385608)

hls_s2 <- sits_cube(
    source = "HLS",
    collection = "HLSS30",
    roi = bbox,
    start_date = "2020-08-01",
    end_date = "2021-07-31"
)

sits_timeline(hls_s2)
sits_bands(hls_s2)

hls_l8 <- sits_cube(
    source = "HLS",
    collection = "HLSL30",
    roi = bbox,
    start_date = "2020-08-01",
    end_date = "2021-07-31"
)

sits_timeline(hls_l8)
sits_bands(hls_l8)

hls_merged <- sits_merge(hls_s2, hls_l8)

sits_bands(hls_merged)
sits_timeline(hls_merged)
daniel-althoff commented 1 year ago

Hi @rolfsimoes Thank you so much for this. I'll try the example sometime soon and hopefully get a good outcome :)

Do you guys have any personal opinion or preferences when comparing HLS to S2 or other collections? Any drawback? Thanks again!

gilbertocamara commented 1 year ago

Dear @daniel-althoff We have not yet run major applications using HLS data, but we'll keep you posted.

daniel-althoff commented 1 year ago

Hi @daniel-althoff

I've prepared an example to you on how to use the HLS collection. We will include this example soon in the sits documentation. To run the example, you must create a ~/.netrc plain text file in Unix (or %HOME%\_netrc in Windows) containing the following fields:

machine urs.earthdata.nasa.gov
login <YOUR-LOGIN>
password <YOUR-PASSWORD>

You must create an account here. Once you have create ~/.netrc file, you can run the example using sits 1.4 available in github (development version). You can install it by typing devtools::install_github("e-sensing/sits@dev").

so the .netrc, in my case, should be created here 'C:\Users\danie.netrc', right?

However, I have not been able to install sits@dev I get the following:

The downloaded source packages are in ‘C:\Users\danie\AppData\Local\Temp\Rtmp8OT3p1\downloaded_packages’ ✔ checking for file 'C:\Users\danie\AppData\Local\Temp\Rtmp8OT3p1\remotes24f85637760d\e-sensing-sits-6a988b9/DESCRIPTION' ... ─ preparing 'sits': (1.9s) ✔ checking DESCRIPTION meta-information ... ─ cleaning src ─ checking for LF line-endings in source and make files and shell scripts ─ checking for empty or unneeded directories ─ building 'sits_1.4.0.tar.gz'

Installing package into ‘C:/Users/danie/AppData/Local/R/win-library/4.2’ (as ‘lib’ is unspecified)

Is there something I am missing?

version _
platform x86_64-w64-mingw32
arch x86_64
os mingw32
crt ucrt
system x86_64, mingw32
status
major 4
minor 2.1
year 2022
month 06
day 23
svn rev 82513
language R
version.string R version 4.2.1 (2022-06-23 ucrt) nickname Funny-Looking Kid

gilbertocamara commented 1 year ago

Dear @daniel-althoff, this seems to be a problem with the Windows version of sits 1.4. We are investigating the problem, and will come back to you ASAP.

OldLipe commented 1 year ago

Hi @daniel-althoff,

I just updated the dev branch in my repo. Could you please test it?

devtools::install_github("oldlipe/sits@dev2")

daniel-althoff commented 1 year ago

Hi @OldLipe. It worked, thanks a lot!