data_filters
MultiLATSelectionFilter
Bases: DataFilter
Filter that selects the next LAT value.
min_lat = min_lat
instance-attribute
__init__(min_lat=0)
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
min_lat |
int
|
Minimum lat value. Defaults to 0. |
0
|
apply(scalars)
Select next closest to min_lat non-nan LAT from 2d array of LAT values.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
scalars |
ndarray
|
array of scalars |
required |
Returns:
| Type | Description |
|---|---|
ndarray
|
np.ndarray[N,]: Selected LAT values. |
PeriodicRangeFilter
Bases: DataFilter
A data filter to constrain the data to a range. This range can be defined in a number of ways: - Using a period and an upper and lower bound: range of [lower_bound, upper_bound] - Using an upper and lower bound: range of [lower_bound, upper_bound], period = upper_bound - lower_bound - using a period and an upper bound: range of ]-inf, upper_bound] - using a period and a lower bound: range of [lower_bound, inf[ - using only a period: range of [0, period]
lower_bound = lower_bound
instance-attribute
period = period
instance-attribute
upper_bound = upper_bound
instance-attribute
__init__(period=None, lower_bound=None, upper_bound=None)
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
period |
float | NoneType
|
The period of the scalar data. Defaults to None. |
None
|
lower_bound |
float | NoneType
|
The lower bound of the selected range (inclusive). Defaults to None. |
None
|
upper_bound |
float | NoneType
|
The upper bound of the selected range (inclusive). Defaults to None. |
None
|
apply(scalars)
Check if enough arguments are passed to use this method/NoneType and then limit the scalar range by using a method based on the arguments passed.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
scalars |
ndarray
|
array of scalars |
required |
Returns:
| Name | Type | Description |
|---|---|---|
scalars |
ndarray
|
updated array of scalars |
ScalarCorrectionFilter
Bases: DataFilter
A data filter to make values smaller than a certain threshold larger than said threshold. This is done by adding a correction value (often the period) to each scalar until its value is above the threshold.
This can be used to make negative scalar values positive.
correction_value = correction_value
instance-attribute
threshold = threshold
instance-attribute
__init__(threshold, correction_value)
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
threshold |
float
|
The threshold under which all values are corrected. |
required |
correction_value |
float
|
The value added N times to each scalar under the threshold. |
required |
apply(scalars)
Moves values below the threshold to above the threshold by adding the correction value N times.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
scalars |
ndarray
|
array of scalars |
required |
Returns:
| Name | Type | Description |
|---|---|---|
scalars |
ndarray
|
updated array of scalars |
ScalarRangeFilter
Bases: DataFilter
A data filter to constrain the data to a range. Values outside the range are
marking_val = marking_val
instance-attribute
max_threshold = max_threshold
instance-attribute
min_threshold = min_threshold
instance-attribute
__init__(min_threshold=None, max_threshold=None, marking_val=None)
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
min_threshold |
float
|
The lower bound of the selected range (inclusive). |
None
|
max_threshold |
float
|
The upper bound of the selected range (inclusive). |
None
|
marking_val |
float
|
If a marking value is passed, all values outside the selected range are marked with said value (e.g. NaN, -1, etc.). |
None
|
apply(scalars)
Apply the filter to remove or mark any values outside the selected range.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
scalars |
ndarray
|
array of scalars |
required |
Returns:
| Name | Type | Description |
|---|---|---|
scalars |
ndarray
|
updated array of scalars |