woodcrafty / PyETo

Python package for calculating reference/potential evapotranspiration (ETo).
BSD 3-Clause "New" or "Revised" License
153 stars 81 forks source link

Missing function #7

Closed Dan-in-CA closed 4 years ago

Dan-in-CA commented 4 years ago

Hi, I really like your code. I am working on an ET0 plugin for my SIP Python irrigation software http://dan-in-ca.github.io/SIP/

while developing a function to calculate the Penman Monteith equation using your code I ran into a small problem.

In your definition of sol_rad_from_sun_hours() on line 599 - 600 of fao.py it states: :param sunshine_hours: Sunshine duration [hours]. Can be calculated using sunshine_hours(). But there is not a sunshine_hours() function that I can find. Am I missing something?

Thanks in advance. Dan

woodcrafty commented 4 years ago

Hi Dan,

Thanks for your email. I believe that's an error in my comment as there isn't a function to estimate sunshine hours.

If sunshine hours data aren't available you should use fao.sol_rad_from_t() (or fao.sol_rad_island() for small island locations).

From the documentation (docs/fao56_penman_monteith.rst):

Solar (shortwave) radiation


The amount of incoming solar radiation (or shortwave radiation) reaching a
horizontal plane after scattering by the atmosphere. If measured values of
gross incoming solar radiation are not available the following functions (in
order of preference), can be used to estimate it:

1. If sunshine duration data are available use
``fao.sol_rad_from_sun_hours()``.
2. Otherwise use ``fao.sol_rad_from_t()`` which requires minimum and
   maximum temperature. Suitable for coastal or inland areas but not
islands.
3. For island locations (<= 20 km wide), where no measured values are
   available from elsewhere on the island and the altitude is 0-100 m, use
   ``fao.sol_rad_island()``. Only suitable for monthly calculations.

Sorry about that, and hope that helps. I'll fix the comment shortly.

Cheers,
Mark

On Sun, 15 Dec 2019 at 04:18, Dan <notifications@github.com> wrote:

> Hi,
> I really like your code. I am working on an ET0 plugin for my SIP Python
> irrigation software
> http://dan-in-ca.github.io/SIP/
>
> while developing a function to calculate the Penman Monteith equation
> using your code I ran into a small problem.
>
> In your definition of sol_rad_from_sun_hours() on line 599 - 600 of fao.py
> it states:
> :param sunshine_hours: Sunshine duration [hours]. Can be calculated
> using sunshine_hours().
> But there is not a sunshine_hours() function that I can find.
> Am I missing something?
>
> Thanks in advance.
> Dan
>
> —
> You are receiving this because you are subscribed to this thread.
> Reply to this email directly, view it on GitHub
> <https://github.com/woodcrafty/PyETo/issues/7?email_source=notifications&email_token=AB6NA3KO2V6RY6XY6CDQKRLQYWVZLA5CNFSM4J26HN62YY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4IARH4AA>,
> or unsubscribe
> <https://github.com/notifications/unsubscribe-auth/AB6NA3IFQELERBN6EEZFUYDQYWVZLANCNFSM4J26HN6Q>
> .
>
Dan-in-CA commented 4 years ago

Yes. That solved the problem.

Thanks for the quick response.