def prepare_inputs(self, times=None, weather=None):
if weather is not None:<EOL><INDENT>self.weather = weather<EOL><DEDENT>if self.weather is None:<EOL><INDENT>self.weather = pd.DataFrame(index=times)<EOL><DEDENT>if times is not None:<EOL><INDENT>self.times = times<EOL><DEDENT>self.solar_position = self.location.get_solarposition(<EOL>self.times, method=self.solar_position_method)<EOL>self.airmass = self.location.get_airmass(<EOL>solar_position=self.solar_position, model=self.airmass_model)<EOL>if not any([x in ['<STR_LIT>', '<STR_LIT>', '<STR_LIT>'] for x in self.weather.columns]):<EOL><INDENT>self.weather[['<STR_LIT>', '<STR_LIT>', '<STR_LIT>']] = self.location.get_clearsky(<EOL>self.solar_position.index, self.clearsky_model,<EOL>solar_position=self.solar_position,<EOL>airmass_absolute=self.airmass['<STR_LIT>'])<EOL><DEDENT>if not {'<STR_LIT>', '<STR_LIT>', '<STR_LIT>'} <= set(self.weather.columns):<EOL><INDENT>raise ValueError(<EOL>"<STR_LIT>" +<EOL>"<STR_LIT>" +<EOL>"<STR_LIT>".format(list(self.weather.columns)))<EOL><DEDENT>if isinstance(self.system, SingleAxisTracker):<EOL><INDENT>self.tracking = self.system.singleaxis(<EOL>self.solar_position['<STR_LIT>'],<EOL>self.solar_position['<STR_LIT>'])<EOL>self.tracking['<STR_LIT>'] = (<EOL>self.tracking['<STR_LIT>']<EOL>.fillna(self.system.axis_tilt))<EOL>self.tracking['<STR_LIT>'] = (<EOL>self.tracking['<STR_LIT>']<EOL>.fillna(self.system.axis_azimuth))<EOL>self.aoi = self.tracking['<STR_LIT>']<EOL>get_irradiance = partial(<EOL>self.system.get_irradiance,<EOL>self.tracking['<STR_LIT>'],<EOL>self.tracking['<STR_LIT>'],<EOL>self.solar_position['<STR_LIT>'],<EOL>self.solar_position['<STR_LIT>'])<EOL><DEDENT>else:<EOL><INDENT>self.aoi = self.system.get_aoi(<EOL>self.solar_position['<STR_LIT>'],<EOL>self.solar_position['<STR_LIT>'])<EOL>get_irradiance = partial(<EOL>self.system.get_irradiance,<EOL>self.solar_position['<STR_LIT>'],<EOL>self.solar_position['<STR_LIT>'])<EOL><DEDENT>self.total_irrad = get_irradiance(<EOL>self.weather['<STR_LIT>'],<EOL>self.weather['<STR_LIT>'],<EOL>self.weather['<STR_LIT>'],<EOL>airmass=self.airmass['<STR_LIT>'],<EOL>model=self.transposition_model)<EOL>if self.weather.get('<STR_LIT>') is None:<EOL><INDENT>self.weather['<STR_LIT>'] = <NUM_LIT:0><EOL><DEDENT>if self.weather.get('<STR_LIT>') is None:<EOL><INDENT>self.weather['<STR_LIT>'] = <NUM_LIT:20><EOL><DEDENT>return self<EOL>
Prepare the solar position, irradiance, and weather inputs to
the model.

Parameters
----------
times : None or DatetimeIndex, default None
    Times at which to evaluate the model. Can be None if
    attribute `times` is already set.
weather : None or DataFrame, default None
    If ``None``, the weather attribute is used. If the weather
    attribute is also ``None`` assumes air temperature is 20 C, wind
    speed is 0 m/s and irradiation calculated from clear sky
    data. Column names must be ``'wind_speed'``, ``'temp_air'``,
    ``'dni'``, ``'ghi'``, ``'dhi'``. Do not pass incomplete irradiation
    data. Use method
    :py:meth:`~pvlib.modelchain.ModelChain.complete_irradiance`
    instead.

Notes
-----
Assigns attributes: ``times``, ``solar_position``, ``airmass``,
``total_irrad``, `aoi`