How the 2023 coal model transportation distances by facility were created #273
dt-woods
started this conversation in
Show and tell
Replies: 1 comment 1 reply
-
To be fully transparent, the data still comes from the third party, it's just now publicly available as part of the report. And while it's the 2023 report, the report and data are for 2016 data year coal. I think the approach outlined above is great! Thanks for putting it together. |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
In the 2016 baseline, coal transportation data were provided by a third-party data provider (see here. In the 2023 coal model (see here), transportation distances are now publicly provided; however, they are on a NERC-region and coal-basin basis (see Transportation tab in the Excel workbook).
Challenge: Map transportation data at the regional level to their associated facilities based on NERC region and coal basin attributes.
Solution: The following shows how this may be done. In this approach, the goal is to replace the CSV file with updated values from the 2023 coal model.
This method uses the in-development version 2 of the ElectricityLCI Python package.
Start by importing needed Python packages.
Note that the imports from ElectricityLCI will prompt for model specification file.
In this example, the 'ELCI_2020' model was chosen.
Once implemented in the code, this won't be necessary.
Generate the coal upstream map, which labels each facility with its coal source code: a three-part combo of coal basin, coal type, and mine type. We want the coal basin data from this.
Using string split, we can take just the coal basin code from the coal source code string.
The coal basin code is known!
Now, let's find the NERC region.
Note that this example is hard-coding the generation year, which is to be replaced with model_specs EIA generation year.
This provides us with NERC regions for each facility.
Note that Plant IDs are strings in this dataset.
Let's create a dictionary that maps facilities to their NERC region, fixing the plant ID from string to integer along the way.
We don't need the heat input or the old coal source code, so let's drop them.
That's the basis of our mapping!
We now have facilities and their NERC region and their coal basin.
Now, let's pull the new coal transportation data from the coal model.
Download NETL's 2023 coal Excel model, find the Transportation tab, and scroll over to the transportation data (see screen shot).
Copy the transportation data values (AW3:BD46) to its own workbook (see screen shot); note that the headers were adjusted for convenience.
UPDATE (12/6/2024): The worksheet was exported to CSV after removing the Total column, TRIM-ing the whitespace from the NERC region names, and converting the scientific values to General.
Now, read the coal model transportation data.
Remove the extra spaces in the NERC region column, and drop the total column.
The 2023 coal model uses a slightly different naming scheme for WNW coal basin.
So, let's correct that!
Now, map the basin names to their basin codes.
Note that this works for all basins except for "U.S. Average"
Some facilities may not map to our coal model, so let's save the U.S. average and use it for them.
Drop the NaNs from our coal transportation data frame (i.e., the U.S. average that we saved separately).
Now, let's put it all together by merging our transportation data and our coal data using the NERC region and coal basin codes as the common attributes.
We were right, there are facilities not mapped to transportation.
Let's give them the U.S. average.
Lastly, the transportation data from the coal model are in miles.
Let's convert miles to kilometers, and calculate the kg*km values by multiplying the quantity (kg of coal) by transportation distance (miles converted to km).
This is essentially the same the data as the CSV file from the 2016 baseline, updated with transportation data from the 2023 coal model, where gaps are filled using the U.S. average.
Arguably, U.S. average may be too robust for regions where barges and ocean vessels do not make sense.
Beta Was this translation helpful? Give feedback.
All reactions