.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "auto_examples/daily_methods.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_daily_methods.py: ================= Daily Methods ================= .. 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/daily_methods.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-42 .. code-block:: Python import pandas as pd from ETUtil import PenmanMonteith _df = pd.read_excel(os.path.join(et_dir, 'data/y_river.xlsx')) df = pd.DataFrame() df[['sol_rad', 'rel_hum', 'wind_speed', 'tmin', 'tmax']] = _df[['solar rad', 'humidity', 'wind', 'tmin', 'tmax']] df.index = pd.to_datetime(_df['date']) constants = {'lat_dec_deg': 35.34440, 'altitude': 300} units = {'sol_rad': '', 'rel_hum': 'percentage', 'wind_speed': 'MeterPerSecond', 'tmin': 'Centigrade', 'tmax': 'Centigrade'} # following values are wild guess constants['albedo'] = 0.23 constants['a_s'] = 0.23 constants['b_s'] = 0.5 constants['wind_z'] = 2 pm_pet = PenmanMonteith(df, units, constants) et = pm_pet() pm_pet.plot_outputs() pm_pet.plot_inputs() pm_pet.summary() .. rst-class:: sphx-glr-timing **Total running time of the script:** (0 minutes 0.001 seconds) .. _sphx_glr_download_auto_examples_daily_methods.py: .. only:: html .. container:: sphx-glr-footer sphx-glr-footer-example .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: daily_methods.ipynb ` .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: daily_methods.py ` .. container:: sphx-glr-download sphx-glr-download-zip :download:`Download zipped: daily_methods.zip ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_