mlampros/IceSat2R

1 output sublist did not have a valid 'description' and will be removed!

KristinaNe opened this issue · 14 comments

I tried to run the second vignette. When i tried to create the rgt_winter, i got the mistake for 138 times. Furthermore i got this error: Error: It seems that after splitting the observations by empty space the number of columns (per row) are not an even number!

The output object looks like this: Simple feature collection with 8645 features and 5 fields

T tried to run the testthat function, you described, the first test passed. With the second test i got this error:
── Warning (Line 8): the function 'vsi_time_specific_orbits_wkt()' returns the expected output for an input WKT! ──
The 'sf' gdalinfo returned an empty character string (or vector)! Attempt to read the url using the OS configured 'gdalinfo' function! (As an alternative you can set the parameter 'download_zip' to TRUE and re-run the function)
Backtrace:

  1. IceSat2R::vsi_time_specific_orbits_wkt(...)
  2. IceSat2R::vsi_kml_from_zip(...)

── Error (Line 8): the function 'vsi_time_specific_orbits_wkt()' returns the expected output for an input WKT! ──
Error: The OS 'gdalinfo' gave the following error: '"gdalinfo"' not found!
Backtrace:

  1. IceSat2R::vsi_time_specific_orbits_wkt(...)
  2. IceSat2R::vsi_kml_from_zip(...)

