If you want to run the vignette [FOCUS_calibration_t2m.ipynb](https://earth.bsc.es/gitlab/external/cstools/-/blob/develop-CalibrationVignette/FOCUS_7_2/FOCUS_calibration_t2m.ipynb) in a computer you must ensure that the next computational requirements are met.

#### COMPUTATIONAL REQUIREMENTS
- **R - version 3.6.1**. It can be downloaded from [https://cran.r-project.org/](https://cran.r-project.org/)  
- **CDO - version 1.9.8**. It can be downloaded from [https://code.mpimet.mpg.de/projects/cdo](https://code.mpimet.mpg.de/projects/cdo) (with previous registration). Some useful information can be found on [https://code.mpimet.mpg.de/projects/cdo/embedded/cdo.pdf]() , specially on the section 1.1.
- **JupyterLab or similar**: A tool able to open a Jupyter notebook is needed. We recommend using JupyterLab. It can be installed from [https://jupyter.org/install](https://jupyter.org/install)




A relatively easy way to download and install JupyterLab and the requested versions of R and CDO may be through conda. Conda quickly installs, runs and updates packages and their dependencies (more detailed information of conda can be found here: https://docs.conda.io/en/latest/). Some details and a guide regarding the Conda download and installation are described in: https://docs.conda.io/projects/conda/en/latest/user-guide/install/. Complementary information regarding how conda works and how can be used for installing some packages (as well as installing R, CDO or Jupyter-Lab)  can be found in their user guide: https://docs.anaconda.com/anaconda/user-guide/. 

#### STEPS TO INSTALL JupyterLab AND THE REQUIRED VERSIONS OF R AND CDO THROUGH CONDA
**Only once**:
1. Go to the [repository](https://earth.bsc.es/gitlab/external/cstools/-/tree/develop-CalibrationVignette/FOCUS_7_2) containing the FOCUS vignette and download it: (imagelink)
2. Extract the contents in the path that you prefer within your computer. (imagelink)
3. Download and install Conda ([https://docs.conda.io/projects/conda/en/latest/user-guide/install/](https://docs.conda.io/projects/conda/en/latest/user-guide/install/)). More information on this can be found above.
4. Open a terminal (if Linux) or anaconda prompt (if windows) and execute the following commands in order to set the environment properly:
    - `conda env create -f <repository_path>/FOCUS_7_2/in_computer/settings_cda.yml`
    - `conda activate environment_settings`. If it does not work try `source activate environment_settings`. More info in https://docs.conda.io/projects/conda/en/latest/user-guide/tasks/manage-environments.html#activating-an-environment
    - `R -e "install.packages('devtools', repos='https://ftp.cixug.es/CRAN/')"`
    - `R -e "library(devtools); path_anaconda <-'/home/amartine/anaconda3/'; Sys.setenv(TAR = paste0(path_anaconda,'/envs/environment_settings/bin/tar'));install_version('Rcpp',version='1.0.8.3', quiet=T, repos='https://ftp.cixug.es/CRAN/'); install_version('uuid',version='1.1.0', quiet=T, repos='https://ftp.cixug.es/CRAN/')"`
    
    
    **Note 1**: you should replace <repository_path> by the path where the contents of the downloaded repository were stored (**Step 2**). As a piece of example, <repository_path>= '/amartine/home/cstools-develop-CalibrationVignette-FOCUS_7_2/'
    
    **Note 2**: 'path_anaconda' must specify the path where anaconda3 has been installed in your computer. 

**Steps that need to be followed every time you want to run the vignette**:
1. Open a terminal (if Linux) or anaconda prompt (if windows).
2. Type `conda activate environment_settings`. If it does not work try `source activate environment_settings`. More info in https://docs.conda.io/projects/conda/en/latest/user-guide/tasks/manage-environments.html#activating-an-environment
3. Open Jupyter Lab.
4. Set the Rkernel.
5. On the left you can now go to the repository path (which is the path within your computer where you have archived the [repository](https://earth.bsc.es/gitlab/external/cstools/-/tree/develop-CalibrationVignette/FOCUS_7_2) containing the FOCUS vignette).
6. Click on the vignette script and you can now run the code line by line.


