e-sensing / sits

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

Error running cloud detection #182

Closed albhasan closed 3 years ago

albhasan commented 3 years ago

Good evening,

I'd like to run the cloud mask on CBERS images. However, I'm getting the following error message below. I appreciate your help.

Using 9 blocks of size 1810 x 15657
Error in cbers4_cld_detect(b13.mx, b14.mx, b15.mx, b16.mx) : 
  argument "thres_1" is missing, with no default
Called from: cbers4_cld_detect(b13.mx, b14.mx, b15.mx, b16.mx)

After running this code:

library(dplyr)
library(sits)

data_dir <- "/home/alber.ipia/Documents/sits_cloud_mask/data/raster/CBERS4A/2020_10/CBERS_4A_WFI_RAW_2020_10_20.13_34_30_ETC2/205_116_0/4_BC_UTM_WGS84"

cbers_cube <- sits_cube(type = "RASTER",
                        name = "cbers",
                        satellite = "CBERS-4",
                        sensor = "AWFI",
                        resolution = "64m",
                        data_dir = data_dir,
                        parse_info = c("X1", "X2", "X3","date", "X5", "X6", "X7", "band", "X9", "X10"))
cbers_mask <- sits::sits_cloud_cbers(cube = cbers_cube,
                                     cld_band_name = "CMASK",
                                     t1 = 1,
                                     t2 = 0.125,
                                     t3 = 0.66,
                                     t4 = 0.8,
                                     t5 = 40,
                                     t6 = 5,
                                     memsize = 8,
                                     multicores = 1)

sessionInfo reports the following:

R version 4.0.2 (2020-06-22)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Ubuntu 20.04 LTS

Matrix products: default
BLAS/LAPACK: /usr/lib/x86_64-linux-gnu/openblas-openmp/libopenblasp-r0.3.8.so

locale:
 [1] LC_CTYPE=en_US.UTF-8       LC_NUMERIC=C               LC_TIME=en_US.UTF-8        LC_COLLATE=en_US.UTF-8    
 [5] LC_MONETARY=en_US.UTF-8    LC_MESSAGES=C              LC_PAPER=en_US.UTF-8       LC_NAME=C                 
 [9] LC_ADDRESS=C               LC_TELEPHONE=C             LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C       

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

other attached packages:
[1] sits_0.9.7.1 dplyr_1.0.2 

loaded via a namespace (and not attached):
 [1] Rcpp_1.0.5        rstudioapi_0.13   magrittr_2.0.1    tidyselect_1.1.0  lattice_0.20-41   R6_2.5.0         
 [7] rlang_0.4.9       fansi_0.4.1       tools_4.0.2       rgdal_1.5-18      grid_4.0.2        data.table_1.13.0
[13] config_0.3        cli_2.2.0         ellipsis_0.3.1    yaml_2.2.1        assertthat_0.2.1  tibble_3.0.4     
[19] lifecycle_0.2.0   crayon_1.3.4      purrr_0.3.4       vctrs_0.3.5       glue_1.4.2        sp_1.4-2         
[25] compiler_4.0.2    pillar_1.4.6      generics_0.1.0    lubridate_1.7.9   pkgconfig_2.0.3 

Thanks!

gilbertocamara commented 3 years ago

Thanks, @albhasan. Bug has been fixed and the corrections uploaded to github.