When i continue trough the script, R culd not find the ne_10m_glaciated_areas.RDS:
ne_glaciers = system.file('data_files', 'ne_10m_glaciated_areas.RDS', package = "IceSat2R", mustWork = TRUE)
Error in system.file("data_files", "ne_10m_glaciated_areas.RDS", package = "IceSat2R", :
keine Datei gefunden

Can you help me to solve this problem?
Thank you very much

@KristinaNe can you include your

sessionInfo()

in this issue?

of course, i am sorry, i have done this for the first time:

R version 4.2.2 (2022-10-31 ucrt)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 10 x64 (build 22621)

Matrix products: default

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

other attached packages:
[1] magrittr_2.0.3 terra_1.7-3 rgdal_1.6-4 sp_1.6-0 testthat_3.1.6
[6] IceSat2R_1.0.4 sf_1.0-9

loaded via a namespace (and not attached):
[1] httr_1.4.4 rnaturalearth_0.3.2 sass_0.4.5 pkgload_1.3.2
[5] jsonlite_1.8.4 foreach_1.5.2 bslib_0.4.2 brio_1.1.3
[9] stargazer_5.2.3 shiny_1.7.4 stats4_4.2.2 selectr_0.4-2
[13] pillar_1.8.1 lattice_0.20-45 glue_1.6.2 leafgl_0.1.1
[17] digest_0.6.31 promises_1.2.0.1 rvest_1.0.3 colorspace_2.1-0
[21] htmltools_0.5.4 httpuv_1.6.8 pkgconfig_2.0.3 raster_3.6-14
[25] xtable_1.8-4 webshot_0.5.4 scales_1.2.1 satellite_1.0.4
[29] later_1.3.0 timechange_0.2.0 tibble_3.1.8 proxy_0.4-27
[33] leaflet.extras_1.0.0 generics_0.1.3 DT_0.27 ellipsis_0.3.2
[37] cachem_1.0.6 withr_2.5.0 leafsync_0.1.0 cli_3.6.0
[41] mapview_2.11.0 mime_0.12 fansi_1.0.4 doParallel_1.0.17
[45] xml2_1.3.3 lwgeom_0.2-11 class_7.3-20 tools_4.2.2
[49] data.table_1.14.6 lifecycle_1.0.3 stringr_1.5.0 munsell_0.5.0
[53] jquerylib_0.1.4 compiler_4.2.2 e1071_1.7-12 rlang_1.0.6
[57] classInt_0.4-8 units_0.8-1 grid_4.2.2 iterators_1.0.14
[61] rstudioapi_0.14 htmlwidgets_1.6.1 crosstalk_1.2.0 miniUI_0.1.1.1
[65] leafem_0.2.0 base64enc_0.1-3 waldo_0.4.0 codetools_0.2-18
[69] DBI_1.1.3 curl_5.0.0 R6_2.5.1 lubridate_1.9.1
[73] dplyr_1.1.0 fastmap_1.1.0 utf8_1.2.2 rprojroot_2.0.3
[77] KernSmooth_2.23-20 desc_1.4.2 stringi_1.7.12 parallel_4.2.2
[81] Rcpp_1.0.10 vctrs_0.5.2 png_0.1-8 leaflet_2.1.1
[85] tidyselect_1.2.0

you use this vignette (just for confirmation)

messages like the following are expected (depending on the operating system - it looks you are on a Windows OS)

1 output sublist did not have a valid 'description' and will be removed!
1 output sublist did not have a valid 'description' and will be removed!

In the function

start_date_w = "2020-12-15"
end_date_w = "2021-02-15"

rgt_winter = time_specific_orbits(date_from = start_date_w,
                                 date_to = end_date_w,
                                 RGT_cycle = NULL,
                                 download_method = 'curl',
                                 threads = parallel::detectCores(),
                                 verbose = TRUE)

If you receive an error for the

vsi_time_specific_orbits_wkt()

function, you have to set the download_zip to TRUE (for instance),

orb_cyc_multi = vsi_time_specific_orbits_wkt(date_from = date_start,
                                             date_to = date_end,
                                             RGTs = out_rgt,
                                             wkt_filter = WKT,
                                             download_zip = TRUE,
                                             verbose = TRUE)

I just installed the latest version of IceSat2R from CRAN and I don't receive any error

The 'description' column of the output data will be processed ...
The temproary files will be removed ...
Processing of cycle 'RGT_cycle_10': Elapsed time: 0 hours and 9 minutes and 35 seconds. 
Total Elapsed time: 0 hours and 12 minutes and 52 seconds. 

The 'sf' R package is required for IceSat2R, can you also check that you have configure it correctly (https://github.com/r-spatial/sf#windows)

Can you point me to where the next line is located, I'm not able to find it in version 1.0.4

ne_glaciers = system.file('data_files', 'ne_10m_glaciated_areas.RDS', package = "IceSat2R", mustWork = TRUE)

thank you for your fast comments!!!! Yes it is this vignette.

When the error is expected (i work with Windows), than it seems to be ok.

I changed the column in the vsi_time_specific_orbits_wkt() function, but i got a new error:

── Error (Line 8): the function 'vsi_time_specific_orbits_wkt()' returns the expected output for an input WKT! ──
Error in data.table::rbindlist(dat_all): Class attribute on column 3 of item 2 does not match with column 3 of item 1.
Backtrace:

  1. IceSat2R::vsi_time_specific_orbits_wkt(...)
  2. base::lapply(...)
  3. IceSat2R (local) FUN(X[[i]], ...)
  4. data.table::rbindlist(dat_all)

I also installed the packages sf and IceSat2R one more time and checked the rtools, everything seems to be correct. It is line:

ne_glaciers = system.file('data_files', 'ne_10m_glaciated_areas.RDS', package = "IceSat2R") (# no error, but the object looks like: "")
ne_obj = readRDS(file = ne_glaciers),

ERROR:

ne_obj = readRDS(file = ne_glaciers)
Error in gzfile(file, "rb") : cannot open the connection
In addition: Warning message:
In gzfile(file, "rb") :
cannot open compressed file '', probable reason 'Invalid argument'

so i tried:

ne_glaciers = system.file('data_files', 'ne_10m_glaciated_areas.RDS', package = "IceSat2R", mustWork = TRUE)
Error in system.file("data_files", "ne_10m_glaciated_areas.RDS", package = "IceSat2R", :
keine Datei gefunden

it seems to me that you use an older version of the IceSat2R package (the same applies for the vignette that you use), because I replaced the 'ne_10m_glaciated_areas.RDS' in version 1.0.2 with "ne_10m_glaciated_areas.rda" (the current version is 1.0.4)
You can now load the data using

require(IceSat2R)
data(ne_10m_glaciated_areas)

Can you please install the Github version of the package using

remotes::install_github('mlampros/IceSat2R', dependencies = TRUE)

I think your system configuration might be the cause of the error but I can not confirm it, because I only run the tests for Windows on CRAN. You mentioned that you receive an error when you run the package tests but the tests pass on CRAN for recent Windows OS versions (there is an error for the old release of Windows but it's unrelated to your issue).
Is it an option for you to use the IceSat2R docker image that comes with Rstudio installed? I explain in the README.md file how to bind a directory to the docker container so that you can work with your data as well

I think there is an overlapping of the naming for the docker and binder image, I'll try to fix this today (latest tomorrow). You can use the binder image instead?

sorry to hear that the binder image gave an error as well.

Is it possible for me to put in a new polygon? Or to use another object?

yes, this is actually what the IceSat2R package is meant for, i.e. to use it for you area of interest.

I'll try to fix the docker image tomorrow, because that way you (and any other user of the package) will be in place to use the full capacity of the computer compared to the binder image which has limitations (RAM and CPU). Moreover, that way you'll be able to confirm that you receive the same results as I do

the docker image now works and you can reproduce the vignettes (or work with your area of interest) using the included Rstudio session. In case you want to use the CopernicusDEM R package (for elevation data as is the case in one of the vignettes) you might have to include your AWS credentials. I give more details in the README.md file of the package. I reproduced the IceSat-2_Atlas_products_HTML.html vignette today (which includes a command to the CopernicusDEM R package) using the following docker command:

docker run -d --name rstudio_dev -v /home/.aws:/home/rstudio/.aws -e USER=rstudio -e PASSWORD=give_here_your_password --rm -p 8787:8787 mlampros/icesat2r:rstudiodev

you have to adjust the password in the previous command and the ".aws" directory path that includes your AWS credentials. Then I opened a web browser and by giving

http://localhost:8787

I was asked to give the Rstudio username and password and proceeded to the Rstudio session
The binder image doesn't work currently I'll adjust it late in the afternoon or tomorrow morning

I assume you were able to reproduce the vignette with the docker image. Currently, I face an issue with the binder url and I opened a couple of issues but no responses yet (repo2docker-action and in the corresponding discussion forum)

Feel free to re-open the issue if the code does not work as expected