def get_airmass(self, times=None, solar_position=None,<EOL>model='<STR_LIT>'):
if solar_position is None:<EOL><INDENT>solar_position = self.get_solarposition(times)<EOL><DEDENT>if model in atmosphere.APPARENT_ZENITH_MODELS:<EOL><INDENT>zenith = solar_position['<STR_LIT>']<EOL><DEDENT>elif model in atmosphere.TRUE_ZENITH_MODELS:<EOL><INDENT>zenith = solar_position['<STR_LIT>']<EOL><DEDENT>else:<EOL><INDENT>raise ValueError('<STR_LIT>'.format(model))<EOL><DEDENT>airmass_relative = atmosphere.get_relative_airmass(zenith, model)<EOL>pressure = atmosphere.alt2pres(self.altitude)<EOL>airmass_absolute = atmosphere.get_absolute_airmass(airmass_relative,<EOL>pressure)<EOL>airmass = pd.DataFrame(index=solar_position.index)<EOL>airmass['<STR_LIT>'] = airmass_relative<EOL>airmass['<STR_LIT>'] = airmass_absolute<EOL>return airmass<EOL>
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 or DataFrame, default None
    DataFrame with with columns 'apparent_zenith', 'zenith'.
model : str, default 'kastenyoung1989'
    Relative airmass model

Returns
-------
airmass : DataFrame
    Columns are 'airmass_relative', 'airmass_absolute'