utils.index_limits#
Back to Module page
Summary#
Function that decides which indices to include in the average such that we always average window_size indices to avoid \`regression-to-mean’ artifacts due to fewer samples near holes
Signature#
def index_limits(window_index, extra_req, jump, window_size, valid_mask)
Name |
Type |
Default |
Description |
|---|---|---|---|
|
Index of window to decide limits for |
||
|
Number of extra indices to pull in |
||
|
Jump in indices between window starts |
||
|
Size of window desired, after respecting the valid mask |
||
|
Valid mask deciding which entries are to kept |
Output variables#
Return annotation |
Docstring type |
Description |
|---|---|---|
|
left and right limits of window with required number of entries |
Docstring#
Function that decides which indices to include in the average
such that we always average window_size indices to avoid
`regression-to-mean' artifacts due to fewer samples near holes
:param window_index: Index of window to decide limits for
:param extra_req: Number of extra indices to pull in
:param jump: Jump in indices between window starts
:param window_size: Size of window desired, after respecting the valid mask
:param valid_mask: Valid mask deciding which entries are to kept
:return: left and right limits of window with required number of entries