.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "auto_examples/szeged_hungry.py" .. LINE NUMBERS ARE GIVEN BELOW. .. only:: html .. note:: :class: sphx-glr-download-link-note :ref:`Go to the end ` to download the full example code. .. rst-class:: sphx-glr-example-title .. _sphx_glr_auto_examples_szeged_hungry.py: ========================= Szeged Hungary ========================= .. GENERATED FROM PYTHON SOURCE LINES 6-15 .. code-block:: Python if __name__ == '__main__': import os import site # add parent directory to path et_dir = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) print(et_dir) site.addsitedir(et_dir) .. rst-class:: sphx-glr-script-out .. code-block:: pytb Traceback (most recent call last): File "/home/docs/checkouts/readthedocs.org/user_builds/etutil/checkouts/latest/examples/szeged_hungry.py", line 11, in et_dir = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) NameError: name '__file__' is not defined .. GENERATED FROM PYTHON SOURCE LINES 16-60 .. code-block:: Python import pandas as pd from ETUtil.et_methods import PenmanMonteith # This should be a good example for missing data/interpolation of input data # https://www.kaggle.com/budincsevity/szeged-weather?select=weatherHistory.csv df = pd.read_csv( "/mnt/datawaha/hyex/atr/weatherHistory.csv", #na_values="-", delimiter=',' ) idx_str = df['Formatted Date'].astype(str) x = [] for i in idx_str: x.append(i[0:19]) df.index = pd.to_datetime(x) df = df[['Temperature (C)', 'Humidity', 'Wind Speed (km/h)']] df = df.rename(columns={'Temperature (C)': 'temp', 'Humidity': 'rel_hum', 'Wind Speed (km/h)': 'wind_speed', }) df = df.apply(pd.to_numeric) units = {'temp': 'Centigrade', 'rel_hum': 'percent', 'wind_speed': 'MilesPerHour'} constants = dict() constants['lat_dec_deg'] = 46.2529984 constants['altitude'] = 76 # These values are not accurate constants['a_s'] = 0.23 constants['albedo'] = 0.23 constants['b_s'] = 0.5 constants['wind_z'] = 2 eto_model = PenmanMonteith(df, units=units, constants=constants, verbosity=2, calculate_at='60mins') eto = eto_model() .. rst-class:: sphx-glr-timing **Total running time of the script:** (0 minutes 0.001 seconds) .. _sphx_glr_download_auto_examples_szeged_hungry.py: .. only:: html .. container:: sphx-glr-footer sphx-glr-footer-example .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: szeged_hungry.ipynb ` .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: szeged_hungry.py ` .. container:: sphx-glr-download sphx-glr-download-zip :download:`Download zipped: szeged_hungry.zip ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_