fosanalysis
A framework to evaluate distributed fiber optic sensor data
Loading...
Searching...
No Matches
fosanalysis.utils.cropping Namespace Reference

Contains functionality to restrict data to a given area of interest. More...

Functions

tuple cropping (np.array x_values, np.array z_values, float start_pos=None, float end_pos=None, float length=None, float offset=None, *args, **kwargs)
 Crop a data set \(x_i,\: z_i\) based on locational data \(x\).
 

Detailed Description

Contains functionality to restrict data to a given area of interest.

Author
Bertram Richter
Date
2023

Function Documentation

◆ cropping()

tuple fosanalysis.utils.cropping.cropping ( np.array x_values,
np.array z_values,
float start_pos = None,
float end_pos = None,
float length = None,
float offset = None,
* args,
** kwargs )

Crop a data set \(x_i,\: z_i\) based on locational data \(x\).

The process consists of two steps:

  1. The \(x\) data is shifted by the offset \(o\), such that \(x \gets x + o\).
  2. Cropping (restricting entries): \(x_i:\: x_i \in [s,\: e]\) and \(z_i:\: x_i \in [s,\: e]\)
Parameters
x_valuesOne-dimensional array of x-positions \(x\).
z_valuesArray of z-values \(z\) matching \(x\). Can be a 1D or 2D array.
start_posThe starting position \(s\) specifies the length of the sensor, before entering the measurement area. Defaults to None (no data is removed at the beginning).
end_posThe end position \(s\) specifies the length of the sensor, when leaving the measurement area. If both length and end_pos are provided, end_pos takes precedence. Defaults to None (no data is removed at the end).
lengthLength of the data excerpt. If set, it is used to determine the end_pos. If both length and end_pos are provided, end_pos takes precedence.
offsetBefore cropping, \(x\) data is shifted by the offset \(o\), such that \(x \gets x + o\), defaults to 0.
*argsAdditional positional arguments, ignored.
**kwargsAdditional keyword arguments, ignored.
Returns
Returns the cropped lists \((x_i,\: z_i)\):
Return values
x_croppedArray, such that \(x_i:\: x_i \in [s,\: e]\).
z_croppedArray, such that, \(z_i:\: x_i \in [s,\: e]\).

To reduce/avoid boundary effects, genrally crop the data after smoothing.

Definition at line 12 of file cropping.py.