Data Overview
The data used in this web-book is derived from federal, state, commercial, and local sources, as well as direct communications with utilities and state program managers. More information about data sources can be found on the methods page of this web-book.
Download Individual Tables
Individual tables can be downloaded here as text files (CSV, comma-separated values). Once downloaded to your local machine, these files can be opened graphically using Microsoft Excel, or programmatically using R or Python.
Capacity
capacity_wide_description = metadata. resources [0 ]. description ;
capacity_wide_raw = FileAttachment ("data/final_data/capacity.csv" ). csv ({typed : true });
capacity_wide = tidy (capacity_wide_raw,
filter ((d) => d. year < 2020 ))
capacity_wide_path = metadata. resources [0 ]. path ;
capacity_wide_metadata = metadata. resources [0 ]. schema . fields ;
viewof capacity_input = Inputs. select (new Map ([
["Capacity Metadata" , capacity_wide_metadata],
["Capacity" , capacity_wide]]),
{value : capacity_wide_metadata, label : "Preview:" }
);
Inputs. table (capacity_input);
button (capacity_wide_metadata, 'capacity_metadata.csv' , `Capacity Metadata` )
button (capacity_wide, `capacity.csv` , `Capacity` )
Net Generation
net_generation_wide_description = metadata. resources [2 ]. description
net_generation_wide_raw = FileAttachment ("data/final_data/generation.csv" ). csv ({typed : true });
net_generation_wide = tidy (net_generation_wide_raw,
filter ((d) => d. year < 2020 ))
net_generation_wide_path = metadata. resources [2 ]. path
net_generation_wide_metadata = metadata. resources [2 ]. schema . fields
viewof generation_input = Inputs. select (new Map ([["Generation Metadata" , net_generation_wide_metadata],
["Generation" , net_generation_wide]]),
{value : net_generation_wide_metadata, label : "Preview:" }
);
Inputs. table (generation_input);
button (net_generation_wide_metadata, 'net_generation_metadata.csv' , `Generation Metadata` )
button (net_generation_wide, `generation.csv` , `Net Generation` )
Consumption and Sales
consumption_wide_description = metadata. resources [4 ]. description
consumption_wide_raw = FileAttachment ("data/final_data/consumption.csv" ). csv ({typed : true });
consumption_wide = tidy (consumption_wide_raw,
filter ((d) => d. year < 2020 ))
consumption_wide_path = metadata. resources [4 ]. path
consumption_wide_metadata = metadata. resources [4 ]. schema . fields
viewof consumption_input = Inputs. select (new Map ([["Consumption Metadata" , consumption_wide_metadata],
["Consumption" , consumption_wide]]),
{value : consumption_wide_metadata, label : "Preview:" }
);
Inputs. table (consumption_input);
button (consumption_wide_metadata, 'consumption_wide_metadata.csv' , `Consumption Metadata` )
button (consumption_wide, `consumption_wide.csv` , `Consumption` )
Prices
prices_description = metadata. resources [6 ]. description ;
prices_raw = FileAttachment ("data/final_data/prices.csv" ). csv ({typed : true });
prices = tidy (prices_raw,
filter ((d) => d. year < 2020 ))
prices_path = metadata. resources [6 ]. path ;
prices_metadata = metadata. resources [6 ]. schema . fields ;
viewof prices_input = Inputs. select (new Map ([["Prices Metadata" , prices_metadata],
["Prices" , prices]]),
{value : prices_metadata, label : "Preview:" }
);
Inputs. table (prices_input);
button (prices_metadata, `prices_metadata.csv` , `Metadata` );
button (prices, `prices.csv` , `Prices` );
Population-Weighted Average Prices
weighted_prices_description = metadata. resources [7 ]. description ;
weighted_prices_raw = FileAttachment ("data/final_data/weighted_prices.csv" ). csv ({typed : true });
weighted_prices = tidy (weighted_prices_raw,
filter ((d) => d. year < 2020 ))
weighted_prices_path = metadata. resources [7 ]. path ;
weighted_prices_metadata = metadata. resources [7 ]. schema . fields ;
viewof weighted_prices_input = Inputs. select (new Map ([["Weighted Prices Metadata" , weighted_prices_metadata],
["Weighted Prices" , weighted_prices]]),
{value : weighted_prices_metadata, label : "Preview:" }
);
Inputs. table (weighted_prices_input);
button (weighted_prices_metadata, `weighted_prices_metadata.csv` , `Metadata` );
button (weighted_prices, `weighted_prices.csv` , `Weighted Prices` )
stdlib = require ("@observablehq/stdlib" )
d3 = require ("d3@7" )
import {tidy, groupBy, rename, summarize, sum, mutate, select, n, nDistinct, mean, filter, pivotWider, pivotLonger, leftJoin, slice} from "@pbeshai/tidyjs"
// load metadata
metadata = FileAttachment ("data/final_data/metadata.json" ). json ();
// download button function
button = (data, filename = 'data.csv' , displayname) => {
const downloadData = new Blob ([d3. csvFormat (data)], { type : "text/csv" });
const size = (downloadData. size / 1024 ). toFixed (1 );
const button = DOM. download (
downloadData,
filename,
` ${ displayname} ( ${ size} KB)`
);
return button;
}
db = FileAttachment ("data/working/aetr.db" ). sqlite ()
viewof dbTable = Inputs. select ((await db. describe ()). value . map (d => d. name ),
{ label : "" })
database = db. query (`SELECT * FROM ${ dbTable} ` )
Inputs. table (database)
db_button = (database, filename = 'data.csv' ) => {
const downloadData = new Blob ([d3. csvFormat (database)], { type : "text/csv" });
const size = (downloadData. size / 1024 ). toFixed (1 );
const button = DOM. download (
downloadData,
filename,
`Download ${ filename} ( ${ size} KB)`
);
return button;
}
db_button (database, ` ${ dbTable} ` )