This is the code repository for the following paper. To use this repo, please cite:
- Wang, Z., Wara, M., Majumdar, A., & Rajagopal, R. (2023). Local and Utility-Wide Cost Allocations for a More Equitable Wildfire-Resilient Distribution Grid. To appear in Nature Energy.
The operating system for developing this code repo is Ubuntu 16.04, but it should also be able to run in other environments. The Python version used for developing this code repo is Python 3.6.
Run the following command line:
$ pip install -r requirements.txt
Run the following command lines to download the ZIP files right under the code repo directory:
$ curl -O https://opendatasharing.s3.us-west-2.amazonaws.com/vulnerability/checkpoint.zip
$ curl -O https://opendatasharing.s3.us-west-2.amazonaws.com/vulnerability/dataset.zip
$ curl -O https://opendatasharing.s3.us-west-2.amazonaws.com/vulnerability/results.zip
Unzip them such that the directory structure looks like:
vulnerability/checkpoint/...
vulnerability/dataset/...
vulnerability/results/...
Note 1: for the street view imagery dataset under dataset
, due to the restriction of the imagery data source, we are not able to publicly share the full training/validation/test sets. Instead, we sample 20 images (10 positive and 10 negative) for each of them.
Note 2: to run Jupyter Notebook, the default kernel is called "conda_tensorflow_p36", which does not necessarily exist in your computer. Please change the kernel to the one where all required packages are installed.
test_classification_pytorch_for_lines.py
: This script loads the trained power line identification model checkpoint checkpoint/deepGrid_seg_pretrained.tar
and runs it on the demo image test set. This script is run on a Nvidia Tesla K80 GPU by default.
train_classification_pytorch_for_lines.py
: This script trains the power line identification model using the images in the demo training set and saves the model with the best performance on the validation set. A pre-trained model can be specified. The default pre-trained model is the model pretrained on ImageNet dataset: checkpoint/inception_v3_google-1a9a5a14.pth
. This script is run on a Nvidia Tesla K80 GPU by default.
analyze_grid_vulnerability.ipynb
: This notebook is used for analyzing the distribution grid vulnerability (undergrounding rate, vegetation proximity, etc) at the census block group level and correlating it with regional characteristics (demographics, etc). It also contains the code for cost allocation analysis (the variation of undergrounding cost per household relative to income under different income threshold X). It can be used to generate the plots in Figure 2 to Figure 5.
spatial_map_visualization.ipynb
: This notebook is used for visualizing the block-group-level geospatial distribution of various characteristics such as undergrounding rate, wildfire threats, and median household income in California. It can be used to generated Figure 1.