### Welcome to the repository how-to-calibrate-seasonal-forecasts:

### This folder contains:

- #### [FOCUS_calibration_t2m.ipynb](https://earth.bsc.es/gitlab/amartine/vignette/-/blob/main/FOCUS_calibration_t2m.ipynb): 
    This vignette provides an example of code written in R that can be used to calibrate seasonal forecasts using several calibration methods.
    
    For each calibration method, the results and different skill scores are displayed and compared to the ones obtained by using a non-calibrated forecast. This example is conducted over a south-african domain, along a reference period going from 1995 to 2015 and for the variable "t2m" (air temperature 2m above the ground). The initialisation month of the hindcast - which is a forecast initialised in the past (known as well as retrospective forecast) - is November and the analysis is done for the seasonal aggregation of November, December and January (NDJ).  

    The vignette includes five main steps: (1) Loading R libraries, (2) Downloading the data and setting the configuration parameters, (3) Loading the seasonal data, (4) Calibrating and verifying the forecast and (5) Visualising the results.

    **THIS VIGNETTE MAY BE RUN IN TWO WAYS:**
    - **1. Virtually**. To use this option (and to know some information regarding this) you can go to the [binder](https://earth.bsc.es/gitlab/amartine/vignette/-/tree/main/binder) folder .
    - **2. Using your own computer**. Some computational requirements must be met. To get more information on this option you can go to the [in_computer](https://earth.bsc.es/gitlab/amartine/vignette/-/tree/main/in_computer) folder

<br>

- #### [Figures](https://earth.bsc.es/gitlab/amartine/vignette/-/tree/main/Figures): 

    Folder which contains the figures obtained in the analysis conducted within [FOCUS_calibration_t2m.ipynb](https://earth.bsc.es/gitlab/amartine/vignette/-/blob/main/FOCUS_calibration_t2m.ipynb) 

- #### [binder](https://earth.bsc.es/gitlab/amartine/vignette/-/tree/main/binder):

    Folder containing the elements necessaries to run the vignette [FOCUS_calibration_t2m.ipynb](https://earth.bsc.es/gitlab/amartine/vignette/-/blob/main/FOCUS_calibration_t2m.ipynb) through Binder.


- #### [in_computer](https://earth.bsc.es/gitlab/amartine/vignette/-/tree/main/in_computer):

    Folder containing information regarding some computational requirements and steps that need to be followed to run the vignette [FOCUS_calibration_t2m.ipynb](https://earth.bsc.es/gitlab/amartine/vignette/-/blob/main/FOCUS_calibration_t2m.ipynb) in a computer. 
    
 - #### [download_seasonal_data.R](https://earth.bsc.es/gitlab/amartine/vignette/-/blob/main/download_seasonal_data.R):

    This script might be called when the vignette [FOCUS_calibration_t2m.ipynb](https://earth.bsc.es/gitlab/amartine/vignette/-/blob/main/FOCUS_calibration_t2m.ipynb) is run. It allows downloading, formatting and storing the seasonal data from the CDS (netCDFs files are obtained). This script is aimed at providing an example of how the seasonal hindcast and observations can be downloaded using R.


- #### [reference_seas5.nc](https://earth.bsc.es/gitlab/amartine/vignette/-/blob/main/reference_seas5.nc):

    netCDF file used within [FOCUS_calibration_t2m.ipynb](https://earth.bsc.es/gitlab/amartine/vignette/-/blob/main/FOCUS_calibration_t2m.ipynb) to match the resolutions of both the observations and the hindcast.



#### WARNINGS:
The time employed on downloading the data may be large and it depends on the CDS' server performance. In the other hand, Binder usually has a limitation time per user session up to 6 hours, after that, it cannot be guaranteed that the session will remain running (https://mybinder.readthedocs.io/en/latest/about/user-guidelines.html#how-long-will-my-binder-session-last). For this reason, some interruptions when downloading data that include extended regions and periods may occur. It is also important to remember that when the Binder session is closed, the session is not saved; hence, the downloaded files would be lost. If you want to keep them you can always download them to your personal computer. In the same way, Binder also allows uploading files once the session is started.
