For a rendering of the data visualization, see the project page at https://eayoungs.github.io/Oil_imports_BA_California-EIA/
This project is a data visualization of the flows of oil from around the world to refineries in the San Francisco Bay Area. The intent is to make the changes in carbon emissions related to the various crude oil grades from each country of import and compare that to the changes in air polutants regulated by the Bay Area Air Quality Manangement Board (BAAQMD).
The thesis, based on scientific papers, commissioned by BAAQMD itself, from the Union of Concerned Scientists and the staff's own proposed rule 12-16 , is that the driving factors for carbon emissions are separate and independent of those that produce other air pollutants known as criteria air pollutants (CAP) and toxic air contaminants.
The primary data sources for data in this project are from the Energy Information Administration and the California Air Resources Board.
The data was reformed according to the tenents of Tidy Data , which essentially reforms the as table in a data frame. This allows the use of SQL queries on the data frame, thereby reducing the confusion and messiness of operating. The simple query shown below, for example was used to get all of the variables used in the Sankey diagram that can be seen on the project page. (link at the top of this page)
SELECT origin_var, destination_var, dat_var AS BARRELS FROM imports
WHERE NOT origin_var='World' AND years_var='2009' AND destination_var IN
('CHEVRON USA / RICHMOND / CA',
'PHILLIPS 66 CO / SAN FRANCISCO / CA',
'VALERO REFINING CO CALIFORNIA / BENICIA / CA',
'SHELL OIL PRODUCTS US / MARTINEZ / CA',
'TESORO CORP / GOLDEN EAGLE / CA')
GROUP BY 1,2