Interpolation between base_inv_dict years for contrail climate impact calculations of single flights #46
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
This pull request adds functionality that allows the years defined in
inv_dict
to vary independently from those defined inbase_inv_dict
. This is helpful if the climate impact of a flight or yearly inventory in for example the year 2024 is desired, but global emission inventories only exist in for example the years 2020 and 2050.The new function
interp_base_inv_dict
uses a custom nearest neighbour method to regrid the base emission inventories onto the contrail grid, then linearly interpolates between them to get the values at any years ininv_dict
that are not defined inbase_inv_dict
. It is not possible to include years ininv_dict
that are outside of the range of years defined by the inventories inbase_inv_dict
. Going forward, I will consider whether this could be possible if one of the scaling functions were to be used on the base emission inventories.Linked issues
Closes #45.
Type of change
How has this been tested?
TestCheckContInput
andTestInterpBaseInvDict
intests/calc_cont_test.py
Test configuration:
Checklist