def basic_chain(times, latitude, longitude,<EOL>module_parameters, inverter_parameters,<EOL>irradiance=None, weather=None,<EOL>surface_tilt=None, surface_azimuth=None,<EOL>orientation_strategy=None,<EOL>transposition_model='<STR_LIT>',<EOL>solar_position_method='<STR_LIT>',<EOL>airmass_model='<STR_LIT>',<EOL>altitude=None, pressure=None,<EOL>**kwargs):
<EOL>if surface_tilt is not None and surface_azimuth is not None:<EOL><INDENT>pass<EOL><DEDENT>elif orientation_strategy is not None:<EOL><INDENT>surface_tilt, surface_azimuth =get_orientation(orientation_strategy, latitude=latitude)<EOL><DEDENT>else:<EOL><INDENT>raise ValueError('<STR_LIT>'<EOL>'<STR_LIT>')<EOL><DEDENT>if altitude is None and pressure is None:<EOL><INDENT>altitude = <NUM_LIT:0.><EOL>pressure = <NUM_LIT><EOL><DEDENT>elif altitude is None:<EOL><INDENT>altitude = atmosphere.pres2alt(pressure)<EOL><DEDENT>elif pressure is None:<EOL><INDENT>pressure = atmosphere.alt2pres(altitude)<EOL><DEDENT>solar_position = solarposition.get_solarposition(<EOL>times, latitude, longitude, altitude=altitude, pressure=pressure,<EOL>method=solar_position_method, **kwargs)<EOL>airmass = atmosphere.get_relative_airmass(<EOL>solar_position['<STR_LIT>'], model=airmass_model)<EOL>airmass = atmosphere.get_absolute_airmass(airmass, pressure)<EOL>dni_extra = pvlib.irradiance.get_extra_radiation(solar_position.index)<EOL>aoi = pvlib.irradiance.aoi(surface_tilt, surface_azimuth,<EOL>solar_position['<STR_LIT>'],<EOL>solar_position['<STR_LIT>'])<EOL>if irradiance is None:<EOL><INDENT>linke_turbidity = clearsky.lookup_linke_turbidity(<EOL>solar_position.index, latitude, longitude)<EOL>irradiance = clearsky.ineichen(<EOL>solar_position['<STR_LIT>'],<EOL>airmass,<EOL>linke_turbidity,<EOL>altitude=altitude,<EOL>dni_extra=dni_extra<EOL>)<EOL><DEDENT>total_irrad = pvlib.irradiance.get_total_irradiance(<EOL>surface_tilt,<EOL>surface_azimuth,<EOL>solar_position['<STR_LIT>'],<EOL>solar_position['<STR_LIT>'],<EOL>irradiance['<STR_LIT>'],<EOL>irradiance['<STR_LIT>'],<EOL>irradiance['<STR_LIT>'],<EOL>model=transposition_model,<EOL>dni_extra=dni_extra)<EOL>if weather is None:<EOL><INDENT>weather = {'<STR_LIT>': <NUM_LIT:0>, '<STR_LIT>': <NUM_LIT:20>}<EOL><DEDENT>temps = pvsystem.sapm_celltemp(total_irrad['<STR_LIT>'],<EOL>weather['<STR_LIT>'],<EOL>weather['<STR_LIT>'])<EOL>effective_irradiance = pvsystem.sapm_effective_irradiance(<EOL>total_irrad['<STR_LIT>'], total_irrad['<STR_LIT>'], airmass, aoi,<EOL>module_parameters)<EOL>dc = pvsystem.sapm(effective_irradiance, temps['<STR_LIT>'],<EOL>module_parameters)<EOL>ac = pvsystem.snlinverter(dc['<STR_LIT>'], dc['<STR_LIT>'], inverter_parameters)<EOL>return dc, ac<EOL>
An experimental function that computes all of the modeling steps
necessary for calculating power or energy for a PV system at a given
location.

Parameters
----------
times : DatetimeIndex
    Times at which to evaluate the model.

latitude : float.
    Positive is north of the equator.
    Use decimal degrees notation.

longitude : float.
    Positive is east of the prime meridian.
    Use decimal degrees notation.

module_parameters : None, dict or Series
    Module parameters as defined by the SAPM.

inverter_parameters : None, dict or Series
    Inverter parameters as defined by the CEC.

irradiance : None or DataFrame, default None
    If None, calculates clear sky data.
    Columns must be 'dni', 'ghi', 'dhi'.

weather : None or DataFrame, default None
    If None, assumes air temperature is 20 C and
    wind speed is 0 m/s.
    Columns must be 'wind_speed', 'temp_air'.

surface_tilt : None, float or Series, default None
    Surface tilt angles in decimal degrees.
    The tilt angle is defined as degrees from horizontal
    (e.g. surface facing up = 0, surface facing horizon = 90)

surface_azimuth : None, float or Series, default None
    Surface azimuth angles in decimal degrees.
    The azimuth convention is defined
    as degrees east of north
    (North=0, South=180, East=90, West=270).

orientation_strategy : None or str, default None
    The strategy for aligning the modules.
    If not None, sets the ``surface_azimuth`` and ``surface_tilt``
    properties of the ``system``. Allowed strategies include 'flat',
    'south_at_latitude_tilt'. Ignored for SingleAxisTracker systems.

transposition_model : str, default 'haydavies'
    Passed to system.get_irradiance.

solar_position_method : str, default 'nrel_numpy'
    Passed to solarposition.get_solarposition.

airmass_model : str, default 'kastenyoung1989'
    Passed to atmosphere.relativeairmass.

altitude : None or float, default None
    If None, computed from pressure. Assumed to be 0 m
    if pressure is also None.

pressure : None or float, default None
    If None, computed from altitude. Assumed to be 101325 Pa
    if altitude is also None.

**kwargs
    Arbitrary keyword arguments.
    See code for details.

Returns
-------
output : (dc, ac)
    Tuple of DC power (with SAPM parameters) (DataFrame) and AC
    power (Series).