Files
new-orphan-wells/README.md
2026-03-08 20:39:23 -07:00

156 lines
6.0 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# Governing Focssil Fuel Legacies: Orphaned Wells Analysis
**Project:** *Governing Focssil Fuel Legacies: Policy, Risk, and Resistance*
**Repository Author:** Dr. David P. Adams, California State University, Fullerton
**Publisher:** Routledge (forthcoming)
**Collaborators:** Dr. Jon Fisk, Dr. Nurun Nahar, Dr. John Morris
---
## Overview
This repository contains the data infrastructure, analysis notebooks, and SQL code supporting the empirical chapters of *Governing Focssil Fuel Legacies*. The book examines the politics of fossil fuel site closure in the United States, with particular attention to orphaned oil and gas wells as physical indicators of stranded assets and the unresolved liabilities of the fossil fuel regime.
The core database (`orphaned_wells`, PostgreSQL/PostGIS) integrates:
- **117,672 documented unplugged orphaned wells** across 27 states (USGS DOW dataset, 2022)
- **85,230 U.S. census tracts** (2021 TIGER/Line cartographic boundary file)
- **State governance framework data** — just transition offices and plugging prioritization schemes
- **Financial liability estimates** — per-well plugging costs and IIJA/BIL funding allocations
- **FGDC and ScienceBase metadata** — full provenance for the primary dataset
---
## Repository Structure
```
new-orphan-wells/
├── README.md
├── docs/
│ ├── database-schema.md # Full schema reference: all tables, columns, indexes
│ ├── data-sources.md # Provenance, citations, and data quality notes
│ ├── chapter4-variables.md # Variable definitions for Chapter 4 (governance coding)
│ └── chapter5-variables.md # Variable definitions for Chapter 5 (financial liability)
├── notebooks/
│ ├── ch4_geography/ # Chapter 4: Geography of Transition
│ ├── ch5_costs/ # Chapter 5: Costs of Transition
│ ├── ej_analysis/ # Environmental justice / ACS demographic joins
│ └── spatial/ # Mapping and spatial analysis
├── sql/
│ ├── schema/ # Table and index DDL
│ ├── views/ # View definitions
│ └── queries/ # Analysis queries by chapter
├── data/
│ ├── raw/ # Source files (gitignored — see below)
│ ├── processed/ # Derived/exported datasets
│ └── ra-input/ # RA Excel workbooks (Transition_Offices, Prioritization)
├── figures/
│ ├── ch4/ # Maps and charts for Chapter 4
│ └── ch5/ # Charts and tables for Chapter 5
└── scripts/ # Shell and Python utility scripts
```
---
## Database
**Name:** `orphaned_wells`
**Host:** localhost (PostgreSQL 18, PostGIS enabled)
**Connection:** `psql -U postgres -h localhost -d orphaned_wells`
See [`docs/database-schema.md`](docs/database-schema.md) for the full schema reference.
### Quick start
```sql
-- Well count by state with liability estimates
SELECT state, state_name, well_count_dow,
est_mid_liability, iija_phase1, unfunded_mid
FROM v_ch5_liability_summary;
-- State governance framework (populated after RA data loaded)
SELECT state, state_name, well_count_dow, framework_type, office_language_type
FROM v_ch4_state_analysis
ORDER BY well_count_dow DESC;
-- Highest-density tracts (environmental justice targeting)
SELECT tract_geoid, tract_name, county_name, state_usps, well_count, wells_per_km2
FROM v_highest_density_tracts
LIMIT 20;
```
---
## Data Sources
| Dataset | Source | Citation |
|---|---|---|
| U.S. Orphaned Wells (DOW) | USGS ScienceBase | Grove & Merrill (2022), DOI: 10.5066/P91PJETI |
| Census Tracts | U.S. Census Bureau | cb_2021_us_tract_500k, TIGER/Line |
| Plugging Cost Estimates | Raimi et al. (2021) | DOI: 10.1021/acs.est.1c02234 |
| IIJA Funding | DOI/OSMRE | Phase 1 formula grants, Nov 2022 |
| Transition Offices | Climate Policy Dashboard | climatepolicydashboard.org |
| Prioritization Schemes | IOGCC | Prioritization Report, July 2023 |
Full citations and data quality notes: [`docs/data-sources.md`](docs/data-sources.md)
---
## RA Data Integration
When the RA returns the Excel workbook (`Transition_Offices` + `Prioritization` tabs), load into the database:
```bash
# From data/ra-input/ after saving tabs as CSV
psql -U postgres -h localhost -d orphaned_wells \
-c "\COPY state_transition_offices (state,state_name,office_name,year_established,target_text,code_fossil,code_equity,source_url,date_collected,collected_by,notes) FROM 'data/ra-input/Transition_Offices.csv' CSV HEADER;"
psql -U postgres -h localhost -d orphaned_wells \
-c "\COPY state_prioritization (state,state_name,system_type,tech_factors,code_rural_urban,code_vuln,code_surface,pdf_page,source_quote,source_url,date_collected,collected_by,notes) FROM 'data/ra-input/Prioritization.csv' CSV HEADER;"
```
The `v_state_governance` and `v_ch4_state_analysis` views activate automatically.
---
## Notebooks
| Notebook | Chapter | Description |
|---|---|---|
| `ch4_geography/01_state_distribution.ipynb` | 4 | Well counts, maps, fossil dependence by state |
| `ch4_geography/02_governance_framework.ipynb` | 4 | Engineering vs. justice state typology |
| `ch4_geography/03_ej_concentration.ipynb` | 4 | Tract-level EJ analysis |
| `ch5_costs/01_liability_estimates.ipynb` | 5 | State-level cost and funding gap |
| `ch5_costs/02_iija_adequacy.ipynb` | 5 | IIJA Phase 1 coverage analysis |
| `ej_analysis/01_acs_join.ipynb` | 45 | ACS demographic join via tract_geoid |
| `spatial/01_national_map.ipynb` | 4 | National well distribution map |
---
## Gitignore Notes
Large source files are not tracked. Add to `.gitignore`:
```
data/raw/
*.shp
*.dbf
*.shx
*.prj
*.sbn
*.sbx
*.cpg
*.csv
figures/**/*.png
figures/**/*.pdf
```
---
## Citation
Naher, Nurun, David Adams, Jonathan Fisk, John Morris (forthcoming). *Governing Focssil Fuel Legacies: Policy, Risk, and Resistance*. Routledge.