Skip to content

yueyang1101/ece143team15

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ece143team15: Analysis On Global Warming

Please use this link for the Jupyter NoteBook:

https://nbviewer.jupyter.org/github/yueyang1101/ece143team15/blob/master/visualizationcode.ipynb

The src folder contains all the python scripts (DataProcessing, Plots). The Original Data folder contains all the data needed for processing. The Image folder contains all the images and an HTML file generated by us. The DataProcessing, Plots and Image folders are divided into four parts corresponding to the four parts in our presentation.

Steps:

  1. Data Processing:

    a) processTrade.py

       -> location: src/DataProcessing/processTrade.py
       
       -> run command: python src/DataProcessing/processTrade.py
       
       -> description: The file reads in data from data/OriginalData/production-vs-consumption-co2-emissions.csv, and generate the data with the net CO2 emission and stored the data in data/VisualizationData/HeatmapData 
    

    b) processFeatureTemp.py

       -> location: src/DataProcessing/processTrade.py
       
       -> run command: python src/DataProcessing/processTrade.py
       
       -> description: The file reads in data from Data/OriginalData/forcings.csv and data/OriginalData/fobserved.csv , and generate a new dataframe with all the feaure info stored as 
       
       -> data generated: data generated is stored in data/VisualizationData/TempFeature.csv
    

    c) main.py

       -> location: src/DataProcessing/CO2_GDP/main.py
       
       -> run command: python src/VisualizationData/CO2_GDP/main.py
       
       -> description: Clean data and generate some specific dataframes for CO2_GDP part. 
       The file reads in data from Data/OriginalData/annual-co-emissions-by-region.xlsx, average-real-gdp-per-capita-across-countries-and-regions.xlsx, co2-concentration-long-term.xlsx, temperature-anomaly.xlsx. 
       Generate six dataframes for six countries' co2 emissions and GDP, a dataframe of all countries' correlation rate between co2 emissions and GDP, a dictionary of cleaned co2 emissions data for all countries, two dataframe of 44 picked countries' correlation rate, a dictionary of co2 emissions from all continents and corresponding countries, a txt file of countries' name for wordcloud image.
       
       -> data generated: data generated is stored in Data/VisualizationData/CO2_GDP with 15 files.
    

    d) process_1_5.py

       -> location: src/DataProcessing/process_1_5.py
       
       -> run command: python src/VisualizationData/process_1_5.py
       
       -> description: The file reads in data from Data/OriginalData/mitigation_curves_1.5C_191203_data.csv, and generates two dataframes: one with just the historical data and other with 1.5 degree mitigation curves data
       
       -> data generated: data generated is stored in Data/VisualizationData/1.5_Mitigation_Curves_Data.csv and Data/FinalData/Historical_CO2_Emissions_Data.csv
    

    e) process_2.py

       -> location: src/DataProcessing/process_2.py
       
       -> run command: python src/DataProcessing/process_2.py
       
       -> description: The file reads in data from Data/OriginalData/mitigation_curves_2.0C_191203_data.csv, and generates one dataframe with 2 degree mitigation curves data
       
       -> data generated: data generated is stored in Data/VisualizationData/2_Mitigation_Curves_Data.csv
    
  2. Plotting

    a) Feature VS ObservedTemp

       -> location: src/plots/FeatureVSObservedTemp.py 
       
       -> run command: python src/plots/FeatureVSObservedTemp.py 
       
       -> description: The file reads in the data from data/VisualizationData/TempFeature.csv folder and plots graph comparing the selected feature vs the observed earth temp. 
    

    b) Plot_Trade_CO2_Heatmap.py

       -> location: src/plots/Plot_Trade_CO2_Heatmap.py 
       
       -> run command: python src/plots/Plot_Trade_CO2_Heatmap.py
       
       -> description: The file reads in the data from data/VisualizationData/HeatmapData folder and plots the heatmap of selected country and selected feauture
    

    c) Temperature heat map

       -> location: src/plots/TemperatureMap.py
       
       -> functions: 
       * get_figure(year: int): create bokeh figure object
       * save_figure(year: int, filename: str): save figure to filename
       * show_figure(year: int): show figure in ipython
       * generate_gif(plots_directory: str, file_path: str, start: int, end: int, step: int = 1, fps: int = 5): geterate gif from plots
       * show_gif(file_path): show gif in ipython
       -> description: it is a module that can be used to plot temperature heatmap and also create gif animations. It is called in the ipython file.
    

    d) correlation_scatterplot.py

       -> location: src/plots/CO2_GDP/correlation_scatterplot.py
       
       -> functions: plot(developed, developing): draw a scatter plot and save it.
       
       -> description: A function which is used to draw and save a scatter plot based on the developed and developing countries' correlation rate between co2 emissions and GDP. It is called in the ipython file.
    

    e) country_trend_plot.py

       -> location: src/plots/CO2_GDP/country_trend_plot.py
       
       -> functions: plot(csvaddress, countryname): draw a trend chart and save it.
       
       -> description: A function which is used to draw and save a trend chart of a country's co2 emissions and GDP. It is called in the ipython file.
    

    f) plot_co2emission_tem.py

       -> location: src/plots/CO2_GDP/plot_co2emission_tem.py 
       
       -> functions: plot(csvaddress): draw a trend chart and save it
       
       -> description: A function which is used to draw and save a trend chart of global co2 emissions and temperature. It is called in the ipython file.
    

    g) tree_map.py

       -> location: src/plots/CO2_GDP/tree_map.py 
       
       -> functions: plot(txtaddress, filepath): generate an interactive treemap and save it.
       
       -> description: A function which is used to generate an interactive treemap based on the co2 emissions of continents and correponding countries and save it as an HTML file. It is called in the ipython file.
    

    h) word_cloud.py

       -> location: src/plots/CO2_GDP/word_cloud.py 
       
       -> functions: plot(txtaddress): generate a wordcloud image and save it.
       
       -> description: A function which is used to generate and save a wordcloud image corresponds to each country's correlation rate between co2 emissions and GDP. It is called in the ipython file.
    

    i) Plots_1_5.py

       -> location: src/plots/Plots_1.5.py 
       
       -> functions: 
           plot_1_5_animation(df_historical_data, df15): generate an animated plot with 1.5 mitigation curves and save it.
           plot_1_5_2020(df_historical_data, df15): generate the plot of the mitigation curve starting in 2020.
       
       -> description: The animation function plots the historical CO2 Emissions from 1900-2019 & plots the mitigation curves from 2000-2026 to meet +1.5C degrees in an animation and the animation is also saved as a GIF. 2nd function plots the historical CO2 Emissions from 1900-2019 & plots the mitigation curve starting at the beginning of 2020 to meet +1.5C degrees.
    

    j) Plots_2.py

       -> location: src/plots/Plots_2.py
       
       -> functions: 
           plot_1_5_animation(df_historical_data, df15): generate an animated plot with 2 mitigation curves and save it.
           plot_1_5_2020(df_historical_data, df15): generate the plot of the mitigation curve starting in 2020.
       
       -> description: The animation function plots the historical CO2 Emissions from 1900-2019 & plots the mitigation curves from 2000-2026 to meet +2C degrees in an animation and the animation is also saved as a GIF. 2nd function plots the historical CO2 Emissions from 1900-2019 & plots the mitigation curve starting at the beginning of 2020 to meet +2C degrees.
    

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •