loicdtx / bfastSpatial

Set of utilities and wrappers to perform change detection on satellite image time-series (Landsat and MODIS). Includes pre-processing steps and functions for spatial implementation of bfastmonitor change detection and post processing of the results.
93 stars 39 forks source link

run filename pre-check in mc.calc before running mclapply #53

Open bendv opened 9 years ago

bendv commented 9 years ago

If writeRaster returns an error (e.g. you referred to a character object with the filename, but with a typo), you only find out after minutes/hours of processing. A pre-check could avoid alot of frustration...

bendv commented 8 years ago

This should work: 67311c7885d41aec4b16af78a2f0231539617f4f. We can add further checks (e.g. validity of file path) later, if needed.

loicdtx commented 8 years ago

Hey Ben, I'm not sure we should do that or at least I don't really like it inside mc.calc(). None of the raster package functions have these options and mc.calc is just a parallel version of calc(). If you find a way to do that with a small utils function which we'd systematically call before mc.calc() I'd be much happier.