extract depth range
xbox.defdepth looks for the model depth level that is closest to the depth range given by the user. So e.g. if a depth range of
depth=[470,1000] is given the depth levels in the output from
xbox.getbox are (roughly) [452,...,989].
I think it would be better to only include depth levels that are within the given range. So for the example that would be [534,...,989].