build_country_flh: Fix aggregated flh reports for wind
This commit is contained in:
parent
ef867ebfc0
commit
33823c9012
@ -64,7 +64,12 @@ def build_aggregate(flh, countries, areamatrix, breaks, p_area, fn):
|
||||
agg_a = pd.Series(np.ravel((areamatrix / areamatrix.sum(axis=1)).dot(flh.values)),
|
||||
countries, name="PyPSA-Eur")
|
||||
|
||||
if p_area is not None:
|
||||
if p_area is None:
|
||||
agg_a['Overall'] = float((np.asarray((areamatrix.sum(axis=0) / areamatrix.sum())
|
||||
.dot(flh.values)).squeeze()))
|
||||
|
||||
agg = pd.DataFrame({'PyPSA-Eur': agg_a})
|
||||
else:
|
||||
# Determine indices of countries which are also in Pietzcker
|
||||
inds = pd.Index(countries).get_indexer(p_area.index)
|
||||
areamatrix = areamatrix[inds]
|
||||
@ -72,7 +77,6 @@ def build_aggregate(flh, countries, areamatrix, breaks, p_area, fn):
|
||||
agg_a['Overall'] = float((np.asarray((areamatrix.sum(axis=0) / areamatrix.sum())
|
||||
.dot(flh.values)).squeeze()))
|
||||
|
||||
|
||||
midpoints = (breaks[1:] + breaks[:-1])/2.
|
||||
p = p_area.T
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user