The makeDataCube R project generates a data cube from Landsat data using FORCE and allows to generate and add a data mask to the data cube.
You can install it via:
library(devtools)
install_github("RETURN-project/makeDataCube")
This script requires certain programs to be installed in your computer in order to work. The guide below will help you through this process.
pip install pylandsat
and pip install shapely
.sudo apt-get install <library name>
.We made available a Docker image with all the requirements pre-installed. Please run
docker pull returnproject/makedatacube:v01
to obtain it and add it to your docker images. After installing, you can use it, for example, like this:
docker run -t returnproject/makedatacube:v01 \
Rscript -e "rmarkdown::render('vignettes/make_Landsat_cube.Rmd', params = list(starttime = '2000-11-1', endtime = '2001-5-28’))”
The corresponding Dockerfile
is also available in inst/docker/Dockerfile
.
Keep in mind that these images cannot and should not include your credentials. Click here for a shortcut to include your credentials in your own Docker image.
If you are more comfortable with Singularity, we pushed an image to Singularity Cloud Services. You can use:
singularity pull --arch amd64 library://returnproject/default/makedatacube:v1
to obtain it. It will download a file with a name like makeDataCube_v01.sif
. After installing, you can use it, for example, like this:
singularity exec makeDataCube_v01.sif \
Rscript -e "rmarkdown::render('vignettes/make_Landsat_cube.Rmd', params = list(starttime = '2000-11-1', endtime = '2001-5-28’))”
The corresponding .def
file is available in inst/singularity/full.def
.
Keep in mind that these images cannot and should not include your credentials. Click here for a shortcut to include your credentials in your own Singularity image.
This script connects to different data sources. Some of them require credentials, typically a username and a password. Please follow this guide to get yours:
gsutil config
and following the instructions. The result of the activation is a .boto
file..netrc
file by executing makeDataCube::EartDataLogin()
in your R console and following the instructions.A presentation about this project was given at Wageningen University on Nov 8th 2021. The slides are temporarily available here.
If you experience any problem, please take a look at our troubleshooting section.
For launching the analysis in Spider follow the next steps:
git clone https://github.com/RETURN-project/makeDataCube.git
.cd makeDataCube
.inputs.csv
with your desired inputs.make_Landsat_cube.Rmd
. More information about these parameters can be found in the documentation and tutorials of FORCE.sbatch --array=2-3 -N1 ./main.sh inputs.csv
(note that --array=2-3
processes the lines 2 and 3 of inputs.csv
).OUTPUTD="/home/${USER}/outputs"
. Do you want to change this? Edit it in run.sh
.inputs.csv
contains the data ranges to be processed. Each line would be send to a node.run.sh
takes care of the fine details.main.sh
calls run.sh
in a loop, once per line in inputs.csv
.When running on Spider, the workflow is slightly modified:
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.