Update livestock sector implementation to use headcounts dataset#183
Open
aethr wants to merge 13 commits into
Open
Update livestock sector implementation to use headcounts dataset#183aethr wants to merge 13 commits into
aethr wants to merge 13 commits into
Conversation
Contributor
Author
|
Still need to update documentation once we have a bit more information about the new data source, but the implementation is ready to review. |
3 tasks
8734db3 to
f2e84d6
Compare
00bddcd to
c9203f5
Compare
f2e84d6 to
0777108
Compare
0777108 to
bf88760
Compare
Contributor
Author
|
A basic analysis on the agriculture layer shows that with the current list of ALUM codes, which includes grazing, dairy and feedlots, we are matching |
Iterating over rows in the livestock DataFrame isn't necessary once we've calculated the grid cell indexes. The emissions can be distributed to grid cells directly using `np.add.at((indices), values)`.
Since we have per-animal headcounts, and the enteric fermentation inventory sector can be broken down by animal, we can scale the emissions independently for each animal based on where the animals are. It's worth noting, the livestock headcounts dataset includes beef and dairy cows and sheep, but does not include swine or other livestock. Based on this we've moved the UNFCCC categories for enteric fermentation from swine and other livestock into the agriculture sector, which is spatialised by land use. This causes a small increase in the agriculture emissions because their combined sector total will be increased by this inclusion.
bf88760 to
4a55bd2
Compare
This removes the landuse-sector-map.csv file where prior sectors are associated with ALUM codes, which is how the NLUM Land Use GeoTIFF designates land use of each pixel. The landuse-sector-map.csv was already tightly coupled to the sector implementation, because one of the columns was the sector name. With this change we lose the ability to update which ALUM codes fall into each sector without updating the implementation. However, like UNFCCC and ANZSIC codes, the sector implementation is intimately bound to the types of activities and emissions it represents. It doesn't make sense to change the ALUM mapping for a sector without changing the implementation. This also makes the ALUM mapping more visible, so that if the implementation does change (for example, the recent change to include swine and other livestock in the agriculture sector), it forces the person making the change to evaluate whether the mapped ALUM codes are still accurate.
Emissions from manure management are likely to occur where livestock are, so spatialise manure management alongside enteric fermentation according to livestock headcount locations.
Emissions from manure management are likely to occur where livestock are, so spatialise manure management alongside enteric fermentation according to livestock headcount locations. This also means removing some ALUM codes from the agriculture layer which are primarily related to beef and sheep management.
acbf74a to
0de8384
Compare
Contributor
|
livestock/sector.py:123: only a comment but you mean /m2 not /m3 |
prayner
approved these changes
Jun 9, 2026
Contributor
Author
Good catch! Will fix. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Resolves #182.
Integrates the refreshed CSIRO livestock headcount dataset, and calculates CH4 emissions per animal based on static annual emission estimates. Previously this sector was only concerned with enteric fermentation, but since the two main sources of emissions from cattle and sheep are enteric fermentation and manure, this PR also moves manure management emissions into the livestock layer, and out of the agriculture layer, for cattle and sheep.
Checklist
Please confirm that this pull request has done the following:
changelog/Notes
Even after introducing a completely new data source and methodology, the livestock emissions haven't significantly changed, as evidenced by the minimal changes to the livestock layer in test_om_prior.py. However, since we're now spatialising the inventory total directly, we're seeing 0.0% discrepancy in the livestock layer when running the prior over the full domain:
Previously, this sector was failing with between 0.3 - 0.8% discrepancy depending on the period of interest.
It's worth noting, the livestock headcounts dataset includes beef and dairy cows and sheep, but does not include swine or other livestock. Based on this we've moved the UNFCCC categories for enteric fermentation from swine and other livestock into the agriculture sector, which is spatialised by land use. This causes a small increase in the agriculture emissions because their combined sector total will be increased by this inclusion.
ALUM codes
Now that the livestock layer accounts for all emissions from cattle and sheep, the ALUM categories included in the agriculture sector have been updated to remove:
The visibility of these sector/category relationships was previously hard to find (located in
landuse-sector-map.csvdata file), so ALUM codes for the agriculture sector have been moved into the sector implementation insector.py. For consistency, the same change has been made to the LULUCF sector, and thelanduse-sector-map.csvdata source has been removed from the project.