def z_shape_linear(cell_position, index): iz = int64(math.floor(cell_position)) if index == 0: return iz+1.-cell_position if index == 1: return cell_position - iz