# Introduction

## OACG - Hydrology for Costa Rica

This web application is a viewer of **hydrological information** for 605 catchments for Costa Rica, developed using the [HYPE](https://hypeweb.smhi.se/model-water/about-hype-code/) hydrological model, using global data products adjusted with available data observed. The platform has been developed using [Python](https://www.python.org/) and open-source libraries.

This **100% free** tool provides hydrological information such as *hydrological balances*, *hydrological indicators*, and *time series* at different time scales of *precipitation*, *runoff*, *evapotranspiration*, *potential evapotranspiration*, *infiltration*, and *soil moisture* in a free and easily accessible way.

Developed by the [Observatory of Water and Global Change (OACG)](https://www.oacg.fcs.ucr.ac.cr/), of the [School of Geography at the University of Costa Rica](https://www.ucr.ac.cr/), in collaboration with *Dr. Saúl Arciniega Esparza*, of the [Hydrogeology Group](https://www.ingenieria.unam.mx/hydrogeology/) at the [Faculty of Engineering UNAM](https://www.ingenieria.unam.mx/), Mexico.

This short manual explains how to use the web application, the source data, the hydrological model with its results, and how to interpret the simulations.

{% hint style="info" %}
The **data** in this application is **not official** and has been generated mainly for academic and divulgation purposes.
{% endhint %}

{% hint style="info" %}
The **OACG - Hydrology for Costa Rica** web application has been developed for screens of at least 13 inches, so it is not recommended to use it on mobile devices such as cell phones. Furthermore, it is recommended to launch the application in web browsers such as *Mozilla Firefox*, *Microsoft Edge,* or *Google Chrome*.
{% endhint %}

{% content-ref url="/pages/-MIG5DVmLxW1A30\_WnEv" %}
[Broken mention](broken://pages/-MIG5DVmLxW1A30_WnEv)
{% endcontent-ref %}

## Acknowledgment

The development of this application is due to the efforts of several institutions that have collaborated either with access to hydrological information for the calibration of the hydrological model, as well as collaboration for the processing of the information. We would like to particularly thank the **Costa Rican Electricity Institute (ICE)** for sharing the hydrometric information used for the calibration of the model, the **National Meteorological Institute (IMN)**, which provided the climatological information for the correction of the satellite data, and the **Geophysical Research Center of the UCR (CIGEFI)** who have collaborated with the processing of hydrological information.

## Content

1. [Web Application Tutorial](/english/tutorial_en)
2. [Documentation](/english/documentation)
3. [Contacts](/english/contacts)


# Tutorial

This section shows a brief introduction to the web application of the **OACG - Hydrology for Costa Rica** for the visualization, interpretation, and download of hydrological information.

{% content-ref url="/pages/-MIG5DVmLxW1A30\_WnEv" %}
[Broken mention](broken://pages/-MIG5DVmLxW1A30_WnEv)
{% endcontent-ref %}

## Application Elements

![](https://2919081452-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MFVwnsCvMhZ6wGot0Rs%2F-MIGpXntwhs6hxiNy8_k%2F-MIGsC1fO49rCDxE_HDG%2FMainWindow_en.png?alt=media\&token=4ef594c5-c857-4739-b8e7-554be43fba44)

1. Link to the page of the Observatory of Water and Global Change ([OACG](https://www.oacg.fcs.ucr.ac.cr/)).
2. Link to the page of the University of Costa Rica ([UCR](https://www.ucr.ac.cr/)).
3. Selection of the application language (Spanish / English). By default, it is in the Spanish language. When the language is changed, you must wait for the application to update all the components, so it could take a little time.
4. Selection of the variable to be displayed on the map. By default, the average annual precipitation is displayed. For more information on the available variables, you can consult the Hydrological Indices section in the Documentation section. Every time the variable on the map is changed, you must wait for the application to load the necessary data, which may take a few seconds.
5. Map of sub-catchments in Costa Rica used for hydrological simulation. Hovering the cursor over a catchment will show the attributes of the catchment, starting with the sub-catchment index (ID), which is associated with the time series displayed in window #10. When clicking on any sub-catchment, it will be keeps selected. Multiple sub-catchments can be selected by holding down the Shift key.
6. Sub-catchments layer opacity option. Changing the opacity restarts the presentation of the sub-catchment layer, so this process may take a few seconds to show an update.
7. Temporal aggregation of hydrological series (monthly, annual, monthly average). The statistical operation applied to each series is shown in the Simulated Hydrological Series section.
8. Type of spatial series selection. By default, the Subcatchment option is activated, which allows the extraction of time series only for the sub-catchment area. When activating the Catchment option, the resulting time series is the weighting of the series of all the upstream catchments of the selected sub-catchment.
9. Selection of hydrological variables to be displayed. More than one variable can be selected at the same time, for which one axis per variable will be created (it is recommended to display a maximum of three variables).
10. Hydrological series display area. When the device window is very narrow, the area of the graph is positioned below the map of the sub-catchments.
11. Updating of the hydrological series graph. This is recommended to press after selecting more watersheds on the map, but it is not necessary if the variable options are changed because they automatically updated the figure.
12. Export the time series that are displayed in the figure. This option allows you to download a comma-delimited file (csv) with the time series of the selected catchments and variables.

{% hint style="info" %}
The average daily flow always corresponds to the contribution of the entire catchment, where the selected sub-catchment is the lowest part of the catchment.
{% endhint %}

## Time series visualization

### Visualize series for a sub-catchment

To visualize a time serie for a sub-catchment, follow the steps described below:

![](https://2919081452-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MFVwnsCvMhZ6wGot0Rs%2F-MIGpXntwhs6hxiNy8_k%2F-MIGtqEEH9aAeNneo0aG%2FTimeseries_1_en.png?alt=media\&token=705044c9-b4af-45a4-82c5-b626280ee657)

1. Select the sub-catchment of interest by clicking on the map.
2. The time scale is indicated and the Subcatchment option is selected.
3. The variables to display are selected.
4. If the variables are selected before the sub-catchments, it is necessary to press the *Plot Series* button to update the figure.
5. The sub-catchment indicator (ID) is displayed in the legend and it is associated with the catchment ID on the map. When multiple variables are displayed, the color line for each sub-catchments is preserved.

## Visualization of series for multiple sub-catchments

![](https://2919081452-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MFVwnsCvMhZ6wGot0Rs%2F-MIGu0qOa5NPJiRyy3im%2F-MIGw4DMga6A6wDGMQ69%2FTimeseries_2_en.png?alt=media\&token=934097a0-d643-4e9c-8f44-bb19439224e4)

1. The sub-basins of interest are selected by Shift + clicking on the map.
2. The time scale is indicated and the Sub-basin option is selected.
3. The variables to display are selected.
4. If the variables are selected before the sub-catchments, the Plot Series button must be pressed to update the figure.
5. The sub-catchment indicator (ID) is displayed as the figure legend and corresponds to the sub-catchment ID on the map. Each sub-catchment is assigned the same line color in the series for all the variables displayed.

### Visualization tools for time series

![](https://2919081452-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MFVwnsCvMhZ6wGot0Rs%2F-MHX4M1ROQMjeiZg5RlE%2F-MHX71zni76D818jbNhO%2FTimeseries_3_es.png?alt=media\&token=4a239a1b-408a-4426-ab05-276af7b4f0d5)

1. A label is displayed when a time series is hovered with the cursor, showing the month and day, year, and the value of the time series (Month day, Year, Value) within the box. Outside the box, the catchment ID is shown, which corresponds to ID on the map.
2. Download the current figure as png file format.
3. Zoom tools to control the display of the series.
4. Show dotted lines over the intersection in the selected series. By default, this tool is disabled.
5. Label tools for selected series. By default, the single label option is selected, but there is another option to shows the label of all series at the same time.

## Catchments visualization

![](https://2919081452-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MFVwnsCvMhZ6wGot0Rs%2F-MIGwCYzgTcgupqtf6fU%2F-MIGwnKRNwyIyDKaglpn%2FCuencas_1_en.png?alt=media\&token=f98863bb-a4e1-487b-9250-00814ab88554)

Most of the hydrological series were simulated at the sub-catchment scale, with the exception of the average daily flow that corresponds to the total contribution of the upstream area at the discharge point of the selected sub-catchment.

If the average precipitation is required, for example, in the entire catchment considering the upstream area, the *Catchment* option must be selected, as shown in the following image. When this option is selected, when you click on a sub-catchment, all the sub-catchments that contribute up to the discharge point of the selected sub-catchment will be marked in black on the map.

The series in such case are weighted considering the area of each sub-catchment marked in black, and the average variable X will be given by:

$$
X = \frac{X1 \* A1 + X2 \* A2 + ... + Xn \* An} {A1 + A2 + ... + An} = \frac{\sum\_{i=1}^{n}Xi \* Ai} {Atotal}
$$

where X is the average variable in the entire catchment, Xi is the variable of sub-catchment i, Ai is the area of sub-catchment i, Atotal is the total area of the catchment (obtained from the sum of all sub-catchments).

## Download hydrological time series

All series can be downloaded in comma-delimited files (csv). The first step to download the hydrological series is to select them in the viewer, following the steps described in previous sections. Once the sub-catchments or catchments and the variables of interest have been selected, press the *Download Data* button. The downloaded file will contain all the selected basins and variables where the first row corresponds to the variable name and the second row to the sub-catchment ID.

It should be taken into account that the series are downloaded considering the selected time scale at the sub-catchment or catchment scales.


# Documentation

This section shows a brief description of the methodology and information sources used to perform the hydrological simulation in Costa Rica.

{% hint style="info" %}
For more information on the methodology used and the hydrological model used, the **publication** by [Arciniega-Esparza et al. (2022)](https://hess.copernicus.org/articles/26/975/2022/).

The hydrological simulation **database** for Costa Rica is available at [Zenodo](https://zenodo.org/record/4029572).
{% endhint %}

## Databases

The [SRTM](https://dwtkns.com/srtm30m/) (*Bamler, 1999*) public domain digital elevation model was used with a pixel size of 30m corrected with the national water network as the basis for delimiting the country's catchments. The vegetation cover raster (300m) was obtained from the [CCI Land Cover](http://maps.elie.ucl.ac.be/CCI/viewer/index.php) product (*Bontemps et al., 2013*) and the physical characteristics of the soils were obtained from [SoilGrids](https://soilgrids.org/) at 250m (*Hengl et al., 2017*).

Due to the lack of observed hydrological records, data from different free sources were used to run and evaluate the model. Climate data input to the model comes from [CHIRPSv2](https://www.chc.ucsb.edu/data/chirps) (*Funk et al., 2015*) for daily precipitation and product air temperature from NOAA's [CPC Global Daily Temperature product](https://psl.noaa.gov/).

The precipitation product was corrected with observed data from 75 available stations in the country using a linear bias correction method (bias = Xobs / Xsatelite). The temperature data were corrected with the elevation of the terrain due to the lack of records for the correction of bias. Global potential evapotranspiration (PET) and current evapotranspiration (ETA) products from the [MODIS 16A3](https://www.ntsg.umt.edu/project/modis/mod16.php) satellite (*Mu et al., 2011*) were used to adjust the hydrological balance.

The description of the sources used is shown in the following table:

| Dataset                | Variable              | Label          | Resolution | Period       | Scale   | Data type                                             |
| ---------------------- | --------------------- | -------------- | ---------- | ------------ | ------- | ----------------------------------------------------- |
| CHIRPSv2               | Precipitation         | P              | 0.05°      | 1981-preset  | Daily   | Remote sensing and calibrated merged with ground data |
| MODIS16                | Evapotranspiration    | AET, PET       | 5km        | 2000-2014    | Monthly | Remote sensed                                         |
| CPC Global Temperature | Temperature           | Tmin,Tmax,Tmed | 0.5°       | 1979-present | Daily   | Gridded from stations                                 |
| CCI Land Cover         | Land Cover            | Land use       | 300m       | 1993-2015    | Annual  | Remote sensed                                         |
| SoilGrids              | Sand and clay content | Soil type      | 250m       | -            | -       | MachineLearning from soil profiles                    |
| SRTM                   | Terrain elevation     | DEM            | 30m        | -            | -       | SAR interferometry                                    |

## Hydrological Model

The semi-distributed, conceptual model, based on hydrological processes [HYPE](https://hypeweb.smhi.se/model-water/) (Lindström et al., 2010) was used for the hydrological simulations.

![Scheme of the discrimination in sub-catchments of the model and the processes simulated by HYPE. Source: Lindström et al. (2010)](https://2919081452-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MFVwnsCvMhZ6wGot0Rs%2F-MG6WaPMyie2sHjN866u%2F-MG6YLUvNHLJjM_-sr9O%2FEsquema_HYPE.png?alt=media\&token=be326212-6aac-4ce8-8f60-b2b711c95571)

**HYPE** source code can be downloaded from [sourceforge](https://sourceforge.net/projects/hype/files/). The official [documentation](http://www.smhi.net/hype/wiki/doku.php) must be used for more information about the model.

## Model calibration and performance

HYPE calibration and validation were performed using observed daily flow data in 13 watersheds of Costa Rica, with a calibration period from 1991 to 1999 and a validation period from 2000 to 2003. Additionally, global potential evapotranspiration products were used (PET) and **MODIS** current evapotranspiration (AET) to adjust the hydrological balance for the period 2001 to 2010, with a validation period from 2011 to 2014.

A step-wise calibration procedure was incorporated for the model calibration, starting with the calibration of the monthly potential evapotranspiration (PET), the monthly evapotranspiration (ETA), the monthly streamflow (Qt) and finally using the daily streamflow (Qt) data. The following figure shows the performance of the model to simulate the monthly streamflow in the 13 monitored catchments.

![](https://2919081452-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MFVwnsCvMhZ6wGot0Rs%2F-MIGhjc8jahjSrerolgy%2F-MIGjDkFIRRgf6qC9Y9K%2FCorrelacion_Qtm_Documentacion_en.svg?alt=media\&token=9cc79696-9af2-41a7-b63e-881e55deb808)

The simulations correspond to the first version of the regional model of Costa Rica with the HYPE model (**HYPE CR 1.0**), which was selected from a set of models that generated similar performance with respect to the observed streamflow, however, **HYPE CR 1.0** has generated a balanced performance with streamflow (Qt), actual evapotranspiration (AET) and potential evapotranspiration (PET). Likewise, it must be taken into account that there is uncertainty with the **HYPE CR 1.0** model since different values of the parameters generated similar results, as can be seen in the following image.

![](https://2919081452-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MFVwnsCvMhZ6wGot0Rs%2F-MIGhjc8jahjSrerolgy%2F-MIGjtD-xJrskIzsNwl1%2FSeries_Cuencas_mejor-ajuste_Documentacion_en.svg?alt=media\&token=39e35567-a8c8-4975-902e-efc1b6e00520)

## Hydrological Series Simulated

The results of the hydrological model were generated for 605 basins in Costa Rica and cover the period from 1985 to 2019, at monthly and annual scales. The time series of the simulated hydrological variables, as well as the type of statistical aggregation, are shown in the following table:

| Variable                     | Label | Units | Aggregation | Description                                                                             |
| ---------------------------- | ----- | ----- | ----------- | --------------------------------------------------------------------------------------- |
| Precipitation                | P     | mm    | sum         | Bias corrected precipitation from CHIRPS                                                |
| Average daily streamflow     | Qt    | m3/s  | mean        | Total streamflow from the upstream area                                                 |
| Actual Evapotranspiration    | AET   | mm    | sum         | Evapotranspiration of vegetation + evaporation of soil and water                        |
| Potential Evapotranspiration | PET   | mm    | sum         | Potential Evapotranspiration                                                            |
| Runoff                       | Qd    | mm    | sum         | Surface runoff (effective precipitation) at sub-catchment scale                         |
| Baseflow                     | Qb    | mm    | sum         | Contribution of water from the three layers of soil to the river at sub-catchment scale |
| Total flow                   | Q     | mm    | sum         | Sum of runoff and baseflow at sub-catchment scale                                       |
| Infiltration                 | Infil | mm    | sum         | Infiltration at the upper soil layers                                                   |
| Soil Moisture                | SM    | mm    | mean        | Sum of the soil moisture in the three soil layers                                       |

## Hydrological Indices

Hydrological indices are particularly useful for the synthesis of the long-term hydrological behavior of catchments, allowing the evaluation of spatial patterns in large regions. From the results obtained with **HYPE CR 1.0**, different hydrological indices were estimated, and are available in the web application.

| Name                   | Label | Description                                                                                                                                                                        |
| ---------------------- | ----- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Evaporative Index      | EI    | Relates the amount of water that is lost by current evapotranspiration with the water available as precipitation (EI = AET / P)                                                    |
| Aridity Index          | AI    | Relates the energy available to generate evapotranspiration with the water available as precipitation (AI = PET / P)                                                               |
| Baseflow Index         | BFI   | Relates the amount of water that the soil layers and aquifers contribute to the hydrological behavior of rivers with respect to the total volume of water in rivers (BFI = Qb / Q) |
| Streamflow Coefficient | CE    | Indicator of the amount of precipitation that became streamflow in a basin (CE = Q / P)                                                                                            |

## References

* Bamler, R. (1999). *The SRTM mission: A world-wide 30m resolution DEM from SAR interferometry in 11 days*. Photogrammetric Week.
* Bontemps, S., Defourny, P., Radoux, J., Van Bogaert, E., Lamarche, C., Achard, F., et al. (2013). *Consistent Global Land Cover Maps for Climate Modeling Communities: Current Achievements of the ESA’s Land Cover CCI*. In ESA Living Planet Symposium.
* Funk, C., Peterson, P., Landsfeld, M., Pedreros, D., Verdin, J., Shukla, S., et al. (2015). *The climate hazards infrared precipitation with stations - A new environmental record for monitoring extremes*. Scientific Data, 2, 1–21. <https://doi.org/10.1038/sdata.2015.66>
* Hengl, T., De Jesus, J. M., Heuvelink, G. B. M., Gonzalez, M. R., Kilibarda, M., Blagotić, A., et al. (2017). *SoilGrids250m: Global gridded soil information based on machine learning*. PLoS ONE. <https://doi.org/10.1371/journal.pone.0169748>
* Lindström, G., Pers, C., Rosberg, J., Strömqvist, J., & Berit, A. (2010). *Development and testing of the HYPE (Hydrological Predictions for the Environment) water quality model for different spatial scales.* Hydrology Research, 4(41.3), 295–319. <https://doi.org/10.2166/nh.2010.007>
* Mu, Q., Zhao, M. and Running, S. W. (2013). *MODIS Global Terrestrial Evapotranspiration (ET) Product (MOD16A2/A3),* Algorithm Theor. Basis Doc.


# Contacts

## Observatory of Water and Global Change (OACG)

The Observatory of Water and Global Change (OACG) is a research unit of the [School of Geography of the University of Costa Rica](https://www.ucr.ac.cr/). It is an interdisciplinary group of academics, professionals, and students who work on issues related to water and global change from research, teaching, and social action.

**Email**: [oacg@ucr.ac.cr](https://app.gitbook.com/s/-MFVwnsCvMhZ6wGot0Rs-1703796690/oacg@ucr.ac.cr)

**Web Site**: [OACG.UCR](https://www.oacg.fcs.ucr.ac.cr/)

**Social Media**: [Facebook](https://www.facebook.com/OACG.UCR)

## Dr. Christian Birkel

Leader of the **OACG**. Doctor in Hydrology focused on the measurement and simulation of *streamflow generation processes* and the *storage of water* and *biogeochemical substances*.

**Email**: [christian.birkel@ucr.ac.cr](https://app.gitbook.com/s/-MFVwnsCvMhZ6wGot0Rs-1703796690/christian.birkel@ucr.ac.cr)

**Profile**: [URC](https://www.geografia.fcs.ucr.ac.cr/index.php/quienes-somos/recurso-humano/christian-birkel) | [ResearchGate](https://www.researchgate.net/profile/Christian_Birkel)

## Dr. Saúl Arciniega Esparza

External collaborator of the **OACG**. A civil engineer with a master's and a doctorate in hydraulics oriented to the management of water resources, the use of remote sensing in hydrology, and data science.

**Email**: [zaul.ae@gmail.com](https://app.gitbook.com/s/-MFVwnsCvMhZ6wGot0Rs-1703796690/zaul.ae@gmail.com)

**Profile**: [ResearchGate](https://www.researchgate.net/profile/Saul_Arciniega-Esparza)

**Social Media**: [Twitter](https://twitter.com/zaul_arciniega) | [LinkedIn](https://www.linkedin.com/in/sa%C3%BAl-arciniega-esparza-07ab9b122/)


# Introducción

## OACG - Hidrología de Costa Rica

Esta aplicación web es un visualizador de **información hidrológica** para 605 cuencas de todo **Costa Rica**, desarrollado a partir del modelo hidrológico [HYPE](https://hypeweb.smhi.se/model-water/about-hype-code/), usando productos de datos globales ajustados con datos disponibles observados en el país. La plataforma ha sido desarrollada utilizando [Python](https://www.python.org/) y librerías open-source.

Esta herramienta **100% gratuita** brinda información hidrológica como *balances hidrológicos*, *indicadores hidrológicos* y *series de tiempo* a diferentes escalas temporales de *precipitación*, *escorrentía*, *evapotranspiración real*, *evapotranspiración potencial*, *infiltración* y *humedad del suelo* de manera libre y de fácil acceso.

Elaborado por el [Observatorio del Agua y Cambio Global (OACG)](https://www.oacg.fcs.ucr.ac.cr/), de la [Escuela de Geografía en la Universidad de Costa Rica](https://www.ucr.ac.cr/), en colaboración con el *Dr. Saúl Arciniega Esparza*, del [Hydrogeology Group](https://www.ingenieria.unam.mx/hydrogeology/), de la [Facultad de Ingeniería de la UNAM](https://www.ingenieria.unam.mx/), México.

En este breve manual se explica cómo utilizar la aplicación web, los datos originarios, el modelo hidrológico con sus resultados y cómo interpretar las simulaciones.

{% hint style="info" %}
Los **datos** de esta aplicación **no son oficiales**, por lo que se debe tener en cuenta que han sido generados principalmente para usos académicos y de divulgación.
{% endhint %}

{% hint style="info" %}
La aplicación web de **OACG - Hidrología de Costa Rica** ha sido desarrollada para pantallas de al menos 13 pulgadas, por lo que no se recomienda utilizar en dispositivos móviles como celulares. Además, se recomienda lanzar la aplicación en exploradores web como *Mozilla Firefox*, *Microsoft Edge* o *Google Chrome*.
{% endhint %}

{% content-ref url="/pages/-MHHIcO6zMKPK2Ki-ZMK" %}
[Broken mention](broken://pages/-MHHIcO6zMKPK2Ki-ZMK)
{% endcontent-ref %}

## Agradecimientos

La elaboración de esta aplicación se debe al esfuerzo de varias instituciones que han colaborado ya sea con el acceso a la información hidrológica para la calibración del modelo hidrológico, así como colaboración para el procesamiento de la información. Queremos agradecer particularmente al **Instituto Costarricense de Electricidad (ICE)** por compartir la información hidrométrica utilizada para la calibración del modelo, al **Instituto Meteorológico Nacional (IMN)** quien proporcionó la información climatológica para la corrección de los datos satelitales, y al **Centro de Investigaciones Geofísicas de la UCR (CIGEFI)** quienes han colaborado con el procesamiento de la información hidrológica.

## Contenido

1. [Tutorial de la Aplicación Web](/tutorial)&#x20;
2. [Documentación](/documentacion)
3. [Contactos](/contactos)


# Tutorial

En esta sección se muestra una breve introducción a la aplicación web del **OACG - Hidrología de Costa Rica** para la visualización, interpretación y descarga de la información hidrológica.

{% content-ref url="/pages/-MHHIcO6zMKPK2Ki-ZMK" %}
[Broken mention](broken://pages/-MHHIcO6zMKPK2Ki-ZMK)
{% endcontent-ref %}

## Elementos de la aplicación

![](https://458755423-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MFVwnsCvMhZ6wGot0Rs%2F-MHU6BOjgMrCrTsIUjz8%2F-MHUDlyYDN5j-N2p3Gja%2FMainWindow_es_edit.png?alt=media\&token=f3808777-4156-420c-9f15-bb95c769953c)

1. Link de la página del Observatorio de Agua y Cambio Global ([OACG](https://www.oacg.fcs.ucr.ac.cr/)).
2. Link de la página de la Universidad de Costa Rica ([UCR](https://www.ucr.ac.cr/)).
3. Selección del idioma de la aplicación (Español/Inglés). Por defecto se encuentra en idioma Español. Cuando se cambia el idioma se debe esperar a que la aplicación actualice todos los componentes, por lo que podría llevar un poco de tiempo.
4. Selección de la variable a visualizar en el mapa. Por defecto se visualiza la precipitación media anual. Para mayor información de las variables disponibles se puede consultar la sección de [Índices Hidrológicos](/documentacion#indices-hidrologicos) en la sección de [Documentación](/documentacion). Cada vez que se cambia la variable en el mapa se debe esperar a que la aplicación cargue los datos necesarios, lo que puede llevar algunos segundos.
5. Mapa de subcuencas en Costa Rica utilizadas para la simulación hidrológica. Al pasar el cursor sobre alguna cuenca se mostrarán los atributos de la cuenca, iniciando por el indice de la subcuenca (ID), el cual se asocia con las series de tiempo visualizadas en la ventana 10. Al dar clic sobre alguna subcuenca, esta se mantiene seleccionada. Se pueden seleccionar múltiples subcuencas si se mantiene presionada la tecla Shift.
6. Opción de opacidad de la capa de subcuencas. Al cambiar la opacidad se reinicia la presentación de la capa de subcuencas, por lo que este proceso puede llegar a tardar algunos segundos en mostrar alguna actualización.
7. Agregación temporal de las series hidrológicas (mensual, anual, estacional o promedio mensual). La operación estadística aplicada a cada serie se muestra en la sección de [Series Hidrológicas Simuladas](/documentacion#series-hidrologicas-simuladas).
8. Tipo de selección de series espaciales. Por defecto se encuentra activada la opción de *Subcuenca*, la cual permite extraer las series temporales únicamente para el área de la subcuenca. Al activar la opción de *Cuenca*, la serie de tiempo resultante es la ponderación de las series de todas las cuencas de aportación aguas arriba de la subcuenca seleccionada.
9. Selección de las variables hidrológicas a visualizar. Se puede seleccionar más de una variable al mismo tiempo, para lo cual se creará un eje por variable (se recomienda visualizar máximo tres variables).
10. Área de visualización de la series hidrológicas. Cuando la ventana del dispositivo es muy angosta, el área de la gráfica se posiciona debajo del mapa de las subcuencas.
11. Actualización de la gráfica de series hidrológicas. Se recomienda presionar después de seleccionar más cuencas en el mapa, pero no es necesario si se cambian las opciones de variables ya que están actualizan automáticamente la figura.
12. Exportar las series de tiempo que se visualizan en la figura. Esta opción permite descargar un archivo delimitado por comas (csv) con las series temporales de las cuencas y variables seleccionadas.

{% hint style="info" %}
El caudal medio diario siempre corresponde a la aportación de toda la cuenca, en donde la subcuenca seleccionada es la parte más baja de la cuenca.
{% endhint %}

## Visualización de series de tiempo

### Visualizar serie para una subcuenca

Para visualizar una serie de tiempo para una subcuenca se deben seguir los pasos descritos a continuación:

![](https://458755423-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MFVwnsCvMhZ6wGot0Rs%2F-MHWj8PZhEEA14SQ2aXr%2F-MHWrIYm87Rv_QbXizi-%2FTimeseries_1_es.png?alt=media\&token=fdcd45a8-a085-407e-9dd6-636483ff9a55)

1. Se selecciona la subcuenca de interés dando clic sobre el mapa.
2. Se indica la escala temporal y se selecciona la opción de *Subcuenca*.
3. Se selecciona la variable a visualizar. Si se selecciona más de una variable, la figura se dividirá en varios ejes.
4. Si se selecciona primero la variable y luego la subcuenca, es necesario presionar el botón *Graficar Series* para que se actualice la figura.
5. El indicador de la cuenca (ID) se muestra como leyenda de la figura para que se pueda asociar con el ID  de la cuenca en el mapa.

### Visualización de múltiples subcuencas y series

![](https://458755423-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MFVwnsCvMhZ6wGot0Rs%2F-MHWj8PZhEEA14SQ2aXr%2F-MHX0lU0z4_Ka8wGhWww%2FTimeseries_2_es.png?alt=media\&token=bcf63a41-bfd4-4a04-8588-c34245c9c266)

1. Se seleccionan las subcuencas de interés dando *Shift* + clic sobre el mapa.
2. Se indica la escala temporal y se selecciona la opción de *Subcuenca*.
3. Se seleccionan la variables a visualizar.
4. Si se seleccionan primero la variables y luego la subcuencas, es necesario presionar el botón *Graficar Series* para que se actualice la figura.
5. El indicador de la cuenca (ID) se muestra como leyenda de la figura para que se pueda asociar con el ID  de la cuenca en el mapa. A cada cuenca se le asigna el mismo color de línea en las series para todos las variables visualizadas.

### Herramientas de visualización de series de tiempo

![](https://458755423-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MFVwnsCvMhZ6wGot0Rs%2F-MHX4M1ROQMjeiZg5RlE%2F-MHX71zni76D818jbNhO%2FTimeseries_3_es.png?alt=media\&token=4a239a1b-408a-4426-ab05-276af7b4f0d5)

1. Al posicionar el cursos sobre alguna serie de tiempo, se mostrará encima de ella una etiqueta que muestra dentro del recuadro el mes y día, año y el valor de la serie de tiempo (Mes día, Año, Valor). Fuera del recuadro se muestra en ID de la cuenca, que corresponde al que se muestra en la leyenda y que se asocia con el mapa.
2. Esta herramienta permite descargar la figura actual en formato png.
3. Herramientas de zoom para controlar la visualización de las series.
4. Herramienta que coloca líneas punteadas sobre la intersección en la serie seleccionada. Por defecto se encuentra desactivada.
5. Herramientas de etiquetas para las series seleccionadas. Por defecto se encuentra seleccionada la opción de etiqueta única para la serie seleccionada, pero se puede activar la opción que muestre la etiqueta de todas las series para la fecha seleccionada con el cursor.

## Visualización de cuencas

![](https://458755423-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MFVwnsCvMhZ6wGot0Rs%2F-MHXNmnhtSyaZGsilhZu%2F-MHXPw-1JVNGg-m-7AaO%2FCuencas_1_es.png?alt=media\&token=07c5faf6-e230-4a55-a412-361a13d64dc2)

La mayoría de las series hidrológicas fueron simuladas a escala de subcuenca, a excepción del caudal medio diario que corresponde a la aportación total del área aguas arriba del punto de descarga de la subcuenca seleccionada.

Si se requiere obtener, por ejemplo, la precipitación media de toda la cuenca de aportación hasta la salida de la subcuenca seleccionada, se debe seleccionar la opción de *Cuenca*, tal y como se muestra en la siguiente imagen. Al tener seleccionada esta opción, al dar clic sobre una cuenca se marcarán en el mapa con color negro todas las subcuencas que aportan hasta la salida de la subcuenca seleccionada.

Las series en este caso son ponderadas considerando el área de cada subcuenca marcada en color negro, de tal manera que la variable X promedio estaría dada por:

$$
X = \frac{X1 \* A1 + X2 \* A2 + ... + Xn \* An} {A1 + A2 + ... + An} = \frac{\sum\_{i=1}^{n}Xi \* Ai} {Atotal}
$$

en donde X es la variable promedio en toda la cuenca, Xi es la variable de la subcuenca i, Ai es el área de la subcuenca i, Atotal es el área total de la cuenca (obtenida de la suma de todas las subcuencas).

## Exportar series hidrológicas

![](https://458755423-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MFVwnsCvMhZ6wGot0Rs%2F-MHXQ22avG6mDLlUL5e4%2F-MHXTX9_FPg3BOrc_ynA%2FExportar_1_es.png?alt=media\&token=816f925b-6b6a-4df5-8c83-6c2662b09041)

Todas las series disponibles para su visualización en la aplicación pueden ser descargadas en archivos delimitados por coma (csv). Para exportar las series hidrológicas, primero es necesario visualizarlas siguiendo los pasos que se han descrito en secciones anteriores. Una vez que se han seleccionado las subcuencas o cuencas y las variables de interés se presiona el botón *Descargar Datos*. El archivo descargado contiene en el primer renglón la variable y en el segundo renglón el ID de la subcuenca, por lo que se genera un archivo para todas las cuencas y variables seleccionadas.

También se debe tener en cuenta que las series se descargan considerando la escala temporal seleccionada y si se quiere obtener la variable promedio por toda la cuenca de aportación o sólo para las subcuencas seleccionadas.


# Documentación

En esta sección se muestra una breve descripción de la metodología y las fuentes de información utilizadas para realizar la simulación hidrológica en Costa Rica.&#x20;

{% hint style="info" %}
Para mayor información de la metodología utilizada y el modelo hidrológico utilizado se puede consultar la **publicación** de [Arciniega-Esparza et al. (2022)](https://hess.copernicus.org/articles/26/975/2022/).

La **base de datos** de las simulaciones hidrológicas para Costa Rica está disponible en [Zenodo](https://doi.org/10.5281/zenodo.4029572).
{% endhint %}

## Bases de datos

Se utilizó el modelo digital de elevación [SRTM](https://dwtkns.com/srtm30m/) (*Bamler, 1999*) de dominio publico con tamaño pixel de 30m corregido con la red hídrica nacional como base para delimitar las cuencas del país. El raster de cobertura vegetal (300m) fue obtenido del producto [CCI Land Cover](http://maps.elie.ucl.ac.be/CCI/viewer/index.php) (*Bontemps et al., 2013*) y las características físicas de los suelos se obtuvieron de [SoilGrids](https://soilgrids.org/) a 250m (*Hengl et al., 2017*).

Debido a la escasez de datos hidrológicos observados, se usaron datos de diferentes fuentes gratuitas para correr y evaluar el modelo. Los datos climáticos de entrada al modelo provienen de [CHIRPSv2](https://www.chc.ucsb.edu/data/chirps) (*Funk et al., 2015*) para precipitación diaria y temperatura del aire del producto del producto [CPC Global Daily Temperature de la NOAA](https://psl.noaa.gov/).

El producto de precipitación fue corregido con datos observados de 75 estaciones disponibles del país mediante un método de corrección lineal de sesgo (sesgo=Xobs/Xsatelite). Los datos de temperatura fueron corregidos con la elevación del terreno debido a la falta de registros para la corrección de sesgo. Se usaron productos globales de evapotranspiración potencial (PET) y evapotranspiración actual (ETA) del satélite [MODIS 16A3](https://www.ntsg.umt.edu/project/modis/mod16.php) (*Mu et al., 2011*) para ajustar el balance hidrológico.

La descripción de las fuentes utilizadas se muestra en la tabla siguiete:

| **Dataset**            | **Variable**                 | **Etiqueta**   | **Resolución** | **Periodo**   | **Escala** | **Tipo de dato**                                           |
| ---------------------- | ---------------------------- | -------------- | -------------- | ------------- | ---------- | ---------------------------------------------------------- |
| CHIRPSv2               | Precipitación                | P              | 0.05°          | 1981-presente | Diario     | Unión de percepción remota y calibrado con datos en tierra |
| MODIS16                | Evapotranspiración           | ETA,PET        | 5km            | 2000-2014     | Mensual    | Precepción remota                                          |
| CPC Global Temperature | Temperatura                  | Tmin,Tmax,Tmed | 0.5°           | 1979-presente | Diario     | Mallado de estaciones                                      |
| CCI Land Cover         | Covertura vegetal            | Uso de suelo   | 300m           | 1993-2015     | Anual      | Percepción remota                                          |
| SoilGrids              | Contenido de arena y arcilla | Tipo de suelo  | 250m           | -             | -          | MachineLearning a partir de perfiles de suelo              |
| SRTM                   | Elevación de terreno         | DEM            | 30m            | -             | -          | Interferrometría SAR                                       |

## Modelo hidrológico

Las simulaciones se realizaron con el modelo semi-distribuido, conceptual, basado en procesos hidrológicos [HYPE](https://hypeweb.smhi.se/model-water/) (*Lindström et al., 2010*).

![Esquema de la discritización en subcuencas del modelo y los procesos simulados por HYPE. Fuente: Lindström et al. (2010)](https://458755423-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MFVwnsCvMhZ6wGot0Rs%2F-MG6WaPMyie2sHjN866u%2F-MG6YLUvNHLJjM_-sr9O%2FEsquema_HYPE.png?alt=media\&token=be326212-6aac-4ce8-8f60-b2b711c95571)

El código fuente de **HYPE** se puede descargar desde [sourceforge](https://sourceforge.net/projects/hype/files/). Para mayor información del modelo se puede consultar la [documentación oficial](http://www.smhi.net/hype/wiki/doku.php).

## Calibración y desempeño del modelo

La calibración y validación de **HYPE** se realizó mediante datos observados de caudal diario en 13 cuencas de Costa Rica, con un periodo de calibración de 1991 a 1999 y un periodo de validación del 2000 a 2003. Adicionalmente, se usaron productos globales de evapotranspiración potencial (PET) y evapotranspíración actual (ETA) de **MODIS** para ajustar el balance hidrológico para el periodo del 2001 a 2010, con un periodo de validación del 2011 a 2014.

La calibración del modelo se desarrolló por pasos, iniciando por la calibración de la evapotranspiración potencial (PET) mensual, la evapotranspiración actual (ETA) mensual, el caudal (Qt) mensual y finalmente usando los datos del caudal (Qt) diario. En la siguiente figura se muestra el desempeño del modelo para simular el caudal mensual en las 13 cuencas con datos hidrométricos.

![Comparación del caudal mensual observado y simulado en las 13 cuencas monitoreadas](https://458755423-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MFVwnsCvMhZ6wGot0Rs%2F-MHHc761AgMbAeevFbPZ%2F-MHI3x8C9Ql41G-bGh8V%2FCorrelacion_Qtm_Documentacion_es.svg?alt=media\&token=ba62f7be-c7c6-43cb-9fdd-653b973c5c87)

Los resultados obtenidos corresponden a la primera versión del modelo regional de Costa Rica con el modelo HYPE (**HYPE CR 1.0**), el cual se seleccionó de un conjunto de modelos que generaron desempeño similar respecto al caudal observado, sin embargo, **HYPE CR 1.0** ha generado un desempeño equilibrado con caudal (Qt), evapotranspiración actual (ETA) y evapotranspiración potencial (PET). Así mismo, se debe tener en cuenta que existe incertidumbre con el modelo **HYPE CR 1.0** debido a que valores diferentes de los parámetros generaron resultados similares, tal y como se puede apreciar en la siguiente imagen.

![Comparación de modelos calibrados con desempeño similar en una cuenca de Costa Rica](https://458755423-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MFVwnsCvMhZ6wGot0Rs%2F-MHI9AFM56f1sjzKFWfe%2F-MHIQ95AFNYfRysaQ324%2FSeries_Cuencas_mejor-ajuste_Documentacion_es.svg?alt=media\&token=5ebb0432-2452-4f68-b4cd-4ade06640962)

## Series Hidrológicas Simuladas

Los resultados del modelo hidrológico se generaron para 605 cuencas en Costa Rica y cubren el periodo de 1985 al 2019, a escala mensual y anual. Las series de tiempo de las variables hidrológicas simuladas, así como el tipo de agregación estadística se muestran en la tabla siguiente:

| Variable                     | Etiqueta | Unidades | Agregación | Descripción                                                                |
| ---------------------------- | -------- | -------- | ---------- | -------------------------------------------------------------------------- |
| Precipitación                | P        | mm       | suma       | Precipitación corregida de CHIRPS                                          |
| Gasto medio diario           | Qt       | m3/s     | promedio   | Gasto total de toda el área de aportación aguas arriba                     |
| Evapotranspiración Real      | ETR      | mm       | suma       | Evapotranspiración de la vegetación + evaporación del suelo y agua         |
| Evapotranspiración Potencial | PET      | mm       | suma       | Evapotranspiración potencial                                               |
| Escurrimiento                | Qd       | mm       | suma       | Escurrimiento superficial (precipitación efectiva) a escala de subcuenca   |
| Caudal base                  | Qb       | mm       | suma       | Aportación de agua de las tres capas de suelo al río a escala de subcuenca |
| Caudal total                 | Q        | mm       | suma       | Suma del escurrimiento y caudal base                                       |
| Infiltración                 | Infil    | mm       | suma       | Infiltración en las capas superiores                                       |
| Humedad del suelo            | SM       | mm       | promedio   | Suma de la humedad del suelo en las tres capas de suelo                    |

## Índices Hidrológicos

Los índices hidrológicos son particularmente útiles para sintetizar el comportamiento hidrológico de largo plazo de las cuencas, lo que permite evaluar patrones espaciales en grandes regiones. A partir de los resultados obtenidos con **HYPE CR 1.0** se estimaron distintos indices hidrológicos, los cuales se pueden visualizar desde la aplicación web.

| Nombre                       | Etiqueta | Descripción                                                                                                                                                                  |
| ---------------------------- | -------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Índice Evaporativo           | IE       | Relaciona la cantidad de agua que se pierde por evapotranspiración real con el agua disponible como precipitación (IE=ETR/P)                                                 |
| Índice de Aridéz             | IA       | Relaciona la energía disponible para generar evapotranspiración con el agua disponible como precipitación (IA=PET/P)                                                         |
| Índice de Gasto Base         | IGB      | Relaciona la cantidad de agua que aportan el subsuelo y los acuíferos al comportamiento hidrológico de los ríos con respecto al volumen total de agua en los ríos (IGB=Qb/Q) |
| Coeficiente de Escurrimiento | CE       | Es un indicador de la cantidad de precipitación que se convirtió en caudal en una cuenca (CE=Q/P)                                                                            |

## Referencias

* Bamler, R. (1999). *The SRTM mission: A world-wide 30m resolution DEM from SAR interferometry in 11 days*. Photogrammetric Week.
* Bontemps, S., Defourny, P., Radoux, J., Van Bogaert, E., Lamarche, C., Achard, F., et al. (2013). *Consistent Global Land Cover Maps for Climate Modeling Communities: Current Achievements of the ESA’s Land Cover CCI*. In ESA Living Planet Symposium.
* Funk, C., Peterson, P., Landsfeld, M., Pedreros, D., Verdin, J., Shukla, S., et al. (2015). *The climate hazards infrared precipitation with stations - A new environmental record for monitoring extremes*. Scientific Data, 2, 1–21. <https://doi.org/10.1038/sdata.2015.66>
* Hengl, T., De Jesus, J. M., Heuvelink, G. B. M., Gonzalez, M. R., Kilibarda, M., Blagotić, A., et al. (2017). *SoilGrids250m: Global gridded soil information based on machine learning*. PLoS ONE. <https://doi.org/10.1371/journal.pone.0169748>
* Lindström, G., Pers, C., Rosberg, J., Strömqvist, J., & Berit, A. (2010). *Development and testing of the HYPE (Hydrological Predictions for the Environment) water quality model for different spatial scales.* Hydrology Research, 4(41.3), 295–319. <https://doi.org/10.2166/nh.2010.007>
* Mu, Q., Zhao, M. and Running, S. W. (2013). *MODIS Global Terrestrial Evapotranspiration (ET) Product (MOD16A2/A3),* Algorithm Theor. Basis Doc.


# Contactos

## Observatorio del Agua y Cambio Global (OACG)

*El Observatorio del Agua y Cambio Global (OACG) es una unidad de investigación de la* [*Escuela de Geografía de la Universidad de Costa Rica*](https://www.ucr.ac.cr/)*. Es un grupo interdisciplinario de académicos, profesionales y estudiantes que trabajan en temas relacionados al agua y el cambio global desde la investigación, la docencia y la acción social.*

**Email**: [oacg@ucr.ac.cr](https://app.gitbook.com/s/-MFVwnsCvMhZ6wGot0Rs-887967055/oacg@ucr.ac.cr)

**Sitio Oficial**: [OACG.UCR](https://www.oacg.fcs.ucr.ac.cr/)

**Redes sociales**: [Facebook](https://www.facebook.com/OACG.UCR)

## Dr. Christian Birkel

*Lider del **OACG.** Doctor en hidrología enfocado en la medición y simulación de procesos de la generación de escorrentía y el almacenamiento de agua y sustancias biogeoquímicas.*

**Email**: [christian.birkel@ucr.ac.cr](https://app.gitbook.com/s/-MFVwnsCvMhZ6wGot0Rs-887967055/christian.birkel@ucr.ac.cr)

**Perfil**: [URC](https://www.oacg.fcs.ucr.ac.cr/index.php/acerca-de/investigadores) | [ResearchGate](https://www.researchgate.net/profile/Christian_Birkel)

## Dr. Saúl Arciniega Esparza

*Colaborador externo del **OACG**. Ingeniero civil con maestría y doctorado en hidráulica con orientación al manejo de recursos hídricos, uso de percepción remota en hidrología y ciencia de datos.*

**Email**: [zaul.ae@gmail.com](https://app.gitbook.com/s/-MFVwnsCvMhZ6wGot0Rs-887967055/zaul.ae@gmail.com)

**Perfil**: [ResearchGate](https://www.researchgate.net/profile/Saul_Arciniega-Esparza)

**Redes Sociales**: [Twitter](https://twitter.com/zaul_arciniega) | [LinkedIn](https://www.linkedin.com/in/sa%C3%BAl-arciniega-esparza-07ab9b122/)


