UrbanHeatPro.Functions

UrbanHeatPro A. Molar-Cruz @ TUM ENS

Submodules

Package Contents

Functions

plot_timeseries(dt_vector, timeseries, legend, fig_name)

Plots timeseries as steps

plot_stacked_timeseries(dt_vector, timeseries, legend, ...)

Plots timeseries as steps

plot_histogram(values, ylabel, fig_name[, factor, ...])

Plots simple histogram

plot_histogram_table(use, thermal_property, title, ...)

Plots a histogram showing the values of the thermal properties for all buildings in

plot_imshow_comparison(use, sim_stock, stat_stock, ...)

Shows a figure with two tables:

plot_typical_days(days_in_year, data_in_days, Z, ...)

Figures: calculation of typical days

create_normal_distribution(x, mean, sigma)

Returns a vector of len(x) values distributed normally around the specific

create_interpolated_cdf(x, p)

Returns the cumulative density function (cdf) as a vector of len(x) values

building_use_to_tuple(use)

Map building use to tuple (use_int, use_str)

year_class_to_tuple(use_int, year_class_int)

Map year class to tuple (year_class_int, year_class_str)

size_class_to_tuple(use_int, size_class_int)

Map size class to tuple (size_class_int, size_class_str)

UrbanHeatPro.Functions.plot_timeseries(dt_vector, timeseries, legend, fig_name, xticks=('month', 3), ynumticks='auto', ylabel='Power [kW]', ylim0=True, yfactor=1000.0)[source]

Plots timeseries as steps

Parameters:
  • dt_vector (list) – list of datetime objects

  • timeseries (list) – timeseries to plot [ts1, ts2, ts3]

  • legend (list) – list of legends [leg1, leg2, leg3]

  • fig_name (string) – figure name

  • xticks (tuple) – Every X months/days/hours. Possible values: (‘month’, X), (‘day’, X), (‘hour’, X)

  • ynumticks

  • ylabel

  • ylim0

  • yfactor

UrbanHeatPro.Functions.plot_stacked_timeseries(dt_vector, timeseries, legend, fig_name, xticks=('month', 3), ynumticks='auto', ylabel='Power [kW]', ylim0=True, yfactor=1000.0)[source]

Plots timeseries as steps

Parameters:
  • dt_vector (list) – list of datetime objects

  • timeseries (list) – timeseries to stack [ts1, ts2]

  • legend (list) – list of legends [leg1, leg2, leg3]

  • fig_name (string) – figure name

  • xticks (tuple) – Every X months/days/hours. Possible values: (‘month’, X), (‘day’, X), (‘hour’, X)

  • ynumticks

  • ylabel

  • ylim0

  • yfactor

UrbanHeatPro.Functions.plot_histogram(values, ylabel, fig_name, factor=1000.0, statistics=[])[source]

Plots simple histogram

UrbanHeatPro.Functions.plot_histogram_table(use, thermal_property, title, fig_name, factor=1000.0, statistics=[], figsize=(30, 25))[source]

Plots a histogram showing the values of the thermal properties for all buildings in the city (only residential). A histogram per year construction class and building type is shown.

UrbanHeatPro.Functions.plot_imshow_comparison(use, sim_stock, stat_stock, fig_name, cmap='RdBu')[source]
Shows a figure with two tables:
Left The distribution of residential buildings in the diff categories (year_class, btype)

according to the statistics used to generate the synthetic building stock

Right The distribution of residential buildings in the diff categories (year_class, btype)

in the synthetic building stock

UrbanHeatPro.Functions.plot_typical_days(days_in_year, data_in_days, Z, number_of_clusters, min_distance_day, avg_day, clusters, clusters_per_month, month_names, timeseries_min, timeseries_avg, result_dir)[source]

Figures: calculation of typical days

UrbanHeatPro.Functions.create_normal_distribution(x, mean, sigma)[source]

Returns a vector of len(x) values distributed normally around the specific mean and standard deviation sigma.

UrbanHeatPro.Functions.create_interpolated_cdf(x, p)[source]

Returns the cumulative density function (cdf) as a vector of len(x) values given a probability function, p. The cdf interpolated in case the probability function has fewer values than the given x vector.

UrbanHeatPro.Functions.building_use_to_tuple(use)[source]

Map building use to tuple (use_int, use_str)

Parameters:

use – building use as string or integer

Returns:

tuple (use_int, use_str)

UrbanHeatPro.Functions.year_class_to_tuple(use_int, year_class_int)[source]

Map year class to tuple (year_class_int, year_class_str)

Parameters:
  • use_int – building use as integer

  • year_class_int – year class as integer

Returns:

tuple (year_class_int, year_class_str)

UrbanHeatPro.Functions.size_class_to_tuple(use_int, size_class_int)[source]

Map size class to tuple (size_class_int, size_class_str)

Parameters:
  • use_int – building use as integer

  • size_class_int – size class as integer

Returns:

tuple (size_class_int, size_class_str)