The goal of nimbus is to simulate cloud cover and add it to raster files.
Installation
You can install the development version of nimbus from GitHub with:
# install.packages("devtools")
devtools::install_github("jonotuke/nimbus")Example
First we load the package.
We will illustrate by adding a cloud cover to the example raster. First we look at the example raster
plot(example_raster)
We will simulate a 70 × 70 pixels cloud
cloud <- simulate_cloud(phi = 0.1, seed = 2023)
plot(cloud)
Next, we will match the extent and projection of the simulated cloud raster with the original raster.
cloud <- match_rasters(example_raster, cloud)
plot(cloud)
cloud
#> class : RasterLayer
#> dimensions : 7061, 7911, 55859571 (nrow, ncol, ncell)
#> resolution : 30, 30 (x, y)
#> extent : 426885, 664215, 7019185, 7231015 (xmin, xmax, ymin, ymax)
#> crs : +proj=utm +zone=55 +south +datum=WGS84 +units=m +no_defs
#> source : memory
#> names : Z
#> values : -5.199408, 5.321076 (min, max)Now, we will filter the cloud and convert values to NAs that will add ask masks in the next stage.
speckled_cloud <- filter_cloud(cloud)
large_cloud <- filter_cloud(cloud, type = "large")
plot(speckled_cloud)
plot(large_cloud)
Finally, we can now add the clouds to the original raster

