def line(y, thickness, gaussian_width):
distance_from_line = abs(y)<EOL>gaussian_y_coord = distance_from_line - thickness/<NUM_LIT><EOL>sigmasq = gaussian_width*gaussian_width<EOL>if sigmasq==<NUM_LIT:0.0>:<EOL><INDENT>falloff = y*<NUM_LIT:0.0><EOL><DEDENT>else:<EOL><INDENT>with float_error_ignore():<EOL><INDENT>falloff = np.exp(np.divide(-gaussian_y_coord*gaussian_y_coord,<NUM_LIT:2>*sigmasq))<EOL><DEDENT><DEDENT>return np.where(gaussian_y_coord<=<NUM_LIT:0>, <NUM_LIT:1.0>, falloff)<EOL>
Infinite-length line with a solid central region, then Gaussian fall-off at the edges.