def plotStoresSelectedAllDynamicPlusStatic(fp, outfp, store, max_time, fig_width, colormap_name, cbar=False, colors=None): """Plot lines for selected stores where all accessibility elements (people, transport, acitivity locations) are dynamic. Add static line as additional element to show difference.""" # Sheet numbers in the Excel file stores = { 'Lasnamäe': 'LasnamaePrisma', 'Solaris': 'Solaris', 'Rocca': 'RoccaPrisma' } # Determine the store sheet sheet = stores[store] # Read file data = pd.read_excel(fp, sheet_name=sheet, skiprows=2) static = pd.read_excel(fp, sheet_name='ALL_STATIC', skiprows=2) # Join the files together data = data.merge(static, on='Time') # Change column names ('t' --> time, 'ap' --> accessed population) time_col = 'Time' acc_cols = ["h8d", "h13d", "h17d", "h22d"] title = ""#"All dynamic" xlabel = ""#"Population reaching food store (%)" # Column containing static information static_col = "static" # Plot the graph plotGraph(data=data, acc_cols=acc_cols, time_col=time_col, title=title, xlabel=xlabel, outfp=outfp, max_time=max_time, fig_width=fig_width, colormap_name=colormap_name, cbar=cbar, incl_static=static_col, colors=colors)
def plotPTDynamic(fp, outfp, max_time, fig_width, colormap_name, cbar=False, colors=None): """Plot lines where transportation (PT) is dynamic but people and activity locations are static""" # Read file data = pd.read_excel(fp, sheet_name='ONLY_PT_DYN', skiprows=2) # Change column names ('t' --> time, 'ap' --> accessed population) time_col = 'Time' acc_cols = ["h %s" % t for t in range(0,24)] title = "" #"PT dynamic" xlabel = "" #"Population reaching food store (%)" # Plot the graph plotGraph(data=data, acc_cols=acc_cols, time_col=time_col, title=title, xlabel=xlabel, outfp=outfp, max_time=max_time, fig_width=fig_width, colormap_name=colormap_name, cbar=cbar, colors=colors)
def plotAllDynamic(fp, outfp, max_time, fig_width, colormap_name, cbar=False, colors=None): """Plot lines where all accessibility elements (people, transport, acitivity locations) are dynamic.""" # Read file data = pd.read_excel(fp, sheet_name='ALL_DYNAMIC_&_COMPARISON', skiprows=2) # Change column names ('t' --> time, 'ap' --> accessed population) time_col = 'Time' acc_cols = ["h %s" % t for t in range(0,24)] title = ""#"All dynamic" xlabel = ""#"Population reaching food store (%)" # Plot the graph plotGraph(data=data, acc_cols=acc_cols, time_col=time_col, title=title, xlabel=xlabel, outfp=outfp, max_time=max_time, fig_width=fig_width, colormap_name=colormap_name, cbar=cbar, colors=colors)
def plotAllDynamicPlusStatic(fp, outfp, max_time, fig_width, colormap_name, cbar=False, colors=None): # Read file data = pd.read_excel(fp, sheet_name='ALL_DYNAMIC_&_COMPARISON', skiprows=2) static = pd.read_excel(fp, sheet_name='ALL_STATIC', skiprows=2) # Join the files together data = data.merge(static, on='Time') # Change column names ('t' --> time, 'ap' --> accessed population) time_col = 'Time' acc_cols = ["h %s" % t for t in range(0,24)] title = ""#"All dynamic" xlabel = ""#"Population reaching food store (%)" # Column containing static information static_col = "h 0 - 23" # Plot the graph plotGraph(data=data, acc_cols=acc_cols, time_col=time_col, title=title, xlabel=xlabel, outfp=outfp, max_time=max_time, fig_width=fig_width, colormap_name=colormap_name, cbar=cbar, incl_static=static_col)
def plotSelectedAllDynamicPlusStatic(fp, outfp, max_time, fig_width, colormap_name, cbar=False, colors=None): """Plot lines where all accessibility elements (people, transport, acitivity locations) are dynamic. Add static line as additional element to show difference.""" # Read file data = pd.read_excel(fp, sheet_name='ALL_DYNAMIC_&_COMPARISON', skiprows=2) static = pd.read_excel(fp, sheet_name='ALL_STATIC', skiprows=2) # Join the files together data = data.merge(static, on='Time') # Change column names ('t' --> time, 'ap' --> accessed population) time_col = 'Time' acc_cols = ["h 8", "h 13", "h 17", "h 22"] title = ""#"All dynamic" xlabel = ""#"Population reaching food store (%)" # Column containing static information static_col = "h 0 - 23" # Plot the graph plotGraph(data=data, acc_cols=acc_cols, time_col=time_col, title=title, xlabel=xlabel, outfp=outfp, max_time=max_time, fig_width=fig_width, colormap_name=colormap_name, cbar=cbar, incl_static=static_col, colors=colors)
def plotGiniAllDynamicPlusStatic(fp, outfp, max_time, fig_width, colormap_name, cbar=False, colors=None): # Read file data = pd.read_excel(fp, sheetname=3, skiprows=2) static = pd.read_excel(fp, sheetname=4, skiprows=2) # Join the files together data = data.merge(static, on='Time') # Normalize accessibility values data = normalizeAccessibility(df=data, time_col='Time', target_col='nTime') # Change column names ('t' --> time, 'ap' --> accessed population) time_col = 'nTime' acc_cols = ["h %s" % t for t in range(0, 24)] title = "" #"All dynamic" xlabel = "" #"Population reaching food store (%)" # Column containing static information static_col = "h 0 - 23" # Plot the graph plotGraph(data=data, acc_cols=acc_cols, time_col=time_col, title=title, xlabel=xlabel, outfp=outfp, max_time=max_time, fig_width=fig_width, colormap_name=colormap_name, cbar=cbar, incl_static=static_col) return data