Beispiel #1
0
def _get_extra_radiation_shim(datetime_or_doy, solar_constant=1366.1,
    method='spencer', epoch_year=2014, **kwargs):
    if method == 'spencer':
        if not isinstance(datetime_or_doy, (float, int)):
            dayofyear = datetime_or_doy.timetuple().tm_yday
        else:
            dayofyear = datetime_or_doy
        B = (2.*pi/365.)*(dayofyear - 1)
        RoverR0sqrd = (1.00011 + 0.034221*cos(B) + 0.00128*sin(B) +
        0.000719*cos(2.0*B) + 7.7e-05*sin(2.0*B))

        Ea = solar_constant * RoverR0sqrd
        return Ea
    from pvlib import get_extra_radiation
    return get_extra_radiation(datetime_or_doy=datetime_or_doy,
                              solar_constant=solar_constant,
                              method=method,
                              epoch_year=epoch_year,
                              **kwargs)
Beispiel #2
0
def _get_extra_radiation_shim(datetime_or_doy, solar_constant=1366.1,
    method='spencer', epoch_year=2014, **kwargs):
    if method == 'spencer':
        if not isinstance(datetime_or_doy, (float, int)):
            dayofyear = datetime_or_doy.timetuple().tm_yday
        else:
            dayofyear = datetime_or_doy
        B = (2.*pi/365.)*(dayofyear - 1)
        RoverR0sqrd = (1.00011 + 0.034221*cos(B) + 0.00128*sin(B) +
        0.000719*cos(2.0*B) + 7.7e-05*sin(2.0*B))

        Ea = solar_constant * RoverR0sqrd
        return Ea
    from pvlib import get_extra_radiation
    return get_extra_radiation(datetime_or_doy=datetime_or_doy,
                              solar_constant=solar_constant,
                              method=method,
                              epoch_year=epoch_year,
                              **kwargs)