Closed jakobjassmann closed 2 years ago
For now, I have commented out the line in the example. This allowed me to run all remaining checks.
The function is also used in other code examples. In some it was already commented out, but not in other. I commented out the call in those too. The following examples now contain a commented out line with the call:
Unsure if this is related, but I run into an error when using lsat_calibrate_rf() on a dataset from west Greenland with >1000 pixels.
Code example:
lsat.dt <- lsat_calibrate_rf(lsat.dt, band.or.si = 'ndvi', doy.rng = 150:242, min.obs = 5, frac.train = 0.75, overwrite.col = T, write.output = T, train.with.highlat.data = F, outdir = outputs_dir))
fails with error message:
Error in data.table::dcast.data.table(sample.doy.dt, sample.id + doy ~ : Can not cast an empty data.table
Everything runs fine if I switch the 'train.with.highlat.data' to TRUE.
Not an urgent issue, just wanted to have it flagged in case it was a more general problem.
@jakobjassmann and @jtkerb -- Yes, you both hit related issues with having few to no samples sites with temporally overlapping measurements between Landsat 7 and Landsat5/8. I updated the function so it now checks whether there are atleast 100 sample sites with temporally overlapping data from both sensors. If there is not adequate data, then the function now produces an error message, returns the original data.table, and stops. The error message looks like this, but is better formatted in R:
Error in lsat_calibrate_rf(lsat.dt, band.or.si = "ndvi", :
Your dataset has 0 sample sites with temporally overlapping measurements from LANDSAT_7 and LANDSAT_5. This is not enough data to cross-calibrate the sensors. Either set min.obs lower, set train.with.highlat.data = T if working in the Arctic or Boreal biome, or extract Landsat data from more sample sites... The function will now stop!
Could you please update to the latest version of lsatTS on the repo and try again. I'll close this Issue, but please reopen if you still encounter issues.
Code example in documentation for lsat_calibrate_rf()
fails with error message:
@logan-berner I am not sure how to interpret this error, is it because the last.example.dt dataset is too small?