TotalDepth icon indicating copy to clipboard operation
TotalDepth copied to clipboard

Suggestion: Change the Xstart and Xstop behaviour in the LIS LogPass.setFrameSetChX(...) function

Open erlendviggen opened this issue 6 years ago • 0 comments

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:

  1. 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.
  2. Make the Xstart and Xstop arguments optional. If they are not specified, then default to getting every frame.

erlendviggen avatar May 15 '18 08:05 erlendviggen