air_pollution_functions
index
/mnt/f/University of Exeter/environmental_insights/air_pollution_functions.py

 
Modules
       
matplotlib.colors
geopandas
math
matplotlib.patches
numpy
pandas
matplotlib.pyplot
variables

 
Functions
       
air_pollution_concentrations_to_UK_daily_air_quality_index(predicitions, pollutant, air_pollutant_column_name)
Add onto an existing dataframe the Daily Air Quality Index (https://uk-air.defra.gov.uk/air-pollution/daqi?view=more-info) for the air pollutant concentration data described.
 
Parameters:
predicitions (dataframe): A dataframe of the air pollution concentrations that are to be added onto
pollutant (string): The string of the air pollutant concentration thresholds to be used to create the air quality indexes.
air_pollutant_column_name (string): The string of the column name for the air pollution concentration to calculate the air quality index on.
 
Returns:
dataframe: A dataframe with the additional columns for the air quality index based on the outlined air pollution concentration data.
change_in_aqi_visulisation(first_dataframe, second_dataframe, air_pollutant, filename)
Visualisation the change in concentrations for two datasets of air pollution concentrations based on air quality indexes.
 
Parameters:
Parameters:
first_dataframe (DataFrame): The first concentration dataset.
second_dataframe (DataFrame): The second concentration dataset.
air_pollutant (string):  Common column name in both dataframes that will be used to calculate the difference in concentrations.
filename (string): Filename for the visualisation that is outputted in the environmental_insights_visulisations directory
change_in_concentration_line(air_pollutant, baseline_list, change_list, days, hours_covered, filename)
Visualisation the change in concentrations for two datasets of air pollution concentrations in a line graph.
 
Parameters:
Parameters:
air_pollutant (string): The name of the air pollutant to plot,
baseline_list (list): List of the air pollution concentrations for the baseline scenario.
change_list (list): List of the air pollution concentrations for the future scenario.
days (list): The days the lists covers.
hours_covered (list): The house the list covers.
filename (string): Filename for the visualisation that is outputted in the environmental_insights_visulisations directory
change_in_concentrations_visulisation(first_dataframe, second_dataframe, air_pollutant, filename)
Visualisation the change in concentrations for two datasets of air pollution concentrations based on actual concentrations.
 
Parameters:
Parameters:
first_dataframe (DataFrame): The first concentration dataset.
second_dataframe (DataFrame): The second concentration dataset.
air_pollutant (string):  Common column name in both dataframes that will be used to calculate the difference in concentrations.
filename (string): Filename for the visualisation that is outputted in the environmental_insights_visulisations directory
visualise_air_pollution_daily_air_quality_bands(air_pollution_GDF, aqi_to_plot, filename)
Visualise air_pollution_GDF with the UK Daily Air Quality Index (https://uk-air.defra.gov.uk/air-pollution/daqi?view=more-info) using the bands and standard color codes.
 
Parameters:
air_pollution_GDF (dataframe): A dataframe of the air pollution concentrations that are to be added onto
aqi_to_plot (string): Name of the column within air_pollution_GDF that has the bands that are to be plotted.
filename (string): Filename for the visualisation that is outputted in the environmental_insights_visulisations directory
visualise_air_pollution_daily_air_quality_index(air_pollution_GDF, aqi_to_plot, filename)
Visualise air_pollution_GDF with the UK Daily Air Quality Index (https://uk-air.defra.gov.uk/air-pollution/daqi?view=more-info) using the indiviudal index bounds and standard color codes.
 
Parameters:
air_pollution_GDF (dataframe): A dataframe of the air pollution concentrations that are to be added onto
aqi_to_plot (string): Name of the column within air_pollution_GDF that has the indexes that are to be plotted.
filename (string): Filename for the visualisation that is outputted in the environmental_insights_visulisations directory