<div align="center">
  <img src="/logo_BSC.png" alt="Logo 1" height="50">
  <img src="/logo_FOCUS.png" alt="Logo 2" height="50">
</div>

<br>
<div align="center">

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

This project is licensed under GNU General Public License version 3 ([GPL-3](https://www.gnu.org/licenses/gpl-3.0)|[View on GitLab](https://earth.bsc.es/gitlab/amartine/vignette/-/blob/main/LICENSE.txt))

[![License: GPL v3](https://img.shields.io/badge/License-GPLv3-blue.svg)](https://www.gnu.org/licenses/gpl-3.0)    

</div>

### This folder contains:

- #### [FOCUS_calibration_t2m.ipynb](https://earth.bsc.es/gitlab/amartine/vignette/-/blob/main/FOCUS_calibration_t2m.ipynb): 
    A vignette which provides an example of code written in R that can be used to calibrate seasonal forecasts using several calibration methods.
    For each calibration method, different skill scores are calculated, compared to the ones obtained by using a non-calibrated forecast and finally displayed. The vignette shows an example 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).
    This vignette also offers the possibility of choosing a different variable, region, and reference period than those specified in the example and can be run virtually via binder or locally on a personal computer. Depending on the selected parameters and the location where the vignette is executed, it may also download and store seasonal climate data from the Climate Data Store - Copernicus  ([CDS](https://cds.climate.copernicus.eu/cdsapp#!/home)) .

    **AS MENTIONED BEFORE, 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 [on_computer](https://earth.bsc.es/gitlab/amartine/vignette/-/tree/main/on_computer) folder

<br>

 - #### [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.

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

    Folder which contains a data sample with the data of the example conducted within [FOCUS_calibration_t2m.ipynb](https://earth.bsc.es/gitlab/amartine/vignette/-/blob/main/FOCUS_calibration_t2m.ipynb)

- #### [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) for the example that makes use of the data sample contained in the [data](https://earth.bsc.es/gitlab/amartine/vignette/-/tree/main/data) folder.

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

    txt file with the conditions and terms on the use and distribution of this code

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

    Logo of the BSC (Barcelona Supercomputing Center)

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

    Logo of FOCUS-Africa 
    

#### 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.

<br>
<div align="center">

This project is licensed under GNU General Public License version 3 ([GPL-3](https://www.gnu.org/licenses/gpl-3.0)|[View on GitLab](https://earth.bsc.es/gitlab/amartine/vignette/-/blob/main/LICENSE.txt))

[![License: GPL v3](https://img.shields.io/badge/License-GPLv3-blue.svg)](https://www.gnu.org/licenses/gpl-3.0)    

</div>

<div align="center">
  <img src="/logo_BSC.png" alt="Logo 1" height="50">
  <img src="/logo_FOCUS.png" alt="Logo 2" height="50">
</div>
