geco-bern / ingestr

Data ingest for points (given longitude, latitude, and required dates) from large global files or remote data servers and create time series at user-specified temporal resolution.
https://geco-bern.github.io/ingestr
42 stars 21 forks source link

cannot get gee products - inconsistencies for prod and prod_suffix #39

Closed padasch closed 2 years ago

padasch commented 2 years ago

Problem:

Reproducible Code:

library(ingestr)
library(ggplot2)

settings_gee <- get_settings_gee(
  bundle            = "modis_lst_aqua", #modis_evi results in the same error
  python_path       = system("which python3", intern = TRUE),
  gee_path          = "~/repos/google_earth_engine_subsets/src/gee_subset/",
  data_path         = "~/data/gee_subsets/",
  method_interpol   = "linear",
  keep              = TRUE,
  overwrite_raw     = FALSE,
  overwrite_interpol= TRUE
  )

df_gee_modis_fpar <- ingest_bysite(
  sitename  = "CH-Lae",
  source    = "gee",
  year_start= 2010,
  year_end  = 2012,
  lon       = 8.365,
  lat       = 47.4781,
  settings  = settings_gee,
  verbose   = FALSE
  )

Error Traceback:

<error/dplyr_error>
Problem with `filter()` input `..1`.
ℹ Input `..1` is `!is.na(modisvar_filtered)`.
x Input `..1` must be of size 1096 or 1, not size 0.
Backtrace:
     █
  1. ├─global::ingest_bysite(...)
  2. │ └─global::ingest_gee_bysite(...) ~/projects/repositories/others/ingestr/R/ingest_bysite.R:538:4
  3. │   └─global::gapfill_interpol_gee(...) ~/projects/repositories/others/ingestr/R/ingest_gee_bysite.R:158:6
  4. │     └─`%>%`(...) ~/projects/repositories/others/ingestr/R/ingest_gee_bysite.R:499:4
  5. ├─dplyr::pull(., period)
  6. ├─dplyr::mutate(., period = as.integer(difftime(date, prevdate)))
  7. ├─dplyr::mutate(., prevdate = lag(date))
  8. ├─dplyr::filter(., !is.na(modisvar_filtered))
  9. ├─dplyr:::filter.data.frame(., !is.na(modisvar_filtered))
 10. │ └─dplyr:::filter_rows(.data, ..., caller_env = caller_env())
 11. │   ├─base::withCallingHandlers(...)
 12. │   └─mask$eval_all_filter(dots, env_filter)
 13. ├─dplyr:::abort_glue(...)
 14. │ ├─rlang::exec(abort, message = message, class = class, !!!data)
 15. │ └─(function (message = NULL, class = NULL, ..., trace = NULL, parent = NULL, ...
 16. │   └─rlang:::signal_abort(cnd)
 17. │     └─base::signalCondition(cnd)
 18. └─(function (e) ...
khufkens commented 2 years ago

Interpolation is not supported, set to "none"

library(ingestr)
library(ggplot2)

settings_gee <- get_settings_gee(
  bundle            = "modis_lst_aqua", #modis_evi results in the same error
  python_path       = system("which python3", intern = TRUE),
  gee_path          = "~/repos/google_earth_engine_subsets/src/gee_subset/",
  data_path         = "~/data/gee_subsets/",
  method_interpol   = "none",
  keep              = TRUE,
  overwrite_raw     = FALSE,
  overwrite_interpol= TRUE
  )

df_gee_modis_fpar <- ingest_bysite(
  sitename  = "CH-Lae",
  source    = "gee",
  year_start= 2010,
  year_end  = 2012,
  lon       = 8.365,
  lat       = 47.4781,
  settings  = settings_gee,
  verbose   = FALSE
  )
padasch commented 2 years ago

@khufkens Does the code you suggested run on your machine? Using 790afc5, I still get the same error message as posted originally.

khufkens commented 2 years ago

Yes, grabbed all data for Martina with it.