Title: | Prepare data to be used by the EDGE-Buildings model |
---|---|
Description: | Prepare data to be used by the EDGE-Buildings model. |
Authors: | Robin Hasse [aut, cre] , Pascal Führlich [aut], Antoine Levesque [aut], Hagen Tockhorn [aut] |
Maintainer: | Robin Hasse <[email protected]> |
License: | MIT + file LICENSE |
Version: | 0.7.6 |
Built: | 2024-11-18 13:35:04 UTC |
Source: | https://github.com/pik-piam/mredgebuildings |
Prepare data to be used by the EDGE-Buildings model.
Maintainer: Robin Hasse [email protected] (ORCID)
Authors:
Pascal Führlich [email protected]
Antoine Levesque
Hagen Tockhorn
Useful links:
Disaggregate regional energy demand per carrier by end use while meeting the end use shares in the aggregated region.
.disaggregate(subset, key)
.disaggregate(subset, key)
subset |
data frame for one period and aggregated region |
key |
named vector with specification of the subset group (not used) |
The function first tries to find a solution that satisfies both the regional carrier and the overall end use constraints. If there is no solution, another optimisation is run that tries to also minimise deviations from the end use quantities but removes them from the constraints.
Aggregate cellular HDD/CDD values to country-wide average (population-weighted)
aggCells(data, weight, mask)
aggCells(data, weight, mask)
data |
raster object containing HDD/CDD values |
weight |
raster object containing aggregation weights |
mask |
raster opbject defining (regional) aggregation boundaries |
data frame containing regionally meaned HDD/CDD values
To adress loss of buildings' internal memory of previous conditions at high
outside temperatures due to window opening, etc., BAIT and outside temperature
are blended. The blend is active between a lower and upper temperature threshold,
bLower
and bUpper
, which are mapped to a range of -5 to +5 of a
sigmoid function (corresponding to a 1% and 99% blend). The maximum amount of
blending (i.e. the amplitude of the sigmoid function) is given by a parameter bMax
.
blend(bait, tas, weight)
blend(bait, tas, weight)
bait |
raster data on BAIT |
tas |
raster data on near-surface atmospherical temperature |
weight |
named list with blending parameters bLower, bUpper, bMax |
blended raster data
linear regression on historic data to determine regression parameters for surface downdwelling shortwave radiation (rsds), near-surface wind speed (sfcwind) and near-surface specific humidity (huss) with respect to near-surface air temperature (tas). The regression is done with on a simple linear model, where the historical input data covers the years of 2000-2014. For rsds and sfcwind, a simple linear relationship is assumed where for huss an exponential relation is assumed, buildig upon the non-linear relation between water vapor pressure and temperature.
calcBAITpars(model = "GFDL-ESM4")
calcBAITpars(model = "GFDL-ESM4")
model |
specify GCM responsible for data input |
terra SpatRaster covering one regression parameter per layer per cell
Hagen Tockhorn
BRG has extremely comprehensive (and extremely expensive) sales data. But one can recover total sales of boilers for space heating from the EHPA report.
calcBRG()
calcBRG()
MagPIE object with total boiler sales in European countries
Robin Hasse
Join data from various sources to construct a consistent European building stock with a focus on floor space (million m2).
calcBuildingStock(subtype = c("residential", "commercial"))
calcBuildingStock(subtype = c("residential", "commercial"))
subtype |
Character with subsector |
MAgPIE object with historic building stock
if the distribution of building types is missing, it is filled with the Europe-wide distribution. It might be worthwhile to map filling countries instead.
Robin Hasse
Final energy carrier prices including energy supply cost, transport and distribution cost(T&D) and taxes (without VAT). CO2 price component and VAT are added later depending on the scenario assumptions.
calcCarrierPrices()
calcCarrierPrices()
Robin Hasse
floor-space specific construction cost
calcCostConstruction()
calcCostConstruction()
Robin Hasse
Demolition cost
calcCostDemolition()
calcCostDemolition()
Robin Hasse
floor-space specific renovation cost
calcCostRenovation(energyLadder = FALSE)
calcCostRenovation(energyLadder = FALSE)
energyLadder |
logical, should the calculation include renovation transitions that are considered a decline on the energy ladder? |
MagPIE object with floor-space specific renovation cost depending on the initial and final state of the building
Robin Hasse
Get Population Density
calcDensity()
calcDensity()
magpie object
Hagen Tockhorn
Calculate the regression parameters for the projection of final (FE) to useful (UE) energy conversion projection for all combinations of energy enduses and carriers. The regression parameters correspond to an asymptotic regression model and encompass the parameters Asym, R0 and lrc. The are determined using a nonlinear least-squares regression.
calcEfficiencyRegression()
calcEfficiencyRegression()
This approach closely follows the model by De Stercke et al. which is mainly driven by GDP per Capita.
Hagen Tockhorn
De Stercke, S. (2014). Dynamics of Energy Systems: A Useful Perspective (Interim Report, p. 68). IIASA. http://pure.iiasa.ac.at/id/eprint/11254/1/IR-14-013.pdf
Takes the historic final energy demand by carriers from IEA and disaggregates it into different end uses.
calcFEbyEUEC()
calcFEbyEUEC()
The disaggregation is performed such that the aggregated carrier-specific FE values of the IEA IO regions are met as a minimum requirement. In an ideal case, the enduse-specific FE shares are met as well.
data.frame with historic energy demands
For now, existing disaggregated final energy data with respect to carriers and
enduses combined is replaced in the final output. However, since the Odyssee
data is largely underestimating the real IEA FE targets, these shall serve as
lower boundaries for the disaggregation.
Such feature has been implemented in toolDisaggregate
but is not running
smoothly yet.
Hagen Tockhorn, Robin Hasse
Historic Final Energy (FE) Demand and FE-EU-Efficiencies are taken to compute Useful Energy (UE) Demand.
calcFEUE()
calcFEUE()
data.frame with final and useful energy demand
Hagen Tockhorn
Calculate Efficiencies of Final (FE) to Useful (UE) Energy Conversion for all combinations of Energy Carriers and Enduses. The efficiency projections are based on a model by De Stercke et al. which is mainly driven by GDP per Capita. It describes an S-shaped curve approaching assumed efficiency levels. The parameters of that curve are derived by a regression with observations of IEA data.
calcFEUEefficiencies(gasBioEquality = TRUE)
calcFEUEefficiencies(gasBioEquality = TRUE)
gasBioEquality |
Determines if carriers natgas and biomod share the same efficiencies |
Hagen Tockhorn
De Stercke, S. (2014). Dynamics of Energy Systems: A Useful Perspective (Interim Report, p. 68). IIASA. http://pure.iiasa.ac.at/id/eprint/11254/1/IR-14-013.pdf
Data for many European countries is taken from EEA, India from IEA and other countries from Daioglou et al 2012. The result does not cover all countries and has mixed points in time depending on the region.
calcFloorspacePast()
calcFloorspacePast()
MAgPIE object with historic floor space
RK: In Antoine's EDGE-B, data points associated with an GDP/POP above 70000 USD/cap are dropped here to improve the later regression. This filtering should be moved to getFloorspaceResidential where the regression is performed. Therefore, the high-income data points are kept at this stage.
Robin Hasse, Antoine Levesque, Hagen Tockhorn
Residential floor space per capita
calcFloorspacePerCap()
calcFloorspacePerCap()
MagPIE object with residential floor space per capita
Robin Hasse
Get historic GDP per Capita for SSP Scenarios
calcGDPPop()
calcGDPPop()
magpie object
Hagen Tockhorn
Heating and cooling degree days based on raw outside temperature or bias-adjusted internal temperature (BAIT), driver for space heating and cooling demand in buildings.
calcHDDCDD( mappingFile, bait = FALSE, multiscen = FALSE, rasDir = NULL, cacheDir = NULL, fromSource = FALSE )
calcHDDCDD( mappingFile, bait = FALSE, multiscen = FALSE, rasDir = NULL, cacheDir = NULL, fromSource = FALSE )
mappingFile |
file name of sectoral mapping containing input data file names and directories |
bait |
boolean, use BAIT instead of raw temperature |
multiscen |
boolean, does |
rasDir |
absolute path to directory for saving raster files |
cacheDir |
absolute path to directory for pre-calculated BAIT regression parameters |
fromSource |
logical, if TRUE, read the previously calculated data that is temporarily saved as a source |
magpie object of heating and cooling degree days
Robin Hasse, Hagen Tockhorn
Rough assumption based on online reference values scaled with U-values from Hotmaps and heating degree days (HDD).
calcHeatingCapacity(swissFormular = FALSE)
calcHeatingCapacity(swissFormular = FALSE)
swissFormular |
boolean, apply the simplistic swiss formular? |
This is a very rough estimation that neglects regional differences and many other effects. It should be replace by bottom-up calculation based on climate data.
MagPIE object with floor-area specific heating capacity
Robin Hasse
https://www.heizung.de/ratgeber/diverses/heizleistung-berechnen-gruende-und-ablauf.html
Calculate installation cost or efficiency of heating systems
calcHeatingSystem(subtype = c("Purchasing cost", "Efficiency"))
calcHeatingSystem(subtype = c("Purchasing cost", "Efficiency"))
subtype |
character, variable type (either 'Purchasing cost' or 'Efficiency') |
MagPIE object with capacity-specific purchasing cost or efficiency of heating systems
Robin Hasse
Calculate Matrix of heating system replacement shares
calcHeatingSystemReplacement()
calcHeatingSystemReplacement()
MagPIE object with shares
Robin Hasse
We use national data from industry association for the biggest European countries and European data sets from the EHI and EHPA.
calcHeatingSystemSales()
calcHeatingSystemSales()
MagPIE object with heating system sales
Robin Hasse
Number of persons per household.
calcHouseholdSize()
calcHouseholdSize()
MAgPIE object with household size
THE EU Buildings Database gives one share of all dwellings with 5 or more persons. This share is weighted with 5 persons which can cause a downward bias.
Robin Hasse
IEA EEI final energy data is processed and mapped w.r.t. carrier and enduse names.
calcIEA_EEI(subtype = c("buildings"))
calcIEA_EEI(subtype = c("buildings"))
subtype |
sector name |
As for the buildings sector, data for residential and commercial ("service") buildings is aggregated and the carrier "biomass" is split into traditional and modern biomass w.r.t. to income per capita.
data.frame containing enduse- and carrier-resoluted energy data
Hagen Tockhorn
Computes data for the Primary Final Useful (PFU) resolution
calcIEAPFU()
calcIEAPFU()
IEA data as MAgPIE object aggregated to country level
Antoine Levesque, Robin Hasse
## Not run: a <- calcOutput("IEAPFU")
## Not run: a <- calcOutput("IEAPFU")
Parameters for the lifetime of heating systems are taken from a very detailed EIA publication for building sector appliances and equipment. The range of the building shell lifetime is taken from Skarning et al. 2017.
calcLifetimeParams(subtype)
calcLifetimeParams(subtype)
subtype |
character, type of asset (either |
MagPIE object with Weibull lifetime distribution parameters
Robin Hasse
https://www.eia.gov/analysis/studies/buildings/equipcosts/pdf/full.pdf
http://dx.doi.org/10.1016/j.enbuild.2017.01.080
Calculate Reference data for input matching
calcMatchingReference(subtype)
calcMatchingReference(subtype)
subtype |
character, matching reference |
Robin Hasse
PFU Data is disaggregated into different thermal and non-thermal Enduses using FE Shares from Odyssee and IEA_ETP.
calcPFUDB()
calcPFUDB()
This was adapted from EDGE function 'getPFUDB.R'.
magpie object
Hagen Tockhorn, Robin Hasse
Population differentiated by location (urban/rural) and building type
calcPopulationBuildings()
calcPopulationBuildings()
Robin Hasse
The renovation depth is currently calculated based on the ratio of specific useful energy demand after and before the renovation. This is valid under the assumption that there is no change in behaviour (rebound effect) which we currently make. Once adaptive behaviour is considered, we should use the ratio of U-values.
calcRenDepth()
calcRenDepth()
Robin Hasse
Specific renovation cost are estimated with a linear model with intercept w.r.t. to the renovation depth.
calcRenovationCostModel()
calcRenovationCostModel()
The specific investment cost for renovation depending on the depth of renovation is calculated using a two-level statistical model fitted with data from a European Commission (EC) report on renovation. In a fist step, we fit a simple linear model with intercept to predict specific investment (USD/m2) with relative PE savings. In a second step, this linear model is scaled with one factor for each region. This scaling factor is predicted with GDP/POP using a negative exponential curve. For EU regions that are reported, we correct the result with a region-specific but time-invariant factor to best match the linear model to the data. This way, we get a linear model with intercept for each region that can be extrapolated to other regions (using GDP/POP) which still matches data of EU regions very well. The cost is finally disaggregated across residential building types (SFH, MFH) based on a rough cost factor seen in the ENTRANZE data.
MAgPIE object with specific renovation cost
Robin Hasse
https://op.europa.eu/s/xnYt
Calculates country surface
calcSurface()
calcSurface()
Surface by country
Antoine Levesque
IEA's Tracking clean energy progress 2014
calcTCEP(subtype = "enduse")
calcTCEP(subtype = "enduse")
subtype |
character, type of data |
Robin Hasse
Calculate useful energy demand for space heating in buildings
calcUEdemand()
calcUEdemand()
Robin Hasse
Calculate U-value
calcUValue()
calcUValue()
Robin Hasse
Passes U-values read from source
calcUValueSource(subtype = c("EUBuildingsObservatory", "ETSAP"))
calcUValueSource(subtype = c("EUBuildingsObservatory", "ETSAP"))
subtype |
source of U-values |
Falk Benke, Robin Hasse
Simple estimate of total FE demand in different building types
calcWeightFeBuildings()
calcWeightFeBuildings()
Should only be used as weights not actual demand. The disaggregation to building types is too simplistic.
Robin Hasse
The expected value of the respective climate variable (except temperature) is calculated from parameters taken from a preceding linear regression done in calcBAITpars where the respective variable is correlated with the near-surface atmospherical temperature. If no cell-resoluted parameters are given, the globally-meaned parameters from Staffel et. all 2023 are taken (see https://doi.org/10.1038/s41560-023-01341-5).
cfac(t, type, params = NULL)
cfac(t, type, params = NULL)
t |
raster data on near-surface atmospherical temperature |
type |
considered climate variable |
params |
regression parameters as vector or raster object |
counterfactuals for respective climate variable
Check if time period of BAIT input data (rsds, sfc, huss) is congruent with near-surface temperature data (tas).
checkDates(baitInput, tasData)
checkDates(baitInput, tasData)
baitInput |
list of raster data encompassing different climate variables |
tasData |
raster data on near-surface atmosphere temperature |
baitInput with congruent time periods w.r.t. tasData
BAIT is calculated from raster data on near-surface atmospherical temperature
(tas), surface downdwelling shortwave radiation (rsds), near-surface wind speed
(sfcwind) and near-surface specific humidity (huss). The latter three climate
parameters are incorporated in the calculation of BAIT as the difference from
their real value to the their expected value w.r.t. the near-surface temperature
(see cfac
). These are then incorporated in a weighted sum to
account for the respective influence of each climate parameter on BAIT.
The raster data containing BAIT is smoothed to account for the
buildings' thermal inertia (see smooth
) and blended with the
near-surface temperature (see blend
).
compBAIT(baitInput, tasData, weight = NULL, params = NULL)
compBAIT(baitInput, tasData, weight = NULL, params = NULL)
baitInput |
named list containing rsds, sfcwind, huss climate data |
tasData |
raster data on near-surface atmospherical temperature |
weight |
named list with weights |
params |
optional named list with regression parameters from calcBAITpars |
raster object with BAIT values
Assign HDD/CDD values for given ambient/limit temperature
compCellHDDCDD(temp, typeDD, tlim, factors)
compCellHDDCDD(temp, typeDD, tlim, factors)
temp |
raster data containing temperature/BAIT values |
typeDD |
type of degree day |
tlim |
limit temperature |
factors |
data frame with degree day values for |
raster object with HDD/CDD values
HDD/CDD values are pre-calculated for an interval tlow
-tup
and
for a set of limit temperatures tlim
with a temperature resolution of
0.1C.
compHDDCDDFactors(tlow, tup, tlim, tambStd = 5, tlimStd = 5)
compHDDCDDFactors(tlow, tup, tlim, tambStd = 5, tlimStd = 5)
tlow |
lower temperature boundary |
tup |
upper temperature boundary |
tlim |
named list of limit temperature sequences for |
tambStd |
std of ambient temperature |
tlimStd |
std of limit temperature |
The respective heating/cooling degree days are calculated as the difference between the assumed ambient and a limit temperature, aggregated to a full day. The latter defines a threshold above/below which cooling/heating is assumed to be initiated.
To account for heterogenity in heating/cooling behavior, the ambient and limit
temperature, tamb
and tlim
, are assumed to be normally distributed.
This changes the calculation of a degree day to a double integration of
tLimit - T_ambient_day
with integration boundaries set at 3 standard
deviations, tambStd
and tlimStd
, from tamb
and tlim
respectively.
As consequence, the ramp function of HDD_day = max(0, tLimit - T_ambient_day)
changes to a curved function that is above zero even if the mean of T_ambient_day
is above the mean of tLimit
.
data frame of HDD/CDD values
This function calculates country-wise population-weighted HDD/CDD values for raw ambient temperature or bias-adjusted internal temperature for a given set of limit temperatures from raster data on (various) climate variables.
compStackHDDCDD( ftas, tlim, countries, pop, factors, bait, frsds = NULL, fsfc = NULL, fhuss = NULL, wBAIT = NULL, params = NULL, rasDir = NULL )
compStackHDDCDD( ftas, tlim, countries, pop, factors, bait, frsds = NULL, fsfc = NULL, fhuss = NULL, wBAIT = NULL, params = NULL, rasDir = NULL )
ftas |
file name of data on near-surface atmospherical temperature |
tlim |
named list of limit temperature sequences for |
countries |
raster opbject defining (regional) aggregation boundaries |
pop |
raster object containing population data |
factors |
data frame with degree day values for |
bait |
boolean, BAIT is used as ambient temperature |
frsds |
file name of data on surface downdwelling shortwave radiation (optional) |
fsfc |
file name of data on near-surface wind speed (optional) |
fhuss |
file name of data on near-surface specific humidity (optional) |
wBAIT |
named list containing BAIT weights (optional) |
params |
raster object containing regression parameters from |
rasDir |
absolute path to directory for saving raster files |
For further processing, raster objects containing degree day data are written for an interval of ten years.
Convert heating systems sales in Italy from Assotermica
convertAssotermica(x)
convertAssotermica(x)
x |
MagPIE object with Assotermica data |
MagPIE object with ISO 3 country codes
Robin Hasse
Convert German heating system data from BDH
convertBDH(x)
convertBDH(x)
x |
MagPIE object with BDH data |
MagPIE object with ISO 3 country codes
Robin Hasse
Convert heating systems sales in Austria from BMK
convertBMK(x)
convertBMK(x)
x |
MagPIE object with BMK data |
MagPIE object with ISO 3 country codes
Robin Hasse
Convert data from Census Hub
convertCensusHub(x, subtype)
convertCensusHub(x, subtype)
x |
raw data |
subtype |
Eurostat code of data set |
MAgPie object with converted data
Robin Hasse
Tidy data from Daioglou et al. 2012. Currently, only the specific floor space (m2/cap) is available from household data file. UN sources are dropped, if there is data from other sources for the same region. For the remaining data, if there is data from multiple UN Source for a region and period (i.e. different cities), the average of those sources is considered. This neglects the differences in population size of the cities. Selected data points are removed additionally.
convertDaioglou(x, subtype = "households.specific floor space")
convertDaioglou(x, subtype = "households.specific floor space")
x |
MAgPIE object with data from Daioglou et al. #nolint |
subtype |
. |
clean MAgPIE object with unique data points
Robin Hasse, Antoine Levesque
Convert Weibull lifetime distribution parameters for buildings
convertDeetman2020(x, subtype)
convertDeetman2020(x, subtype)
x |
MAgPIE object with data from Deetman et al. 2020 |
subtype |
character, building subsector (either 'residential' or 'commercial') |
Robin Hasse
Convert historic floor space data from the European Environment Agency.
convertEEAfloorspace(x)
convertEEAfloorspace(x)
x |
MAgPIE object with floor space data |
floor national floor space in million m2
Robin Hasse
Convert EHI Heating Market Report
convertEHI(x)
convertEHI(x)
x |
MagPIE object with raw data |
MagPIE object with country-level data
Robin Hasse
Correct heat pump sales data from EHPA
convertEHPA(x)
convertEHPA(x)
x |
MagPIE object with EHPA data |
MagPIE object with ISO 3 country codes
Robin Hasse
We should consider prper extrapolation
convertEnergiforsk2016(x)
convertEnergiforsk2016(x)
x |
MAgPIE object with original district heating prices |
Robin Hasse
Convert to common units.
convertEUBuildingsDB(x, subtype)
convertEUBuildingsDB(x, subtype)
x |
MAgPIE object with data from EU Buildings Database |
subtype |
character |
clean MAgPIE object with
Robin Hasse
Each report of the Heat Pumps Barometer covers the two years before. There numerous cases, where reports contradict in overlapping values or there are huge jumps (probably due to changes in the accounting). This function creates smooth trajectories back-casting from the most recent data. If data overlaps, earlier data is scaled to match more recent data. In case of gaps, the trajectories are back-casted maintaining relative growth within each report. Growth rates between reports are interpolated. The Method yields mostly smooth trajectories always hitting the mos recent reported numbers.
convertEurObservER(x, subtype)
convertEurObservER(x, subtype)
x |
raw data |
subtype |
Eurostat code of data set |
MAgPie object with converted data
Robin Hasse
Drop EU28 aggregate and rename regions to ISO3.
convertEuropeanCommissionRenovation(x)
convertEuropeanCommissionRenovation(x)
x |
MAgPIE object with data from EC report |
clean MAgPIE object with data from EU Buildings Database
Robin Hasse
Convert buildings-related data from Eurostat.
convertEurostatBuildings(x, subtype)
convertEurostatBuildings(x, subtype)
x |
raw data |
subtype |
Eurostat code of data set |
MAgPie object with converted data
Robin Hasse
Convert heating systems sales in Spain from FEGECA
convertFEGECA(x)
convertFEGECA(x)
x |
MagPIE object with Assotermica data |
MagPIE object with ISO 3 country codes
Robin Hasse
Drop subnational data but keep other subgroups (i.e. rural/urban, income quartiles)
convertGDL(x, subtype)
convertGDL(x, subtype)
x |
MAgPIE object with data from EU Buildings Database |
subtype |
. |
clean MAgPIE object with data from EU Buildings Database
Robin Hasse
Convert historic and scenario based HDD CDD data to data on ISO country level.
convertHDDCDD(x)
convertHDDCDD(x)
x |
MAgPIE object containing HDD CDD values at ISO country resolution |
HDD CDD data as MAgPIE object aggregated to country level
Antoine Levesque
The temporary data already is at EDGE-B regional resolution. It is uniformly disaggregated to country level here to comply with the madrat framework before it is aggregated to the identical resolution in fullEDGEBUILDINGS.
convertHDDCDDtemp(x)
convertHDDCDDtemp(x)
x |
MAgPIE object with HDD and CDD data at EDGE-B resolution |
HDD CDD data at country resolution
Robin Hasse
convert Hotmaps
convertHotmaps(x)
convertHotmaps(x)
x |
MagPIE object with raw building stock data |
MagPIE object with converted data
Robin Hasse
convert ISIMIP data for mredgebuildings
convertISIMIPbuildings(x, subtype)
convertISIMIPbuildings(x, subtype)
x |
MAgPIE object on cellular level |
subtype |
filename |
rasterBrick object
Hagen Tockhorn
Rename regions and convert unit
convertOdyssee(x, subtype = "households")
convertOdyssee(x, subtype = "households")
x |
MAgPIE object with data from Odyssee Database |
subtype |
category |
clean MAgPIE object
Robin Hasse
This was adapted from EDGE function 'getPFUDB.R'.
convertPFUDB(x)
convertPFUDB(x)
x |
MAgPIE object with data from PFUDB #nolint |
magpie object
Hagen Tockhorn
Convert heating systems stock and sales in Poland from SPIUG
convertSPIUG(x)
convertSPIUG(x)
x |
MagPIE object with PIUG data |
MagPIE object with ISO 3 country codes
Robin Hasse
Convert TCEP data base
convertTCEP(x, subtype = "enduse")
convertTCEP(x, subtype = "enduse")
x |
MAgPIE object with data from TCEP #nolint |
subtype |
character, type of data |
magpie object
Hagen Tockhorn, Robin Hasse
Clean up UN data on household size and composition
convertUNHouseholds(x, subtype)
convertUNHouseholds(x, subtype)
x |
MAgPIE object with data from EU Buildings Database |
subtype |
household variable |
clean MAgPIE object with
Robin Hasse
Convert heating systems sales in France from Uniclima
convertUniclima(x)
convertUniclima(x)
x |
MagPIE object with PIUG data |
MagPIE object with ISO 3 country codes
Robin Hasse
Convert WEO enduse shares w.r.t. to global final energy demand
convertWEO(x)
convertWEO(x)
x |
readWEO object |
Hagen Tockhorn
Extrapolate missing values beyond existing periods
extrapolateMissingPeriods(chunk, key, slopeOfLast = 5)
extrapolateMissingPeriods(chunk, key, slopeOfLast = 5)
chunk |
grouped data.frame |
key |
column holding values for extrapolation |
slopeOfLast |
number of values for boundary regression |
data.frame with extrapolated column key
Robin Hasse, Hagen Tockhorn
Compute complete input data set for BRICK
fullBRICK(rev = 0)
fullBRICK(rev = 0)
rev |
data revision which should be used as input (positive numeric). |
Robin Hasse
Function that produces the complete ISO data set required for the EDGE - Buildings model.
fullEDGEBUILDINGS(rev = 0)
fullEDGEBUILDINGS(rev = 0)
rev |
data revision which should be used as input (positive numeric). |
Antoine Levesque, Robin Hasse, Hagen Tockhorn
readSource
,getCalculations
,calcOutput
## Not run: fullEDGEBUILDINGS() ## End(Not run)
## Not run: fullEDGEBUILDINGS() ## End(Not run)
Takes the historic final energy demand by carriers from IEA and disaggregates it into different end uses.
getFEbyEUEC()
getFEbyEUEC()
data.frame with historic energy demands
Hagen Tockhorn
Additional columns to join by that have different names can be give. The kind of joint can also be specified.
join_all( x, y, by = NULL, .direction = "left", exclude = "value", silent = TRUE, ... )
join_all( x, y, by = NULL, .direction = "left", exclude = "value", silent = TRUE, ... )
x , y
|
A pair of data frames |
by |
character vector of columns to join by beyond the commonly named |
.direction |
type of dplyr join, 'left' by default |
exclude |
character vector with column names that should be excluded from the search for join columns |
silent |
boolean, whether to print type of joint the join columns |
... |
additional arguments passed to join function |
Robin Hasse
Read in necessary climate data to calculate BAIT or calculate mean values of said climate data to fill missing data in case of temporal mismatch between near-surface atmospherical temperature and other considered climate data.
prepBaitInput( frsds = NULL, fsfc = NULL, fhuss = NULL, baitInput = NULL, fillWithMean = FALSE )
prepBaitInput( frsds = NULL, fsfc = NULL, fhuss = NULL, baitInput = NULL, fillWithMean = FALSE )
frsds |
file path to raster data on surface downdwelling shortwave radiation |
fsfc |
file path to raster data on near-surface wind speed |
fhuss |
file path to raster data on near-surface specific humidity |
baitInput |
named list of climate data |
fillWithMean |
boolean, only mean is calculated and returned |
named list with read-in or meaned climate data
Read heating systems sales in Italy from Assotermica
readAssotermica(subtype = NULL)
readAssotermica(subtype = NULL)
subtype |
Character, report to read. if NULL, the most recent report is used for every data point. |
magpie object
Robin Hasse
Read German heating system data from BDH
readBDH()
readBDH()
MagPIE object with yearly sales of heating systems in Germany
Robin Hasse
Read heating systems sales in Austria from BMK
readBMK()
readBMK()
MagPIE object with yearly sales of heating systems in Germany
Robin Hasse
The Census Hub of the European Statistical System provides census data from 2011 on population and housing of EU member states. 2021 census data is announced to be published there too.
typeVintage: number of dwellings of different construction periods and building types (single, two, multiple dwellings). Show data on: dwellings, location: nations, Topics: Type of building, Period of construction (select all) -> CSV (Separator: Comma)
readCensusHub(subtype)
readCensusHub(subtype)
subtype |
census subset |
MAgPIE object with data
Robin Hasse
https://ec.europa.eu/CensusHub2/
Compilation of survey data. Quintile 0 stands for the entire population.
households: Global data on population, household size, floor space per capita (m2/cap), population density (cap/km2), GINI and household expenditures (PPP2005/cap). Sources are written into a dimension to allow later cleaning based on sources
shares: Final energy shares of end uses in buildings. Sources are dropped.
readDaioglou(subtype = "households.specific floor space")
readDaioglou(subtype = "households.specific floor space")
subtype |
. |
Robin Hasse, Antoine Levesque
https://doi.org/10.1016/j.energy.2011.10.044
Read Weibull lifetime distribution parameters for buildings
readDeetman2020(subtype = "residential")
readDeetman2020(subtype = "residential")
subtype |
character, building subsector (either 'residential' or 'commercial') |
MagPIE object with Weibull lifetime parameters for different world regions
Robin Hasse
https://doi.org/10.1016/j.jclepro.2019.118658
Project data: European Climate and Energy Modelling Forum
readECEMF(subtype = "FEPrices")
readECEMF(subtype = "FEPrices")
subtype |
character, type of data |
FEPrices: price components w/o VAT in EUR/MWh
Robin Hasse
Floor space for many European countries between 1990 and 2009 in thousand m2.
readEEAfloorspace()
readEEAfloorspace()
magpie object with floor space
Robin Hasse
## Not run: a <- readSource(type = "EEAfloorspace")
## Not run: a <- readSource(type = "EEAfloorspace")
Read EHI Heating Market Report
readEHI(subtype = NULL)
readEHI(subtype = NULL)
subtype |
Character, report to read. if NULL, the most recent report is used for every data point. |
magpie object
Robin Hasse
This data was provided upon request. It is free for non-profit organisations but we are not allowed to share it.
readEHPA(subtype = "hpSales")
readEHPA(subtype = "hpSales")
subtype |
character, type of data |
MagPIE object with HP sales data for EU member states
Robin Hasse
Read European district heating prices
readEnergiforsk2016()
readEnergiforsk2016()
Robin Hasse
Read in energy efficiency values from ETSAP
readETSAP()
readETSAP()
Compilation of various data sources from the European Commission. Because of the considereable size of this database, a subtype has to be provided. The subtype represents the category of items. It is possible to append selected variables for further filtering.
readEUBuildingsDB(subtype = "")
readEUBuildingsDB(subtype = "")
subtype |
character |
magpie object
Robin Hasse
## Not run: a <- readSource(type = "EUBuildingsDB")
## Not run: a <- readSource(type = "EUBuildingsDB")
Read in energy efficiency values of building shell in residential and non-residential buildings by the EU Buildings Observatory (2017)
readEUBuildingsObservatory()
readEUBuildingsObservatory()
PDF market reports on Renewables in Europe
readEurObservER(subtype)
readEurObservER(subtype)
subtype |
. |
magpie object
I download the report and snip a png of the table. Then I extract the data with this online tool and save it as a tabular csv in the source folder. The Tool is not fully reliable. This function throws an error if values don't sum up. You then have to correct the csv file manually.
Robin Hasse
https://www.eurobserv-er.org/
This function reads data on renovation from a pdf file of an EC report from 2019 (Tables 2 - 13). There is no period dimension. The data represents averages between 2012 and 2016.
readEuropeanCommissionRenovation(subtype = "csv")
readEuropeanCommissionRenovation(subtype = "csv")
subtype |
character, source to read from: |
MAgPIE object with renovation data
Robin Hasse
https://op.europa.eu/en/publication-detail/-/publication/97d6a4ca-5847-11ea-8b81-01aa75ed71a1
## Not run: a <- readSource(type = "EuropeanCommissionRenovation")
## Not run: a <- readSource(type = "EuropeanCommissionRenovation")
Read various data sets from Eurostat that are used in the modelling of buildings
nrg_inf_hptc: Heat pumps - technical characteristics by technologies
ilc_hcmh02: Average size of dwelling by household type and degree of urbanisation
nrg_d_hhq: Disaggregated final energy consumption in households
readEurostatBuildings(subtype)
readEurostatBuildings(subtype)
subtype |
Eurostat code of data set |
MAgPIE object with data
see https://ec.europa.eu/eurostat/web/energy/data/energy-balances for definitions of codes
Robin Hasse
Read heating systems sales in Spain from FEGECA
readFEGECA(subtype = NULL)
readFEGECA(subtype = NULL)
subtype |
Character, report to read. if NULL, the most recent report is used for every data point. |
magpie object
Robin Hasse
Different databases each comprising the harmonised results of regional/national surveys. Available subtypes are
SHDI: Subnational Human development Database
AreaDatabase: Subnational development Indicators (low/medium income countries)
readGDL(subtype)
readGDL(subtype)
subtype |
. |
magpie object
Robin Hasse
https://globaldatalab.org/
https://doi.org/10.1038/sdata.2019.38
https://globaldatalab.org/asset/286/Smits%20GDL%20Working% 20Paper%2016-101%20v360.pdf
## Not run: a <- readSource(type = "GDL")
## Not run: a <- readSource(type = "GDL")
Read heating and cooling degree days; past and scenario data as magclass objects
readHDDCDD(subtype = 18)
readHDDCDD(subtype = 18)
subtype |
Temperature threshold for computing HDD and CDD |
magpie object HDD CDD
Antoine Levesque
## Not run: a <- readSource(type="HDDCDD")
## Not run: a <- readSource(type="HDDCDD")
Heating and cooling degree days calculated with mredgebuildings::calcHDDCDD
.
Calculating this data currently requires manual help. We therefore read the
result as a source here. This becomes obsolete once the primary calculation
is stable.
readHDDCDDtemp()
readHDDCDDtemp()
Robin Hasse
Consistent building stock of EU28 residential and commercial sector. The data presents a snapshot, I guess in 2016 but this is not clear to me yet.
readHotmaps()
readHotmaps()
There are a few duplicate rows. Due to inconsistent values we average across duplicates.
Robin Hasse
Relevant data such as region masks, population and relevant climate data are read in. The relevant file is declared in the subtype with the full file name.
readISIMIPbuildings(subtype)
readISIMIPbuildings(subtype)
subtype |
filename |
If the file name includes a suffix in the form of an integer such as
_<int>.filetype
, the file is split into a single year period, e.g.
<filename>_2001_2010_2.nc
will return data for the second year of the
2001-2010 period, here 2002.
folder structure in inputdata/sources/ISIMIPbuildings is expected to be: country masks : var/ population : var/scenario other : var/scenario/model
currently, this function only reads data from ISIMIP3b
Hagen Tockhorn
Copied from website: The Odyssee database contains detailed energy consumption by end-use and their drivers as well as energy efficiency and CO2-related indicators. Latest available data is provided by national representatives, such as energy agencies or statistical organization, from all EU countries as well as Norway, Serbia, Switzerland and the United Kingdom.
readOdyssee(subtype = "households")
readOdyssee(subtype = "households")
subtype |
database category |
magpie object
To download new data, log into the website, select all items of all levels and download the data 'column-orientated csv'.
Variables are labels with the item code but full names can be found in the source data
Pascal Führlich, Robin Hasse
https://odyssee.enerdata.net/database/
This was adapted from EDGE function 'getPFUDB.R'.
readPFUDB()
readPFUDB()
magpie object
Hagen Tockhorn
Read heating systems stock and sales in Poland from SPIUG
readSPIUG()
readSPIUG()
magpie object
Robin Hasse
Read TCEP data base
readTCEP(subtype = "enduse")
readTCEP(subtype = "enduse")
subtype |
character, type of data |
magpie object
Hagen Tockhorn, Robin Hasse
Compilation of indicators on household size and membership composition. The estimates are based on 814 unique data points from 172 countries or areas, representing approximately 97 per cent of the world’s population in 2019, collected between 1960 to 2018.
readUNHouseholds(subtype)
readUNHouseholds(subtype)
subtype |
household variable |
magpie object
Robin Hasse
https://www.un.org/development/desa/pd/data/household-size-and-composition
## Not run: a <- readSource(type = "UNHouseholds")
## Not run: a <- readSource(type = "UNHouseholds")
Read heating systems sales in France from Uniclima
readUniclima()
readUniclima()
magpie object
Robin Hasse
Read WEO enduse shares w.r.t. to global final energy demand
readWEO(subtype)
readWEO(subtype)
subtype |
variable to define data subset ("Buildings", "Transport", "Industry") |
Hagen Tockhorn
Smooth data over preceding two days
smooth(r, weight)
smooth(r, weight)
r |
raster data to be smoothed |
weight |
named list with smoothing parameter sig |
smoothed raster data
Introduce refrigerators as appliances
toolAddThermal(df, mapping, fridgeShare, feOnly = TRUE, shareOf = NULL)
toolAddThermal(df, mapping, fridgeShare, feOnly = TRUE, shareOf = NULL)
df |
data.frame |
mapping |
original EDGE-B region mapping |
fridgeShare |
regional shares of refrigerators |
feOnly |
are absolute values (TRUE) or shares (FALSE) considered? |
shareOf |
column name to calculate share of - must be given if feOnly = FALSE |
Hagen Tockhorn
This function expects a MAgPIE object with ISO country codes in the spatial dimension. It applies toolCountryFill but fills with the average across regions.
toolCountryFillAvg(x, ...)
toolCountryFillAvg(x, ...)
x |
MAgPIE object with ISO country codes in the spatial dimension |
... |
arguments passed to toolCountryFill |
Robin Hasse
This function takes energy demand data that differentiates only by carrier and disaggregates it further such that all relevant combinations of carrier and end use are differentiated. It ensures that given end use shares (across all carriers) are met.
toolDisaggregate( data, enduseShares, outliers = NULL, exclude = NULL, dataDisagg = NULL, regionMapping = NULL )
toolDisaggregate( data, enduseShares, outliers = NULL, exclude = NULL, dataDisagg = NULL, regionMapping = NULL )
data |
data.frame with energy demand data differentiated by carriers that is to be disaggregated |
enduseShares |
data.frame with end use shares that have to be met. These
shares might be given at aggregated regional resolution if
|
outliers |
list of regions where naive disaggregation estimate shall be used. |
exclude |
data.frame with the columns |
dataDisagg |
data.frame similar to |
regionMapping |
data.frame with the columns |
The function essentially performs a quadratic optimisation. The constraints make sure that both the carrier quantities and the end use shares are met. This generally leaves infinite solutions (in problematic cases none). To get to one disaggregation, the deviation from a given distribution across all relevant combinations of carriers and end uses is minimised.
Hagen Tockhorn, Robin Hasse
This is adapted from EDGE-B Function "splitBiomass.R" by Antoine Levesque.
toolSplitBiomass(df, dfGDPpop, min = 10000, max = 15000, varName = "biomass")
toolSplitBiomass(df, dfGDPpop, min = 10000, max = 15000, varName = "biomass")
df |
dataframe with carrier as 'variable' |
dfGDPpop |
dataframe containing the GDP per Capita |
min |
lower threshold of GDP per Capita in USD 2005 |
max |
upper threshold of GDP per Capita in USD 2005 |
varName |
nomenclature of biomass |
Any value belonging to the carrier defined by "varName" will be split into the default carrier names "biomod" and "biotrad" according to weights given by "dfGDPpop".
factor.data.frame
Hagen Tockhorn
Takes MAgPIE object with a variable dimension that has the unit as suffix separated with '_' and converts the unit according to a unit conversion table.
toolUnitConversion(x, unitConversion, dim = 3.1, removeUnit = FALSE)
toolUnitConversion(x, unitConversion, dim = 3.1, removeUnit = FALSE)
x |
MAgPIE object |
unitConversion |
data.frame with the columns from, to, factor |
dim |
variable dimension that contains the unit as suffix |
removeUnit |
boolean remove unit after conversion for clean variable names |
Robin Hasse
Exchange rate between USD and EUR
usd2eur(year = 2020)
usd2eur(year = 2020)
year |
integer, reference year |
MER EUR in USD in given year
Robin Hasse