.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "auto_examples/austin.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_austin.py: ================ Austin Weather ================ .. GENERATED FROM PYTHON SOURCE LINES 6-14 .. 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/austin.py", line 10, in et_dir = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) NameError: name '__file__' is not defined .. GENERATED FROM PYTHON SOURCE LINES 15-58 .. code-block:: Python import pandas as pd from ETUtil import PenmanMonteith # This example shows when solar radiation is not given then it can be calculated from temperature data. fpath = "/mnt/datawaha/hyex/atr/datasets_1923_3359_austin_weather.csv" # https://www.kaggle.com/grubenm/austin-weather?select=austin_weather.csv df = pd.read_csv(fpath, na_values="-") df.index = pd.to_datetime(df['Date']) df.index.freq = pd.infer_freq(df.index) df = df[['TempHighF', 'TempLowF', 'DewPointAvgF', 'HumidityAvgPercent', 'WindAvgMPH']] df = df.rename(columns={'TempHighF': 'tmax', 'TempLowF': 'tmin', 'HumidityAvgPercent': 'rel_hum', 'DewPointAvgF': 'tdew', 'WindAvgMPH': 'wind_speed', }) df = df.apply(pd.to_numeric) units = {'tmin': 'Fahrenheit', 'tmax': 'Fahrenheit', 'rel_hum': 'percent', 'tdew': 'Fahrenheit', 'wind_speed': 'MilesPerHour'} constants = dict() constants['lat_dec_deg'] = 30.266666 constants['altitude'] = 305 # 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) pet = eto_model() eto_model.plot_outputs() eto_model.plot_inputs() .. rst-class:: sphx-glr-timing **Total running time of the script:** (0 minutes 0.001 seconds) .. _sphx_glr_download_auto_examples_austin.py: .. only:: html .. container:: sphx-glr-footer sphx-glr-footer-example .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: austin.ipynb ` .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: austin.py ` .. container:: sphx-glr-download sphx-glr-download-zip :download:`Download zipped: austin.zip ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_