e-sensing / sits

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

Error in downloading sentinel images using roi #1218

Open anadefreitas opened 1 week ago

anadefreitas commented 1 week ago

Dear all,

I am trying to download images from Sentinel-1 and 2 in the sits-1.4.1 version. But I faced errors when clipping to my ROI. The visualization of both rasters is okay.

In the case of Sentinel-1, there is a displacement of my region of interest, which is in Ipu-CE, to the surroundings of the city of Piracuruca-PI.

In Sentinel-2, the raster is coming empty in all bands, except in the cloud band. Returning the error:

r in `purrr::map()`:
ℹ In index: 1.
Caused by error in `.check_remote_errors()`:
! 6 nodes produced errors; first error: gdal_utils translate: an error occured
---
Backtrace:
     ▆
  1. └─sits::sits_cube_copy(cube_s2, roi = roi, output_dir = "~/sits/ana/")
  2.   └─sits:::.jobs_map_parallel_dfr(...)
  3.     └─sits:::.jobs_map_parallel(jobs, fn, ..., progress = progress)
  4.       ├─base::unlist(...)
  5.       └─purrr::map(...)
  6.         └─purrr:::map_("list", .x, .f, ..., .progress = .progress)
  7.           ├─purrr:::with_indexed_errors(...)
  8.           │ └─base::withCallingHandlers(...)
  9.           ├─purrr:::call_with_cleanup(...)
 10.           └─sits (local) .f(.x[[i]], ...)
 11.             └─sits:::.parallel_map(round, fn, ..., progress = progress)
 12.               └─sits:::.parallel_cluster_apply(x, fn, ..., pb = pb)
 13.                 └─parallel (local) .check_remote_errors(val)
 14.                   └─base::stop(...)
Run rlang::last_trace(drop = FALSE) to see 4 hidden frames.

Below are the codes used.

Sentinel-1

library(sits)

# Ipu-Ce region
roi <- c("lon_min" = -40.76319703, "lat_min" = -4.36079723,
         "lon_max" = -40.67849202, "lat_max" = -4.29126327)

# Data cube
cube_s2 <- sits_cube(
    source = "MPC",
    collection = "SENTINEL-1-GRD",
    bands = c("VV"),
    orbit = "descending",
    roi = roi,
    start_date = "2021-08-01",
    end_date = "2021-09-30"
)

# Time period
sits_timeline(cube_s2)

plot(cube_s1_grd, band = "VV", palette = "Greys")

# Download
copy <- sits_cube_copy(cube_s2, roi = roi, output_dir = "~/sits/ana/")

Sentinel-2

library(sits)

# Ipu-Ce region
roi <- c("lon_min" = -40.76319703, "lat_min" = -4.36079723,
         "lon_max" = -40.67849202, "lat_max" = -4.29126327)

# Data cube
cube_s2 <- sits_cube(
    source = "MPC",
    collection = "SENTINEL-2-L2A",
    bands = c("B02", "B8A", "B11", "CLOUD"),
    roi = roi,
    start_date = "2024-09-15",
    end_date = "2024-09-25"
)

# Time period
sits_timeline(cube_s2)

# Visualize
sits_view(cube_s2,
     red = "B11", blue = "B02", green = "B8A",
     date = "2024-09-22"
)

# Download
copy <- sits_cube_copy(cube_s2, roi = roi, output_dir = "~/sits/ana/")
OldLipe commented 6 days ago

Dear @anadefreitas,

Thank you for your contribution and for providing a reproducible example.

We will investigate the issue reported and return to you as soon as possible.

Thank you! Felipe Carvalho