Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Air Travel Carbon Calculator

CSCI E-33a Final Project

Motivation

In recent years, climate change and global warming become more extreme and pose an imminent challenge to humility. According to a report by IATA, the global aviation industry accounts for 2% of all human source carbon dioxide emissions, and one of the highest among transport methods in terms of per passenger mile emission. With environmental awareness on the rise, frequent air travelers are seeking to counterbalance their carbon footprint by purchasing carbon offset credit. As a frequent flyer traveling over 100k miles each year, I hoped to design a web app to calculate and record my travel history and to enable me to better track my carbon emissions and purchase a proper amount of credit to offset my footprint.

Installation

Other than Django and the Python standard library, this app does not require additional Python libraries.

To install Django, use a package manager like pip to install the modules.

pip install django

Pipenv is also supported. Pipfile and Pipfile.lock have been packaged and are ready to deploy. To activate a virtualenv run:

pipenv shell

Make sure the app is on the final directory, if not:

cd final

To start the Django web server, run:

python manage.py runserver

Usage

A user can search departure and arrival airports, and travel distance and carbon footprint will be calculated and displayed to the user. The search feature currently supports search by airport name, and location information (e.g. city name, county name.) One of the popular identifiers, IATA 3 letter airport code is not currently supported due to licensing requirements. The aerodrome location dataset is obtained from International Civil Aviation Organization's public database.

The distance between two airports is calculated based on standard distance calculation between latitude/longitude points, which returns the shortest route between two points on the earth. The actual fly distance may vary depending on the operator and schedule. Alternatively, the user can adjust the travel distance based on their actual travel distance if this information is known to the user. Additionally, the user is able to select a unit between miles and kilometers, whether which is chosen, the unit will be automatically converted, and produce the result accordingly.

The frontend interface is handled by JavaScript. Scripts can be found in:

final/calculator/static/calculator/scripts.js

Furthermore, the user can elect to save the calculation to their personal profile. After each calculation, the user can click on "Save the Entry" button to save the calculation, if the user is not login, it will take the user to the login page. When the user clicks on his/her user name, it will take them to the user's profile page, and the user will be able to check his/her travel history.

The backend API is written in Python and can be found in:

final/calculator/views.py

The database is managed by Django models. The models can be found in:

final/calculator/models.py

References

In addition to the above-mentioned references, the aerodrome location dataset from International Civil Aviation Organization's public database and formulation for distance calculation between latitude/longitude points from Movable Type Ltd..

The emission calculation for carbon dioxide utilizes a formulation from the United States Environmental Protection Agency.

The user login/logout and register features are based on Harvard University CSCI E-33a's course homework projects.

These references can be found on the app's references page as well.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages