TotalDepth
TotalDepth copied to clipboard
Suggestion: Change the Xstart and Xstop behaviour in the LIS LogPass.setFrameSetChX(...) function
I just tracked down a bug in my code where the last depth frame in a LIS file ended up missing. The bug stemmed from a line where I wanted to read a selection of the channels over the entire depth:
logPass.setFrameSetChX(file, channelMnemList, logPass.xAxisFirstEngVal, logPass.xAxisLastEngVal)
My expected behaviour was to get every frame from logPass.xAxisFirstEngVal
to and including logPass.xAxisLastEngVal
, while I got every frame to but not including the latter, since TotalDepth here follows the Python convention on ranges.
This makes it somewhat inconvenient to get all frames for a selection of channels, since I suppose it means that you have to specify a stop depth after logPass.xAxisLastEngVal
in order to get every frame. Therefore, I have two possible suggestions on how to change this behaviour:
- Change the behaviour of
LogPass.setFrameSetChX(...)
so that it gets the frames to and including the specified stop frame depth. This would make it more convenient to use, although it might not be quite Pythonic. - Make the
Xstart
andXstop
arguments optional. If they are not specified, then default to getting every frame.