watex.utils.exmath.detect_station_position#
- watex.utils.exmath.detect_station_position(s, p)[source]#
Detect station position and return the index in positions
- Parameters:
s – str, int - Station location in the position array. It should be the positionning of the drilling location. If the value given is type string. It should be match the exact position to locate the drilling. Otherwise, if the value given is in float or integer type, it should be match the index of the position array.
p – Array-like - Should be the conductive zone as array of station location values.
- Returns:
s_index- the position index location in the conductive zone.
s- the station position in distance.
- Example:
>>> import numpy as np >>> from watex.utils.exmath import detect_station_position >>> pos = np.arange(0 , 50 , 10 ) >>> detect_station_position (s ='S30', p = pos) ... (3, 30.0) >>> detect_station_position (s ='40', p = pos) ... (4, 40.0) >>> detect_station_position (s =2, p = pos) ... (2, 20) >>> detect_station_position (s ='sta200', p = pos) ... WATexError_station: Station sta200 is out of the range; max position = 40