def smooth_angle_channels(self, channels):
for vertex in self.vertices:<EOL><INDENT>for col in vertex.meta['<STR_LIT>']:<EOL><INDENT>if col:<EOL><INDENT>for k in range(<NUM_LIT:1>, channels.shape[<NUM_LIT:0>]):<EOL><INDENT>diff=channels[k, col]-channels[k-<NUM_LIT:1>, col]<EOL><DEDENT>if abs(diff+<NUM_LIT>)<abs(diff):<EOL><INDENT>channels[k:, col]=channels[k:, col]+<NUM_LIT><EOL><DEDENT>elif abs(diff-<NUM_LIT>)<abs(diff):<EOL><INDENT>channels[k:, col]=channels[k:, col]-<NUM_LIT><EOL><DEDENT><DEDENT><DEDENT><DEDENT>
Remove discontinuities in angle channels so that they don't cause artifacts in algorithms that rely on the smoothness of the functions.