Weather Factors¶
-
class
EnergyIntensityIndicators.weather_factors.WeatherFactors(sector, directory, activity_data=None, residential_floorspace=None, nominal_energy_intensity=None, end_year=2018, projections=False)¶ Bases:
object-
static
adjust_data(subregions, hdd_by_division, hdd_activity_weights, cooling=True, cdd_by_division=None, cdd_activity_weights=None, use_weights_1961_90=True)¶ Calculate weights for adjusted weather factors prediction
-
adjust_for_weather(data, energy_type)¶ Adjust data by weather factors :param data: dataset to adjust by weather :type data: dataframe :param energy_type: :type energy_type: str
- Returns
weather_adjusted_data
- Return type
dataframe
Calculate fuels and elec shares for the commercial sector from CBECS 1995 data
-
commercial_estimate_regional_floorspace()¶ Estimate regional floorspace for the commercial sector
-
commercial_regional_intensity_aggregate()¶ Calculate Energy Intensities (kBtu/sq. ft.) by region and fuel type (i.e. Fuels and Electricity) for use in calculating weather factors :returns: ‘electricity’ and ‘fuels’, values: dataframes of intensity data for the commercial sector
with Year index and Region columns
- Return type
dictionary with keys
-
ensure_same_indices(df1, df2)¶ Returns two dataframes with the same indices purpose: enable dataframe operations such as multiply and divide between the two dfs
Spreadsheet equivalent: Commercial –> ‘Regional Shares’ assumed commercial floorspace in each region follows same trends as population or housing units
-
gather_weights_data()¶ Calculate weights to aggregate subregions into four regions
-
get_weather(energy_dict=None, energy_type=None, energy_df=None, weather_adjust=False, seds_data=None)¶ Collect weather data by sector (commercial or residential)
-
heating_cooling_data()¶ Collect heating and cooling data (HDD, CDD)
-
static
heating_cooling_degree_days(type_day)¶
Used fixed weights to develop from regional factors, weighted by regional energy share from 1995 CBECS
-
national_method2_regression_models(seds_data, weather_factors)¶ Second regression model
-
process_prices(weather_factors_df)¶ Process price data
Calculate fuels and elec shares for the residential sector from RECS 1993 data
Calulate shares of regional totals by subregion
-
residential_regional_intensity_aggregate()¶ This function does not need to exist if nominal_energy_intensity is properly formated, change formatting here if not :returns: ‘electricity’ and ‘fuels’, values: dataframes of intensity data for the residential sector
with Year index and Region columns i.e. {‘fuels’: fuels_regional, ‘electricity’: elec_regional}
- Return type
dictionary with keys
-
static
use_intersection(data, intersection_)¶ Return portion of dataframe with intersection_ as index
-
weather_factors(region, energy_type, actual_intensity, weights_df, regional_weights)¶ Estimate a simple regression model to fit the regional intensity to a linear function of time (included squared and cubed values of time) and degree days. -electricity model: constant term, heating degree day (HDD), cooling degree day (CDD), time, time-squared, and time-cubed -fuels model: contant term?, HDD, HDD*Time, Time, Time-squared and composite fuel price index (the composite fuel price index was developed as a weighted average of the national distillate
fuel oil price index and a national average price for natural gas)
Weather factors are applied at the regional level to generate the weather-normalized intensity indexes for each of the four Census regions
-The weather factors for delivered energy and source energy are computed implicitly. For delivered energy, they are calculated as the sum of reported electricity and fuels divided by the sum of the weather-adjusted electricity and weather-adjusted fuels. A similar procedure is followed for source energt. As such, the implied weather factors are a result of the process, not an independent variable that influences the values of intensity indexes for delivered energy and source energy. All of these computation occur within Commercial_Total worksheet.
TODO: Input data
-
static