Open dt-woods opened 1 year ago
For posterity, I believe the missing source for DATA_FILE
comes from EIA's Thermoelectric cooling water data, here: https://www.eia.gov/electricity/data/water/
It looks like the culprit is actually from the EIA cooling detail workbook (see link above). Water types and water amounts are not matched for 132 plants where cooling ID is PLANT. Since water amounts were more important, they were taken without their associated water types. This simply needs to be scrubbed for each plant, year, month, generator, and boiler. This search should give two values for water type (empty and actual); see images below. A quick search shows several are of type "Fresh"; therefore, the recommendation to label as "Other" is unwise (since only Fresh water resources are analyzed in AWARE-US).
Attached is a proposed solution. fix_py.txt
Apologies, here's the missing download file function:
def download_file(url, filename):
"""Helper function to download a file from the internet.
Parameters
----------
url : str
The URL for a file stored somewhere on the internet.
filename: str
A path and file name to save a local copy of the web-based file.
Returns
-------
None. Check for file existence after running this function.
Raises
------
IOError : If a downloaded file fails to download.
"""
import urllib.request
urllib.request.urlretrieve(url, filename)
In method
generate_plant_water_use
in module plant_water_use.py, there's 708,000,000 MWh that are unaccounted for, which represents 1.59e+13 liters of withdrawal and 1.52e+13 liters of discharge due to thegroupby
method including "Water Type" field, which has 6,787 rows with NaN as the water type (see Reference).This seems relevant given that this method assumes linearity between net generation and water quantities (i.e., consumption and withdrawal). Given the unaccounted for generation, the "fraction_gen" that's calculated may be misleading.
Two possible options that I see:
DATA_FILE
) are the same for most facilities, it seems reasonable to skip the intermediate scaling and simply scale based on EIA. The only caveats to this are where EIA generation is negative (e.g., facilities 1077, 1233, 1404), which I believe is evidence against the linear scaling of water withdrawal to generation.Reference: https://github.com/USEPA/ElectricityLCI/blob/2232c41f2cb4fd333ad59c8710aa55906e6a7ed3/electricitylci/plant_water_use.py#L104
Reproducible code:
Generated output: