gradient_aware_harmonisation.spline#
Spline handling
Classes:
| Name | Description |
|---|---|
ProductOfSplines |
Product of two splines |
Spline |
Single spline |
SplineScipy |
An adapter which wraps various classes from scipy.interpolate |
SumOfSplines |
Sum of two splines |
Attributes:
| Name | Type | Description |
|---|---|---|
NP_ARRAY_OF_FLOAT_OR_INT |
TypeAlias
|
Type alias for an array of numpy float or int (not complex) |
NP_FLOAT_OR_INT |
TypeAlias
|
Type alias for a numpy float or int (not complex) |
NP_ARRAY_OF_FLOAT_OR_INT
module-attribute
#
NP_ARRAY_OF_FLOAT_OR_INT: TypeAlias = NDArray[
NP_FLOAT_OR_INT
]
Type alias for an array of numpy float or int (not complex)
NP_FLOAT_OR_INT
module-attribute
#
Type alias for a numpy float or int (not complex)
ProductOfSplines #
Product of two splines
Methods:
| Name | Description |
|---|---|
__call__ |
Evaluate the spline at a given x-value |
antiderivative |
Calculate the anti-derivative/integral of self |
derivative |
Calculate the derivative of self |
Attributes:
| Name | Type | Description |
|---|---|---|
spline_one |
Spline
|
First spline |
spline_two |
Spline
|
Second spline |
Source code in src/gradient_aware_harmonisation/spline.py
__call__ #
__call__(x: NP_FLOAT_OR_INT) -> NP_FLOAT_OR_INT
__call__(
x: NP_ARRAY_OF_FLOAT_OR_INT,
) -> NP_ARRAY_OF_FLOAT_OR_INT
__call__(
x: int
| float
| NP_FLOAT_OR_INT
| NP_ARRAY_OF_FLOAT_OR_INT,
) -> (
int | float | NP_FLOAT_OR_INT | NP_ARRAY_OF_FLOAT_OR_INT
)
Evaluate the spline at a given x-value
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
x
|
int | float | NP_FLOAT_OR_INT | NP_ARRAY_OF_FLOAT_OR_INT
|
x-value |
required |
Returns:
| Type | Description |
|---|---|
int | float | NP_FLOAT_OR_INT | NP_ARRAY_OF_FLOAT_OR_INT
|
Value of the spline at |
Source code in src/gradient_aware_harmonisation/spline.py
antiderivative #
antiderivative() -> SumOfSplines
Calculate the anti-derivative/integral of self
Returns:
| Type | Description |
|---|---|
SumOfSplines
|
Anti-derivative of self |
Source code in src/gradient_aware_harmonisation/spline.py
derivative #
derivative() -> SumOfSplines
Calculate the derivative of self
Returns:
| Type | Description |
|---|---|
SumOfSplines
|
Derivative of self |
Source code in src/gradient_aware_harmonisation/spline.py
Spline #
Bases: Protocol
Single spline
Methods:
| Name | Description |
|---|---|
__call__ |
Get the value of the spline at a particular x-value |
antiderivative |
Calculate the anti-derivative/integral of self |
derivative |
Calculate the derivative of self |
Source code in src/gradient_aware_harmonisation/spline.py
__call__ #
__call__(x: NP_FLOAT_OR_INT) -> NP_FLOAT_OR_INT
__call__(
x: NP_ARRAY_OF_FLOAT_OR_INT,
) -> NP_ARRAY_OF_FLOAT_OR_INT
__call__(
x: int
| float
| NP_FLOAT_OR_INT
| NP_ARRAY_OF_FLOAT_OR_INT,
) -> (
int | float | NP_FLOAT_OR_INT | NP_ARRAY_OF_FLOAT_OR_INT
)
Get the value of the spline at a particular x-value
SplineScipy #
An adapter which wraps various classes from scipy.interpolate
Methods:
| Name | Description |
|---|---|
__call__ |
Evaluate the spline at a given x-value |
antiderivative |
Calculate the anti-derivative/integral of self |
derivative |
Calculate the derivative of self |
Source code in src/gradient_aware_harmonisation/spline.py
__call__ #
__call__(x: NP_FLOAT_OR_INT) -> NP_FLOAT_OR_INT
__call__(
x: NP_ARRAY_OF_FLOAT_OR_INT,
) -> NP_ARRAY_OF_FLOAT_OR_INT
__call__(
x: int
| float
| NP_FLOAT_OR_INT
| NP_ARRAY_OF_FLOAT_OR_INT,
) -> (
int | float | NP_FLOAT_OR_INT | NP_ARRAY_OF_FLOAT_OR_INT
)
Evaluate the spline at a given x-value
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
x
|
int | float | NP_FLOAT_OR_INT | NP_ARRAY_OF_FLOAT_OR_INT
|
x-value |
required |
Returns:
| Type | Description |
|---|---|
int | float | NP_FLOAT_OR_INT | NP_ARRAY_OF_FLOAT_OR_INT
|
Value of the spline at |
Source code in src/gradient_aware_harmonisation/spline.py
antiderivative #
antiderivative() -> SplineScipy
Calculate the anti-derivative/integral of self
Returns:
| Type | Description |
|---|---|
SplineScipy
|
Anti-derivative of self |
derivative #
derivative() -> SplineScipy
SumOfSplines #
Sum of two splines
Methods:
| Name | Description |
|---|---|
__call__ |
Evaluate the spline at a given x-value |
antiderivative |
Calculate the anti-derivative/integral of self |
derivative |
Calculate the derivative of self |
Attributes:
| Name | Type | Description |
|---|---|---|
spline_one |
Spline
|
First spline |
spline_two |
Spline
|
Second spline |
Source code in src/gradient_aware_harmonisation/spline.py
__call__ #
__call__(x: NP_FLOAT_OR_INT) -> NP_FLOAT_OR_INT
__call__(
x: NP_ARRAY_OF_FLOAT_OR_INT,
) -> NP_ARRAY_OF_FLOAT_OR_INT
__call__(
x: int
| float
| NP_FLOAT_OR_INT
| NP_ARRAY_OF_FLOAT_OR_INT,
) -> (
int | float | NP_FLOAT_OR_INT | NP_ARRAY_OF_FLOAT_OR_INT
)
Evaluate the spline at a given x-value
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
x
|
int | float | NP_FLOAT_OR_INT | NP_ARRAY_OF_FLOAT_OR_INT
|
x-value |
required |
Returns:
| Type | Description |
|---|---|
int | float | NP_FLOAT_OR_INT | NP_ARRAY_OF_FLOAT_OR_INT
|
Value of the spline at |
Source code in src/gradient_aware_harmonisation/spline.py
antiderivative #
antiderivative() -> SumOfSplines
Calculate the anti-derivative/integral of self
Returns:
| Type | Description |
|---|---|
SumOfSplines
|
Anti-derivative of self |
Source code in src/gradient_aware_harmonisation/spline.py
derivative #
derivative() -> SumOfSplines