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('example1')
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 default parameters.
In [4]: et1.param_est(tsdata)
In [5]: et1.ts_param.head()
Out[5]:
R_s T_max T_min e_a R_n G T_mean T_dew \
date
2000-01-01 13.4 17.700001 13.7 1.60 9.285734 0.0 15.70 NaN
2000-01-02 14.7 19.600000 13.0 1.68 10.017707 0.0 16.30 NaN
2000-01-03 12.2 21.700001 9.2 1.09 8.475450 0.0 15.45 NaN
2000-01-04 4.2 14.400000 8.4 1.04 4.385135 0.0 11.40 NaN
2000-01-05 14.1 11.700000 8.9 1.12 9.540114 0.0 10.30 NaN
RH_min RH_max ... n_sun U_z P gamma e_max \
date ...
2000-01-01 NaN NaN ... NaN NaN 95.527647 0.063526 2.025376
2000-01-02 NaN NaN ... NaN NaN 95.527647 0.063526 2.281006
2000-01-03 NaN NaN ... NaN NaN 95.527647 0.063526 2.595970
2000-01-04 NaN NaN ... NaN NaN 95.527647 0.063526 1.640576
2000-01-05 NaN NaN ... NaN NaN 95.527647 0.063526 1.375058
e_min e_s delta R_a U_2
date
2000-01-01 1.567747 1.796562 0.114199 44.443793 2.0
2000-01-02 1.497771 1.889388 0.118099 44.386929 2.0
2000-01-03 1.163665 1.879817 0.112606 44.325018 2.0
2000-01-04 1.102347 1.371462 0.089314 44.258075 2.0
2000-01-05 1.140328 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 [6]: eto1 = et1.eto_fao()
In [7]: eto1.head()
Out[7]:
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