gradient_aware_harmonisation#
Gradient-aware harmonisation of timeseries
Modules:
| Name | Description |
|---|---|
add_cubic |
Harmonisation by adding a cubic |
convergence |
Implements the decay/convergence methods |
exceptions |
Exceptions that are used throughout |
plotting |
Helper functions |
spline |
Spline handling |
timeseries |
Definition of our timeseries class |
typing |
Type hinting support |
utils |
Utility functions |
Functions:
| Name | Description |
|---|---|
harmonise |
Harmonise two timeseries |
harmonise_splines |
Harmonise spline |
harmonise #
harmonise(
harmonisee_timeseries: Timeseries,
target_timeseries: Timeseries,
harmonisation_time: Union[int, float],
convergence_timeseries: Optional[Timeseries] = None,
convergence_time: Optional[Union[int, float]] = None,
get_harmonised_spline: GetHarmonisedSplineLike = get_cosine_decay_harmonised_spline,
) -> Timeseries
Harmonise two timeseries
When we say harmonise, we mean make it such that the harmonisee matches with the target at some specified time point (called harmonisation time) before returning to some other timeseries (the convergence timeseries) at the convergence time.
Parameters#
harmonisee_timeseries Harmonisee timeseries (i.e. the timeseries we want to harmonise)
target_timeseries Target timeseries (i.e. what we harmonise to)
harmonisation_time Time point at which harmonisee should be matched to the target
convergence_timeseries The timeseries to which the result should converge.
If not supplied, we use `harmonisee_timeseries`
i.e. we converge back to the timeseries we are harmonising.
convergence_time Time point at which the harmonised data should converge to the convergence timeseries.
If not supplied, we converge to convergence timeseries
at the last time point in harmonisee_timeseries.
get_harmonised_spline Function used to get the harmonised spline from a gradient- preserving spline and the timeseries to converge to
Returns#
harmonised_timeseries : Harmonised timeseries
Source code in src/gradient_aware_harmonisation/__init__.py
harmonise_splines #
harmonise_splines(
harmonisee: Spline,
target: Spline,
harmonisation_time: Union[int, float],
converge_to: Spline,
convergence_time: Union[int, float],
get_harmonised_spline: GetHarmonisedSplineLike = get_cosine_decay_harmonised_spline,
) -> Spline
Harmonise spline
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
harmonisee
|
Spline
|
Spline that we want to harmonise |
required |
target
|
Spline
|
Spline to which we harmonise |
required |
harmonisation_time
|
Union[int, float]
|
Time point at which harmonisee should be matched to the target |
required |
converge_to
|
Spline
|
The spline to which the result should converge. If not supplied, we use `harmonisee'. i.e. we converge back to the spline we are harmonising. |
required |
convergence_time
|
Union[int, float]
|
Time point at which the harmonised data should converge to the convergence spline |
required |
get_harmonised_spline
|
GetHarmonisedSplineLike
|
The method to use to converge back to the convergence spline. |
get_cosine_decay_harmonised_spline
|
Returns:
| Type | Description |
|---|---|
Spline
|
harmonised spline |