How to use ETo

This section will describe how to use the ETo package. The ETo class and functions depend heavily on the Pandas package. Nearly all outputs are either as Pandas Series or DataFrames.

Initialising

The package and general usage is via the main ETo class. It can be initialised without any initial input parameters.

from eto import ETo, datasets
import pandas as pd

et1 = ETo()

Parameter estimation

The input data can be read into the class at initiatisation or via the param_est function.

We first need to get an example dataset and read it in via pd.read_csv.

In [1]: ex1_path = datasets.get_path('example_daily')

In [2]: tsdata = pd.read_csv(ex1_path, parse_dates=True, infer_datetime_format=True, index_col='date')

In [3]: tsdata.head()
Out[3]: 
             R_s      T_max  T_min   e_a
date                                    
2000-01-01  13.4  17.700001   13.7  1.60
2000-01-02  14.7  19.600000   13.0  1.68
2000-01-03  12.2  21.700001    9.2  1.09
2000-01-04   4.2  14.400000    8.4  1.04
2000-01-05  14.1  11.700000    8.9  1.12

Now we can run the parameter estimation using the newly loaded in dataset using the parameters below.

In [4]: z_msl = 500

In [5]: lat = -43.6

In [6]: lon = 172

In [7]: TZ_lon = 173

In [8]: freq = 'D'

In [9]: et1.param_est(tsdata, freq, z_msl, lat, lon, TZ_lon)

In [10]: et1.ts_param.head()
Out[10]: 
             R_s      T_max  T_min   e_a  ...       e_s     delta        R_a  U_2
date                                      ...                                    
2000-01-01  13.4  17.700001   13.7  1.60  ...  1.796562  0.114199  44.443793  2.0
2000-01-02  14.7  19.600000   13.0  1.68  ...  1.889388  0.118099  44.386929  2.0
2000-01-03  12.2  21.700001    9.2  1.09  ...  1.879817  0.112606  44.325018  2.0
2000-01-04   4.2  14.400000    8.4  1.04  ...  1.371462  0.089314  44.258075  2.0
2000-01-05  14.1  11.700000    8.9  1.12  ...  1.257693  0.083748  44.186116  2.0

[5 rows x 21 columns]

Calculate ETo

Now it’s just a matter of running the specific ETo function. For example, the FAO ETo.

In [11]: eto1 = et1.eto_fao()

In [12]: eto1.head()
Out[12]: 
date
2000-01-01    2.31
2000-01-02    2.52
2000-01-03    3.20
2000-01-04    1.49
2000-01-05    2.00
Name: ETo_FAO_mm, dtype: float64