Skip to content
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

MOBT-639: Temporal interpolation of period diagnostics #1982

Merged
merged 20 commits into from
Mar 20, 2024
Merged
Show file tree
Hide file tree
Changes from 17 commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
ab7e892
Modified to return the later of the two input cubes along with the ne…
bayliffe Feb 8, 2024
2df6e07
Add identification of period diagnostics using time bounds on inputs.…
bayliffe Feb 8, 2024
51d974c
Add renormalisation for period accumulations. These need to be adjust…
bayliffe Feb 8, 2024
58437b1
Add a check to ensure the guessed bounds of the interpolated outputs …
bayliffe Feb 8, 2024
f72fd0b
Partial rewrite of unit tests to use pytest.
bayliffe Feb 9, 2024
56c579a
All existing unit tests for temporal interpolation converted to pytest.
bayliffe Feb 15, 2024
1b7a0cb
Style fixes.
bayliffe Feb 15, 2024
35dae51
Unit tests for new functionality added. Fixed a bug in the applicatio…
bayliffe Feb 16, 2024
c35a863
Enforce float type on renormalised accumulations.
bayliffe Feb 16, 2024
c7f749a
Add acceptance tests for temporal interpolation of period data.
bayliffe Feb 19, 2024
b12be5c
Add an additional test to check for overlapping period diagnostics.
bayliffe Feb 19, 2024
2bddb65
Add pass through if only target is the trailing input cube.
bayliffe Feb 19, 2024
c762517
Fix up multi-realization accumulation handling and add test coverage.
bayliffe Feb 19, 2024
cf1fc70
Improve comment.
bayliffe Feb 20, 2024
31eca75
Add unit tests to cover unequal length inputs when interpolating accu…
bayliffe Feb 20, 2024
f483638
Modify arguments from maximum and minimum to max and min to align wit…
bayliffe Feb 21, 2024
d355471
Merge branch 'master' into mobt639
bayliffe Feb 26, 2024
e78b07d
Review changes.
bayliffe Feb 27, 2024
37a0fd2
Second review changes.
bayliffe Mar 18, 2024
8569487
Additional check within plugin. Added bounds checking to unit tests.
bayliffe Mar 19, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 23 additions & 1 deletion improver/cli/temporal_interpolate.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,9 @@ def process(
interval_in_mins: int = None,
times: cli.comma_separated_list = None,
interpolation_method="linear",
accumulation: bool = False,
max: bool = False,
min: bool = False,
):
"""Interpolate data between validity times.

Expand Down Expand Up @@ -75,7 +78,23 @@ def process(
solar interpolates using the solar elevation,
daynight uses linear interpolation but sets night time points to
0.0 linear is linear interpolation.

accumulation:
Set True if the diagnostic being temporally interpolated is a
period accumulation. The output will be renormalised to ensure
that the total across the period constructed from the shorter
intervals matches the total across the period from the coarser
intervals. Trends between adjacent input periods will be used
to provide variation across the interpolated periods.
max:
Set True if the diagnostic being temporally interpolated is a
period maximum. Trends between adjacent input periods will be used
to provide variation across the interpolated periods where these
are consistent with the inputs.
min:
Set True if the diagnostic being temporally interpolated is a
period minimum. Trends between adjacent input periods will be used
to provide variation across the interpolated periods where these
are consistent with the inputs.
Returns:
iris.cube.CubeList:
A list of cubes interpolated to the desired times. The
Expand All @@ -99,5 +118,8 @@ def process(
interval_in_minutes=interval_in_mins,
times=times,
interpolation_method=interpolation_method,
accumulation=accumulation,
max=max,
min=min,
)(start_cube, end_cube)
return MergeCubes()(result)
Loading
Loading