Calculates the density of air at hub height.
The density is calculated using the method specified by the parameter density_model. Previous to the calculation of the density the temperature at hub height is calculated using the method specified by the parameter temperature_model.
Parameters: weather_df (pandas.DataFrame) – DataFrame with time series for temperature temperature in K, pressure pressure in Pa and/or density density in kg/m³, depending on the density_model used. The columns of the DataFrame are a MultiIndex where the first level contains the variable name (e.g. temperature) and the second level contains the height at which it applies (e.g. 10, if it was measured at a height of 10 m). See documentation of
ModelChain.run_model()for an example on how to create the weather_df DataFrame.
Returns: Density of air in kg/m³ at hub height. Return type: pandas.Series or numpy.array
If weather_df contains data at different heights the data closest to the hub height are used. If interpolation_extrapolation is used to calculate the density at hub height, the weather_df must contain at least two time series for density.