How to use the pvlib.irradiance.aoi function in pvlib

To help you get started, we’ve selected a few pvlib examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github oemof / feedinlib / feedinlib / models.py View on Github external
Returns
        -------
        pandas.Series
            Angle of incidence in degrees.

        See Also
        --------
        solarposition_hourly_mean, solarposition

        References
        ----------
        .. [4] `pvlib angle of incidence `_.
        """
        return pvlib.irradiance.aoi(
            solar_azimuth=data['azimuth'], solar_zenith=data['zenith'],
            surface_tilt=self.powerplant.tilt,
            surface_azimuth=self.powerplant.azimuth)
github sandialabs / pecos / examples / pv / pv_model.py View on Github external
poa_diffuse = pd.Series(data=0, index=index)
    dni = pm.cleaned_data[pm.trans['DNI']].squeeze()
    
    # Compute sun position
    solarposition = pvlib.solarposition.get_solarposition(index, location['Latitude'], 
                                                  location['Longitude'])
    
    # Compute cell temperature
    celltemp = pvlib.pvsystem.sapm_celltemp(poa, wind, temperature)

    # Compute absolute airmass
    airmass_relative  = pvlib.atmosphere.get_relative_airmass(solarposition['zenith'])
    airmass_absolute = pvlib.atmosphere.get_absolute_airmass(airmass_relative)
    
    # Compute aoi
    aoi = pvlib.irradiance.aoi(location['Latitude'], 180, solarposition['zenith'], 
                               solarposition['azimuth'])
    
    # Compute effective irradiance
    Ee = pvlib.pvsystem.sapm_effective_irradiance(poa, poa_diffuse, airmass_absolute, 
                                                  aoi, sapm_parameters)
    
    # Run SAPM
    sapm_model = pvlib.pvsystem.sapm(Ee, celltemp['temp_cell'], sapm_parameters)
    
    # Compute the relative error between observed and predicted DC Power.  
    # Add the composite signal and run a range test
    modeled_dcpower = sapm_model['p_mp']*sapm_parameters['Ns']*sapm_parameters['Np']
    dc_power_relative_error = np.abs(dcpower - modeled_dcpower)/dcpower
    pm.add_dataframe(dc_power_relative_error.to_frame('DC Power Relative Error'))
    pm.check_range([0,0.1], 'DC Power Relative Error')
github sunspec / prodromos / forecasting / pv_forecast_dev.py View on Github external
#    clearSky['elevation'] = sp['elevation']

    extraI = pvlib.irradiance.get_extra_radiation(dr)

    # calculate GHI using Haurwitz model
    haurwitz = pvlib.clearsky.haurwitz(apparent_zenith)
    ghi = haurwitz['ghi']

    disc = pvlib.irradiance.disc(ghi, zenith, dr)
    #dniDiscIrrad(clearSky)
    dni = disc['dni']

    dhi = ghi - dni * np.sin((90.0 - zenith) * (np.pi / 180))

    if not pvobj.tracking:
        aoi = pvlib.irradiance.aoi(surface_tilt=pvobj.tilt,
                                   surface_azimuth=pvobj.azimuth,
                                   solar_zenith=zenith,
                                   solar_azimuth=solar_azimuth)
        tilt = pvobj.tilt
        azimuth = pvobj.azimuth
    else:
        result = get_tracker_position(pvobj, solar_zenith=apparent_zenith,
                                      solar_azimuth=solar_azimuth)
        aoi = result['aoi']
        tilt = result['surface_tilt']
        azimuth = result['surface_azimuth']

    # Convert the AOI to radians
    aoi *= (np.pi/180.0)

    # Calculate the POA irradiance based on the given site information
github SunPower / pvfactors / pvfactors / pvarray.py View on Github external
solar_azimuth : float
            azimuth angle of the sun [in deg]
        surface_tilt : float
            Surface tilt angles in decimal degrees.
            surface_tilt must be >=0 and <=180.
            The tilt angle is defined as degrees from horizontal
            (e.g. surface facing up = 0, surface facing horizon = 90)
        surface_azimuth : float
            The azimuth of the rotated panel,
            determined by projecting the vector normal to the panel's surface
            to the earth's surface [degrees].

        """
        self.line_registry = self.initialize_registry()
        # Check on which side the light is incident
        sun_on_front_surface = aoi_function(surface_tilt, surface_azimuth,
                                            solar_zenith, solar_azimuth) <= 90

        # Update array parameters
        self.surface_azimuth = surface_azimuth
        self.surface_tilt = surface_tilt
        self.solar_zenith = solar_zenith
        self.solar_azimuth = solar_azimuth

        # ------- Line creation: returning the line registry
        LOGGER.debug("...building line registry")
        # Create the PV rows / structures
        self.pvrows = self.create_pvrows_array(self.n_pvrows,
                                               self.pvrow_height)

        # Create the ground and the shadows on it
        self.create_pvrow_shadows(surface_azimuth, solar_zenith, solar_azimuth)
github SolarArbiter / solarforecastarbiter-core / solarforecastarbiter / pvmodel.py View on Github external
consistency with similar tracker function.

    Parameters
    ----------
    surface_tilt : float
    surface_azimuth : float
    apparent_zenith : pd.Series
        Solar apparent zenith
    azimuth : pd.Series
        Solar azimuth

    Returns
    -------
    surface_tilt : pd.Series, surface_azimuth : pd.Series, aoi : pd.Series
    """
    aoi = pvlib.irradiance.aoi(surface_tilt, surface_azimuth,
                               apparent_zenith, azimuth)
    return surface_tilt, surface_azimuth, aoi
github pvlib / pvlib-python / pvlib / pvsystem.py View on Github external
"""Get the angle of incidence on the system.

        Parameters
        ----------
        solar_zenith : float or Series.
            Solar zenith angle.
        solar_azimuth : float or Series.
            Solar azimuth angle.

        Returns
        -------
        aoi : Series
            The angle of incidence
        """

        aoi = irradiance.aoi(self.surface_tilt, self.surface_azimuth,
                             solar_zenith, solar_azimuth)
        return aoi