-
Notifications
You must be signed in to change notification settings - Fork 1
update capacity input database to AEO-NEMS 2026 #13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
ea0e484
b154cd5
115df1a
096d2da
052b76c
ca10173
65c5d10
9f7f52f
7094ac1
a9747e9
6f1e95c
4d51f22
00c3b12
f28ff48
f5144a9
511e19d
6a0a615
2887277
c8b448a
73a333a
fc7f63d
dd2e810
db6ba98
4e4f336
398ca93
b421a01
124e4e2
11ce7f7
19ec2c5
a4afc6b
d970927
a2fcead
959cd9c
3e2ed7d
8857a9c
bbbed2c
207c02d
0704bf4
c3fa3ef
4497416
f4f3563
2ef8621
e08c448
11e331f
42ed3a9
7dccab7
75bd247
d370213
f76b37d
d7f8208
2531945
4314ee5
69acde2
6f1d347
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,48 +1,51 @@ | ||
| # Overview | ||
| This repo includes scripts and inputs to preprocess the final NEMS fleet that is used to run ReEDS 2.0. | ||
| This repo includes scripts and inputs to clean and process AEO-NEMS generator capacity data and EIA860M generator inventory data, merge them together and perform additional adjustment and clean-up to generate final EIA-NEMS generator database input file that is used to run ReEDS. | ||
|
|
||
| # Running scripts | ||
| All the scripts are run sequentially from `run.sh` | ||
|
|
||
| # run.sh | ||
| `run.sh` runs 5 python scripts that process NEMS fleet data sequentially: | ||
| * `a_inheritance.py` | ||
| * `b_aeo_cleaning.py`: This script cleans raw AEO-NEMS and EIA860M files and appends planned and missing existing EIA860M units into AEO-NEMS, and also updates unit retirement years according to specified version of EIA860M | ||
| * `c_geospatial_mapping.py`: This script maps the lon/lats of units database established in step b to their counties and FIPS. For any units that are missing lon/lats, please look up their lon/lats and manually add these units with their lon/lats to in `/inputs/user_adjusted_units_missing_lon_lats.csv`. This step will incur errors until all units are mapped to their counties and FIPS. Any units that need manually adjusted locations should be done in this step. | ||
| * `d_hydro_classification.py`. | ||
| * `e_additional_inputs.py`, which includes `e1_set_retire_years.py`, `e2_fix_upgrades.py`, and `e3_merge_psh_dbs.py`: This script handles updated retirement years that are outdated in AEO-NEMS and EIA860M, fix upgrades, and handles other additional adjustments. Any manually adjusted retirement years should be included in `e1_set_retire_years.py`. | ||
| * `f_comparison_plotting.py`, which generates comparison figures between previous version of NEMS and the newly updated version. | ||
| `run.sh` runs 5 python scripts sequentially to generate final EIA-NEMS input data file: | ||
| * `a_data_cleaning.py`: This script cleans raw AEO-NEMS (https://github.com/EIAgov/NEMS/blob/main/input/emm/emm_db/PLTF860_RDB.xlsx) and EIA860M (https://www.eia.gov/electricity/data/eia860m/) files, appends planned, retired, and missing operating EIA860M units into AEO-NEMS, and updates unit online and retire years according to specified version of EIA860M | ||
| * `b_geospatial_mapping.py`: This script maps the lon/lats of units database established in step a to their FIPS. For any units that are missing lon/lats, please look up their lon/lats and manually add these units with their lon/lats to in `/inputs/user_adjusted_units_missing_lon_lats.csv`. This step will incur errors until all units are mapped to their FIPS. Any units that need manually adjusted locations should be done in this step. | ||
| * `c_hydro_classification.py`: This script determines which ReEDS hydro units are dispatchable or non-dispatchable using input hydro unit data from ORNL. | ||
| * `d_additional_inputs.py`, which includes `d1_set_retire_years.py`, `d2_fix_upgrades.py`, and `d3_merge_psh_dbs.py`, and handles other additional adjustments and clean up before generating final EIA-NEMS dataset. | ||
| * `d1_set_retire_years.py`: This script handles updated retire years that are outdated or missing in AEO-NEMS and EIA860M, using published list of coal plants that are exempted from 2024 Mercury and Air Toxics Standards (MATS) (https://www.epa.gov/system/files/documents/2025-04/regulatory-relief-for-certain-stationary-annex-1.pdf), and online articles announcing specific plants' early retirements, restarts, and retrofits. Any manually adjusted retirement years should be included in this step. | ||
| * `d2_fix_upgrades.py`: This script updates online and retire dates for units that are upgraded. | ||
| * `d3_merge_psh_dbs.py`: This script merges the two hydro databases from ORNL and uses the merged database to reclassify various hydro units. | ||
| * `e_comparison_plotting.py`: This script generates comparison figures between previous version of NEMS and the newly updated version for validation. | ||
|
|
||
| # Input files and params to run run.sh | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Would you add some details to this section on where you get the input files? If we download them from somewhere it would be good to include links.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I added input links here now. The input links are also provided in the scripts when the inputs first appear. |
||
| All the input files to run all 5 python scripts are now specified upfront in run.sh. All inputs files are loacted in `Inputs` folder. | ||
| All the input files to run all 5 python scripts are now specified upfront in run.sh. All inputs files are loacted in `inputs` folder. | ||
| | Input | Description | | ||
| | --- | --- | | ||
| | `current_reeds_fleet_ver` | Most recent version of final NEMS fleet used in ReEDS. Right now is `2024` | | ||
| | `current_year` | Specify current year. Right now it is `2026` | | ||
| | `aeo_file` | Most recent version of AEO file. Right now it is `PLTF860_RDB.xlsx` | | ||
| | `eia860M_ver_mon` | Most recent EIA 860M version month (all lower case). Right now it's `march` | | ||
| | `eia860M_ver_year` | Most recent EIA 860M version year (number). Right now is `2025`| | ||
| | `append_operating_units` | `True` if append both missing operating and planned units from EIA860 to NEMS, `False` if append only planned units| | ||
| | `nems_ver` | Most recent version of NEMS. Right now it is `2023`| | ||
| | `ornl_hydro_plant_ver` | Most recent version of EHA hydro plants from ORNL used in `d_hydro_classification.py`. Right now it is `ORNL_EHAHydroPlant_FY2024.xlsx`| | ||
| | `hydro_dispatchability` | Most recent version of EHA units dispatchability used in `d_hydro_classification.py`. Right now it is `EHA_dispatchability.csv`| | ||
| | `hydro_prjtype` | Most recent version EHA hydro unit classification updates, used in `e3_merge_psh_dbs.py`. Right now it is `EHA_FY22_post2009_prjtype.xlsx`| | ||
| | `ornl_hydro_unit_ver` | Most recent version of EHA hydro plants from ORN used in `e3_merge_psh_dbs.py`. Right now it is `ORNL_EHAHydroUnit_PublicFY2024.xlsx`| | ||
| | `eia860M_ver_mon` | Most recent EIA 860M version month (all lower case). Right now it's `june` | | ||
| | `eia860M_ver_year` | Most recent EIA 860M version year (number). Right now is `2026`| | ||
| | `ornl_hydro_plant_ver` | Most recent version of EHA hydro plants from ORNL used in `c_hydro_classification.py`. Right now it is `ORNL_EHAHydroPlant_PublicFY2024.xlsx`| | ||
| | `hydro_dispatchability` | Most recent version of EHA units dispatchability used in `c_hydro_classification.py`. Right now it is `EHA_dispatchability.csv`| | ||
| | `coal_plant_retirement` | List of coal plant retirement data that are exempt from general coal retirement rules, used in `d1_set_retire_year.py`. Right now it is `EIA860_2025ER_CoalRetirements.csv`| | ||
| | `ornl_hydro_unit_ver` | Most recent version of EHA hydro plants from ORN used in `d3_merge_psh_dbs.py`. Right now it is `ORNL_EHAHydroUnit_PublicFY2024.xlsx`| | ||
| | `hydro_prjtype` | Most recent version EHA hydro unit classification updates, used in `d3_merge_psh_dbs.py`. Right now it is `EHA_FY22_post2009_prjtype.xlsx`| | ||
|
|
||
|
|
||
| # Other input files that probably are updated less frequently | ||
| All located in `inputs` folder: | ||
| * `county_to_reeds_region.csv` | ||
| * `tech_to_cooling_tech_map.csv` | ||
| All located in `inputs/tech_mappings` folder: | ||
| * `aeo_reeds_tech_map.csv`: Mapping between AOE-NEMS tech names and ReEDS tech names | ||
| * `eia_reeds_tech_map.csv`: Mapping between EIA860M tech names and ReEDS tech names | ||
| * `tech_to_cooling_tech_map`: Mapping cooling techs to ReEDS techs | ||
|
|
||
| # Output file | ||
| Located in `outputs` folder. This is the final file that will be used to run ReEDS: | ||
| * `ReEDS_generator_database_final_EIA-NEMS.csv` | ||
|
|
||
| # Output comparison figures | ||
| Located in `outputs/figures`. This folder includes figures of online/retire capacity by year for different NEMS versions and their differences. Figures are both national and at `z90` resolution. The figures are generated from `f_comparison_plotting.py`. | ||
| Located in `outputs/figures`. This folder includes figures of online/retire capacity by year for different NEMS versions and their differences. Figures are both national and at `z90` resolution. The figures are generated from `e_comparison_plotting.py`. | ||
|
|
||
| # Debug | ||
| # Debugging | ||
| A `debug` folder, which stores the FIPS that have mismatched online/retire capacity between two NEMS versions, is created for easy debugging. If the two NEMS versions have no changes at all at FIPS-level, this folder is not created or is empty. | ||
|
|
||
| # Note: | ||
| Sometimes when running `c_geospatial_mapping.py`, geopandas operation results in invalid geometry - point (inf, inf) or polygon (inf, inf). If this occurs, run `conda install -c conda-forge proj-data` to pre-download projection data in the current environment before rerunning the script. | ||
| # Note | ||
| - When read in EIA860M csv file, make sure to check if the file has empty first row and empty last two rows to drop them out of the dataframe before processing. | ||
| - Sometimes when running `b_geospatial_mapping.py`, geopandas operation results in invalid geometry - point (inf, inf) or polygon (inf, inf). If this occurs, run `conda install -c conda-forge proj-data` to pre-download projection data in the current environment before rerunning the script. | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would you add a bit more to the overview about the general process? My rough understanding is that we start from AEO file, clean it, and then supplement with the 860M.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I added a bit more details in overview and the steps