partition
stringclasses
3 values
func_name
stringlengths
1
134
docstring
stringlengths
1
46.9k
path
stringlengths
4
223
original_string
stringlengths
75
104k
code
stringlengths
75
104k
docstring_tokens
listlengths
1
1.97k
repo
stringlengths
7
55
language
stringclasses
1 value
url
stringlengths
87
315
code_tokens
listlengths
19
28.4k
sha
stringlengths
40
40
train
poa_components
r''' Determine in-plane irradiance components. Combines DNI with sky diffuse and ground-reflected irradiance to calculate total, direct and diffuse irradiance components in the plane of array. Parameters ---------- aoi : numeric Angle of incidence of solar rays with respect to the modu...
pvlib/irradiance.py
def poa_components(aoi, dni, poa_sky_diffuse, poa_ground_diffuse): r''' Determine in-plane irradiance components. Combines DNI with sky diffuse and ground-reflected irradiance to calculate total, direct and diffuse irradiance components in the plane of array. Parameters ---------- aoi : nu...
def poa_components(aoi, dni, poa_sky_diffuse, poa_ground_diffuse): r''' Determine in-plane irradiance components. Combines DNI with sky diffuse and ground-reflected irradiance to calculate total, direct and diffuse irradiance components in the plane of array. Parameters ---------- aoi : nu...
[ "r", "Determine", "in", "-", "plane", "irradiance", "components", "." ]
pvlib/pvlib-python
python
https://github.com/pvlib/pvlib-python/blob/2e844a595b820b43d1170269781fa66bd0ccc8a3/pvlib/irradiance.py#L448-L505
[ "def", "poa_components", "(", "aoi", ",", "dni", ",", "poa_sky_diffuse", ",", "poa_ground_diffuse", ")", ":", "poa_direct", "=", "np", ".", "maximum", "(", "dni", "*", "np", ".", "cos", "(", "np", ".", "radians", "(", "aoi", ")", ")", ",", "0", ")", ...
2e844a595b820b43d1170269781fa66bd0ccc8a3
train
get_ground_diffuse
Estimate diffuse irradiance from ground reflections given irradiance, albedo, and surface tilt Function to determine the portion of irradiance on a tilted surface due to ground reflections. Any of the inputs may be DataFrames or scalars. Parameters ---------- surface_tilt : numeric ...
pvlib/irradiance.py
def get_ground_diffuse(surface_tilt, ghi, albedo=.25, surface_type=None): ''' Estimate diffuse irradiance from ground reflections given irradiance, albedo, and surface tilt Function to determine the portion of irradiance on a tilted surface due to ground reflections. Any of the inputs may be DataFr...
def get_ground_diffuse(surface_tilt, ghi, albedo=.25, surface_type=None): ''' Estimate diffuse irradiance from ground reflections given irradiance, albedo, and surface tilt Function to determine the portion of irradiance on a tilted surface due to ground reflections. Any of the inputs may be DataFr...
[ "Estimate", "diffuse", "irradiance", "from", "ground", "reflections", "given", "irradiance", "albedo", "and", "surface", "tilt" ]
pvlib/pvlib-python
python
https://github.com/pvlib/pvlib-python/blob/2e844a595b820b43d1170269781fa66bd0ccc8a3/pvlib/irradiance.py#L567-L629
[ "def", "get_ground_diffuse", "(", "surface_tilt", ",", "ghi", ",", "albedo", "=", ".25", ",", "surface_type", "=", "None", ")", ":", "if", "surface_type", "is", "not", "None", ":", "albedo", "=", "SURFACE_ALBEDOS", "[", "surface_type", "]", "diffuse_irrad", ...
2e844a595b820b43d1170269781fa66bd0ccc8a3
train
klucher
r''' Determine diffuse irradiance from the sky on a tilted surface using Klucher's 1979 model .. math:: I_{d} = DHI \frac{1 + \cos\beta}{2} (1 + F' \sin^3(\beta/2)) (1 + F' \cos^2\theta\sin^3\theta_z) where .. math:: F' = 1 - (I_{d0} / GHI) Klucher's 1979 model determi...
pvlib/irradiance.py
def klucher(surface_tilt, surface_azimuth, dhi, ghi, solar_zenith, solar_azimuth): r''' Determine diffuse irradiance from the sky on a tilted surface using Klucher's 1979 model .. math:: I_{d} = DHI \frac{1 + \cos\beta}{2} (1 + F' \sin^3(\beta/2)) (1 + F' \cos^2\theta\sin^3\t...
def klucher(surface_tilt, surface_azimuth, dhi, ghi, solar_zenith, solar_azimuth): r''' Determine diffuse irradiance from the sky on a tilted surface using Klucher's 1979 model .. math:: I_{d} = DHI \frac{1 + \cos\beta}{2} (1 + F' \sin^3(\beta/2)) (1 + F' \cos^2\theta\sin^3\t...
[ "r", "Determine", "diffuse", "irradiance", "from", "the", "sky", "on", "a", "tilted", "surface", "using", "Klucher", "s", "1979", "model" ]
pvlib/pvlib-python
python
https://github.com/pvlib/pvlib-python/blob/2e844a595b820b43d1170269781fa66bd0ccc8a3/pvlib/irradiance.py#L682-L766
[ "def", "klucher", "(", "surface_tilt", ",", "surface_azimuth", ",", "dhi", ",", "ghi", ",", "solar_zenith", ",", "solar_azimuth", ")", ":", "# zenith angle with respect to panel normal.", "cos_tt", "=", "aoi_projection", "(", "surface_tilt", ",", "surface_azimuth", ",...
2e844a595b820b43d1170269781fa66bd0ccc8a3
train
haydavies
r''' Determine diffuse irradiance from the sky on a tilted surface using Hay & Davies' 1980 model .. math:: I_{d} = DHI ( A R_b + (1 - A) (\frac{1 + \cos\beta}{2}) ) Hay and Davies' 1980 model determines the diffuse irradiance from the sky (ground reflected irradiance is not included in th...
pvlib/irradiance.py
def haydavies(surface_tilt, surface_azimuth, dhi, dni, dni_extra, solar_zenith=None, solar_azimuth=None, projection_ratio=None): r''' Determine diffuse irradiance from the sky on a tilted surface using Hay & Davies' 1980 model .. math:: I_{d} = DHI ( A R_b + (1 - A) (\frac{1 + \co...
def haydavies(surface_tilt, surface_azimuth, dhi, dni, dni_extra, solar_zenith=None, solar_azimuth=None, projection_ratio=None): r''' Determine diffuse irradiance from the sky on a tilted surface using Hay & Davies' 1980 model .. math:: I_{d} = DHI ( A R_b + (1 - A) (\frac{1 + \co...
[ "r", "Determine", "diffuse", "irradiance", "from", "the", "sky", "on", "a", "tilted", "surface", "using", "Hay", "&", "Davies", "1980", "model" ]
pvlib/pvlib-python
python
https://github.com/pvlib/pvlib-python/blob/2e844a595b820b43d1170269781fa66bd0ccc8a3/pvlib/irradiance.py#L769-L858
[ "def", "haydavies", "(", "surface_tilt", ",", "surface_azimuth", ",", "dhi", ",", "dni", ",", "dni_extra", ",", "solar_zenith", "=", "None", ",", "solar_azimuth", "=", "None", ",", "projection_ratio", "=", "None", ")", ":", "# if necessary, calculate ratio of titl...
2e844a595b820b43d1170269781fa66bd0ccc8a3
train
reindl
r''' Determine diffuse irradiance from the sky on a tilted surface using Reindl's 1990 model .. math:: I_{d} = DHI (A R_b + (1 - A) (\frac{1 + \cos\beta}{2}) (1 + \sqrt{\frac{I_{hb}}{I_h}} \sin^3(\beta/2)) ) Reindl's 1990 model determines the diffuse irradiance from the sky (ground ...
pvlib/irradiance.py
def reindl(surface_tilt, surface_azimuth, dhi, dni, ghi, dni_extra, solar_zenith, solar_azimuth): r''' Determine diffuse irradiance from the sky on a tilted surface using Reindl's 1990 model .. math:: I_{d} = DHI (A R_b + (1 - A) (\frac{1 + \cos\beta}{2}) (1 + \sqrt{\frac{I_{h...
def reindl(surface_tilt, surface_azimuth, dhi, dni, ghi, dni_extra, solar_zenith, solar_azimuth): r''' Determine diffuse irradiance from the sky on a tilted surface using Reindl's 1990 model .. math:: I_{d} = DHI (A R_b + (1 - A) (\frac{1 + \cos\beta}{2}) (1 + \sqrt{\frac{I_{h...
[ "r", "Determine", "diffuse", "irradiance", "from", "the", "sky", "on", "a", "tilted", "surface", "using", "Reindl", "s", "1990", "model" ]
pvlib/pvlib-python
python
https://github.com/pvlib/pvlib-python/blob/2e844a595b820b43d1170269781fa66bd0ccc8a3/pvlib/irradiance.py#L861-L962
[ "def", "reindl", "(", "surface_tilt", ",", "surface_azimuth", ",", "dhi", ",", "dni", ",", "ghi", ",", "dni_extra", ",", "solar_zenith", ",", "solar_azimuth", ")", ":", "cos_tt", "=", "aoi_projection", "(", "surface_tilt", ",", "surface_azimuth", ",", "solar_z...
2e844a595b820b43d1170269781fa66bd0ccc8a3
train
king
Determine diffuse irradiance from the sky on a tilted surface using the King model. King's model determines the diffuse irradiance from the sky (ground reflected irradiance is not included in this algorithm) on a tilted surface using the surface tilt angle, diffuse horizontal irradiance, global hor...
pvlib/irradiance.py
def king(surface_tilt, dhi, ghi, solar_zenith): ''' Determine diffuse irradiance from the sky on a tilted surface using the King model. King's model determines the diffuse irradiance from the sky (ground reflected irradiance is not included in this algorithm) on a tilted surface using the surfa...
def king(surface_tilt, dhi, ghi, solar_zenith): ''' Determine diffuse irradiance from the sky on a tilted surface using the King model. King's model determines the diffuse irradiance from the sky (ground reflected irradiance is not included in this algorithm) on a tilted surface using the surfa...
[ "Determine", "diffuse", "irradiance", "from", "the", "sky", "on", "a", "tilted", "surface", "using", "the", "King", "model", "." ]
pvlib/pvlib-python
python
https://github.com/pvlib/pvlib-python/blob/2e844a595b820b43d1170269781fa66bd0ccc8a3/pvlib/irradiance.py#L965-L1004
[ "def", "king", "(", "surface_tilt", ",", "dhi", ",", "ghi", ",", "solar_zenith", ")", ":", "sky_diffuse", "=", "(", "dhi", "*", "(", "(", "1", "+", "tools", ".", "cosd", "(", "surface_tilt", ")", ")", ")", "/", "2", "+", "ghi", "*", "(", "(", "...
2e844a595b820b43d1170269781fa66bd0ccc8a3
train
perez
Determine diffuse irradiance from the sky on a tilted surface using one of the Perez models. Perez models determine the diffuse irradiance from the sky (ground reflected irradiance is not included in this algorithm) on a tilted surface using the surface tilt angle, surface azimuth angle, diffuse ho...
pvlib/irradiance.py
def perez(surface_tilt, surface_azimuth, dhi, dni, dni_extra, solar_zenith, solar_azimuth, airmass, model='allsitescomposite1990', return_components=False): ''' Determine diffuse irradiance from the sky on a tilted surface using one of the Perez models. Perez models determine the di...
def perez(surface_tilt, surface_azimuth, dhi, dni, dni_extra, solar_zenith, solar_azimuth, airmass, model='allsitescomposite1990', return_components=False): ''' Determine diffuse irradiance from the sky on a tilted surface using one of the Perez models. Perez models determine the di...
[ "Determine", "diffuse", "irradiance", "from", "the", "sky", "on", "a", "tilted", "surface", "using", "one", "of", "the", "Perez", "models", "." ]
pvlib/pvlib-python
python
https://github.com/pvlib/pvlib-python/blob/2e844a595b820b43d1170269781fa66bd0ccc8a3/pvlib/irradiance.py#L1007-L1197
[ "def", "perez", "(", "surface_tilt", ",", "surface_azimuth", ",", "dhi", ",", "dni", ",", "dni_extra", ",", "solar_zenith", ",", "solar_azimuth", ",", "airmass", ",", "model", "=", "'allsitescomposite1990'", ",", "return_components", "=", "False", ")", ":", "k...
2e844a595b820b43d1170269781fa66bd0ccc8a3
train
clearsky_index
Calculate the clearsky index. The clearsky index is the ratio of global to clearsky global irradiance. Negative and non-finite clearsky index values will be truncated to zero. Parameters ---------- ghi : numeric Global horizontal irradiance in W/m^2. clearsky_ghi : numeric Mod...
pvlib/irradiance.py
def clearsky_index(ghi, clearsky_ghi, max_clearsky_index=2.0): """ Calculate the clearsky index. The clearsky index is the ratio of global to clearsky global irradiance. Negative and non-finite clearsky index values will be truncated to zero. Parameters ---------- ghi : numeric Glo...
def clearsky_index(ghi, clearsky_ghi, max_clearsky_index=2.0): """ Calculate the clearsky index. The clearsky index is the ratio of global to clearsky global irradiance. Negative and non-finite clearsky index values will be truncated to zero. Parameters ---------- ghi : numeric Glo...
[ "Calculate", "the", "clearsky", "index", "." ]
pvlib/pvlib-python
python
https://github.com/pvlib/pvlib-python/blob/2e844a595b820b43d1170269781fa66bd0ccc8a3/pvlib/irradiance.py#L1200-L1239
[ "def", "clearsky_index", "(", "ghi", ",", "clearsky_ghi", ",", "max_clearsky_index", "=", "2.0", ")", ":", "clearsky_index", "=", "ghi", "/", "clearsky_ghi", "# set +inf, -inf, and nans to zero", "clearsky_index", "=", "np", ".", "where", "(", "~", "np", ".", "i...
2e844a595b820b43d1170269781fa66bd0ccc8a3
train
clearness_index
Calculate the clearness index. The clearness index is the ratio of global to extraterrestrial irradiance on a horizontal plane. Parameters ---------- ghi : numeric Global horizontal irradiance in W/m^2. solar_zenith : numeric True (not refraction-corrected) solar zenith angle ...
pvlib/irradiance.py
def clearness_index(ghi, solar_zenith, extra_radiation, min_cos_zenith=0.065, max_clearness_index=2.0): """ Calculate the clearness index. The clearness index is the ratio of global to extraterrestrial irradiance on a horizontal plane. Parameters ---------- ghi : numeri...
def clearness_index(ghi, solar_zenith, extra_radiation, min_cos_zenith=0.065, max_clearness_index=2.0): """ Calculate the clearness index. The clearness index is the ratio of global to extraterrestrial irradiance on a horizontal plane. Parameters ---------- ghi : numeri...
[ "Calculate", "the", "clearness", "index", "." ]
pvlib/pvlib-python
python
https://github.com/pvlib/pvlib-python/blob/2e844a595b820b43d1170269781fa66bd0ccc8a3/pvlib/irradiance.py#L1242-L1292
[ "def", "clearness_index", "(", "ghi", ",", "solar_zenith", ",", "extra_radiation", ",", "min_cos_zenith", "=", "0.065", ",", "max_clearness_index", "=", "2.0", ")", ":", "cos_zenith", "=", "tools", ".", "cosd", "(", "solar_zenith", ")", "I0h", "=", "extra_radi...
2e844a595b820b43d1170269781fa66bd0ccc8a3
train
clearness_index_zenith_independent
Calculate the zenith angle independent clearness index. Parameters ---------- clearness_index : numeric Ratio of global to extraterrestrial irradiance on a horizontal plane airmass : numeric Airmass max_clearness_index : numeric, default 2.0 Maximum value of the cl...
pvlib/irradiance.py
def clearness_index_zenith_independent(clearness_index, airmass, max_clearness_index=2.0): """ Calculate the zenith angle independent clearness index. Parameters ---------- clearness_index : numeric Ratio of global to extraterrestrial irradiance on a h...
def clearness_index_zenith_independent(clearness_index, airmass, max_clearness_index=2.0): """ Calculate the zenith angle independent clearness index. Parameters ---------- clearness_index : numeric Ratio of global to extraterrestrial irradiance on a h...
[ "Calculate", "the", "zenith", "angle", "independent", "clearness", "index", "." ]
pvlib/pvlib-python
python
https://github.com/pvlib/pvlib-python/blob/2e844a595b820b43d1170269781fa66bd0ccc8a3/pvlib/irradiance.py#L1295-L1329
[ "def", "clearness_index_zenith_independent", "(", "clearness_index", ",", "airmass", ",", "max_clearness_index", "=", "2.0", ")", ":", "# Perez eqn 1", "kt_prime", "=", "clearness_index", "/", "_kt_kt_prime_factor", "(", "airmass", ")", "kt_prime", "=", "np", ".", "...
2e844a595b820b43d1170269781fa66bd0ccc8a3
train
disc
Estimate Direct Normal Irradiance from Global Horizontal Irradiance using the DISC model. The DISC algorithm converts global horizontal irradiance to direct normal irradiance through empirical relationships between the global and direct clearness indices. The pvlib implementation limits the clearn...
pvlib/irradiance.py
def disc(ghi, solar_zenith, datetime_or_doy, pressure=101325, min_cos_zenith=0.065, max_zenith=87, max_airmass=12): """ Estimate Direct Normal Irradiance from Global Horizontal Irradiance using the DISC model. The DISC algorithm converts global horizontal irradiance to direct normal irradi...
def disc(ghi, solar_zenith, datetime_or_doy, pressure=101325, min_cos_zenith=0.065, max_zenith=87, max_airmass=12): """ Estimate Direct Normal Irradiance from Global Horizontal Irradiance using the DISC model. The DISC algorithm converts global horizontal irradiance to direct normal irradi...
[ "Estimate", "Direct", "Normal", "Irradiance", "from", "Global", "Horizontal", "Irradiance", "using", "the", "DISC", "model", "." ]
pvlib/pvlib-python
python
https://github.com/pvlib/pvlib-python/blob/2e844a595b820b43d1170269781fa66bd0ccc8a3/pvlib/irradiance.py#L1342-L1443
[ "def", "disc", "(", "ghi", ",", "solar_zenith", ",", "datetime_or_doy", ",", "pressure", "=", "101325", ",", "min_cos_zenith", "=", "0.065", ",", "max_zenith", "=", "87", ",", "max_airmass", "=", "12", ")", ":", "# this is the I0 calculation from the reference", ...
2e844a595b820b43d1170269781fa66bd0ccc8a3
train
_disc_kn
Calculate Kn for `disc` Parameters ---------- clearness_index : numeric airmass : numeric max_airmass : float airmass > max_airmass is set to max_airmass before being used in calculating Kn. Returns ------- Kn : numeric am : numeric airmass used in the calcu...
pvlib/irradiance.py
def _disc_kn(clearness_index, airmass, max_airmass=12): """ Calculate Kn for `disc` Parameters ---------- clearness_index : numeric airmass : numeric max_airmass : float airmass > max_airmass is set to max_airmass before being used in calculating Kn. Returns -------...
def _disc_kn(clearness_index, airmass, max_airmass=12): """ Calculate Kn for `disc` Parameters ---------- clearness_index : numeric airmass : numeric max_airmass : float airmass > max_airmass is set to max_airmass before being used in calculating Kn. Returns -------...
[ "Calculate", "Kn", "for", "disc" ]
pvlib/pvlib-python
python
https://github.com/pvlib/pvlib-python/blob/2e844a595b820b43d1170269781fa66bd0ccc8a3/pvlib/irradiance.py#L1446-L1489
[ "def", "_disc_kn", "(", "clearness_index", ",", "airmass", ",", "max_airmass", "=", "12", ")", ":", "# short names for equations", "kt", "=", "clearness_index", "am", "=", "airmass", "am", "=", "np", ".", "minimum", "(", "am", ",", "max_airmass", ")", "# GH ...
2e844a595b820b43d1170269781fa66bd0ccc8a3
train
dirint
Determine DNI from GHI using the DIRINT modification of the DISC model. Implements the modified DISC model known as "DIRINT" introduced in [1]. DIRINT predicts direct normal irradiance (DNI) from measured global horizontal irradiance (GHI). DIRINT improves upon the DISC model by using time-series G...
pvlib/irradiance.py
def dirint(ghi, solar_zenith, times, pressure=101325., use_delta_kt_prime=True, temp_dew=None, min_cos_zenith=0.065, max_zenith=87): """ Determine DNI from GHI using the DIRINT modification of the DISC model. Implements the modified DISC model known as "DIRINT" introduced in [1]. DIRINT ...
def dirint(ghi, solar_zenith, times, pressure=101325., use_delta_kt_prime=True, temp_dew=None, min_cos_zenith=0.065, max_zenith=87): """ Determine DNI from GHI using the DIRINT modification of the DISC model. Implements the modified DISC model known as "DIRINT" introduced in [1]. DIRINT ...
[ "Determine", "DNI", "from", "GHI", "using", "the", "DIRINT", "modification", "of", "the", "DISC", "model", "." ]
pvlib/pvlib-python
python
https://github.com/pvlib/pvlib-python/blob/2e844a595b820b43d1170269781fa66bd0ccc8a3/pvlib/irradiance.py#L1492-L1584
[ "def", "dirint", "(", "ghi", ",", "solar_zenith", ",", "times", ",", "pressure", "=", "101325.", ",", "use_delta_kt_prime", "=", "True", ",", "temp_dew", "=", "None", ",", "min_cos_zenith", "=", "0.065", ",", "max_zenith", "=", "87", ")", ":", "disc_out", ...
2e844a595b820b43d1170269781fa66bd0ccc8a3
train
_dirint_from_dni_ktprime
Calculate DIRINT DNI from supplied DISC DNI and Kt'. Supports :py:func:`gti_dirint`
pvlib/irradiance.py
def _dirint_from_dni_ktprime(dni, kt_prime, solar_zenith, use_delta_kt_prime, temp_dew): """ Calculate DIRINT DNI from supplied DISC DNI and Kt'. Supports :py:func:`gti_dirint` """ times = dni.index delta_kt_prime = _delta_kt_prime_dirint(kt_prime, use_delta_kt_prim...
def _dirint_from_dni_ktprime(dni, kt_prime, solar_zenith, use_delta_kt_prime, temp_dew): """ Calculate DIRINT DNI from supplied DISC DNI and Kt'. Supports :py:func:`gti_dirint` """ times = dni.index delta_kt_prime = _delta_kt_prime_dirint(kt_prime, use_delta_kt_prim...
[ "Calculate", "DIRINT", "DNI", "from", "supplied", "DISC", "DNI", "and", "Kt", "." ]
pvlib/pvlib-python
python
https://github.com/pvlib/pvlib-python/blob/2e844a595b820b43d1170269781fa66bd0ccc8a3/pvlib/irradiance.py#L1587-L1601
[ "def", "_dirint_from_dni_ktprime", "(", "dni", ",", "kt_prime", ",", "solar_zenith", ",", "use_delta_kt_prime", ",", "temp_dew", ")", ":", "times", "=", "dni", ".", "index", "delta_kt_prime", "=", "_delta_kt_prime_dirint", "(", "kt_prime", ",", "use_delta_kt_prime",...
2e844a595b820b43d1170269781fa66bd0ccc8a3
train
_delta_kt_prime_dirint
Calculate delta_kt_prime (Perez eqn 2 and eqn 3), or return a default value for use with :py:func:`_dirint_bins`.
pvlib/irradiance.py
def _delta_kt_prime_dirint(kt_prime, use_delta_kt_prime, times): """ Calculate delta_kt_prime (Perez eqn 2 and eqn 3), or return a default value for use with :py:func:`_dirint_bins`. """ if use_delta_kt_prime: # Perez eqn 2 kt_next = kt_prime.shift(-1) kt_previous = kt_prime....
def _delta_kt_prime_dirint(kt_prime, use_delta_kt_prime, times): """ Calculate delta_kt_prime (Perez eqn 2 and eqn 3), or return a default value for use with :py:func:`_dirint_bins`. """ if use_delta_kt_prime: # Perez eqn 2 kt_next = kt_prime.shift(-1) kt_previous = kt_prime....
[ "Calculate", "delta_kt_prime", "(", "Perez", "eqn", "2", "and", "eqn", "3", ")", "or", "return", "a", "default", "value", "for", "use", "with", ":", "py", ":", "func", ":", "_dirint_bins", "." ]
pvlib/pvlib-python
python
https://github.com/pvlib/pvlib-python/blob/2e844a595b820b43d1170269781fa66bd0ccc8a3/pvlib/irradiance.py#L1604-L1623
[ "def", "_delta_kt_prime_dirint", "(", "kt_prime", ",", "use_delta_kt_prime", ",", "times", ")", ":", "if", "use_delta_kt_prime", ":", "# Perez eqn 2", "kt_next", "=", "kt_prime", ".", "shift", "(", "-", "1", ")", "kt_previous", "=", "kt_prime", ".", "shift", "...
2e844a595b820b43d1170269781fa66bd0ccc8a3
train
_temp_dew_dirint
Calculate precipitable water from surface dew point temp (Perez eqn 4), or return a default value for use with :py:func:`_dirint_bins`.
pvlib/irradiance.py
def _temp_dew_dirint(temp_dew, times): """ Calculate precipitable water from surface dew point temp (Perez eqn 4), or return a default value for use with :py:func:`_dirint_bins`. """ if temp_dew is not None: # Perez eqn 4 w = pd.Series(np.exp(0.07 * temp_dew - 0.075), index=times) ...
def _temp_dew_dirint(temp_dew, times): """ Calculate precipitable water from surface dew point temp (Perez eqn 4), or return a default value for use with :py:func:`_dirint_bins`. """ if temp_dew is not None: # Perez eqn 4 w = pd.Series(np.exp(0.07 * temp_dew - 0.075), index=times) ...
[ "Calculate", "precipitable", "water", "from", "surface", "dew", "point", "temp", "(", "Perez", "eqn", "4", ")", "or", "return", "a", "default", "value", "for", "use", "with", ":", "py", ":", "func", ":", "_dirint_bins", "." ]
pvlib/pvlib-python
python
https://github.com/pvlib/pvlib-python/blob/2e844a595b820b43d1170269781fa66bd0ccc8a3/pvlib/irradiance.py#L1626-L1637
[ "def", "_temp_dew_dirint", "(", "temp_dew", ",", "times", ")", ":", "if", "temp_dew", "is", "not", "None", ":", "# Perez eqn 4", "w", "=", "pd", ".", "Series", "(", "np", ".", "exp", "(", "0.07", "*", "temp_dew", "-", "0.075", ")", ",", "index", "=",...
2e844a595b820b43d1170269781fa66bd0ccc8a3
train
_dirint_coeffs
Determine the DISC to DIRINT multiplier `dirint_coeffs`. dni = disc_out['dni'] * dirint_coeffs Parameters ---------- times : pd.DatetimeIndex kt_prime : Zenith-independent clearness index solar_zenith : Solar zenith angle w : precipitable water estimated from surface dew-point temperature ...
pvlib/irradiance.py
def _dirint_coeffs(times, kt_prime, solar_zenith, w, delta_kt_prime): """ Determine the DISC to DIRINT multiplier `dirint_coeffs`. dni = disc_out['dni'] * dirint_coeffs Parameters ---------- times : pd.DatetimeIndex kt_prime : Zenith-independent clearness index solar_zenith : Solar zen...
def _dirint_coeffs(times, kt_prime, solar_zenith, w, delta_kt_prime): """ Determine the DISC to DIRINT multiplier `dirint_coeffs`. dni = disc_out['dni'] * dirint_coeffs Parameters ---------- times : pd.DatetimeIndex kt_prime : Zenith-independent clearness index solar_zenith : Solar zen...
[ "Determine", "the", "DISC", "to", "DIRINT", "multiplier", "dirint_coeffs", "." ]
pvlib/pvlib-python
python
https://github.com/pvlib/pvlib-python/blob/2e844a595b820b43d1170269781fa66bd0ccc8a3/pvlib/irradiance.py#L1640-L1673
[ "def", "_dirint_coeffs", "(", "times", ",", "kt_prime", ",", "solar_zenith", ",", "w", ",", "delta_kt_prime", ")", ":", "kt_prime_bin", ",", "zenith_bin", ",", "w_bin", ",", "delta_kt_prime_bin", "=", "_dirint_bins", "(", "times", ",", "kt_prime", ",", "solar_...
2e844a595b820b43d1170269781fa66bd0ccc8a3
train
_dirint_bins
Determine the bins for the DIRINT coefficients. Parameters ---------- times : pd.DatetimeIndex kt_prime : Zenith-independent clearness index zenith : Solar zenith angle w : precipitable water estimated from surface dew-point temperature delta_kt_prime : stability index Returns ----...
pvlib/irradiance.py
def _dirint_bins(times, kt_prime, zenith, w, delta_kt_prime): """ Determine the bins for the DIRINT coefficients. Parameters ---------- times : pd.DatetimeIndex kt_prime : Zenith-independent clearness index zenith : Solar zenith angle w : precipitable water estimated from surface dew-po...
def _dirint_bins(times, kt_prime, zenith, w, delta_kt_prime): """ Determine the bins for the DIRINT coefficients. Parameters ---------- times : pd.DatetimeIndex kt_prime : Zenith-independent clearness index zenith : Solar zenith angle w : precipitable water estimated from surface dew-po...
[ "Determine", "the", "bins", "for", "the", "DIRINT", "coefficients", "." ]
pvlib/pvlib-python
python
https://github.com/pvlib/pvlib-python/blob/2e844a595b820b43d1170269781fa66bd0ccc8a3/pvlib/irradiance.py#L1676-L1732
[ "def", "_dirint_bins", "(", "times", ",", "kt_prime", ",", "zenith", ",", "w", ",", "delta_kt_prime", ")", ":", "# @wholmgren: the following bin assignments use MATLAB's 1-indexing.", "# Later, we'll subtract 1 to conform to Python's 0-indexing.", "# Create kt_prime bins", "kt_prim...
2e844a595b820b43d1170269781fa66bd0ccc8a3
train
dirindex
Determine DNI from GHI using the DIRINDEX model, which is a modification of the DIRINT model with information from a clear sky model. DIRINDEX [1] improves upon the DIRINT model by taking into account turbidity when used with the Ineichen clear sky model results. The pvlib implementation limits the cl...
pvlib/irradiance.py
def dirindex(ghi, ghi_clearsky, dni_clearsky, zenith, times, pressure=101325., use_delta_kt_prime=True, temp_dew=None, min_cos_zenith=0.065, max_zenith=87): """ Determine DNI from GHI using the DIRINDEX model, which is a modification of the DIRINT model with information from a clea...
def dirindex(ghi, ghi_clearsky, dni_clearsky, zenith, times, pressure=101325., use_delta_kt_prime=True, temp_dew=None, min_cos_zenith=0.065, max_zenith=87): """ Determine DNI from GHI using the DIRINDEX model, which is a modification of the DIRINT model with information from a clea...
[ "Determine", "DNI", "from", "GHI", "using", "the", "DIRINDEX", "model", "which", "is", "a", "modification", "of", "the", "DIRINT", "model", "with", "information", "from", "a", "clear", "sky", "model", "." ]
pvlib/pvlib-python
python
https://github.com/pvlib/pvlib-python/blob/2e844a595b820b43d1170269781fa66bd0ccc8a3/pvlib/irradiance.py#L1735-L1825
[ "def", "dirindex", "(", "ghi", ",", "ghi_clearsky", ",", "dni_clearsky", ",", "zenith", ",", "times", ",", "pressure", "=", "101325.", ",", "use_delta_kt_prime", "=", "True", ",", "temp_dew", "=", "None", ",", "min_cos_zenith", "=", "0.065", ",", "max_zenith...
2e844a595b820b43d1170269781fa66bd0ccc8a3
train
gti_dirint
Determine GHI, DNI, DHI from POA global using the GTI DIRINT model. .. warning:: Model performance is poor for AOI greater than approximately 80 degrees `and` plane of array irradiance greater than approximately 200 W/m^2. Parameters ---------- poa_global : array-like ...
pvlib/irradiance.py
def gti_dirint(poa_global, aoi, solar_zenith, solar_azimuth, times, surface_tilt, surface_azimuth, pressure=101325., use_delta_kt_prime=True, temp_dew=None, albedo=.25, model='perez', model_perez='allsitescomposite1990', calculate_gt_90=True, max_iterations=30...
def gti_dirint(poa_global, aoi, solar_zenith, solar_azimuth, times, surface_tilt, surface_azimuth, pressure=101325., use_delta_kt_prime=True, temp_dew=None, albedo=.25, model='perez', model_perez='allsitescomposite1990', calculate_gt_90=True, max_iterations=30...
[ "Determine", "GHI", "DNI", "DHI", "from", "POA", "global", "using", "the", "GTI", "DIRINT", "model", "." ]
pvlib/pvlib-python
python
https://github.com/pvlib/pvlib-python/blob/2e844a595b820b43d1170269781fa66bd0ccc8a3/pvlib/irradiance.py#L1828-L1952
[ "def", "gti_dirint", "(", "poa_global", ",", "aoi", ",", "solar_zenith", ",", "solar_azimuth", ",", "times", ",", "surface_tilt", ",", "surface_azimuth", ",", "pressure", "=", "101325.", ",", "use_delta_kt_prime", "=", "True", ",", "temp_dew", "=", "None", ","...
2e844a595b820b43d1170269781fa66bd0ccc8a3
train
_gti_dirint_lt_90
GTI-DIRINT model for AOI < 90 degrees. See Marion 2015 Section 2.1. See gti_dirint signature for parameter details.
pvlib/irradiance.py
def _gti_dirint_lt_90(poa_global, aoi, aoi_lt_90, solar_zenith, solar_azimuth, times, surface_tilt, surface_azimuth, pressure=101325., use_delta_kt_prime=True, temp_dew=None, albedo=.25, model='perez', model_perez='allsitescomposite1990', ...
def _gti_dirint_lt_90(poa_global, aoi, aoi_lt_90, solar_zenith, solar_azimuth, times, surface_tilt, surface_azimuth, pressure=101325., use_delta_kt_prime=True, temp_dew=None, albedo=.25, model='perez', model_perez='allsitescomposite1990', ...
[ "GTI", "-", "DIRINT", "model", "for", "AOI", "<", "90", "degrees", ".", "See", "Marion", "2015", "Section", "2", ".", "1", "." ]
pvlib/pvlib-python
python
https://github.com/pvlib/pvlib-python/blob/2e844a595b820b43d1170269781fa66bd0ccc8a3/pvlib/irradiance.py#L1955-L2070
[ "def", "_gti_dirint_lt_90", "(", "poa_global", ",", "aoi", ",", "aoi_lt_90", ",", "solar_zenith", ",", "solar_azimuth", ",", "times", ",", "surface_tilt", ",", "surface_azimuth", ",", "pressure", "=", "101325.", ",", "use_delta_kt_prime", "=", "True", ",", "temp...
2e844a595b820b43d1170269781fa66bd0ccc8a3
train
_gti_dirint_gte_90
GTI-DIRINT model for AOI >= 90 degrees. See Marion 2015 Section 2.2. See gti_dirint signature for parameter details.
pvlib/irradiance.py
def _gti_dirint_gte_90(poa_global, aoi, solar_zenith, solar_azimuth, surface_tilt, times, kt_prime, pressure=101325., temp_dew=None, albedo=.25): """ GTI-DIRINT model for AOI >= 90 degrees. See Marion 2015 Section 2.2. See gti_dirint signature for parameter det...
def _gti_dirint_gte_90(poa_global, aoi, solar_zenith, solar_azimuth, surface_tilt, times, kt_prime, pressure=101325., temp_dew=None, albedo=.25): """ GTI-DIRINT model for AOI >= 90 degrees. See Marion 2015 Section 2.2. See gti_dirint signature for parameter det...
[ "GTI", "-", "DIRINT", "model", "for", "AOI", ">", "=", "90", "degrees", ".", "See", "Marion", "2015", "Section", "2", ".", "2", "." ]
pvlib/pvlib-python
python
https://github.com/pvlib/pvlib-python/blob/2e844a595b820b43d1170269781fa66bd0ccc8a3/pvlib/irradiance.py#L2073-L2104
[ "def", "_gti_dirint_gte_90", "(", "poa_global", ",", "aoi", ",", "solar_zenith", ",", "solar_azimuth", ",", "surface_tilt", ",", "times", ",", "kt_prime", ",", "pressure", "=", "101325.", ",", "temp_dew", "=", "None", ",", "albedo", "=", ".25", ")", ":", "...
2e844a595b820b43d1170269781fa66bd0ccc8a3
train
_gti_dirint_gte_90_kt_prime
Determine kt' values to be used in GTI-DIRINT AOI >= 90 deg case. See Marion 2015 Section 2.2. For AOI >= 90 deg: average of the kt_prime values for 65 < AOI < 80 in each day's morning and afternoon. Morning and afternoon are treated separately. For AOI < 90 deg: NaN. See gti_dirint signature...
pvlib/irradiance.py
def _gti_dirint_gte_90_kt_prime(aoi, solar_zenith, solar_azimuth, times, kt_prime): """ Determine kt' values to be used in GTI-DIRINT AOI >= 90 deg case. See Marion 2015 Section 2.2. For AOI >= 90 deg: average of the kt_prime values for 65 < AOI < 80 in each day's mo...
def _gti_dirint_gte_90_kt_prime(aoi, solar_zenith, solar_azimuth, times, kt_prime): """ Determine kt' values to be used in GTI-DIRINT AOI >= 90 deg case. See Marion 2015 Section 2.2. For AOI >= 90 deg: average of the kt_prime values for 65 < AOI < 80 in each day's mo...
[ "Determine", "kt", "values", "to", "be", "used", "in", "GTI", "-", "DIRINT", "AOI", ">", "=", "90", "deg", "case", ".", "See", "Marion", "2015", "Section", "2", ".", "2", "." ]
pvlib/pvlib-python
python
https://github.com/pvlib/pvlib-python/blob/2e844a595b820b43d1170269781fa66bd0ccc8a3/pvlib/irradiance.py#L2107-L2151
[ "def", "_gti_dirint_gte_90_kt_prime", "(", "aoi", ",", "solar_zenith", ",", "solar_azimuth", ",", "times", ",", "kt_prime", ")", ":", "# kt_prime values from DIRINT calculation for AOI < 90 case", "# set the kt_prime from sunrise to AOI=90 to be equal to", "# the kt_prime for 65 < AO...
2e844a595b820b43d1170269781fa66bd0ccc8a3
train
erbs
r""" Estimate DNI and DHI from GHI using the Erbs model. The Erbs model [1]_ estimates the diffuse fraction DF from global horizontal irradiance through an empirical relationship between DF and the ratio of GHI to extraterrestrial irradiance, Kt. The function uses the diffuse fraction to compute DH...
pvlib/irradiance.py
def erbs(ghi, zenith, datetime_or_doy, min_cos_zenith=0.065, max_zenith=87): r""" Estimate DNI and DHI from GHI using the Erbs model. The Erbs model [1]_ estimates the diffuse fraction DF from global horizontal irradiance through an empirical relationship between DF and the ratio of GHI to extrater...
def erbs(ghi, zenith, datetime_or_doy, min_cos_zenith=0.065, max_zenith=87): r""" Estimate DNI and DHI from GHI using the Erbs model. The Erbs model [1]_ estimates the diffuse fraction DF from global horizontal irradiance through an empirical relationship between DF and the ratio of GHI to extrater...
[ "r", "Estimate", "DNI", "and", "DHI", "from", "GHI", "using", "the", "Erbs", "model", "." ]
pvlib/pvlib-python
python
https://github.com/pvlib/pvlib-python/blob/2e844a595b820b43d1170269781fa66bd0ccc8a3/pvlib/irradiance.py#L2154-L2247
[ "def", "erbs", "(", "ghi", ",", "zenith", ",", "datetime_or_doy", ",", "min_cos_zenith", "=", "0.065", ",", "max_zenith", "=", "87", ")", ":", "dni_extra", "=", "get_extra_radiation", "(", "datetime_or_doy", ")", "kt", "=", "clearness_index", "(", "ghi", ","...
2e844a595b820b43d1170269781fa66bd0ccc8a3
train
liujordan
Determine DNI, DHI, GHI from extraterrestrial flux, transmittance, and optical air mass number. Liu and Jordan, 1960, developed a simplified direct radiation model. DHI is from an empirical equation for diffuse radiation from Liu and Jordan, 1960. Parameters ---------- zenith: pd.Series ...
pvlib/irradiance.py
def liujordan(zenith, transmittance, airmass, dni_extra=1367.0): ''' Determine DNI, DHI, GHI from extraterrestrial flux, transmittance, and optical air mass number. Liu and Jordan, 1960, developed a simplified direct radiation model. DHI is from an empirical equation for diffuse radiation from Liu ...
def liujordan(zenith, transmittance, airmass, dni_extra=1367.0): ''' Determine DNI, DHI, GHI from extraterrestrial flux, transmittance, and optical air mass number. Liu and Jordan, 1960, developed a simplified direct radiation model. DHI is from an empirical equation for diffuse radiation from Liu ...
[ "Determine", "DNI", "DHI", "GHI", "from", "extraterrestrial", "flux", "transmittance", "and", "optical", "air", "mass", "number", "." ]
pvlib/pvlib-python
python
https://github.com/pvlib/pvlib-python/blob/2e844a595b820b43d1170269781fa66bd0ccc8a3/pvlib/irradiance.py#L2250-L2305
[ "def", "liujordan", "(", "zenith", ",", "transmittance", ",", "airmass", ",", "dni_extra", "=", "1367.0", ")", ":", "tau", "=", "transmittance", "dni", "=", "dni_extra", "*", "tau", "**", "airmass", "dhi", "=", "0.3", "*", "(", "1.0", "-", "tau", "**",...
2e844a595b820b43d1170269781fa66bd0ccc8a3
train
_get_perez_coefficients
Find coefficients for the Perez model Parameters ---------- perezmodel : string (optional, default='allsitescomposite1990') a character string which selects the desired set of Perez coefficients. If model is not provided as an input, the default, '1990' will be used. Al...
pvlib/irradiance.py
def _get_perez_coefficients(perezmodel): ''' Find coefficients for the Perez model Parameters ---------- perezmodel : string (optional, default='allsitescomposite1990') a character string which selects the desired set of Perez coefficients. If model is not provided as an input...
def _get_perez_coefficients(perezmodel): ''' Find coefficients for the Perez model Parameters ---------- perezmodel : string (optional, default='allsitescomposite1990') a character string which selects the desired set of Perez coefficients. If model is not provided as an input...
[ "Find", "coefficients", "for", "the", "Perez", "model" ]
pvlib/pvlib-python
python
https://github.com/pvlib/pvlib-python/blob/2e844a595b820b43d1170269781fa66bd0ccc8a3/pvlib/irradiance.py#L2308-L2465
[ "def", "_get_perez_coefficients", "(", "perezmodel", ")", ":", "coeffdict", "=", "{", "'allsitescomposite1990'", ":", "[", "[", "-", "0.0080", ",", "0.5880", ",", "-", "0.0620", ",", "-", "0.0600", ",", "0.0720", ",", "-", "0.0220", "]", ",", "[", "0.130...
2e844a595b820b43d1170269781fa66bd0ccc8a3
train
_get_dirint_coeffs
A place to stash the dirint coefficients. Returns ------- np.array with shape ``(6, 6, 7, 5)``. Ordering is ``[kt_prime_bin, zenith_bin, delta_kt_prime_bin, w_bin]``
pvlib/irradiance.py
def _get_dirint_coeffs(): """ A place to stash the dirint coefficients. Returns ------- np.array with shape ``(6, 6, 7, 5)``. Ordering is ``[kt_prime_bin, zenith_bin, delta_kt_prime_bin, w_bin]`` """ # To allow for maximum copy/paste from the MATLAB 1-indexed code, # we create and ...
def _get_dirint_coeffs(): """ A place to stash the dirint coefficients. Returns ------- np.array with shape ``(6, 6, 7, 5)``. Ordering is ``[kt_prime_bin, zenith_bin, delta_kt_prime_bin, w_bin]`` """ # To allow for maximum copy/paste from the MATLAB 1-indexed code, # we create and ...
[ "A", "place", "to", "stash", "the", "dirint", "coefficients", "." ]
pvlib/pvlib-python
python
https://github.com/pvlib/pvlib-python/blob/2e844a595b820b43d1170269781fa66bd0ccc8a3/pvlib/irradiance.py#L2468-L2808
[ "def", "_get_dirint_coeffs", "(", ")", ":", "# To allow for maximum copy/paste from the MATLAB 1-indexed code,", "# we create and assign values to an oversized array.", "# Then, we return the [1:, 1:, :, :] slice.", "coeffs", "=", "np", ".", "zeros", "(", "(", "7", ",", "7", ",",...
2e844a595b820b43d1170269781fa66bd0ccc8a3
train
dni
Determine DNI from GHI and DHI. When calculating the DNI from GHI and DHI the calculated DNI may be unreasonably high or negative for zenith angles close to 90 degrees (sunrise/sunset transitions). This function identifies unreasonable DNI values and sets them to NaN. If the clearsky DNI is given unrea...
pvlib/irradiance.py
def dni(ghi, dhi, zenith, clearsky_dni=None, clearsky_tolerance=1.1, zenith_threshold_for_zero_dni=88.0, zenith_threshold_for_clearsky_limit=80.0): """ Determine DNI from GHI and DHI. When calculating the DNI from GHI and DHI the calculated DNI may be unreasonably high or negative for z...
def dni(ghi, dhi, zenith, clearsky_dni=None, clearsky_tolerance=1.1, zenith_threshold_for_zero_dni=88.0, zenith_threshold_for_clearsky_limit=80.0): """ Determine DNI from GHI and DHI. When calculating the DNI from GHI and DHI the calculated DNI may be unreasonably high or negative for z...
[ "Determine", "DNI", "from", "GHI", "and", "DHI", "." ]
pvlib/pvlib-python
python
https://github.com/pvlib/pvlib-python/blob/2e844a595b820b43d1170269781fa66bd0ccc8a3/pvlib/irradiance.py#L2811-L2879
[ "def", "dni", "(", "ghi", ",", "dhi", ",", "zenith", ",", "clearsky_dni", "=", "None", ",", "clearsky_tolerance", "=", "1.1", ",", "zenith_threshold_for_zero_dni", "=", "88.0", ",", "zenith_threshold_for_clearsky_limit", "=", "80.0", ")", ":", "# calculate DNI", ...
2e844a595b820b43d1170269781fa66bd0ccc8a3
train
ineichen
Determine clear sky GHI, DNI, and DHI from Ineichen/Perez model. Implements the Ineichen and Perez clear sky model for global horizontal irradiance (GHI), direct normal irradiance (DNI), and calculates the clear-sky diffuse horizontal (DHI) component as the difference between GHI and DNI*cos(zenith) as...
pvlib/clearsky.py
def ineichen(apparent_zenith, airmass_absolute, linke_turbidity, altitude=0, dni_extra=1364., perez_enhancement=False): ''' Determine clear sky GHI, DNI, and DHI from Ineichen/Perez model. Implements the Ineichen and Perez clear sky model for global horizontal irradiance (GHI), direct norm...
def ineichen(apparent_zenith, airmass_absolute, linke_turbidity, altitude=0, dni_extra=1364., perez_enhancement=False): ''' Determine clear sky GHI, DNI, and DHI from Ineichen/Perez model. Implements the Ineichen and Perez clear sky model for global horizontal irradiance (GHI), direct norm...
[ "Determine", "clear", "sky", "GHI", "DNI", "and", "DHI", "from", "Ineichen", "/", "Perez", "model", "." ]
pvlib/pvlib-python
python
https://github.com/pvlib/pvlib-python/blob/2e844a595b820b43d1170269781fa66bd0ccc8a3/pvlib/clearsky.py#L18-L141
[ "def", "ineichen", "(", "apparent_zenith", ",", "airmass_absolute", ",", "linke_turbidity", ",", "altitude", "=", "0", ",", "dni_extra", "=", "1364.", ",", "perez_enhancement", "=", "False", ")", ":", "# ghi is calculated using either the equations in [1] by setting", "...
2e844a595b820b43d1170269781fa66bd0ccc8a3
train
lookup_linke_turbidity
Look up the Linke Turibidity from the ``LinkeTurbidities.h5`` data file supplied with pvlib. Parameters ---------- time : pandas.DatetimeIndex latitude : float longitude : float filepath : None or string, default None The path to the ``.h5`` file. interp_turbidity : bool, de...
pvlib/clearsky.py
def lookup_linke_turbidity(time, latitude, longitude, filepath=None, interp_turbidity=True): """ Look up the Linke Turibidity from the ``LinkeTurbidities.h5`` data file supplied with pvlib. Parameters ---------- time : pandas.DatetimeIndex latitude : float l...
def lookup_linke_turbidity(time, latitude, longitude, filepath=None, interp_turbidity=True): """ Look up the Linke Turibidity from the ``LinkeTurbidities.h5`` data file supplied with pvlib. Parameters ---------- time : pandas.DatetimeIndex latitude : float l...
[ "Look", "up", "the", "Linke", "Turibidity", "from", "the", "LinkeTurbidities", ".", "h5", "data", "file", "supplied", "with", "pvlib", "." ]
pvlib/pvlib-python
python
https://github.com/pvlib/pvlib-python/blob/2e844a595b820b43d1170269781fa66bd0ccc8a3/pvlib/clearsky.py#L144-L223
[ "def", "lookup_linke_turbidity", "(", "time", ",", "latitude", ",", "longitude", ",", "filepath", "=", "None", ",", "interp_turbidity", "=", "True", ")", ":", "# The .h5 file 'LinkeTurbidities.h5' contains a single 2160 x 4320 x 12", "# matrix of type uint8 called 'LinkeTurbidi...
2e844a595b820b43d1170269781fa66bd0ccc8a3
train
_is_leap_year
Determine if a year is leap year. Parameters ---------- year : numeric Returns ------- isleap : array of bools
pvlib/clearsky.py
def _is_leap_year(year): """Determine if a year is leap year. Parameters ---------- year : numeric Returns ------- isleap : array of bools """ isleap = ((np.mod(year, 4) == 0) & ((np.mod(year, 100) != 0) | (np.mod(year, 400) == 0))) return isleap
def _is_leap_year(year): """Determine if a year is leap year. Parameters ---------- year : numeric Returns ------- isleap : array of bools """ isleap = ((np.mod(year, 4) == 0) & ((np.mod(year, 100) != 0) | (np.mod(year, 400) == 0))) return isleap
[ "Determine", "if", "a", "year", "is", "leap", "year", "." ]
pvlib/pvlib-python
python
https://github.com/pvlib/pvlib-python/blob/2e844a595b820b43d1170269781fa66bd0ccc8a3/pvlib/clearsky.py#L226-L239
[ "def", "_is_leap_year", "(", "year", ")", ":", "isleap", "=", "(", "(", "np", ".", "mod", "(", "year", ",", "4", ")", "==", "0", ")", "&", "(", "(", "np", ".", "mod", "(", "year", ",", "100", ")", "!=", "0", ")", "|", "(", "np", ".", "mod...
2e844a595b820b43d1170269781fa66bd0ccc8a3
train
_interpolate_turbidity
Interpolated monthly Linke turbidity onto daily values. Parameters ---------- lts : np.array Monthly Linke turbidity values. time : pd.DatetimeIndex Times to be interpolated onto. Returns ------- linke_turbidity : pd.Series The interpolated turbidity.
pvlib/clearsky.py
def _interpolate_turbidity(lts, time): """ Interpolated monthly Linke turbidity onto daily values. Parameters ---------- lts : np.array Monthly Linke turbidity values. time : pd.DatetimeIndex Times to be interpolated onto. Returns ------- linke_turbidity : pd.Series...
def _interpolate_turbidity(lts, time): """ Interpolated monthly Linke turbidity onto daily values. Parameters ---------- lts : np.array Monthly Linke turbidity values. time : pd.DatetimeIndex Times to be interpolated onto. Returns ------- linke_turbidity : pd.Series...
[ "Interpolated", "monthly", "Linke", "turbidity", "onto", "daily", "values", "." ]
pvlib/pvlib-python
python
https://github.com/pvlib/pvlib-python/blob/2e844a595b820b43d1170269781fa66bd0ccc8a3/pvlib/clearsky.py#L242-L283
[ "def", "_interpolate_turbidity", "(", "lts", ",", "time", ")", ":", "# Data covers 1 year. Assume that data corresponds to the value at the", "# middle of each month. This means that we need to add previous Dec and", "# next Jan to the array so that the interpolation will work for", "# Jan 1 -...
2e844a595b820b43d1170269781fa66bd0ccc8a3
train
_calendar_month_middles
List of middle day of each month, used by Linke turbidity lookup
pvlib/clearsky.py
def _calendar_month_middles(year): """List of middle day of each month, used by Linke turbidity lookup""" # remove mdays[0] since January starts at mdays[1] # make local copy of mdays since we need to change # February for leap years mdays = np.array(calendar.mdays[1:]) ydays = 365 # handle ...
def _calendar_month_middles(year): """List of middle day of each month, used by Linke turbidity lookup""" # remove mdays[0] since January starts at mdays[1] # make local copy of mdays since we need to change # February for leap years mdays = np.array(calendar.mdays[1:]) ydays = 365 # handle ...
[ "List", "of", "middle", "day", "of", "each", "month", "used", "by", "Linke", "turbidity", "lookup" ]
pvlib/pvlib-python
python
https://github.com/pvlib/pvlib-python/blob/2e844a595b820b43d1170269781fa66bd0ccc8a3/pvlib/clearsky.py#L286-L301
[ "def", "_calendar_month_middles", "(", "year", ")", ":", "# remove mdays[0] since January starts at mdays[1]", "# make local copy of mdays since we need to change", "# February for leap years", "mdays", "=", "np", ".", "array", "(", "calendar", ".", "mdays", "[", "1", ":", ...
2e844a595b820b43d1170269781fa66bd0ccc8a3
train
_linearly_scale
linearly scale input to output, used by Linke turbidity lookup
pvlib/clearsky.py
def _linearly_scale(inputmatrix, inputmin, inputmax, outputmin, outputmax): """linearly scale input to output, used by Linke turbidity lookup""" inputrange = inputmax - inputmin outputrange = outputmax - outputmin delta = outputrange/inputrange # number of indices per input unit inputmin = inputmin...
def _linearly_scale(inputmatrix, inputmin, inputmax, outputmin, outputmax): """linearly scale input to output, used by Linke turbidity lookup""" inputrange = inputmax - inputmin outputrange = outputmax - outputmin delta = outputrange/inputrange # number of indices per input unit inputmin = inputmin...
[ "linearly", "scale", "input", "to", "output", "used", "by", "Linke", "turbidity", "lookup" ]
pvlib/pvlib-python
python
https://github.com/pvlib/pvlib-python/blob/2e844a595b820b43d1170269781fa66bd0ccc8a3/pvlib/clearsky.py#L304-L325
[ "def", "_linearly_scale", "(", "inputmatrix", ",", "inputmin", ",", "inputmax", ",", "outputmin", ",", "outputmax", ")", ":", "inputrange", "=", "inputmax", "-", "inputmin", "outputrange", "=", "outputmax", "-", "outputmin", "delta", "=", "outputrange", "/", "...
2e844a595b820b43d1170269781fa66bd0ccc8a3
train
haurwitz
Determine clear sky GHI using the Haurwitz model. Implements the Haurwitz clear sky model for global horizontal irradiance (GHI) as presented in [1, 2]. A report on clear sky models found the Haurwitz model to have the best performance in terms of average monthly error among models which require only ...
pvlib/clearsky.py
def haurwitz(apparent_zenith): ''' Determine clear sky GHI using the Haurwitz model. Implements the Haurwitz clear sky model for global horizontal irradiance (GHI) as presented in [1, 2]. A report on clear sky models found the Haurwitz model to have the best performance in terms of average mont...
def haurwitz(apparent_zenith): ''' Determine clear sky GHI using the Haurwitz model. Implements the Haurwitz clear sky model for global horizontal irradiance (GHI) as presented in [1, 2]. A report on clear sky models found the Haurwitz model to have the best performance in terms of average mont...
[ "Determine", "clear", "sky", "GHI", "using", "the", "Haurwitz", "model", "." ]
pvlib/pvlib-python
python
https://github.com/pvlib/pvlib-python/blob/2e844a595b820b43d1170269781fa66bd0ccc8a3/pvlib/clearsky.py#L328-L374
[ "def", "haurwitz", "(", "apparent_zenith", ")", ":", "cos_zenith", "=", "tools", ".", "cosd", "(", "apparent_zenith", ".", "values", ")", "clearsky_ghi", "=", "np", ".", "zeros_like", "(", "apparent_zenith", ".", "values", ")", "cos_zen_gte_0", "=", "cos_zenit...
2e844a595b820b43d1170269781fa66bd0ccc8a3
train
simplified_solis
Calculate the clear sky GHI, DNI, and DHI according to the simplified Solis model [1]_. Reference [1]_ describes the accuracy of the model as being 15, 20, and 18 W/m^2 for the beam, global, and diffuse components. Reference [2]_ provides comparisons with other clear sky models. Parameters ---...
pvlib/clearsky.py
def simplified_solis(apparent_elevation, aod700=0.1, precipitable_water=1., pressure=101325., dni_extra=1364.): """ Calculate the clear sky GHI, DNI, and DHI according to the simplified Solis model [1]_. Reference [1]_ describes the accuracy of the model as being 15, 20, and 18...
def simplified_solis(apparent_elevation, aod700=0.1, precipitable_water=1., pressure=101325., dni_extra=1364.): """ Calculate the clear sky GHI, DNI, and DHI according to the simplified Solis model [1]_. Reference [1]_ describes the accuracy of the model as being 15, 20, and 18...
[ "Calculate", "the", "clear", "sky", "GHI", "DNI", "and", "DHI", "according", "to", "the", "simplified", "Solis", "model", "[", "1", "]", "_", "." ]
pvlib/pvlib-python
python
https://github.com/pvlib/pvlib-python/blob/2e844a595b820b43d1170269781fa66bd0ccc8a3/pvlib/clearsky.py#L377-L465
[ "def", "simplified_solis", "(", "apparent_elevation", ",", "aod700", "=", "0.1", ",", "precipitable_water", "=", "1.", ",", "pressure", "=", "101325.", ",", "dni_extra", "=", "1364.", ")", ":", "p", "=", "pressure", "w", "=", "precipitable_water", "# algorithm...
2e844a595b820b43d1170269781fa66bd0ccc8a3
train
_calc_i0p
Calculate the "enhanced extraterrestrial irradiance".
pvlib/clearsky.py
def _calc_i0p(i0, w, aod700, p): """Calculate the "enhanced extraterrestrial irradiance".""" p0 = 101325. io0 = 1.08 * w**0.0051 i01 = 0.97 * w**0.032 i02 = 0.12 * w**0.56 i0p = i0 * (i02*aod700**2 + i01*aod700 + io0 + 0.071*np.log(p/p0)) return i0p
def _calc_i0p(i0, w, aod700, p): """Calculate the "enhanced extraterrestrial irradiance".""" p0 = 101325. io0 = 1.08 * w**0.0051 i01 = 0.97 * w**0.032 i02 = 0.12 * w**0.56 i0p = i0 * (i02*aod700**2 + i01*aod700 + io0 + 0.071*np.log(p/p0)) return i0p
[ "Calculate", "the", "enhanced", "extraterrestrial", "irradiance", "." ]
pvlib/pvlib-python
python
https://github.com/pvlib/pvlib-python/blob/2e844a595b820b43d1170269781fa66bd0ccc8a3/pvlib/clearsky.py#L468-L476
[ "def", "_calc_i0p", "(", "i0", ",", "w", ",", "aod700", ",", "p", ")", ":", "p0", "=", "101325.", "io0", "=", "1.08", "*", "w", "**", "0.0051", "i01", "=", "0.97", "*", "w", "**", "0.032", "i02", "=", "0.12", "*", "w", "**", "0.56", "i0p", "=...
2e844a595b820b43d1170269781fa66bd0ccc8a3
train
_calc_taub
Calculate the taub coefficient
pvlib/clearsky.py
def _calc_taub(w, aod700, p): """Calculate the taub coefficient""" p0 = 101325. tb1 = 1.82 + 0.056*np.log(w) + 0.0071*np.log(w)**2 tb0 = 0.33 + 0.045*np.log(w) + 0.0096*np.log(w)**2 tbp = 0.0089*w + 0.13 taub = tb1*aod700 + tb0 + tbp*np.log(p/p0) return taub
def _calc_taub(w, aod700, p): """Calculate the taub coefficient""" p0 = 101325. tb1 = 1.82 + 0.056*np.log(w) + 0.0071*np.log(w)**2 tb0 = 0.33 + 0.045*np.log(w) + 0.0096*np.log(w)**2 tbp = 0.0089*w + 0.13 taub = tb1*aod700 + tb0 + tbp*np.log(p/p0) return taub
[ "Calculate", "the", "taub", "coefficient" ]
pvlib/pvlib-python
python
https://github.com/pvlib/pvlib-python/blob/2e844a595b820b43d1170269781fa66bd0ccc8a3/pvlib/clearsky.py#L479-L488
[ "def", "_calc_taub", "(", "w", ",", "aod700", ",", "p", ")", ":", "p0", "=", "101325.", "tb1", "=", "1.82", "+", "0.056", "*", "np", ".", "log", "(", "w", ")", "+", "0.0071", "*", "np", ".", "log", "(", "w", ")", "**", "2", "tb0", "=", "0.3...
2e844a595b820b43d1170269781fa66bd0ccc8a3
train
_calc_b
Calculate the b coefficient.
pvlib/clearsky.py
def _calc_b(w, aod700): """Calculate the b coefficient.""" b1 = 0.00925*aod700**2 + 0.0148*aod700 - 0.0172 b0 = -0.7565*aod700**2 + 0.5057*aod700 + 0.4557 b = b1 * np.log(w) + b0 return b
def _calc_b(w, aod700): """Calculate the b coefficient.""" b1 = 0.00925*aod700**2 + 0.0148*aod700 - 0.0172 b0 = -0.7565*aod700**2 + 0.5057*aod700 + 0.4557 b = b1 * np.log(w) + b0 return b
[ "Calculate", "the", "b", "coefficient", "." ]
pvlib/pvlib-python
python
https://github.com/pvlib/pvlib-python/blob/2e844a595b820b43d1170269781fa66bd0ccc8a3/pvlib/clearsky.py#L491-L499
[ "def", "_calc_b", "(", "w", ",", "aod700", ")", ":", "b1", "=", "0.00925", "*", "aod700", "**", "2", "+", "0.0148", "*", "aod700", "-", "0.0172", "b0", "=", "-", "0.7565", "*", "aod700", "**", "2", "+", "0.5057", "*", "aod700", "+", "0.4557", "b"...
2e844a595b820b43d1170269781fa66bd0ccc8a3
train
_calc_taug
Calculate the taug coefficient
pvlib/clearsky.py
def _calc_taug(w, aod700, p): """Calculate the taug coefficient""" p0 = 101325. tg1 = 1.24 + 0.047*np.log(w) + 0.0061*np.log(w)**2 tg0 = 0.27 + 0.043*np.log(w) + 0.0090*np.log(w)**2 tgp = 0.0079*w + 0.1 taug = tg1*aod700 + tg0 + tgp*np.log(p/p0) return taug
def _calc_taug(w, aod700, p): """Calculate the taug coefficient""" p0 = 101325. tg1 = 1.24 + 0.047*np.log(w) + 0.0061*np.log(w)**2 tg0 = 0.27 + 0.043*np.log(w) + 0.0090*np.log(w)**2 tgp = 0.0079*w + 0.1 taug = tg1*aod700 + tg0 + tgp*np.log(p/p0) return taug
[ "Calculate", "the", "taug", "coefficient" ]
pvlib/pvlib-python
python
https://github.com/pvlib/pvlib-python/blob/2e844a595b820b43d1170269781fa66bd0ccc8a3/pvlib/clearsky.py#L502-L510
[ "def", "_calc_taug", "(", "w", ",", "aod700", ",", "p", ")", ":", "p0", "=", "101325.", "tg1", "=", "1.24", "+", "0.047", "*", "np", ".", "log", "(", "w", ")", "+", "0.0061", "*", "np", ".", "log", "(", "w", ")", "**", "2", "tg0", "=", "0.2...
2e844a595b820b43d1170269781fa66bd0ccc8a3
train
_calc_g
Calculate the g coefficient.
pvlib/clearsky.py
def _calc_g(w, aod700): """Calculate the g coefficient.""" g = -0.0147*np.log(w) - 0.3079*aod700**2 + 0.2846*aod700 + 0.3798 return g
def _calc_g(w, aod700): """Calculate the g coefficient.""" g = -0.0147*np.log(w) - 0.3079*aod700**2 + 0.2846*aod700 + 0.3798 return g
[ "Calculate", "the", "g", "coefficient", "." ]
pvlib/pvlib-python
python
https://github.com/pvlib/pvlib-python/blob/2e844a595b820b43d1170269781fa66bd0ccc8a3/pvlib/clearsky.py#L513-L518
[ "def", "_calc_g", "(", "w", ",", "aod700", ")", ":", "g", "=", "-", "0.0147", "*", "np", ".", "log", "(", "w", ")", "-", "0.3079", "*", "aod700", "**", "2", "+", "0.2846", "*", "aod700", "+", "0.3798", "return", "g" ]
2e844a595b820b43d1170269781fa66bd0ccc8a3
train
_calc_taud
Calculate the taud coefficient.
pvlib/clearsky.py
def _calc_taud(w, aod700, p): """Calculate the taud coefficient.""" # isscalar tests needed to ensure that the arrays will have the # right shape in the tds calculation. # there's probably a better way to do this. if np.isscalar(w) and np.isscalar(aod700): w = np.array([w]) aod700 ...
def _calc_taud(w, aod700, p): """Calculate the taud coefficient.""" # isscalar tests needed to ensure that the arrays will have the # right shape in the tds calculation. # there's probably a better way to do this. if np.isscalar(w) and np.isscalar(aod700): w = np.array([w]) aod700 ...
[ "Calculate", "the", "taud", "coefficient", "." ]
pvlib/pvlib-python
python
https://github.com/pvlib/pvlib-python/blob/2e844a595b820b43d1170269781fa66bd0ccc8a3/pvlib/clearsky.py#L521-L560
[ "def", "_calc_taud", "(", "w", ",", "aod700", ",", "p", ")", ":", "# isscalar tests needed to ensure that the arrays will have the", "# right shape in the tds calculation.", "# there's probably a better way to do this.", "if", "np", ".", "isscalar", "(", "w", ")", "and", "n...
2e844a595b820b43d1170269781fa66bd0ccc8a3
train
_calc_d
Calculate the d coefficient.
pvlib/clearsky.py
def _calc_d(aod700, p): """Calculate the d coefficient.""" p0 = 101325. dp = 1/(18 + 152*aod700) d = -0.337*aod700**2 + 0.63*aod700 + 0.116 + dp*np.log(p/p0) return d
def _calc_d(aod700, p): """Calculate the d coefficient.""" p0 = 101325. dp = 1/(18 + 152*aod700) d = -0.337*aod700**2 + 0.63*aod700 + 0.116 + dp*np.log(p/p0) return d
[ "Calculate", "the", "d", "coefficient", "." ]
pvlib/pvlib-python
python
https://github.com/pvlib/pvlib-python/blob/2e844a595b820b43d1170269781fa66bd0ccc8a3/pvlib/clearsky.py#L563-L570
[ "def", "_calc_d", "(", "aod700", ",", "p", ")", ":", "p0", "=", "101325.", "dp", "=", "1", "/", "(", "18", "+", "152", "*", "aod700", ")", "d", "=", "-", "0.337", "*", "aod700", "**", "2", "+", "0.63", "*", "aod700", "+", "0.116", "+", "dp", ...
2e844a595b820b43d1170269781fa66bd0ccc8a3
train
detect_clearsky
Detects clear sky times according to the algorithm developed by Reno and Hansen for GHI measurements [1]. The algorithm was designed and validated for analyzing GHI time series only. Users may attempt to apply it to other types of time series data using different filter settings, but should be skeptical...
pvlib/clearsky.py
def detect_clearsky(measured, clearsky, times, window_length, mean_diff=75, max_diff=75, lower_line_length=-5, upper_line_length=10, var_diff=0.005, slope_dev=8, max_iterations=20, return_components=False): """ Detects clear sky tim...
def detect_clearsky(measured, clearsky, times, window_length, mean_diff=75, max_diff=75, lower_line_length=-5, upper_line_length=10, var_diff=0.005, slope_dev=8, max_iterations=20, return_components=False): """ Detects clear sky tim...
[ "Detects", "clear", "sky", "times", "according", "to", "the", "algorithm", "developed", "by", "Reno", "and", "Hansen", "for", "GHI", "measurements", "[", "1", "]", ".", "The", "algorithm", "was", "designed", "and", "validated", "for", "analyzing", "GHI", "ti...
pvlib/pvlib-python
python
https://github.com/pvlib/pvlib-python/blob/2e844a595b820b43d1170269781fa66bd0ccc8a3/pvlib/clearsky.py#L573-L769
[ "def", "detect_clearsky", "(", "measured", ",", "clearsky", ",", "times", ",", "window_length", ",", "mean_diff", "=", "75", ",", "max_diff", "=", "75", ",", "lower_line_length", "=", "-", "5", ",", "upper_line_length", "=", "10", ",", "var_diff", "=", "0....
2e844a595b820b43d1170269781fa66bd0ccc8a3
train
bird
Bird Simple Clear Sky Broadband Solar Radiation Model Based on NREL Excel implementation by Daryl R. Myers [1, 2]. Bird and Hulstrom define the zenith as the "angle between a line to the sun and the local zenith". There is no distinction in the paper between solar zenith and apparent (or refracted) ze...
pvlib/clearsky.py
def bird(zenith, airmass_relative, aod380, aod500, precipitable_water, ozone=0.3, pressure=101325., dni_extra=1364., asymmetry=0.85, albedo=0.2): """ Bird Simple Clear Sky Broadband Solar Radiation Model Based on NREL Excel implementation by Daryl R. Myers [1, 2]. Bird and Hulstrom d...
def bird(zenith, airmass_relative, aod380, aod500, precipitable_water, ozone=0.3, pressure=101325., dni_extra=1364., asymmetry=0.85, albedo=0.2): """ Bird Simple Clear Sky Broadband Solar Radiation Model Based on NREL Excel implementation by Daryl R. Myers [1, 2]. Bird and Hulstrom d...
[ "Bird", "Simple", "Clear", "Sky", "Broadband", "Solar", "Radiation", "Model" ]
pvlib/pvlib-python
python
https://github.com/pvlib/pvlib-python/blob/2e844a595b820b43d1170269781fa66bd0ccc8a3/pvlib/clearsky.py#L772-L891
[ "def", "bird", "(", "zenith", ",", "airmass_relative", ",", "aod380", ",", "aod500", ",", "precipitable_water", ",", "ozone", "=", "0.3", ",", "pressure", "=", "101325.", ",", "dni_extra", "=", "1364.", ",", "asymmetry", "=", "0.85", ",", "albedo", "=", ...
2e844a595b820b43d1170269781fa66bd0ccc8a3
train
read_surfrad
Read in a daily NOAA SURFRAD[1] file. Parameters ---------- filename: str Filepath or url. map_variables: bool When true, renames columns of the Dataframe to pvlib variable names where applicable. See variable SURFRAD_COLUMNS. Returns ------- Tuple of the form (data...
pvlib/iotools/surfrad.py
def read_surfrad(filename, map_variables=True): """Read in a daily NOAA SURFRAD[1] file. Parameters ---------- filename: str Filepath or url. map_variables: bool When true, renames columns of the Dataframe to pvlib variable names where applicable. See variable SURFRAD_COLUMN...
def read_surfrad(filename, map_variables=True): """Read in a daily NOAA SURFRAD[1] file. Parameters ---------- filename: str Filepath or url. map_variables: bool When true, renames columns of the Dataframe to pvlib variable names where applicable. See variable SURFRAD_COLUMN...
[ "Read", "in", "a", "daily", "NOAA", "SURFRAD", "[", "1", "]", "file", "." ]
pvlib/pvlib-python
python
https://github.com/pvlib/pvlib-python/blob/2e844a595b820b43d1170269781fa66bd0ccc8a3/pvlib/iotools/surfrad.py#L46-L160
[ "def", "read_surfrad", "(", "filename", ",", "map_variables", "=", "True", ")", ":", "if", "filename", ".", "startswith", "(", "'ftp'", ")", ":", "req", "=", "Request", "(", "filename", ")", "response", "=", "urlopen", "(", "req", ")", "file_buffer", "="...
2e844a595b820b43d1170269781fa66bd0ccc8a3
train
format_index
Create UTC localized DatetimeIndex for the dataframe. Parameters ---------- data: Dataframe Must contain columns 'year', 'jday', 'hour' and 'minute'. Return ------ data: Dataframe Dataframe with a DatetimeIndex localized to UTC.
pvlib/iotools/surfrad.py
def format_index(data): """Create UTC localized DatetimeIndex for the dataframe. Parameters ---------- data: Dataframe Must contain columns 'year', 'jday', 'hour' and 'minute'. Return ------ data: Dataframe Dataframe with a DatetimeIndex localized to UTC. """ ...
def format_index(data): """Create UTC localized DatetimeIndex for the dataframe. Parameters ---------- data: Dataframe Must contain columns 'year', 'jday', 'hour' and 'minute'. Return ------ data: Dataframe Dataframe with a DatetimeIndex localized to UTC. """ ...
[ "Create", "UTC", "localized", "DatetimeIndex", "for", "the", "dataframe", "." ]
pvlib/pvlib-python
python
https://github.com/pvlib/pvlib-python/blob/2e844a595b820b43d1170269781fa66bd0ccc8a3/pvlib/iotools/surfrad.py#L163-L184
[ "def", "format_index", "(", "data", ")", ":", "year", "=", "data", ".", "year", ".", "apply", "(", "str", ")", "jday", "=", "data", ".", "jday", ".", "apply", "(", "lambda", "x", ":", "'{:03d}'", ".", "format", "(", "x", ")", ")", "hours", "=", ...
2e844a595b820b43d1170269781fa66bd0ccc8a3
train
warn_deprecated
Used to display deprecation in a standard way. Parameters ---------- since : str The release at which this API became deprecated. message : str, optional Override the default deprecation message. The format specifier `%(name)s` may be used for the name of the function, a...
pvlib/_deprecation.py
def warn_deprecated( since, message='', name='', alternative='', pending=False, obj_type='attribute', addendum='', removal=''): """ Used to display deprecation in a standard way. Parameters ---------- since : str The release at which this API became deprecated. message : ...
def warn_deprecated( since, message='', name='', alternative='', pending=False, obj_type='attribute', addendum='', removal=''): """ Used to display deprecation in a standard way. Parameters ---------- since : str The release at which this API became deprecated. message : ...
[ "Used", "to", "display", "deprecation", "in", "a", "standard", "way", ".", "Parameters", "----------", "since", ":", "str", "The", "release", "at", "which", "this", "API", "became", "deprecated", ".", "message", ":", "str", "optional", "Override", "the", "de...
pvlib/pvlib-python
python
https://github.com/pvlib/pvlib-python/blob/2e844a595b820b43d1170269781fa66bd0ccc8a3/pvlib/_deprecation.py#L167-L213
[ "def", "warn_deprecated", "(", "since", ",", "message", "=", "''", ",", "name", "=", "''", ",", "alternative", "=", "''", ",", "pending", "=", "False", ",", "obj_type", "=", "'attribute'", ",", "addendum", "=", "''", ",", "removal", "=", "''", ")", "...
2e844a595b820b43d1170269781fa66bd0ccc8a3
train
deprecated
Decorator to mark a function or a class as deprecated. Parameters ---------- since : str The release at which this API became deprecated. This is required. message : str, optional Override the default deprecation message. The format specifier `%(name)s` may be used for ...
pvlib/_deprecation.py
def deprecated(since, message='', name='', alternative='', pending=False, addendum='', removal=''): """ Decorator to mark a function or a class as deprecated. Parameters ---------- since : str The release at which this API became deprecated. This is required. mess...
def deprecated(since, message='', name='', alternative='', pending=False, addendum='', removal=''): """ Decorator to mark a function or a class as deprecated. Parameters ---------- since : str The release at which this API became deprecated. This is required. mess...
[ "Decorator", "to", "mark", "a", "function", "or", "a", "class", "as", "deprecated", ".", "Parameters", "----------", "since", ":", "str", "The", "release", "at", "which", "this", "API", "became", "deprecated", ".", "This", "is", "required", ".", "message", ...
pvlib/pvlib-python
python
https://github.com/pvlib/pvlib-python/blob/2e844a595b820b43d1170269781fa66bd0ccc8a3/pvlib/_deprecation.py#L216-L318
[ "def", "deprecated", "(", "since", ",", "message", "=", "''", ",", "name", "=", "''", ",", "alternative", "=", "''", ",", "pending", "=", "False", ",", "addendum", "=", "''", ",", "removal", "=", "''", ")", ":", "def", "deprecate", "(", "obj", ",",...
2e844a595b820b43d1170269781fa66bd0ccc8a3
train
map_midc_to_pvlib
A mapper function to rename Dataframe columns to their pvlib counterparts. Parameters ---------- variable_map: Dictionary A dictionary for mapping MIDC field name to pvlib name. See VARIABLE_MAP for default value and description of how to construct this argument. field_name: str...
pvlib/iotools/midc.py
def map_midc_to_pvlib(variable_map, field_name): """A mapper function to rename Dataframe columns to their pvlib counterparts. Parameters ---------- variable_map: Dictionary A dictionary for mapping MIDC field name to pvlib name. See VARIABLE_MAP for default value and description of how...
def map_midc_to_pvlib(variable_map, field_name): """A mapper function to rename Dataframe columns to their pvlib counterparts. Parameters ---------- variable_map: Dictionary A dictionary for mapping MIDC field name to pvlib name. See VARIABLE_MAP for default value and description of how...
[ "A", "mapper", "function", "to", "rename", "Dataframe", "columns", "to", "their", "pvlib", "counterparts", "." ]
pvlib/pvlib-python
python
https://github.com/pvlib/pvlib-python/blob/2e844a595b820b43d1170269781fa66bd0ccc8a3/pvlib/iotools/midc.py#L30-L64
[ "def", "map_midc_to_pvlib", "(", "variable_map", ",", "field_name", ")", ":", "new_field_name", "=", "field_name", "for", "midc_name", ",", "pvlib_name", "in", "variable_map", ".", "items", "(", ")", ":", "if", "field_name", ".", "startswith", "(", "midc_name", ...
2e844a595b820b43d1170269781fa66bd0ccc8a3
train
format_index
Create DatetimeIndex for the Dataframe localized to the timezone provided as the label of the second (time) column. Parameters ---------- data: Dataframe Must contain 'DATE (MM/DD/YYYY)' column, second column must be labeled with the timezone and contain times in 'HH:MM' format. Re...
pvlib/iotools/midc.py
def format_index(data): """Create DatetimeIndex for the Dataframe localized to the timezone provided as the label of the second (time) column. Parameters ---------- data: Dataframe Must contain 'DATE (MM/DD/YYYY)' column, second column must be labeled with the timezone and contain t...
def format_index(data): """Create DatetimeIndex for the Dataframe localized to the timezone provided as the label of the second (time) column. Parameters ---------- data: Dataframe Must contain 'DATE (MM/DD/YYYY)' column, second column must be labeled with the timezone and contain t...
[ "Create", "DatetimeIndex", "for", "the", "Dataframe", "localized", "to", "the", "timezone", "provided", "as", "the", "label", "of", "the", "second", "(", "time", ")", "column", "." ]
pvlib/pvlib-python
python
https://github.com/pvlib/pvlib-python/blob/2e844a595b820b43d1170269781fa66bd0ccc8a3/pvlib/iotools/midc.py#L67-L88
[ "def", "format_index", "(", "data", ")", ":", "tz_raw", "=", "data", ".", "columns", "[", "1", "]", "timezone", "=", "TZ_MAP", ".", "get", "(", "tz_raw", ",", "tz_raw", ")", "datetime", "=", "data", "[", "'DATE (MM/DD/YYYY)'", "]", "+", "data", "[", ...
2e844a595b820b43d1170269781fa66bd0ccc8a3
train
format_index_raw
Create DatetimeIndex for the Dataframe localized to the timezone provided as the label of the third column. Parameters ---------- data: Dataframe Must contain columns 'Year' and 'DOY'. Timezone must be found as the label of the third (time) column. Returns ------- data: Dat...
pvlib/iotools/midc.py
def format_index_raw(data): """Create DatetimeIndex for the Dataframe localized to the timezone provided as the label of the third column. Parameters ---------- data: Dataframe Must contain columns 'Year' and 'DOY'. Timezone must be found as the label of the third (time) column. ...
def format_index_raw(data): """Create DatetimeIndex for the Dataframe localized to the timezone provided as the label of the third column. Parameters ---------- data: Dataframe Must contain columns 'Year' and 'DOY'. Timezone must be found as the label of the third (time) column. ...
[ "Create", "DatetimeIndex", "for", "the", "Dataframe", "localized", "to", "the", "timezone", "provided", "as", "the", "label", "of", "the", "third", "column", "." ]
pvlib/pvlib-python
python
https://github.com/pvlib/pvlib-python/blob/2e844a595b820b43d1170269781fa66bd0ccc8a3/pvlib/iotools/midc.py#L91-L114
[ "def", "format_index_raw", "(", "data", ")", ":", "tz_raw", "=", "data", ".", "columns", "[", "3", "]", "timezone", "=", "TZ_MAP", ".", "get", "(", "tz_raw", ",", "tz_raw", ")", "year", "=", "data", ".", "Year", ".", "apply", "(", "str", ")", "jday...
2e844a595b820b43d1170269781fa66bd0ccc8a3
train
read_midc
Read in National Renewable Energy Laboratory Measurement and Instrumentation Data Center [1]_ weather data. Parameters ---------- filename: string Filename or url of data to read. variable_map: dictionary Dictionary for mapping MIDC field names to pvlib names. See variable `...
pvlib/iotools/midc.py
def read_midc(filename, variable_map=VARIABLE_MAP, raw_data=False): """Read in National Renewable Energy Laboratory Measurement and Instrumentation Data Center [1]_ weather data. Parameters ---------- filename: string Filename or url of data to read. variable_map: dictionary Dic...
def read_midc(filename, variable_map=VARIABLE_MAP, raw_data=False): """Read in National Renewable Energy Laboratory Measurement and Instrumentation Data Center [1]_ weather data. Parameters ---------- filename: string Filename or url of data to read. variable_map: dictionary Dic...
[ "Read", "in", "National", "Renewable", "Energy", "Laboratory", "Measurement", "and", "Instrumentation", "Data", "Center", "[", "1", "]", "_", "weather", "data", "." ]
pvlib/pvlib-python
python
https://github.com/pvlib/pvlib-python/blob/2e844a595b820b43d1170269781fa66bd0ccc8a3/pvlib/iotools/midc.py#L117-L165
[ "def", "read_midc", "(", "filename", ",", "variable_map", "=", "VARIABLE_MAP", ",", "raw_data", "=", "False", ")", ":", "data", "=", "pd", ".", "read_csv", "(", "filename", ")", "if", "raw_data", ":", "data", "=", "format_index_raw", "(", "data", ")", "e...
2e844a595b820b43d1170269781fa66bd0ccc8a3
train
read_midc_raw_data_from_nrel
Request and read MIDC data directly from the raw data api. Parameters ---------- site: string The MIDC station id. start: datetime Start date for requested data. end: datetime End date for requested data. Returns ------- data: Dataframe with DatetimeInde...
pvlib/iotools/midc.py
def read_midc_raw_data_from_nrel(site, start, end): """Request and read MIDC data directly from the raw data api. Parameters ---------- site: string The MIDC station id. start: datetime Start date for requested data. end: datetime End date for requested data. Return...
def read_midc_raw_data_from_nrel(site, start, end): """Request and read MIDC data directly from the raw data api. Parameters ---------- site: string The MIDC station id. start: datetime Start date for requested data. end: datetime End date for requested data. Return...
[ "Request", "and", "read", "MIDC", "data", "directly", "from", "the", "raw", "data", "api", "." ]
pvlib/pvlib-python
python
https://github.com/pvlib/pvlib-python/blob/2e844a595b820b43d1170269781fa66bd0ccc8a3/pvlib/iotools/midc.py#L168-L197
[ "def", "read_midc_raw_data_from_nrel", "(", "site", ",", "start", ",", "end", ")", ":", "args", "=", "{", "'site'", ":", "site", ",", "'begin'", ":", "start", ".", "strftime", "(", "'%Y%m%d'", ")", ",", "'end'", ":", "end", ".", "strftime", "(", "'%Y%m...
2e844a595b820b43d1170269781fa66bd0ccc8a3
train
get_relative_airmass
Gives the relative (not pressure-corrected) airmass. Gives the airmass at sea-level when given a sun zenith angle (in degrees). The ``model`` variable allows selection of different airmass models (described below). If ``model`` is not included or is not valid, the default model is 'kastenyoung1989'. ...
pvlib/atmosphere.py
def get_relative_airmass(zenith, model='kastenyoung1989'): ''' Gives the relative (not pressure-corrected) airmass. Gives the airmass at sea-level when given a sun zenith angle (in degrees). The ``model`` variable allows selection of different airmass models (described below). If ``model`` is not i...
def get_relative_airmass(zenith, model='kastenyoung1989'): ''' Gives the relative (not pressure-corrected) airmass. Gives the airmass at sea-level when given a sun zenith angle (in degrees). The ``model`` variable allows selection of different airmass models (described below). If ``model`` is not i...
[ "Gives", "the", "relative", "(", "not", "pressure", "-", "corrected", ")", "airmass", "." ]
pvlib/pvlib-python
python
https://github.com/pvlib/pvlib-python/blob/2e844a595b820b43d1170269781fa66bd0ccc8a3/pvlib/atmosphere.py#L145-L249
[ "def", "get_relative_airmass", "(", "zenith", ",", "model", "=", "'kastenyoung1989'", ")", ":", "# need to filter first because python 2.7 does not support raising a", "# negative number to a negative power.", "z", "=", "np", ".", "where", "(", "zenith", ">", "90", ",", "...
2e844a595b820b43d1170269781fa66bd0ccc8a3
train
gueymard94_pw
r""" Calculates precipitable water (cm) from ambient air temperature (C) and relatively humidity (%) using an empirical model. The accuracy of this method is approximately 20% for moderate PW (1-3 cm) and less accurate otherwise. The model was developed by expanding Eq. 1 in [2]_: .. math:: ...
pvlib/atmosphere.py
def gueymard94_pw(temp_air, relative_humidity): r""" Calculates precipitable water (cm) from ambient air temperature (C) and relatively humidity (%) using an empirical model. The accuracy of this method is approximately 20% for moderate PW (1-3 cm) and less accurate otherwise. The model was dev...
def gueymard94_pw(temp_air, relative_humidity): r""" Calculates precipitable water (cm) from ambient air temperature (C) and relatively humidity (%) using an empirical model. The accuracy of this method is approximately 20% for moderate PW (1-3 cm) and less accurate otherwise. The model was dev...
[ "r", "Calculates", "precipitable", "water", "(", "cm", ")", "from", "ambient", "air", "temperature", "(", "C", ")", "and", "relatively", "humidity", "(", "%", ")", "using", "an", "empirical", "model", ".", "The", "accuracy", "of", "this", "method", "is", ...
pvlib/pvlib-python
python
https://github.com/pvlib/pvlib-python/blob/2e844a595b820b43d1170269781fa66bd0ccc8a3/pvlib/atmosphere.py#L257-L334
[ "def", "gueymard94_pw", "(", "temp_air", ",", "relative_humidity", ")", ":", "T", "=", "temp_air", "+", "273.15", "# Convert to Kelvin # noqa: N806", "RH", "=", "relative_humidity", "# noqa: N806", "theta", "=", "T", "/", "273.15", "# Eq. 1 from Keogh a...
2e844a595b820b43d1170269781fa66bd0ccc8a3
train
first_solar_spectral_correction
r""" Spectral mismatch modifier based on precipitable water and absolute (pressure corrected) airmass. Estimates a spectral mismatch modifier M representing the effect on module short circuit current of variation in the spectral irradiance. M is estimated from absolute (pressure currected) air ...
pvlib/atmosphere.py
def first_solar_spectral_correction(pw, airmass_absolute, module_type=None, coefficients=None): r""" Spectral mismatch modifier based on precipitable water and absolute (pressure corrected) airmass. Estimates a spectral mismatch modifier M representing the effect on ...
def first_solar_spectral_correction(pw, airmass_absolute, module_type=None, coefficients=None): r""" Spectral mismatch modifier based on precipitable water and absolute (pressure corrected) airmass. Estimates a spectral mismatch modifier M representing the effect on ...
[ "r", "Spectral", "mismatch", "modifier", "based", "on", "precipitable", "water", "and", "absolute", "(", "pressure", "corrected", ")", "airmass", "." ]
pvlib/pvlib-python
python
https://github.com/pvlib/pvlib-python/blob/2e844a595b820b43d1170269781fa66bd0ccc8a3/pvlib/atmosphere.py#L337-L496
[ "def", "first_solar_spectral_correction", "(", "pw", ",", "airmass_absolute", ",", "module_type", "=", "None", ",", "coefficients", "=", "None", ")", ":", "# --- Screen Input Data ---", "# *** Pwat ***", "# Replace Pwat Values below 0.1 cm with 0.1 cm to prevent model from", "#...
2e844a595b820b43d1170269781fa66bd0ccc8a3
train
kasten96_lt
Calculate Linke turbidity factor using Kasten pyrheliometric formula. Note that broadband aerosol optical depth (AOD) can be approximated by AOD measured at 700 nm according to Molineaux [4] . Bird and Hulstrom offer an alternate approximation using AOD measured at 380 nm and 500 nm. Based on original...
pvlib/atmosphere.py
def kasten96_lt(airmass_absolute, precipitable_water, aod_bb): """ Calculate Linke turbidity factor using Kasten pyrheliometric formula. Note that broadband aerosol optical depth (AOD) can be approximated by AOD measured at 700 nm according to Molineaux [4] . Bird and Hulstrom offer an alternate ap...
def kasten96_lt(airmass_absolute, precipitable_water, aod_bb): """ Calculate Linke turbidity factor using Kasten pyrheliometric formula. Note that broadband aerosol optical depth (AOD) can be approximated by AOD measured at 700 nm according to Molineaux [4] . Bird and Hulstrom offer an alternate ap...
[ "Calculate", "Linke", "turbidity", "factor", "using", "Kasten", "pyrheliometric", "formula", "." ]
pvlib/pvlib-python
python
https://github.com/pvlib/pvlib-python/blob/2e844a595b820b43d1170269781fa66bd0ccc8a3/pvlib/atmosphere.py#L536-L621
[ "def", "kasten96_lt", "(", "airmass_absolute", ",", "precipitable_water", ",", "aod_bb", ")", ":", "# \"From numerically integrated spectral simulations done with Modtran", "# (Berk, 1989), Molineaux (1998) obtained for the broadband optical depth", "# of a clean and dry atmospshere (fictiti...
2e844a595b820b43d1170269781fa66bd0ccc8a3
train
angstrom_alpha
r""" Calculate Angstrom alpha exponent. Parameters ---------- aod1 : numeric first aerosol optical depth lambda1 : numeric wavelength in nanometers corresponding to ``aod1`` aod2 : numeric second aerosol optical depth lambda2 : numeric wavelength in nanometer...
pvlib/atmosphere.py
def angstrom_alpha(aod1, lambda1, aod2, lambda2): r""" Calculate Angstrom alpha exponent. Parameters ---------- aod1 : numeric first aerosol optical depth lambda1 : numeric wavelength in nanometers corresponding to ``aod1`` aod2 : numeric second aerosol optical depth...
def angstrom_alpha(aod1, lambda1, aod2, lambda2): r""" Calculate Angstrom alpha exponent. Parameters ---------- aod1 : numeric first aerosol optical depth lambda1 : numeric wavelength in nanometers corresponding to ``aod1`` aod2 : numeric second aerosol optical depth...
[ "r", "Calculate", "Angstrom", "alpha", "exponent", "." ]
pvlib/pvlib-python
python
https://github.com/pvlib/pvlib-python/blob/2e844a595b820b43d1170269781fa66bd0ccc8a3/pvlib/atmosphere.py#L662-L686
[ "def", "angstrom_alpha", "(", "aod1", ",", "lambda1", ",", "aod2", ",", "lambda2", ")", ":", "return", "-", "np", ".", "log", "(", "aod1", "/", "aod2", ")", "/", "np", ".", "log", "(", "lambda1", "/", "lambda2", ")" ]
2e844a595b820b43d1170269781fa66bd0ccc8a3
train
localize_to_utc
Converts or localizes a time series to UTC. Parameters ---------- time : datetime.datetime, pandas.DatetimeIndex, or pandas.Series/DataFrame with a DatetimeIndex. location : pvlib.Location object Returns ------- pandas object localized to UTC.
pvlib/tools.py
def localize_to_utc(time, location): """ Converts or localizes a time series to UTC. Parameters ---------- time : datetime.datetime, pandas.DatetimeIndex, or pandas.Series/DataFrame with a DatetimeIndex. location : pvlib.Location object Returns ------- pandas object loca...
def localize_to_utc(time, location): """ Converts or localizes a time series to UTC. Parameters ---------- time : datetime.datetime, pandas.DatetimeIndex, or pandas.Series/DataFrame with a DatetimeIndex. location : pvlib.Location object Returns ------- pandas object loca...
[ "Converts", "or", "localizes", "a", "time", "series", "to", "UTC", "." ]
pvlib/pvlib-python
python
https://github.com/pvlib/pvlib-python/blob/2e844a595b820b43d1170269781fa66bd0ccc8a3/pvlib/tools.py#L89-L113
[ "def", "localize_to_utc", "(", "time", ",", "location", ")", ":", "if", "isinstance", "(", "time", ",", "dt", ".", "datetime", ")", ":", "if", "time", ".", "tzinfo", "is", "None", ":", "time", "=", "pytz", ".", "timezone", "(", "location", ".", "tz",...
2e844a595b820b43d1170269781fa66bd0ccc8a3
train
datetime_to_djd
Converts a datetime to the Dublin Julian Day Parameters ---------- time : datetime.datetime time to convert Returns ------- float fractional days since 12/31/1899+0000
pvlib/tools.py
def datetime_to_djd(time): """ Converts a datetime to the Dublin Julian Day Parameters ---------- time : datetime.datetime time to convert Returns ------- float fractional days since 12/31/1899+0000 """ if time.tzinfo is None: time_utc = pytz.utc.locali...
def datetime_to_djd(time): """ Converts a datetime to the Dublin Julian Day Parameters ---------- time : datetime.datetime time to convert Returns ------- float fractional days since 12/31/1899+0000 """ if time.tzinfo is None: time_utc = pytz.utc.locali...
[ "Converts", "a", "datetime", "to", "the", "Dublin", "Julian", "Day" ]
pvlib/pvlib-python
python
https://github.com/pvlib/pvlib-python/blob/2e844a595b820b43d1170269781fa66bd0ccc8a3/pvlib/tools.py#L116-L139
[ "def", "datetime_to_djd", "(", "time", ")", ":", "if", "time", ".", "tzinfo", "is", "None", ":", "time_utc", "=", "pytz", ".", "utc", ".", "localize", "(", "time", ")", "else", ":", "time_utc", "=", "time", ".", "astimezone", "(", "pytz", ".", "utc",...
2e844a595b820b43d1170269781fa66bd0ccc8a3
train
djd_to_datetime
Converts a Dublin Julian Day float to a datetime.datetime object Parameters ---------- djd : float fractional days since 12/31/1899+0000 tz : str, default 'UTC' timezone to localize the result to Returns ------- datetime.datetime The resultant datetime localized to t...
pvlib/tools.py
def djd_to_datetime(djd, tz='UTC'): """ Converts a Dublin Julian Day float to a datetime.datetime object Parameters ---------- djd : float fractional days since 12/31/1899+0000 tz : str, default 'UTC' timezone to localize the result to Returns ------- datetime.datet...
def djd_to_datetime(djd, tz='UTC'): """ Converts a Dublin Julian Day float to a datetime.datetime object Parameters ---------- djd : float fractional days since 12/31/1899+0000 tz : str, default 'UTC' timezone to localize the result to Returns ------- datetime.datet...
[ "Converts", "a", "Dublin", "Julian", "Day", "float", "to", "a", "datetime", ".", "datetime", "object" ]
pvlib/pvlib-python
python
https://github.com/pvlib/pvlib-python/blob/2e844a595b820b43d1170269781fa66bd0ccc8a3/pvlib/tools.py#L142-L162
[ "def", "djd_to_datetime", "(", "djd", ",", "tz", "=", "'UTC'", ")", ":", "djd_start", "=", "pytz", ".", "utc", ".", "localize", "(", "dt", ".", "datetime", "(", "1899", ",", "12", ",", "31", ",", "12", ")", ")", "utc_time", "=", "djd_start", "+", ...
2e844a595b820b43d1170269781fa66bd0ccc8a3
train
_doy_to_datetimeindex
Convert a day of year scalar or array to a pd.DatetimeIndex. Parameters ---------- doy : numeric Contains days of the year Returns ------- pd.DatetimeIndex
pvlib/tools.py
def _doy_to_datetimeindex(doy, epoch_year=2014): """ Convert a day of year scalar or array to a pd.DatetimeIndex. Parameters ---------- doy : numeric Contains days of the year Returns ------- pd.DatetimeIndex """ doy = np.atleast_1d(doy).astype('float') epoch = pd.T...
def _doy_to_datetimeindex(doy, epoch_year=2014): """ Convert a day of year scalar or array to a pd.DatetimeIndex. Parameters ---------- doy : numeric Contains days of the year Returns ------- pd.DatetimeIndex """ doy = np.atleast_1d(doy).astype('float') epoch = pd.T...
[ "Convert", "a", "day", "of", "year", "scalar", "or", "array", "to", "a", "pd", ".", "DatetimeIndex", "." ]
pvlib/pvlib-python
python
https://github.com/pvlib/pvlib-python/blob/2e844a595b820b43d1170269781fa66bd0ccc8a3/pvlib/tools.py#L182-L198
[ "def", "_doy_to_datetimeindex", "(", "doy", ",", "epoch_year", "=", "2014", ")", ":", "doy", "=", "np", ".", "atleast_1d", "(", "doy", ")", ".", "astype", "(", "'float'", ")", "epoch", "=", "pd", ".", "Timestamp", "(", "'{}-12-31'", ".", "format", "(",...
2e844a595b820b43d1170269781fa66bd0ccc8a3
train
_build_kwargs
Parameters ---------- keys : iterable Typically a list of strings. adict : dict-like A dictionary from which to attempt to pull each key. Returns ------- kwargs : dict A dictionary with only the keys that were in input_dict
pvlib/tools.py
def _build_kwargs(keys, input_dict): """ Parameters ---------- keys : iterable Typically a list of strings. adict : dict-like A dictionary from which to attempt to pull each key. Returns ------- kwargs : dict A dictionary with only the keys that were in input_dic...
def _build_kwargs(keys, input_dict): """ Parameters ---------- keys : iterable Typically a list of strings. adict : dict-like A dictionary from which to attempt to pull each key. Returns ------- kwargs : dict A dictionary with only the keys that were in input_dic...
[ "Parameters", "----------", "keys", ":", "iterable", "Typically", "a", "list", "of", "strings", ".", "adict", ":", "dict", "-", "like", "A", "dictionary", "from", "which", "to", "attempt", "to", "pull", "each", "key", "." ]
pvlib/pvlib-python
python
https://github.com/pvlib/pvlib-python/blob/2e844a595b820b43d1170269781fa66bd0ccc8a3/pvlib/tools.py#L229-L251
[ "def", "_build_kwargs", "(", "keys", ",", "input_dict", ")", ":", "kwargs", "=", "{", "}", "for", "key", "in", "keys", ":", "try", ":", "kwargs", "[", "key", "]", "=", "input_dict", "[", "key", "]", "except", "KeyError", ":", "pass", "return", "kwarg...
2e844a595b820b43d1170269781fa66bd0ccc8a3
train
_array_newton
A vectorized version of Newton, Halley, and secant methods for arrays. Do not use this method directly. This method is called from :func:`newton` when ``np.isscalar(x0)`` is true. For docstring, see :func:`newton`.
pvlib/tools.py
def _array_newton(func, x0, fprime, args, tol, maxiter, fprime2, converged=False): """ A vectorized version of Newton, Halley, and secant methods for arrays. Do not use this method directly. This method is called from :func:`newton` when ``np.isscalar(x0)`` is true. For docstring, see ...
def _array_newton(func, x0, fprime, args, tol, maxiter, fprime2, converged=False): """ A vectorized version of Newton, Halley, and secant methods for arrays. Do not use this method directly. This method is called from :func:`newton` when ``np.isscalar(x0)`` is true. For docstring, see ...
[ "A", "vectorized", "version", "of", "Newton", "Halley", "and", "secant", "methods", "for", "arrays", ".", "Do", "not", "use", "this", "method", "directly", ".", "This", "method", "is", "called", "from", ":", "func", ":", "newton", "when", "np", ".", "iss...
pvlib/pvlib-python
python
https://github.com/pvlib/pvlib-python/blob/2e844a595b820b43d1170269781fa66bd0ccc8a3/pvlib/tools.py#L262-L356
[ "def", "_array_newton", "(", "func", ",", "x0", ",", "fprime", ",", "args", ",", "tol", ",", "maxiter", ",", "fprime2", ",", "converged", "=", "False", ")", ":", "try", ":", "p", "=", "np", ".", "asarray", "(", "x0", ",", "dtype", "=", "float", "...
2e844a595b820b43d1170269781fa66bd0ccc8a3
train
_golden_sect_DataFrame
Vectorized golden section search for finding MPP from a dataframe timeseries. Parameters ---------- params : dict Dictionary containing scalars or arrays of inputs to the function to be optimized. Each row should represent an independent optimization. VL: float Lowe...
pvlib/tools.py
def _golden_sect_DataFrame(params, VL, VH, func): """ Vectorized golden section search for finding MPP from a dataframe timeseries. Parameters ---------- params : dict Dictionary containing scalars or arrays of inputs to the function to be optimized. Each row should repr...
def _golden_sect_DataFrame(params, VL, VH, func): """ Vectorized golden section search for finding MPP from a dataframe timeseries. Parameters ---------- params : dict Dictionary containing scalars or arrays of inputs to the function to be optimized. Each row should repr...
[ "Vectorized", "golden", "section", "search", "for", "finding", "MPP", "from", "a", "dataframe", "timeseries", "." ]
pvlib/pvlib-python
python
https://github.com/pvlib/pvlib-python/blob/2e844a595b820b43d1170269781fa66bd0ccc8a3/pvlib/tools.py#L362-L427
[ "def", "_golden_sect_DataFrame", "(", "params", ",", "VL", ",", "VH", ",", "func", ")", ":", "df", "=", "params", "df", "[", "'VH'", "]", "=", "VH", "df", "[", "'VL'", "]", "=", "VL", "errflag", "=", "True", "iterations", "=", "0", "while", "errfla...
2e844a595b820b43d1170269781fa66bd0ccc8a3
train
singleaxis
Determine the rotation angle of a single axis tracker using the equations in [1] when given a particular sun zenith and azimuth angle. backtracking may be specified, and if so, a ground coverage ratio is required. Rotation angle is determined in a panel-oriented coordinate system. The tracker azimu...
pvlib/tracking.py
def singleaxis(apparent_zenith, apparent_azimuth, axis_tilt=0, axis_azimuth=0, max_angle=90, backtrack=True, gcr=2.0/7.0): """ Determine the rotation angle of a single axis tracker using the equations in [1] when given a particular sun zenith and azimuth angle. backtracking...
def singleaxis(apparent_zenith, apparent_azimuth, axis_tilt=0, axis_azimuth=0, max_angle=90, backtrack=True, gcr=2.0/7.0): """ Determine the rotation angle of a single axis tracker using the equations in [1] when given a particular sun zenith and azimuth angle. backtracking...
[ "Determine", "the", "rotation", "angle", "of", "a", "single", "axis", "tracker", "using", "the", "equations", "in", "[", "1", "]", "when", "given", "a", "particular", "sun", "zenith", "and", "azimuth", "angle", ".", "backtracking", "may", "be", "specified", ...
pvlib/pvlib-python
python
https://github.com/pvlib/pvlib-python/blob/2e844a595b820b43d1170269781fa66bd0ccc8a3/pvlib/tracking.py#L260-L580
[ "def", "singleaxis", "(", "apparent_zenith", ",", "apparent_azimuth", ",", "axis_tilt", "=", "0", ",", "axis_azimuth", "=", "0", ",", "max_angle", "=", "90", ",", "backtrack", "=", "True", ",", "gcr", "=", "2.0", "/", "7.0", ")", ":", "# MATLAB to Python c...
2e844a595b820b43d1170269781fa66bd0ccc8a3
train
SingleAxisTracker.singleaxis
Get tracking data. See :py:func:`pvlib.tracking.singleaxis` more detail. Parameters ---------- apparent_zenith : float, 1d array, or Series Solar apparent zenith angles in decimal degrees. apparent_azimuth : float, 1d array, or Series Solar apparent azim...
pvlib/tracking.py
def singleaxis(self, apparent_zenith, apparent_azimuth): """ Get tracking data. See :py:func:`pvlib.tracking.singleaxis` more detail. Parameters ---------- apparent_zenith : float, 1d array, or Series Solar apparent zenith angles in decimal degrees. ...
def singleaxis(self, apparent_zenith, apparent_azimuth): """ Get tracking data. See :py:func:`pvlib.tracking.singleaxis` more detail. Parameters ---------- apparent_zenith : float, 1d array, or Series Solar apparent zenith angles in decimal degrees. ...
[ "Get", "tracking", "data", ".", "See", ":", "py", ":", "func", ":", "pvlib", ".", "tracking", ".", "singleaxis", "more", "detail", "." ]
pvlib/pvlib-python
python
https://github.com/pvlib/pvlib-python/blob/2e844a595b820b43d1170269781fa66bd0ccc8a3/pvlib/tracking.py#L73-L95
[ "def", "singleaxis", "(", "self", ",", "apparent_zenith", ",", "apparent_azimuth", ")", ":", "tracking_data", "=", "singleaxis", "(", "apparent_zenith", ",", "apparent_azimuth", ",", "self", ".", "axis_tilt", ",", "self", ".", "axis_azimuth", ",", "self", ".", ...
2e844a595b820b43d1170269781fa66bd0ccc8a3
train
SingleAxisTracker.get_irradiance
Uses the :func:`irradiance.get_total_irradiance` function to calculate the plane of array irradiance components on a tilted surface defined by the input data and ``self.albedo``. For a given set of solar zenith and azimuth angles, the surface tilt and azimuth parameters are typically de...
pvlib/tracking.py
def get_irradiance(self, surface_tilt, surface_azimuth, solar_zenith, solar_azimuth, dni, ghi, dhi, dni_extra=None, airmass=None, model='haydavies', **kwargs): """ Uses the :func:`irradiance.get_total_irradiance` function to ca...
def get_irradiance(self, surface_tilt, surface_azimuth, solar_zenith, solar_azimuth, dni, ghi, dhi, dni_extra=None, airmass=None, model='haydavies', **kwargs): """ Uses the :func:`irradiance.get_total_irradiance` function to ca...
[ "Uses", "the", ":", "func", ":", "irradiance", ".", "get_total_irradiance", "function", "to", "calculate", "the", "plane", "of", "array", "irradiance", "components", "on", "a", "tilted", "surface", "defined", "by", "the", "input", "data", "and", "self", ".", ...
pvlib/pvlib-python
python
https://github.com/pvlib/pvlib-python/blob/2e844a595b820b43d1170269781fa66bd0ccc8a3/pvlib/tracking.py#L153-L214
[ "def", "get_irradiance", "(", "self", ",", "surface_tilt", ",", "surface_azimuth", ",", "solar_zenith", ",", "solar_azimuth", ",", "dni", ",", "ghi", ",", "dhi", ",", "dni_extra", "=", "None", ",", "airmass", "=", "None", ",", "model", "=", "'haydavies'", ...
2e844a595b820b43d1170269781fa66bd0ccc8a3
train
read_srml
Read University of Oregon SRML[1] 1min .tsv file into pandas dataframe. Parameters ---------- filename: str filepath or url to read for the tsv file. Returns ------- data: Dataframe A dataframe with datetime index and all of the variables listed in the `VARIABLE_MAP` di...
pvlib/iotools/srml.py
def read_srml(filename): """ Read University of Oregon SRML[1] 1min .tsv file into pandas dataframe. Parameters ---------- filename: str filepath or url to read for the tsv file. Returns ------- data: Dataframe A dataframe with datetime index and all of the variables li...
def read_srml(filename): """ Read University of Oregon SRML[1] 1min .tsv file into pandas dataframe. Parameters ---------- filename: str filepath or url to read for the tsv file. Returns ------- data: Dataframe A dataframe with datetime index and all of the variables li...
[ "Read", "University", "of", "Oregon", "SRML", "[", "1", "]", "1min", ".", "tsv", "file", "into", "pandas", "dataframe", "." ]
pvlib/pvlib-python
python
https://github.com/pvlib/pvlib-python/blob/2e844a595b820b43d1170269781fa66bd0ccc8a3/pvlib/iotools/srml.py#L27-L88
[ "def", "read_srml", "(", "filename", ")", ":", "tsv_data", "=", "pd", ".", "read_csv", "(", "filename", ",", "delimiter", "=", "'\\t'", ")", "data", "=", "format_index", "(", "tsv_data", ")", "# Drop day of year and time columns", "data", "=", "data", "[", "...
2e844a595b820b43d1170269781fa66bd0ccc8a3
train
map_columns
Map data element numbers to pvlib names. Parameters ---------- col: str Column label to be mapped. Returns ------- str The pvlib label if it was found in the mapping, else the original label.
pvlib/iotools/srml.py
def map_columns(col): """Map data element numbers to pvlib names. Parameters ---------- col: str Column label to be mapped. Returns ------- str The pvlib label if it was found in the mapping, else the original label. """ if col.startswith('7'): # spe...
def map_columns(col): """Map data element numbers to pvlib names. Parameters ---------- col: str Column label to be mapped. Returns ------- str The pvlib label if it was found in the mapping, else the original label. """ if col.startswith('7'): # spe...
[ "Map", "data", "element", "numbers", "to", "pvlib", "names", "." ]
pvlib/pvlib-python
python
https://github.com/pvlib/pvlib-python/blob/2e844a595b820b43d1170269781fa66bd0ccc8a3/pvlib/iotools/srml.py#L91-L116
[ "def", "map_columns", "(", "col", ")", ":", "if", "col", ".", "startswith", "(", "'7'", ")", ":", "# spectral data", "try", ":", "return", "VARIABLE_MAP", "[", "col", "]", "except", "KeyError", ":", "return", "col", "try", ":", "variable_name", "=", "VAR...
2e844a595b820b43d1170269781fa66bd0ccc8a3
train
format_index
Create a datetime index from day of year, and time columns. Parameters ---------- df: pd.Dataframe The srml data to reindex. Returns ------- df: pd.Dataframe The Dataframe with a DatetimeIndex localized to 'Etc/GMT+8'.
pvlib/iotools/srml.py
def format_index(df): """Create a datetime index from day of year, and time columns. Parameters ---------- df: pd.Dataframe The srml data to reindex. Returns ------- df: pd.Dataframe The Dataframe with a DatetimeIndex localized to 'Etc/GMT+8'. """ # Name of the seco...
def format_index(df): """Create a datetime index from day of year, and time columns. Parameters ---------- df: pd.Dataframe The srml data to reindex. Returns ------- df: pd.Dataframe The Dataframe with a DatetimeIndex localized to 'Etc/GMT+8'. """ # Name of the seco...
[ "Create", "a", "datetime", "index", "from", "day", "of", "year", "and", "time", "columns", "." ]
pvlib/pvlib-python
python
https://github.com/pvlib/pvlib-python/blob/2e844a595b820b43d1170269781fa66bd0ccc8a3/pvlib/iotools/srml.py#L119-L148
[ "def", "format_index", "(", "df", ")", ":", "# Name of the second column indicates the year of the file, but", "# the column contains times.", "year", "=", "int", "(", "df", ".", "columns", "[", "1", "]", ")", "df_doy", "=", "df", "[", "df", ".", "columns", "[", ...
2e844a595b820b43d1170269781fa66bd0ccc8a3
train
read_srml_month_from_solardat
Request a month of SRML[1] data from solardat and read it into a Dataframe. Parameters ---------- station: str The name of the SRML station to request. year: int Year to request data for month: int Month to request data for. filetype: string SRML file type to...
pvlib/iotools/srml.py
def read_srml_month_from_solardat(station, year, month, filetype='PO'): """Request a month of SRML[1] data from solardat and read it into a Dataframe. Parameters ---------- station: str The name of the SRML station to request. year: int Year to request data for month: int ...
def read_srml_month_from_solardat(station, year, month, filetype='PO'): """Request a month of SRML[1] data from solardat and read it into a Dataframe. Parameters ---------- station: str The name of the SRML station to request. year: int Year to request data for month: int ...
[ "Request", "a", "month", "of", "SRML", "[", "1", "]", "data", "from", "solardat", "and", "read", "it", "into", "a", "Dataframe", "." ]
pvlib/pvlib-python
python
https://github.com/pvlib/pvlib-python/blob/2e844a595b820b43d1170269781fa66bd0ccc8a3/pvlib/iotools/srml.py#L151-L184
[ "def", "read_srml_month_from_solardat", "(", "station", ",", "year", ",", "month", ",", "filetype", "=", "'PO'", ")", ":", "file_name", "=", "\"{station}{filetype}{year:02d}{month:02d}.txt\"", ".", "format", "(", "station", "=", "station", ",", "filetype", "=", "f...
2e844a595b820b43d1170269781fa66bd0ccc8a3
train
get_ecmwf_macc
Download data from ECMWF MACC Reanalysis API. Parameters ---------- filename : str full path of file where to save data, ``.nc`` appended if not given params : str or sequence of str keynames of parameter[s] to download startdate : datetime.datetime or datetime.date UTC date...
pvlib/iotools/ecmwf_macc.py
def get_ecmwf_macc(filename, params, startdate, stopdate, lookup_params=True, server=None, target=_ecmwf): """ Download data from ECMWF MACC Reanalysis API. Parameters ---------- filename : str full path of file where to save data, ``.nc`` appended if not given params...
def get_ecmwf_macc(filename, params, startdate, stopdate, lookup_params=True, server=None, target=_ecmwf): """ Download data from ECMWF MACC Reanalysis API. Parameters ---------- filename : str full path of file where to save data, ``.nc`` appended if not given params...
[ "Download", "data", "from", "ECMWF", "MACC", "Reanalysis", "API", "." ]
pvlib/pvlib-python
python
https://github.com/pvlib/pvlib-python/blob/2e844a595b820b43d1170269781fa66bd0ccc8a3/pvlib/iotools/ecmwf_macc.py#L57-L172
[ "def", "get_ecmwf_macc", "(", "filename", ",", "params", ",", "startdate", ",", "stopdate", ",", "lookup_params", "=", "True", ",", "server", "=", "None", ",", "target", "=", "_ecmwf", ")", ":", "if", "not", "filename", ".", "endswith", "(", "'nc'", ")",...
2e844a595b820b43d1170269781fa66bd0ccc8a3
train
read_ecmwf_macc
Read data from ECMWF MACC reanalysis netCDF4 file. Parameters ---------- filename : string full path to netCDF4 data file. latitude : float latitude in degrees longitude : float longitude in degrees utc_time_range : sequence of datetime.datetime pair of start and...
pvlib/iotools/ecmwf_macc.py
def read_ecmwf_macc(filename, latitude, longitude, utc_time_range=None): """ Read data from ECMWF MACC reanalysis netCDF4 file. Parameters ---------- filename : string full path to netCDF4 data file. latitude : float latitude in degrees longitude : float longitude in...
def read_ecmwf_macc(filename, latitude, longitude, utc_time_range=None): """ Read data from ECMWF MACC reanalysis netCDF4 file. Parameters ---------- filename : string full path to netCDF4 data file. latitude : float latitude in degrees longitude : float longitude in...
[ "Read", "data", "from", "ECMWF", "MACC", "reanalysis", "netCDF4", "file", "." ]
pvlib/pvlib-python
python
https://github.com/pvlib/pvlib-python/blob/2e844a595b820b43d1170269781fa66bd0ccc8a3/pvlib/iotools/ecmwf_macc.py#L272-L313
[ "def", "read_ecmwf_macc", "(", "filename", ",", "latitude", ",", "longitude", ",", "utc_time_range", "=", "None", ")", ":", "ecmwf_macc", "=", "ECMWF_MACC", "(", "filename", ")", "try", ":", "ilat", ",", "ilon", "=", "ecmwf_macc", ".", "get_nearest_indices", ...
2e844a595b820b43d1170269781fa66bd0ccc8a3
train
ECMWF_MACC.get_nearest_indices
Get nearest indices to (latitude, longitude). Parmaeters ---------- latitude : float Latitude in degrees longitude : float Longitude in degrees Returns ------- idx_lat : int index of nearest latitude idx_lon : int ...
pvlib/iotools/ecmwf_macc.py
def get_nearest_indices(self, latitude, longitude): """ Get nearest indices to (latitude, longitude). Parmaeters ---------- latitude : float Latitude in degrees longitude : float Longitude in degrees Returns ------- idx_la...
def get_nearest_indices(self, latitude, longitude): """ Get nearest indices to (latitude, longitude). Parmaeters ---------- latitude : float Latitude in degrees longitude : float Longitude in degrees Returns ------- idx_la...
[ "Get", "nearest", "indices", "to", "(", "latitude", "longitude", ")", "." ]
pvlib/pvlib-python
python
https://github.com/pvlib/pvlib-python/blob/2e844a595b820b43d1170269781fa66bd0ccc8a3/pvlib/iotools/ecmwf_macc.py#L199-L228
[ "def", "get_nearest_indices", "(", "self", ",", "latitude", ",", "longitude", ")", ":", "# index of nearest latitude", "idx_lat", "=", "int", "(", "round", "(", "(", "latitude", "-", "90.0", ")", "/", "self", ".", "delta_lat", ")", ")", "# avoid out of bounds ...
2e844a595b820b43d1170269781fa66bd0ccc8a3
train
ECMWF_MACC.interp_data
Interpolate ``param`` values to ``utc_time`` using indices nearest to (``latitude, longitude``). Parmaeters ---------- latitude : float Latitude in degrees longitude : float Longitude in degrees utc_time : datetime.datetime or datetime.date ...
pvlib/iotools/ecmwf_macc.py
def interp_data(self, latitude, longitude, utc_time, param): """ Interpolate ``param`` values to ``utc_time`` using indices nearest to (``latitude, longitude``). Parmaeters ---------- latitude : float Latitude in degrees longitude : float ...
def interp_data(self, latitude, longitude, utc_time, param): """ Interpolate ``param`` values to ``utc_time`` using indices nearest to (``latitude, longitude``). Parmaeters ---------- latitude : float Latitude in degrees longitude : float ...
[ "Interpolate", "param", "values", "to", "utc_time", "using", "indices", "nearest", "to", "(", "latitude", "longitude", ")", "." ]
pvlib/pvlib-python
python
https://github.com/pvlib/pvlib-python/blob/2e844a595b820b43d1170269781fa66bd0ccc8a3/pvlib/iotools/ecmwf_macc.py#L230-L269
[ "def", "interp_data", "(", "self", ",", "latitude", ",", "longitude", ",", "utc_time", ",", "param", ")", ":", "nctime", "=", "self", ".", "data", "[", "'time'", "]", "# time", "ilat", ",", "ilon", "=", "self", ".", "get_nearest_indices", "(", "latitude"...
2e844a595b820b43d1170269781fa66bd0ccc8a3
train
read_solrad
Read NOAA SOLRAD [1]_ [2]_ fixed-width file into pandas dataframe. Parameters ---------- filename: str filepath or url to read for the fixed-width file. Returns ------- data: Dataframe A dataframe with DatetimeIndex and all of the variables in the file. Notes -...
pvlib/iotools/solrad.py
def read_solrad(filename): """ Read NOAA SOLRAD [1]_ [2]_ fixed-width file into pandas dataframe. Parameters ---------- filename: str filepath or url to read for the fixed-width file. Returns ------- data: Dataframe A dataframe with DatetimeIndex and all of the variable...
def read_solrad(filename): """ Read NOAA SOLRAD [1]_ [2]_ fixed-width file into pandas dataframe. Parameters ---------- filename: str filepath or url to read for the fixed-width file. Returns ------- data: Dataframe A dataframe with DatetimeIndex and all of the variable...
[ "Read", "NOAA", "SOLRAD", "[", "1", "]", "_", "[", "2", "]", "_", "fixed", "-", "width", "file", "into", "pandas", "dataframe", "." ]
pvlib/pvlib-python
python
https://github.com/pvlib/pvlib-python/blob/2e844a595b820b43d1170269781fa66bd0ccc8a3/pvlib/iotools/solrad.py#L50-L122
[ "def", "read_solrad", "(", "filename", ")", ":", "if", "'msn'", "in", "filename", ":", "names", "=", "MADISON_HEADERS", "widths", "=", "MADISON_WIDTHS", "dtypes", "=", "MADISON_DTYPES", "else", ":", "names", "=", "HEADERS", "widths", "=", "WIDTHS", "dtypes", ...
2e844a595b820b43d1170269781fa66bd0ccc8a3
train
read_crn
Read NOAA USCRN [1]_ [2]_ fixed-width file into pandas dataframe. Parameters ---------- filename: str filepath or url to read for the fixed-width file. Returns ------- data: Dataframe A dataframe with DatetimeIndex and all of the variables in the file. Notes --...
pvlib/iotools/crn.py
def read_crn(filename): """ Read NOAA USCRN [1]_ [2]_ fixed-width file into pandas dataframe. Parameters ---------- filename: str filepath or url to read for the fixed-width file. Returns ------- data: Dataframe A dataframe with DatetimeIndex and all of the variables in...
def read_crn(filename): """ Read NOAA USCRN [1]_ [2]_ fixed-width file into pandas dataframe. Parameters ---------- filename: str filepath or url to read for the fixed-width file. Returns ------- data: Dataframe A dataframe with DatetimeIndex and all of the variables in...
[ "Read", "NOAA", "USCRN", "[", "1", "]", "_", "[", "2", "]", "_", "fixed", "-", "width", "file", "into", "pandas", "dataframe", "." ]
pvlib/pvlib-python
python
https://github.com/pvlib/pvlib-python/blob/2e844a595b820b43d1170269781fa66bd0ccc8a3/pvlib/iotools/crn.py#L43-L106
[ "def", "read_crn", "(", "filename", ")", ":", "# read in data", "data", "=", "pd", ".", "read_fwf", "(", "filename", ",", "header", "=", "None", ",", "names", "=", "HEADERS", ".", "split", "(", "' '", ")", ",", "widths", "=", "WIDTHS", ")", "# loop her...
2e844a595b820b43d1170269781fa66bd0ccc8a3
train
read_epw
Read an EPW file in to a pandas dataframe. Note that values contained in the metadata dictionary are unchanged from the EPW file. EPW files are commonly used by building simulation professionals and are widely available on the web. For example via: https://energyplus.net/weather , http://climate.o...
pvlib/iotools/epw.py
def read_epw(filename, coerce_year=None): ''' Read an EPW file in to a pandas dataframe. Note that values contained in the metadata dictionary are unchanged from the EPW file. EPW files are commonly used by building simulation professionals and are widely available on the web. For example via:...
def read_epw(filename, coerce_year=None): ''' Read an EPW file in to a pandas dataframe. Note that values contained in the metadata dictionary are unchanged from the EPW file. EPW files are commonly used by building simulation professionals and are widely available on the web. For example via:...
[ "Read", "an", "EPW", "file", "in", "to", "a", "pandas", "dataframe", "." ]
pvlib/pvlib-python
python
https://github.com/pvlib/pvlib-python/blob/2e844a595b820b43d1170269781fa66bd0ccc8a3/pvlib/iotools/epw.py#L16-L177
[ "def", "read_epw", "(", "filename", ",", "coerce_year", "=", "None", ")", ":", "if", "filename", ".", "startswith", "(", "'http'", ")", ":", "# Attempts to download online EPW file", "# See comments above for possible online sources", "request", "=", "Request", "(", "...
2e844a595b820b43d1170269781fa66bd0ccc8a3
train
Location.from_tmy
Create an object based on a metadata dictionary from tmy2 or tmy3 data readers. Parameters ---------- tmy_metadata : dict Returned from tmy.readtmy2 or tmy.readtmy3 tmy_data : None or DataFrame, default None Optionally attach the TMY data to this object. ...
pvlib/location.py
def from_tmy(cls, tmy_metadata, tmy_data=None, **kwargs): """ Create an object based on a metadata dictionary from tmy2 or tmy3 data readers. Parameters ---------- tmy_metadata : dict Returned from tmy.readtmy2 or tmy.readtmy3 tmy_data : None or DataF...
def from_tmy(cls, tmy_metadata, tmy_data=None, **kwargs): """ Create an object based on a metadata dictionary from tmy2 or tmy3 data readers. Parameters ---------- tmy_metadata : dict Returned from tmy.readtmy2 or tmy.readtmy3 tmy_data : None or DataF...
[ "Create", "an", "object", "based", "on", "a", "metadata", "dictionary", "from", "tmy2", "or", "tmy3", "data", "readers", "." ]
pvlib/pvlib-python
python
https://github.com/pvlib/pvlib-python/blob/2e844a595b820b43d1170269781fa66bd0ccc8a3/pvlib/location.py#L88-L129
[ "def", "from_tmy", "(", "cls", ",", "tmy_metadata", ",", "tmy_data", "=", "None", ",", "*", "*", "kwargs", ")", ":", "# not complete, but hopefully you get the idea.", "# might need code to handle the difference between tmy2 and tmy3", "# determine if we're dealing with TMY2 or T...
2e844a595b820b43d1170269781fa66bd0ccc8a3
train
Location.get_solarposition
Uses the :py:func:`solarposition.get_solarposition` function to calculate the solar zenith, azimuth, etc. at this location. Parameters ---------- times : DatetimeIndex pressure : None, float, or array-like, default None If None, pressure will be calculated using ...
pvlib/location.py
def get_solarposition(self, times, pressure=None, temperature=12, **kwargs): """ Uses the :py:func:`solarposition.get_solarposition` function to calculate the solar zenith, azimuth, etc. at this location. Parameters ---------- times : DatetimeIn...
def get_solarposition(self, times, pressure=None, temperature=12, **kwargs): """ Uses the :py:func:`solarposition.get_solarposition` function to calculate the solar zenith, azimuth, etc. at this location. Parameters ---------- times : DatetimeIn...
[ "Uses", "the", ":", "py", ":", "func", ":", "solarposition", ".", "get_solarposition", "function", "to", "calculate", "the", "solar", "zenith", "azimuth", "etc", ".", "at", "this", "location", "." ]
pvlib/pvlib-python
python
https://github.com/pvlib/pvlib-python/blob/2e844a595b820b43d1170269781fa66bd0ccc8a3/pvlib/location.py#L131-L162
[ "def", "get_solarposition", "(", "self", ",", "times", ",", "pressure", "=", "None", ",", "temperature", "=", "12", ",", "*", "*", "kwargs", ")", ":", "if", "pressure", "is", "None", ":", "pressure", "=", "atmosphere", ".", "alt2pres", "(", "self", "."...
2e844a595b820b43d1170269781fa66bd0ccc8a3
train
Location.get_clearsky
Calculate the clear sky estimates of GHI, DNI, and/or DHI at this location. Parameters ---------- times: DatetimeIndex model: str, default 'ineichen' The clear sky model to use. Must be one of 'ineichen', 'haurwitz', 'simplified_solis'. solar_posi...
pvlib/location.py
def get_clearsky(self, times, model='ineichen', solar_position=None, dni_extra=None, **kwargs): """ Calculate the clear sky estimates of GHI, DNI, and/or DHI at this location. Parameters ---------- times: DatetimeIndex model: str, default 'in...
def get_clearsky(self, times, model='ineichen', solar_position=None, dni_extra=None, **kwargs): """ Calculate the clear sky estimates of GHI, DNI, and/or DHI at this location. Parameters ---------- times: DatetimeIndex model: str, default 'in...
[ "Calculate", "the", "clear", "sky", "estimates", "of", "GHI", "DNI", "and", "/", "or", "DHI", "at", "this", "location", "." ]
pvlib/pvlib-python
python
https://github.com/pvlib/pvlib-python/blob/2e844a595b820b43d1170269781fa66bd0ccc8a3/pvlib/location.py#L164-L235
[ "def", "get_clearsky", "(", "self", ",", "times", ",", "model", "=", "'ineichen'", ",", "solar_position", "=", "None", ",", "dni_extra", "=", "None", ",", "*", "*", "kwargs", ")", ":", "if", "dni_extra", "is", "None", ":", "dni_extra", "=", "irradiance",...
2e844a595b820b43d1170269781fa66bd0ccc8a3
train
Location.get_airmass
Calculate the relative and absolute airmass. Automatically chooses zenith or apparant zenith depending on the selected model. Parameters ---------- times : None or DatetimeIndex, default None Only used if solar_position is not provided. solar_position : None...
pvlib/location.py
def get_airmass(self, times=None, solar_position=None, model='kastenyoung1989'): """ Calculate the relative and absolute airmass. Automatically chooses zenith or apparant zenith depending on the selected model. Parameters ---------- times : N...
def get_airmass(self, times=None, solar_position=None, model='kastenyoung1989'): """ Calculate the relative and absolute airmass. Automatically chooses zenith or apparant zenith depending on the selected model. Parameters ---------- times : N...
[ "Calculate", "the", "relative", "and", "absolute", "airmass", "." ]
pvlib/pvlib-python
python
https://github.com/pvlib/pvlib-python/blob/2e844a595b820b43d1170269781fa66bd0ccc8a3/pvlib/location.py#L237-L280
[ "def", "get_airmass", "(", "self", ",", "times", "=", "None", ",", "solar_position", "=", "None", ",", "model", "=", "'kastenyoung1989'", ")", ":", "if", "solar_position", "is", "None", ":", "solar_position", "=", "self", ".", "get_solarposition", "(", "time...
2e844a595b820b43d1170269781fa66bd0ccc8a3
train
Location.get_sun_rise_set_transit
Calculate sunrise, sunset and transit times. Parameters ---------- times : DatetimeIndex Must be localized to the Location method : str, default 'pyephem' 'pyephem', 'spa', or 'geometric' kwargs are passed to the relevant functions. See solarposi...
pvlib/location.py
def get_sun_rise_set_transit(self, times, method='pyephem', **kwargs): """ Calculate sunrise, sunset and transit times. Parameters ---------- times : DatetimeIndex Must be localized to the Location method : str, default 'pyephem' 'pyephem', 'spa',...
def get_sun_rise_set_transit(self, times, method='pyephem', **kwargs): """ Calculate sunrise, sunset and transit times. Parameters ---------- times : DatetimeIndex Must be localized to the Location method : str, default 'pyephem' 'pyephem', 'spa',...
[ "Calculate", "sunrise", "sunset", "and", "transit", "times", "." ]
pvlib/pvlib-python
python
https://github.com/pvlib/pvlib-python/blob/2e844a595b820b43d1170269781fa66bd0ccc8a3/pvlib/location.py#L282-L319
[ "def", "get_sun_rise_set_transit", "(", "self", ",", "times", ",", "method", "=", "'pyephem'", ",", "*", "*", "kwargs", ")", ":", "if", "method", "==", "'pyephem'", ":", "result", "=", "solarposition", ".", "sun_rise_set_transit_ephem", "(", "times", ",", "s...
2e844a595b820b43d1170269781fa66bd0ccc8a3
train
julian_day_dt
This is the original way to calculate the julian day from the NREL paper. However, it is much faster to convert to unix/epoch time and then convert to julian day. Note that the date must be UTC.
pvlib/spa.py
def julian_day_dt(year, month, day, hour, minute, second, microsecond): """This is the original way to calculate the julian day from the NREL paper. However, it is much faster to convert to unix/epoch time and then convert to julian day. Note that the date must be UTC.""" if month <= 2: year = y...
def julian_day_dt(year, month, day, hour, minute, second, microsecond): """This is the original way to calculate the julian day from the NREL paper. However, it is much faster to convert to unix/epoch time and then convert to julian day. Note that the date must be UTC.""" if month <= 2: year = y...
[ "This", "is", "the", "original", "way", "to", "calculate", "the", "julian", "day", "from", "the", "NREL", "paper", ".", "However", "it", "is", "much", "faster", "to", "convert", "to", "unix", "/", "epoch", "time", "and", "then", "convert", "to", "julian"...
pvlib/pvlib-python
python
https://github.com/pvlib/pvlib-python/blob/2e844a595b820b43d1170269781fa66bd0ccc8a3/pvlib/spa.py#L425-L439
[ "def", "julian_day_dt", "(", "year", ",", "month", ",", "day", ",", "hour", ",", "minute", ",", "second", ",", "microsecond", ")", ":", "if", "month", "<=", "2", ":", "year", "=", "year", "-", "1", "month", "=", "month", "+", "12", "a", "=", "int...
2e844a595b820b43d1170269781fa66bd0ccc8a3
train
solar_position_loop
Loop through the time array and calculate the solar position
pvlib/spa.py
def solar_position_loop(unixtime, loc_args, out): """Loop through the time array and calculate the solar position""" lat = loc_args[0] lon = loc_args[1] elev = loc_args[2] pressure = loc_args[3] temp = loc_args[4] delta_t = loc_args[5] atmos_refract = loc_args[6] sst = loc_args[7] ...
def solar_position_loop(unixtime, loc_args, out): """Loop through the time array and calculate the solar position""" lat = loc_args[0] lon = loc_args[1] elev = loc_args[2] pressure = loc_args[3] temp = loc_args[4] delta_t = loc_args[5] atmos_refract = loc_args[6] sst = loc_args[7] ...
[ "Loop", "through", "the", "time", "array", "and", "calculate", "the", "solar", "position" ]
pvlib/pvlib-python
python
https://github.com/pvlib/pvlib-python/blob/2e844a595b820b43d1170269781fa66bd0ccc8a3/pvlib/spa.py#L894-L966
[ "def", "solar_position_loop", "(", "unixtime", ",", "loc_args", ",", "out", ")", ":", "lat", "=", "loc_args", "[", "0", "]", "lon", "=", "loc_args", "[", "1", "]", "elev", "=", "loc_args", "[", "2", "]", "pressure", "=", "loc_args", "[", "3", "]", ...
2e844a595b820b43d1170269781fa66bd0ccc8a3
train
solar_position_numba
Calculate the solar position using the numba compiled functions and multiple threads. Very slow if functions are not numba compiled.
pvlib/spa.py
def solar_position_numba(unixtime, lat, lon, elev, pressure, temp, delta_t, atmos_refract, numthreads, sst=False, esd=False): """Calculate the solar position using the numba compiled functions and multiple threads. Very slow if functions are not numba compiled. """ # these args ...
def solar_position_numba(unixtime, lat, lon, elev, pressure, temp, delta_t, atmos_refract, numthreads, sst=False, esd=False): """Calculate the solar position using the numba compiled functions and multiple threads. Very slow if functions are not numba compiled. """ # these args ...
[ "Calculate", "the", "solar", "position", "using", "the", "numba", "compiled", "functions", "and", "multiple", "threads", ".", "Very", "slow", "if", "functions", "are", "not", "numba", "compiled", "." ]
pvlib/pvlib-python
python
https://github.com/pvlib/pvlib-python/blob/2e844a595b820b43d1170269781fa66bd0ccc8a3/pvlib/spa.py#L969-L1011
[ "def", "solar_position_numba", "(", "unixtime", ",", "lat", ",", "lon", ",", "elev", ",", "pressure", ",", "temp", ",", "delta_t", ",", "atmos_refract", ",", "numthreads", ",", "sst", "=", "False", ",", "esd", "=", "False", ")", ":", "# these args are the ...
2e844a595b820b43d1170269781fa66bd0ccc8a3
train
earthsun_distance
Calculates the distance from the earth to the sun using the NREL SPA algorithm described in [1]. Parameters ---------- unixtime : numpy array Array of unix/epoch timestamps to calculate solar position for. Unixtime is the number of seconds since Jan. 1, 1970 00:00:00 UTC. A pand...
pvlib/spa.py
def earthsun_distance(unixtime, delta_t, numthreads): """ Calculates the distance from the earth to the sun using the NREL SPA algorithm described in [1]. Parameters ---------- unixtime : numpy array Array of unix/epoch timestamps to calculate solar position for. Unixtime is the...
def earthsun_distance(unixtime, delta_t, numthreads): """ Calculates the distance from the earth to the sun using the NREL SPA algorithm described in [1]. Parameters ---------- unixtime : numpy array Array of unix/epoch timestamps to calculate solar position for. Unixtime is the...
[ "Calculates", "the", "distance", "from", "the", "earth", "to", "the", "sun", "using", "the", "NREL", "SPA", "algorithm", "described", "in", "[", "1", "]", "." ]
pvlib/pvlib-python
python
https://github.com/pvlib/pvlib-python/blob/2e844a595b820b43d1170269781fa66bd0ccc8a3/pvlib/spa.py#L1263-L1294
[ "def", "earthsun_distance", "(", "unixtime", ",", "delta_t", ",", "numthreads", ")", ":", "R", "=", "solar_position", "(", "unixtime", ",", "0", ",", "0", ",", "0", ",", "0", ",", "0", ",", "delta_t", ",", "0", ",", "numthreads", ",", "esd", "=", "...
2e844a595b820b43d1170269781fa66bd0ccc8a3
train
calculate_deltat
Calculate the difference between Terrestrial Dynamical Time (TD) and Universal Time (UT). Note: This function is not yet compatible for calculations using Numba. Equations taken from http://eclipse.gsfc.nasa.gov/SEcat5/deltatpoly.html
pvlib/spa.py
def calculate_deltat(year, month): """Calculate the difference between Terrestrial Dynamical Time (TD) and Universal Time (UT). Note: This function is not yet compatible for calculations using Numba. Equations taken from http://eclipse.gsfc.nasa.gov/SEcat5/deltatpoly.html """ plw = 'Delta...
def calculate_deltat(year, month): """Calculate the difference between Terrestrial Dynamical Time (TD) and Universal Time (UT). Note: This function is not yet compatible for calculations using Numba. Equations taken from http://eclipse.gsfc.nasa.gov/SEcat5/deltatpoly.html """ plw = 'Delta...
[ "Calculate", "the", "difference", "between", "Terrestrial", "Dynamical", "Time", "(", "TD", ")", "and", "Universal", "Time", "(", "UT", ")", "." ]
pvlib/pvlib-python
python
https://github.com/pvlib/pvlib-python/blob/2e844a595b820b43d1170269781fa66bd0ccc8a3/pvlib/spa.py#L1297-L1425
[ "def", "calculate_deltat", "(", "year", ",", "month", ")", ":", "plw", "=", "'Deltat is unknown for years before -1999 and after 3000. '", "'Delta values will be calculated, but the calculations '", "'are not intended to be used for these years.'", "try", ":", "if", "np", ".", "a...
2e844a595b820b43d1170269781fa66bd0ccc8a3
train
pvfactors_timeseries
Calculate front and back surface plane-of-array irradiance on a fixed tilt or single-axis tracker PV array configuration, and using the open-source "pvfactors" package. Please refer to pvfactors online documentation for more details: https://sunpower.github.io/pvfactors/ Parameters ---------- ...
pvlib/bifacial.py
def pvfactors_timeseries( solar_azimuth, solar_zenith, surface_azimuth, surface_tilt, timestamps, dni, dhi, gcr, pvrow_height, pvrow_width, albedo, n_pvrows=3, index_observed_pvrow=1, rho_front_pvrow=0.03, rho_back_pvrow=0.05, horizon_band_angle=15., run_parallel_calculat...
def pvfactors_timeseries( solar_azimuth, solar_zenith, surface_azimuth, surface_tilt, timestamps, dni, dhi, gcr, pvrow_height, pvrow_width, albedo, n_pvrows=3, index_observed_pvrow=1, rho_front_pvrow=0.03, rho_back_pvrow=0.05, horizon_band_angle=15., run_parallel_calculat...
[ "Calculate", "front", "and", "back", "surface", "plane", "-", "of", "-", "array", "irradiance", "on", "a", "fixed", "tilt", "or", "single", "-", "axis", "tracker", "PV", "array", "configuration", "and", "using", "the", "open", "-", "source", "pvfactors", "...
pvlib/pvlib-python
python
https://github.com/pvlib/pvlib-python/blob/2e844a595b820b43d1170269781fa66bd0ccc8a3/pvlib/bifacial.py#L9-L148
[ "def", "pvfactors_timeseries", "(", "solar_azimuth", ",", "solar_zenith", ",", "surface_azimuth", ",", "surface_tilt", ",", "timestamps", ",", "dni", ",", "dhi", ",", "gcr", ",", "pvrow_height", ",", "pvrow_width", ",", "albedo", ",", "n_pvrows", "=", "3", ","...
2e844a595b820b43d1170269781fa66bd0ccc8a3
train
main
File based sample for the Google Assistant API. Examples: $ python -m audiofileinput -i <input file> -o <output file>
google-assistant-sdk/googlesamples/assistant/grpc/audiofileinput.py
def main(api_endpoint, credentials, device_model_id, device_id, lang, verbose, input_audio_file, output_audio_file, block_size, grpc_deadline, *args, **kwargs): """File based sample for the Google Assistant API. Examples: $ python -m audiofileinput -i <input file> -o <output fi...
def main(api_endpoint, credentials, device_model_id, device_id, lang, verbose, input_audio_file, output_audio_file, block_size, grpc_deadline, *args, **kwargs): """File based sample for the Google Assistant API. Examples: $ python -m audiofileinput -i <input file> -o <output fi...
[ "File", "based", "sample", "for", "the", "Google", "Assistant", "API", "." ]
googlesamples/assistant-sdk-python
python
https://github.com/googlesamples/assistant-sdk-python/blob/84995692f35be8e085de8dfa7032039a13ae3fab/google-assistant-sdk/googlesamples/assistant/grpc/audiofileinput.py#L70-L152
[ "def", "main", "(", "api_endpoint", ",", "credentials", ",", "device_model_id", ",", "device_id", ",", "lang", ",", "verbose", ",", "input_audio_file", ",", "output_audio_file", ",", "block_size", ",", "grpc_deadline", ",", "*", "args", ",", "*", "*", "kwargs"...
84995692f35be8e085de8dfa7032039a13ae3fab
train
process_event
Pretty prints events. Prints all events that occur with two spaces between each new conversation and a single space between turns of a conversation. Args: event(event.Event): The current event to process.
google-assistant-sdk/googlesamples/assistant/library/hotword.py
def process_event(event): """Pretty prints events. Prints all events that occur with two spaces between each new conversation and a single space between turns of a conversation. Args: event(event.Event): The current event to process. """ if event.type == EventType.ON_CONVERSATION_TURN_...
def process_event(event): """Pretty prints events. Prints all events that occur with two spaces between each new conversation and a single space between turns of a conversation. Args: event(event.Event): The current event to process. """ if event.type == EventType.ON_CONVERSATION_TURN_...
[ "Pretty", "prints", "events", "." ]
googlesamples/assistant-sdk-python
python
https://github.com/googlesamples/assistant-sdk-python/blob/84995692f35be8e085de8dfa7032039a13ae3fab/google-assistant-sdk/googlesamples/assistant/library/hotword.py#L49-L68
[ "def", "process_event", "(", "event", ")", ":", "if", "event", ".", "type", "==", "EventType", ".", "ON_CONVERSATION_TURN_STARTED", ":", "print", "(", ")", "print", "(", "event", ")", "if", "(", "event", ".", "type", "==", "EventType", ".", "ON_CONVERSATIO...
84995692f35be8e085de8dfa7032039a13ae3fab
train
failed_request_exception
Build ClickException from a failed request.
google-assistant-sdk/googlesamples/assistant/grpc/devicetool.py
def failed_request_exception(message, r): """Build ClickException from a failed request.""" try: resp = json.loads(r.text) message = '%s: %d\n%s' % (message, resp['error']['code'], resp['error']['message']) return click.ClickException(message) except...
def failed_request_exception(message, r): """Build ClickException from a failed request.""" try: resp = json.loads(r.text) message = '%s: %d\n%s' % (message, resp['error']['code'], resp['error']['message']) return click.ClickException(message) except...
[ "Build", "ClickException", "from", "a", "failed", "request", "." ]
googlesamples/assistant-sdk-python
python
https://github.com/googlesamples/assistant-sdk-python/blob/84995692f35be8e085de8dfa7032039a13ae3fab/google-assistant-sdk/googlesamples/assistant/grpc/devicetool.py#L30-L41
[ "def", "failed_request_exception", "(", "message", ",", "r", ")", ":", "try", ":", "resp", "=", "json", ".", "loads", "(", "r", ".", "text", ")", "message", "=", "'%s: %d\\n%s'", "%", "(", "message", ",", "resp", "[", "'error'", "]", "[", "'code'", "...
84995692f35be8e085de8dfa7032039a13ae3fab
train
pretty_print_model
Prints out a device model in the terminal by parsing dict.
google-assistant-sdk/googlesamples/assistant/grpc/devicetool.py
def pretty_print_model(devicemodel): """Prints out a device model in the terminal by parsing dict.""" PRETTY_PRINT_MODEL = """Device Model ID: %(deviceModelId)s Project ID: %(projectId)s Device Type: %(deviceType)s""" logging.info(PRETTY_PRINT_MODEL % devicemodel) if 'traits' in devicemo...
def pretty_print_model(devicemodel): """Prints out a device model in the terminal by parsing dict.""" PRETTY_PRINT_MODEL = """Device Model ID: %(deviceModelId)s Project ID: %(projectId)s Device Type: %(deviceType)s""" logging.info(PRETTY_PRINT_MODEL % devicemodel) if 'traits' in devicemo...
[ "Prints", "out", "a", "device", "model", "in", "the", "terminal", "by", "parsing", "dict", "." ]
googlesamples/assistant-sdk-python
python
https://github.com/googlesamples/assistant-sdk-python/blob/84995692f35be8e085de8dfa7032039a13ae3fab/google-assistant-sdk/googlesamples/assistant/grpc/devicetool.py#L62-L73
[ "def", "pretty_print_model", "(", "devicemodel", ")", ":", "PRETTY_PRINT_MODEL", "=", "\"\"\"Device Model ID: %(deviceModelId)s\n Project ID: %(projectId)s\n Device Type: %(deviceType)s\"\"\"", "logging", ".", "info", "(", "PRETTY_PRINT_MODEL", "%", "devicemodel", ")", ...
84995692f35be8e085de8dfa7032039a13ae3fab
train
pretty_print_device
Prints out a device instance in the terminal by parsing dict.
google-assistant-sdk/googlesamples/assistant/grpc/devicetool.py
def pretty_print_device(device): """Prints out a device instance in the terminal by parsing dict.""" logging.info('Device Instance ID: %s' % device['id']) if 'nickname' in device: logging.info(' Nickname: %s' % device['nickname']) if 'modelId' in device: logging.info(' Model: %s' %...
def pretty_print_device(device): """Prints out a device instance in the terminal by parsing dict.""" logging.info('Device Instance ID: %s' % device['id']) if 'nickname' in device: logging.info(' Nickname: %s' % device['nickname']) if 'modelId' in device: logging.info(' Model: %s' %...
[ "Prints", "out", "a", "device", "instance", "in", "the", "terminal", "by", "parsing", "dict", "." ]
googlesamples/assistant-sdk-python
python
https://github.com/googlesamples/assistant-sdk-python/blob/84995692f35be8e085de8dfa7032039a13ae3fab/google-assistant-sdk/googlesamples/assistant/grpc/devicetool.py#L76-L83
[ "def", "pretty_print_device", "(", "device", ")", ":", "logging", ".", "info", "(", "'Device Instance ID: %s'", "%", "device", "[", "'id'", "]", ")", "if", "'nickname'", "in", "device", ":", "logging", ".", "info", "(", "' Nickname: %s'", "%", "device", "...
84995692f35be8e085de8dfa7032039a13ae3fab
train
register
Registers a device model and instance. Device model fields can only contain letters, numbers, and the following symbols: period (.), hyphen (-), underscore (_), space ( ) and plus (+). The first character of a field must be a letter or number. Device instance fields must start with a letter or number....
google-assistant-sdk/googlesamples/assistant/grpc/devicetool.py
def register(ctx, model, type, trait, manufacturer, product_name, description, device, nickname, client_type): """Registers a device model and instance. Device model fields can only contain letters, numbers, and the following symbols: period (.), hyphen (-), underscore (_), space ( ) and plus ...
def register(ctx, model, type, trait, manufacturer, product_name, description, device, nickname, client_type): """Registers a device model and instance. Device model fields can only contain letters, numbers, and the following symbols: period (.), hyphen (-), underscore (_), space ( ) and plus ...
[ "Registers", "a", "device", "model", "and", "instance", "." ]
googlesamples/assistant-sdk-python
python
https://github.com/googlesamples/assistant-sdk-python/blob/84995692f35be8e085de8dfa7032039a13ae3fab/google-assistant-sdk/googlesamples/assistant/grpc/devicetool.py#L168-L192
[ "def", "register", "(", "ctx", ",", "model", ",", "type", ",", "trait", ",", "manufacturer", ",", "product_name", ",", "description", ",", "device", ",", "nickname", ",", "client_type", ")", ":", "# cache SESSION and PROJECT_ID", "# so that we don't re-create them b...
84995692f35be8e085de8dfa7032039a13ae3fab
train
register_model
Registers a device model. Device model fields can only contain letters, numbers, and the following symbols: period (.), hyphen (-), underscore (_), space ( ) and plus (+). The first character of a field must be a letter or number.
google-assistant-sdk/googlesamples/assistant/grpc/devicetool.py
def register_model(ctx, model, type, trait, manufacturer, product_name, description): """Registers a device model. Device model fields can only contain letters, numbers, and the following symbols: period (.), hyphen (-), underscore (_), space ( ) and plus (+). The first character of ...
def register_model(ctx, model, type, trait, manufacturer, product_name, description): """Registers a device model. Device model fields can only contain letters, numbers, and the following symbols: period (.), hyphen (-), underscore (_), space ( ) and plus (+). The first character of ...
[ "Registers", "a", "device", "model", "." ]
googlesamples/assistant-sdk-python
python
https://github.com/googlesamples/assistant-sdk-python/blob/84995692f35be8e085de8dfa7032039a13ae3fab/google-assistant-sdk/googlesamples/assistant/grpc/devicetool.py#L222-L260
[ "def", "register_model", "(", "ctx", ",", "model", ",", "type", ",", "trait", ",", "manufacturer", ",", "product_name", ",", "description", ")", ":", "session", ",", "api_url", ",", "project_id", "=", "build_client_from_context", "(", "ctx", ")", "model_base_u...
84995692f35be8e085de8dfa7032039a13ae3fab
train
register_device
Registers a device instance under an existing device model. Device instance fields must start with a letter or number. The device ID can only contain letters, numbers, and the following symbols: period (.), hyphen (-), underscore (_), and plus (+). The device nickname can only contain numbers, letters,...
google-assistant-sdk/googlesamples/assistant/grpc/devicetool.py
def register_device(ctx, device, model, nickname, client_type): """Registers a device instance under an existing device model. Device instance fields must start with a letter or number. The device ID can only contain letters, numbers, and the following symbols: period (.), hyphen (-), underscore (_), a...
def register_device(ctx, device, model, nickname, client_type): """Registers a device instance under an existing device model. Device instance fields must start with a letter or number. The device ID can only contain letters, numbers, and the following symbols: period (.), hyphen (-), underscore (_), a...
[ "Registers", "a", "device", "instance", "under", "an", "existing", "device", "model", "." ]
googlesamples/assistant-sdk-python
python
https://github.com/googlesamples/assistant-sdk-python/blob/84995692f35be8e085de8dfa7032039a13ae3fab/google-assistant-sdk/googlesamples/assistant/grpc/devicetool.py#L283-L317
[ "def", "register_device", "(", "ctx", ",", "device", ",", "model", ",", "nickname", ",", "client_type", ")", ":", "session", ",", "api_url", ",", "project_id", "=", "build_client_from_context", "(", "ctx", ")", "device_base_url", "=", "'/'", ".", "join", "("...
84995692f35be8e085de8dfa7032039a13ae3fab
train
get
Gets all of the information (fields) for a given device model or instance.
google-assistant-sdk/googlesamples/assistant/grpc/devicetool.py
def get(ctx, resource, id): """Gets all of the information (fields) for a given device model or instance. """ session, api_url, project_id = build_client_from_context(ctx) url = '/'.join([api_url, resource, id]) r = session.get(url) if r.status_code != 200: raise failed_request_excep...
def get(ctx, resource, id): """Gets all of the information (fields) for a given device model or instance. """ session, api_url, project_id = build_client_from_context(ctx) url = '/'.join([api_url, resource, id]) r = session.get(url) if r.status_code != 200: raise failed_request_excep...
[ "Gets", "all", "of", "the", "information", "(", "fields", ")", "for", "a", "given", "device", "model", "or", "instance", "." ]
googlesamples/assistant-sdk-python
python
https://github.com/googlesamples/assistant-sdk-python/blob/84995692f35be8e085de8dfa7032039a13ae3fab/google-assistant-sdk/googlesamples/assistant/grpc/devicetool.py#L327-L342
[ "def", "get", "(", "ctx", ",", "resource", ",", "id", ")", ":", "session", ",", "api_url", ",", "project_id", "=", "build_client_from_context", "(", "ctx", ")", "url", "=", "'/'", ".", "join", "(", "[", "api_url", ",", "resource", ",", "id", "]", ")"...
84995692f35be8e085de8dfa7032039a13ae3fab