How to use the pvlib.pvsystem.retrieve_sam 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 pvcaptest / pvcaptest / captest / capdata.py View on Github external
'albedo': 0.2}

        tracker_sys1 = {'axis_tilt': 0, 'axis_azimuth': 0,
                       'max_angle': 90, 'backtrack': True,
                       'gcr': 0.2, 'albedo': 0.2}

        Refer to pvlib documentation for details.
        https://pvlib-python.readthedocs.io/en/latest/generated/pvlib.pvsystem.PVSystem.html
        https://pvlib-python.readthedocs.io/en/latest/generated/pvlib.tracking.SingleAxisTracker.html

    Returns
    -------
    pvlib PVSystem or SingleAxisTracker object.
    """
    sandia_modules = retrieve_sam('SandiaMod')
    cec_inverters = retrieve_sam('cecinverter')
    sandia_module = sandia_modules.iloc[:,0]
    cec_inverter = cec_inverters.iloc[:,0]

    trck_kwords = ['axis_tilt', 'axis_azimuth', 'max_angle', 'backtrack', 'gcr']
    if any(kword in sys.keys() for kword in trck_kwords):
        system = SingleAxisTracker(**sys,
                                   module_parameters=sandia_module,
                                   inverter_parameters=cec_inverter)
    else:
        system = PVSystem(**sys,
                          module_parameters=sandia_module,
                          inverter_parameters=cec_inverter)

    return system
github cedricleroy / pyungo / examples / pvlib_ex.py View on Github external
except ImportError:
    raise ImportError("This example require pvlib")
from pvlib import pvsystem
from pyungo.core import Graph


warnings.filterwarnings("ignore")


pvlib_abspath = os.path.dirname(os.path.abspath(inspect.getfile(pvlib)))
datapath = os.path.join(pvlib_abspath, "data", "703165TY.csv")
tmy_data, meta = pvlib.tmy.readtmy3(datapath, coerce_year=2015)
tmy_data.index.name = "Time"
tmy_data = tmy_data.shift(freq="-30Min")
sandia_modules = pvlib.pvsystem.retrieve_sam(name="SandiaMod")
cec_modules = pvlib.pvsystem.retrieve_sam(name="CECMod")
sapm_inverters = pvlib.pvsystem.retrieve_sam("sandiainverter")
sapm_inverter = sapm_inverters["ABB__MICRO_0_25_I_OUTD_US_208_208V__CEC_2014_"]

data = {
    "index": tmy_data.index,
    "surface_tilt": 30,
    "surface_azimuth": 180,
    "DHI": tmy_data["DHI"],
    "DNI": tmy_data["DNI"],
    "GHI": tmy_data["GHI"],
    "Wspd": tmy_data["Wspd"],
    "DryBulb": tmy_data["DryBulb"],
    "albedo": 0.2,
    "latitude": meta["latitude"],
    "longitude": meta["longitude"],
    "sandia_module": sandia_modules.Canadian_Solar_CS5P_220M___2009_,
github cedricleroy / pyungo / examples / pvlib_ex.py View on Github external
import pvlib
except ImportError:
    raise ImportError("This example require pvlib")
from pvlib import pvsystem
from pyungo.core import Graph


warnings.filterwarnings("ignore")


pvlib_abspath = os.path.dirname(os.path.abspath(inspect.getfile(pvlib)))
datapath = os.path.join(pvlib_abspath, "data", "703165TY.csv")
tmy_data, meta = pvlib.tmy.readtmy3(datapath, coerce_year=2015)
tmy_data.index.name = "Time"
tmy_data = tmy_data.shift(freq="-30Min")
sandia_modules = pvlib.pvsystem.retrieve_sam(name="SandiaMod")
cec_modules = pvlib.pvsystem.retrieve_sam(name="CECMod")
sapm_inverters = pvlib.pvsystem.retrieve_sam("sandiainverter")
sapm_inverter = sapm_inverters["ABB__MICRO_0_25_I_OUTD_US_208_208V__CEC_2014_"]

data = {
    "index": tmy_data.index,
    "surface_tilt": 30,
    "surface_azimuth": 180,
    "DHI": tmy_data["DHI"],
    "DNI": tmy_data["DNI"],
    "GHI": tmy_data["GHI"],
    "Wspd": tmy_data["Wspd"],
    "DryBulb": tmy_data["DryBulb"],
    "albedo": 0.2,
    "latitude": meta["latitude"],
    "longitude": meta["longitude"],
github oemof / feedinlib / feedinlib / models.py View on Github external
"""
        if kwargs.get('module_name') is None:
            kwargs['module_name'] = self.powerplant.module_name

        basic_path = os.path.join(os.path.expanduser("~"), '.oemof')
        url = 'https://sam.nrel.gov/sites/default/files/'
        filename = os.path.join(basic_path, 'sam-library-sandia-modules.csv')
        if not os.path.exists(basic_path):
            os.makedirs(basic_path)
        if not os.path.isfile(filename):
            url_file = 'sam-library-sandia-modules-2015-6-30.csv'
            req = requests.get(url + url_file)
            with open(filename, 'wb') as fout:
                fout.write(req.content)
        if kwargs.get('module_name') == 'all':
            module_data = pvlib.pvsystem.retrieve_sam(path=filename)
        else:
            module_data = (pvlib.pvsystem.retrieve_sam(path=filename)
                           [kwargs['module_name']])
            self.area = module_data.Area
            self.peak = module_data.Impo * module_data.Vmpo
        return module_data
github oemof / feedinlib / example / feedinlib_example_new.py View on Github external
# #####################################

# preparing the weather data to suit pvlib's needs
# different name for the wind speed
my_weather.data.rename(columns={'v_wind': 'wind_speed'}, inplace=True)
# temperature in degree Celsius instead of Kelvin
my_weather.data['temp_air'] = my_weather.data.temp_air - 273.15
# calculate ghi
my_weather.data['ghi'] = my_weather.data.dirhi + my_weather.data.dhi
w = my_weather.data

# time index from weather data set
times = my_weather.data.index

# get module and inverter parameter from sandia database
sandia_modules = pvlib.pvsystem.retrieve_sam('SandiaMod')
sapm_inverters = pvlib.pvsystem.retrieve_sam('sandiainverter')

# own module parameters
invertername = 'ABB__MICRO_0_25_I_OUTD_US_208_208V__CEC_2014_'
yingli210 = {
    'module_parameters': sandia_modules['Yingli_YL210__2008__E__'],
    'inverter_parameters': sapm_inverters[invertername],
    'surface_azimuth': 180,
    'surface_tilt': 60,
    'albedo': 0.2,
    }

# own location parameter
wittenberg = {
    'altitude': 34,
    'name': 'Wittenberg',